: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const entry = text.find(({
}) => suffix === 'default');
element.props.children = null;
const result = evaluate(entry);
element.props.children = typeof result === 'object' ? null : result.toString();
element.props.children = null;
run.forEach(entry => evaluate(entry));
context: inheritedContext,
if (element.type !== 'template') {
const inheritedValue = hooks_module_P(inheritedContext);
const list = evaluate(entry);
return list.map(item => {
const itemProp = suffix === 'default' ? 'item' : kebabToCamelCase(suffix);
const itemContext = deepsignal_module_g({
const mergedContext = proxifyContext(itemContext, inheritedValue);
// Set the item after proxifying the context.
mergedContext[namespace][itemProp] = item;
const key = eachKey ? getEvaluate({
}, element.props.content);
directive('each-child', () => null, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/constants.js
const directivePrefix = 'wp';
;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/vdom.js
const ignoreAttr = `data-${directivePrefix}-ignore`;
const islandAttr = `data-${directivePrefix}-interactive`;
const fullPrefix = `data-${directivePrefix}-`;
const currentNamespace = () => {
return (_namespaces = namespaces[namespaces.length - 1]) !== null && _namespaces !== void 0 ? _namespaces : null;
const vdom_isObject = item => Boolean(item && typeof item === 'object' && item.constructor === Object);
// Regular expression for directive parsing.
const directiveParser = new RegExp(`^data-${directivePrefix}-` +
// ${p} must be a prefix string, like 'wp'.
// Match alphanumeric characters including hyphen-separated
// segments. It excludes underscore intentionally to prevent confusion.
// E.g., "custom-directive".
'([a-z0-9]+(?:-[a-z0-9]+)*)' +
// (Optional) Match '--' followed by any alphanumeric charachters. It
// excludes underscore intentionally to prevent confusion, but it can
// contain multiple hyphens. E.g., "--custom-prefix--with-more-info".
'(?:--([a-z0-9_-]+))?$', 'i' // Case insensitive.
// Regular expression for reference parsing. It can contain a namespace before
// the reference, separated by `::`, like `some-namespace::state.somePath`.
// Namespaces can contain any alphanumeric characters, hyphens, underscores or
// forward slashes. References don't have any restrictions.
const nsPathRegExp = /^([\w_\/-]+)::(.+)$/;
const hydratedIslands = new WeakSet();
* Recursive function that transforms a DOM tree into vDOM.
* @param root The root element or node to start traversing on.
* @return The resulting vDOM tree.
const treeWalker = document.createTreeWalker(root, 205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT
// CDATA_SECTION_NODE (4)
const next = treeWalker.nextSibling();
node.replaceWith(new window.Text((_nodeValue = node.nodeValue) !== null && _nodeValue !== void 0 ? _nodeValue : ''));
return [node.nodeValue, next];
// COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7)
if (nodeType === 8 || nodeType === 7) {
const next = treeWalker.nextSibling();
const elementNode = node;
const localName = elementNode.localName;
for (let i = 0; i < attributes.length; i++) {
const attributeName = attributes[i].name;
const attributeValue = attributes[i].value;
if (attributeName[fullPrefix.length] && attributeName.slice(0, fullPrefix.length) === fullPrefix) {
if (attributeName === ignoreAttr) {
var _regexResult$, _regexResult$2;
const regexResult = nsPathRegExp.exec(attributeValue);
const namespace = (_regexResult$ = regexResult?.[1]) !== null && _regexResult$ !== void 0 ? _regexResult$ : null;
let value = (_regexResult$2 = regexResult?.[2]) !== null && _regexResult$2 !== void 0 ? _regexResult$2 : attributeValue;
const parsedValue = JSON.parse(value);
value = vdom_isObject(parsedValue) ? parsedValue : value;
if (attributeName === islandAttr) {
// eslint-disable-next-line no-nested-ternary
typeof value === 'string' ? value : typeof value?.namespace === 'string' ? value.namespace : null;
namespaces.push(islandNamespace);
directives.push([attributeName, namespace, value]);
} else if (attributeName === 'ref') {
props[attributeName] = attributeValue;
innerHTML: elementNode.innerHTML,
hydratedIslands.add(elementNode);
props.__directives = directives.reduce((obj, [name, ns, value]) => {
const directiveMatch = directiveParser.exec(name);
if (directiveMatch === null) {
warn(`Found malformed directive name: ${name}.`);
const prefix = directiveMatch[1] || '';
const suffix = directiveMatch[2] || 'default';
obj[prefix] = obj[prefix] || [];
namespace: ns !== null && ns !== void 0 ? ns : currentNamespace(),
// @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334
if (localName === 'template') {
props.content = [...elementNode.content.childNodes].map(childNode => toVdom(childNode));
let child = treeWalker.firstChild();
const [vnode, nextChild] = walk(child);
child = nextChild || treeWalker.nextSibling();
// Restore previous namespace.
return [_(localName, props, children)];
return walk(treeWalker.currentNode);
;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/init.js
// Keep the same root fragment for each interactive region node.
const regionRootFragments = new WeakMap();
const getRegionRootFragment = region => {
if (!region.parentElement) {
throw Error('The passed region should be an element with a parent.');
if (!regionRootFragments.has(region)) {
regionRootFragments.set(region, createRootFragment(region.parentElement, region));
return regionRootFragments.get(region);
// Initial vDOM regions associated with its DOM element.
const initialVdom = new WeakMap();
// Initialize the router with the initial DOM.
const init = async () => {
const nodes = document.querySelectorAll(`[data-${directivePrefix}-interactive]`);
for (const node of nodes) {
if (!hydratedIslands.has(node)) {
const fragment = getRegionRootFragment(node);
const vdom = toVdom(node);
initialVdom.set(node, vdom);
;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/index.js
const requiredConsent = 'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.';
const privateApis = lock => {
if (lock === requiredConsent) {
directivePrefix: directivePrefix,
getRegionRootFragment: getRegionRootFragment,
initialVdom: initialVdom,
getNamespace: getNamespace,
deepSignal: deepsignal_module_g,
parseInitialData: parseInitialData,
populateInitialData: populateInitialData,
batch: signals_core_module_r
throw new Error('Forbidden access.');
document.addEventListener('DOMContentLoaded', async () => {
;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/debug.js
var __webpack_exports__getConfig = __webpack_exports__.zj;
var __webpack_exports__getContext = __webpack_exports__.SD;
var __webpack_exports__getElement = __webpack_exports__.V6;
var __webpack_exports__privateApis = __webpack_exports__.jb;
var __webpack_exports__splitTask = __webpack_exports__.yT;
var __webpack_exports__store = __webpack_exports__.M_;
var __webpack_exports__useCallback = __webpack_exports__.hb;
var __webpack_exports__useEffect = __webpack_exports__.vJ;
var __webpack_exports__useInit = __webpack_exports__.ip;
var __webpack_exports__useLayoutEffect = __webpack_exports__.Nf;
var __webpack_exports__useMemo = __webpack_exports__.Kr;
var __webpack_exports__useRef = __webpack_exports__.li;
var __webpack_exports__useState = __webpack_exports__.J0;
var __webpack_exports__useWatch = __webpack_exports__.FH;
var __webpack_exports__withScope = __webpack_exports__.v4;
export { __webpack_exports__getConfig as getConfig, __webpack_exports__getContext as getContext, __webpack_exports__getElement as getElement, __webpack_exports__privateApis as privateApis, __webpack_exports__splitTask as splitTask, __webpack_exports__store as store, __webpack_exports__useCallback as useCallback, __webpack_exports__useEffect as useEffect, __webpack_exports__useInit as useInit, __webpack_exports__useLayoutEffect as useLayoutEffect, __webpack_exports__useMemo as useMemo, __webpack_exports__useRef as useRef, __webpack_exports__useState as useState, __webpack_exports__useWatch as useWatch, __webpack_exports__withScope as withScope };