: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if (!child.getAttribute('inert')) {
child.setAttribute('inert', 'true');
child.removeAttribute('inert');
// Debounce re-disable since disabling process itself will incur
// additional mutations which should be ignored.
const debouncedDisable = debounce(disable, 0, {
/** @type {MutationObserver | undefined} */
const observer = new window.MutationObserver(debouncedDisable);
debouncedDisable.cancel();
updates.forEach(update => update());
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-isomorphic-layout-effect/index.js
* Preferred over direct usage of `useLayoutEffect` when supporting
* server rendered components (SSR) because currently React
* throws a warning when using useLayoutEffect in that environment.
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_wp_element_namespaceObject.useLayoutEffect : external_wp_element_namespaceObject.useEffect;
/* harmony default export */ const use_isomorphic_layout_effect = (useIsomorphicLayoutEffect);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-dragging/index.js
// Event handlers that are triggered from `document` listeners accept a MouseEvent,
// while those triggered from React listeners accept a React.MouseEvent.
* @param {(e: import('react').MouseEvent) => void} props.onDragStart
* @param {(e: MouseEvent) => void} props.onDragMove
* @param {(e?: MouseEvent) => void} props.onDragEnd
const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false);
const eventsRef = (0,external_wp_element_namespaceObject.useRef)({
use_isomorphic_layout_effect(() => {
eventsRef.current.onDragStart = onDragStart;
eventsRef.current.onDragMove = onDragMove;
eventsRef.current.onDragEnd = onDragEnd;
}, [onDragStart, onDragMove, onDragEnd]);
/** @type {(e: MouseEvent) => void} */
const onMouseMove = (0,external_wp_element_namespaceObject.useCallback)(event => eventsRef.current.onDragMove && eventsRef.current.onDragMove(event), []);
/** @type {(e?: MouseEvent) => void} */
const endDrag = (0,external_wp_element_namespaceObject.useCallback)(event => {
if (eventsRef.current.onDragEnd) {
eventsRef.current.onDragEnd(event);
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', endDrag);
/** @type {(e: import('react').MouseEvent) => void} */
const startDrag = (0,external_wp_element_namespaceObject.useCallback)(event => {
if (eventsRef.current.onDragStart) {
eventsRef.current.onDragStart(event);
document.addEventListener('mousemove', onMouseMove);
document.addEventListener('mouseup', endDrag);
// Remove the global events when unmounting if needed.
(0,external_wp_element_namespaceObject.useEffect)(() => {
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', endDrag);
// EXTERNAL MODULE: ./node_modules/mousetrap/mousetrap.js
var mousetrap_mousetrap = __webpack_require__(1933);
var mousetrap_default = /*#__PURE__*/__webpack_require__.n(mousetrap_mousetrap);
// EXTERNAL MODULE: ./node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.js
var mousetrap_global_bind = __webpack_require__(5760);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-keyboard-shortcut/index.js
* A block selection object.
* @typedef {Object} WPKeyboardShortcutConfig
* @property {boolean} [bindGlobal] Handle keyboard events anywhere including inside textarea/input fields.
* @property {string} [eventName] Event name used to trigger the handler, defaults to keydown.
* @property {boolean} [isDisabled] Disables the keyboard handler if the value is true.
* @property {import('react').RefObject<HTMLElement>} [target] React reference to the DOM element used to catch the keyboard event.
/* eslint-disable jsdoc/valid-types */
* Attach a keyboard shortcut handler.
* @see https://craig.is/killing/mice#api.bind for information about the `callback` parameter.
* @param {string[]|string} shortcuts Keyboard Shortcuts.
* @param {(e: import('mousetrap').ExtendedKeyboardEvent, combo: string) => void} callback Shortcut callback.
* @param {WPKeyboardShortcutConfig} options Shortcut options.
function useKeyboardShortcut( /* eslint-enable jsdoc/valid-types */
// This is important for performance considerations.
const currentCallback = (0,external_wp_element_namespaceObject.useRef)(callback);
(0,external_wp_element_namespaceObject.useEffect)(() => {
currentCallback.current = callback;
(0,external_wp_element_namespaceObject.useEffect)(() => {
const mousetrap = new (mousetrap_default())(target && target.current ? target.current :
// We were passing `document` here previously, so to successfully cast it to Element we must cast it first to `unknown`.
// Not sure if this is a mistake but it was the behavior previous to the addition of types so we're just doing what's
// necessary to maintain the existing behavior.
/** @type {Element} */ /** @type {unknown} */
const shortcutsArray = Array.isArray(shortcuts) ? shortcuts : [shortcuts];
shortcutsArray.forEach(shortcut => {
const keys = shortcut.split('+');
// Determines whether a key is a modifier by the length of the string.
// E.g. if I add a pass a shortcut Shift+Cmd+M, it'll determine that
// the modifiers are Shift and Cmd because they're not a single character.
const modifiers = new Set(keys.filter(value => value.length > 1));
const hasAlt = modifiers.has('alt');
const hasShift = modifiers.has('shift');
// This should be better moved to the shortcut registration instead.
if ((0,external_wp_keycodes_namespaceObject.isAppleOS)() && (modifiers.size === 1 && hasAlt || modifiers.size === 2 && hasAlt && hasShift)) {
throw new Error(`Cannot bind ${shortcut}. Alt and Shift+Alt modifiers are reserved for character input.`);
const bindFn = bindGlobal ? 'bindGlobal' : 'bind';
// @ts-ignore `bindGlobal` is an undocumented property
mousetrap[bindFn](shortcut, ( /* eslint-disable jsdoc/valid-types */
/** @type {[e: import('mousetrap').ExtendedKeyboardEvent, combo: string]} */...args) => /* eslint-enable jsdoc/valid-types */
currentCallback.current(...args), eventName);
}, [shortcuts, bindGlobal, eventName, target, isDisabled]);
/* harmony default export */ const use_keyboard_shortcut = (useKeyboardShortcut);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-media-query/index.js
const matchMediaCache = new Map();
* A new MediaQueryList object for the media query
* @param {string} [query] Media Query.
* @return {MediaQueryList|null} A new object for the media query
function getMediaQueryList(query) {
let match = matchMediaCache.get(query);
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
match = window.matchMedia(query);
matchMediaCache.set(query, match);
* Runs a media query and returns its value when it changes.
* @param {string} [query] Media Query.
* @return {boolean} return value of the media query.
function useMediaQuery(query) {
const source = (0,external_wp_element_namespaceObject.useMemo)(() => {
const mediaQueryList = getMediaQueryList(query);
/** @type {(onStoreChange: () => void) => () => void} */
subscribe(onStoreChange) {
// Avoid a fatal error when browsers don't support `addEventListener` on MediaQueryList.
mediaQueryList.addEventListener?.('change', onStoreChange);
mediaQueryList.removeEventListener?.('change', onStoreChange);
var _mediaQueryList$match;
return (_mediaQueryList$match = mediaQueryList?.matches) !== null && _mediaQueryList$match !== void 0 ? _mediaQueryList$match : false;
return (0,external_wp_element_namespaceObject.useSyncExternalStore)(source.subscribe, source.getValue, () => false);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-previous/index.js
* Use something's value from the previous render.
* Based on https://usehooks.com/usePrevious/.
* @param value The value to track.
* @return The value from the previous render.
function usePrevious(value) {
const ref = (0,external_wp_element_namespaceObject.useRef)();
// Store current value in ref.
(0,external_wp_element_namespaceObject.useEffect)(() => {
}, [value]); // Re-run when value changes.
// Return previous value (happens before update in useEffect above).
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js
* Hook returning whether the user has a preference for reduced motion.
* @return {boolean} Reduced motion preference value.
const useReducedMotion = () => useMediaQuery('(prefers-reduced-motion: reduce)');
/* harmony default export */ const use_reduced_motion = (useReducedMotion);
// EXTERNAL MODULE: ./node_modules/@wordpress/undo-manager/build-module/index.js
var build_module = __webpack_require__(6689);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-state-with-history/index.js
function undoRedoReducer(state, action) {
const undoRecord = state.manager.undo();
value: undoRecord[0].changes.prop.from
const redoRecord = state.manager.redo();
value: redoRecord[0].changes.prop.to
state.manager.addRecord([{
function initReducer(value) {
manager: (0,build_module.createUndoManager)(),
* useState with undo/redo history.
* @param initialValue Initial value.
* @return Value, setValue, hasUndo, hasRedo, undo, redo.
function useStateWithHistory(initialValue) {
const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(undoRedoReducer, initialValue, initReducer);
setValue: (0,external_wp_element_namespaceObject.useCallback)((newValue, isStaged) => {
hasUndo: state.manager.hasUndo(),
hasRedo: state.manager.hasRedo(),
undo: (0,external_wp_element_namespaceObject.useCallback)(() => {
redo: (0,external_wp_element_namespaceObject.useCallback)(() => {
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-viewport-match/index.js
* @typedef {"huge" | "wide" | "large" | "medium" | "small" | "mobile"} WPBreakpoint
* Hash of breakpoint names with pixel width at which it becomes effective.
* @type {Record<WPBreakpoint, number>}
* @typedef {">=" | "<"} WPViewportOperator
* Object mapping media query operators to the condition to be used.
* @type {Record<WPViewportOperator, string>}
* Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.
* @type {Record<WPViewportOperator, (breakpointValue: number, width: number) => boolean>}
const OPERATOR_EVALUATORS = {
'>=': (breakpointValue, width) => width >= breakpointValue,
'<': (breakpointValue, width) => width < breakpointValue
const ViewportMatchWidthContext = (0,external_wp_element_namespaceObject.createContext)( /** @type {null | number} */null);
* Returns true if the viewport matches the given query, or false otherwise.
* @param {WPBreakpoint} breakpoint Breakpoint size name.
* @param {WPViewportOperator} [operator=">="] Viewport operator.
* useViewportMatch( 'huge', '<' );
* useViewportMatch( 'medium' );
* @return {boolean} Whether viewport matches query.
const useViewportMatch = (breakpoint, operator = '>=') => {
const simulatedWidth = (0,external_wp_element_namespaceObject.useContext)(ViewportMatchWidthContext);
const mediaQuery = !simulatedWidth && `(${CONDITIONS[operator]}: ${BREAKPOINTS[breakpoint]}px)`;
const mediaQueryResult = useMediaQuery(mediaQuery || undefined);
return OPERATOR_EVALUATORS[operator](BREAKPOINTS[breakpoint], simulatedWidth);
useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provider;
/* harmony default export */ const use_viewport_match = (useViewportMatch);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/index.js
// This of course could've been more streamlined with internal state instead of
// refs, but then host hooks / components could not opt out of renders.
// This could've been exported to its own module, but the current build doesn't
// seem to work with module imports and I had no more time to spend on this...
function useResolvedElement(subscriber, refOrElement) {
const callbackRefElement = (0,external_wp_element_namespaceObject.useRef)(null);
const lastReportRef = (0,external_wp_element_namespaceObject.useRef)(null);
const cleanupRef = (0,external_wp_element_namespaceObject.useRef)();
const callSubscriber = (0,external_wp_element_namespaceObject.useCallback)(() => {