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B,GACrB0nB,GAAYrQ,IAAKrX,EAAM4qB,SACjB/Q,MACN9O,EAAAA,EAAAA,IAAS6f,EAAMD,EAChB,CACD,ECKDzC,G","sources":["webpack://wp/./node_modules/preact/src/constants.js","webpack://wp/./node_modules/preact/src/util.js","webpack://wp/./node_modules/preact/src/options.js","webpack://wp/./node_modules/preact/src/create-element.js","webpack://wp/./node_modules/preact/src/component.js","webpack://wp/./node_modules/preact/src/diff/props.js","webpack://wp/./node_modules/preact/src/create-context.js","webpack://wp/./node_modules/preact/src/diff/children.js","webpack://wp/./node_modules/preact/src/diff/index.js","webpack://wp/./node_modules/preact/src/render.js","webpack://wp/./node_modules/preact/src/clone-element.js","webpack://wp/./node_modules/preact/src/diff/catch-error.js","webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/./node_modules/preact/hooks/src/index.js","webpack://wp/./node_modules/@preact/signals-core/src/index.ts","webpack://wp/./node_modules/@preact/signals/src/index.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/namespaces.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/scopes.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/utils.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/registry.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/signals.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/state.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/store.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/context.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/store.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/hooks.tsx","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/directives.tsx","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/constants.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/vdom.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/init.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/index.ts"],"sourcesContent":["/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 16;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 17;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {preact.ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == null && options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor == undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tif (component._parentDom) {\n\t\tconst newVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {Component} a\n * @param {Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c;\n\trerenderQueue.sort(depthSort);\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile ((c = rerenderQueue.shift())) {\n\t\tif (c._dirty) {\n\t\t\tlet renderQueueLength = rerenderQueue.length;\n\t\t\trenderComponent(c);\n\t\t\tif (rerenderQueue.length > renderQueueLength) {\n\t\t\t\t// When i.e. rerendering a provider additional new items can be injected, we want to\n\t\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t\t// single pass\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value == null ? '' : value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture =\n\t\t\tname !== (name = name.replace(/(PointerCapture)$|Capture$/i, '$1'));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (\n\t\t\tname.toLowerCase() in dom ||\n\t\t\tname === 'onFocusOut' ||\n\t\t\tname === 'onFocusIn'\n\t\t)\n\t\t\tname = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == 'http://www.w3.org/2000/svg') {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != null && (value !== false || name[4] === '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e._dispatched == null) {\n\t\t\t\te._dispatched = eventClock++;\n\n\t\t\t\t// When `e._dispatched` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e._dispatched < eventHandler._attached) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {FunctionComponent} */\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\t/** @type {Component[] | null} */\n\t\t\t\tlet subs = [];\n\t\t\t\tlet ctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\t\tsubs = null;\n\t\t\t\t};\n\n\t\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\tsubs.some(c => {\n\t\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tif (subs) {\n\t\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType =\n\t\tcontext);\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR, INSERT_VNODE, MATCHED } from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\tnewParentVNode._nextDom = oldDom;\n\tconstructNewChildrenArray(newParentVNode, renderResult, oldChildren);\n\toldDom = newParentVNode._nextDom;\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == null) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\tif (childVNode._index === -1) {\n\t\t\toldVNode = EMPTY_OBJ;\n\t\t} else {\n\t\t\toldVNode = oldChildren[childVNode._index] || EMPTY_OBJ;\n\t\t}\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, null, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == null && newDom != null) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tif (\n\t\t\tchildVNode._flags & INSERT_VNODE ||\n\t\t\toldVNode._children === childVNode._children\n\t\t) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom);\n\t\t} else if (\n\t\t\ttypeof childVNode.type == 'function' &&\n\t\t\tchildVNode._nextDom !== undefined\n\t\t) {\n\t\t\t// Since Fragments or components that return Fragment like VNodes can\n\t\t\t// contain multiple DOM nodes as the same level, continue the diff from\n\t\t\t// the sibling of last DOM child of this child VNode\n\t\t\toldDom = childVNode._nextDom;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because it\n\t\t// is only used by `diffChildren` to determine where to resume the diff\n\t\t// after diffing Components and Fragments. Once we store it the nextDOM\n\t\t// local var, we can clean up the property. Also prevents us hanging on to\n\t\t// DOM nodes that may have been unmounted.\n\t\tchildVNode._nextDom = undefined;\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\t// TODO: With new child diffing algo, consider alt ways to diff Fragments.\n\t// Such as dropping oldDom and moving fragments in place\n\t//\n\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t// _nextDom property to the nextSibling of its last child DOM node.\n\t//\n\t// `oldDom` contains the correct value here because if the last child\n\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t// node's nextSibling.\n\tnewParentVNode._nextDom = oldDom;\n\tnewParentVNode._dom = firstChildDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tconst newChildrenLength = renderResult.length;\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == null ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode.constructor === undefined && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t//   const reuse = <div />\n\t\t\t//   <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : null,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = null;\n\t\tif (matchingIndex !== -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original === null\n\t\tconst isMounting = oldVNode == null || oldVNode._original === null;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\tskew--;\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex !== skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t//     we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t//     this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != null && (oldVNode._flags & MATCHED) === 0) {\n\t\t\t\tif (oldVNode._dom == newParentVNode._nextDom) {\n\t\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (oldDom && parentVNode.type && !parentDom.contains(oldDom)) {\n\t\t\toldDom = getDomSibling(parentVNode);\n\t\t}\n\t\tparentDom.insertBefore(parentVNode._dom, oldDom || null);\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != null && oldDom.nodeType === 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet x = skewedIndex - 1;\n\tlet y = skewedIndex + 1;\n\tlet oldVNode = oldChildren[skewedIndex];\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\tlet shouldSearch =\n\t\tremainingOldChildren >\n\t\t(oldVNode != null && (oldVNode._flags & MATCHED) === 0 ? 1 : 0);\n\n\tif (\n\t\toldVNode === null ||\n\t\t(oldVNode &&\n\t\t\tkey == oldVNode.key &&\n\t\t\ttype === oldVNode.type &&\n\t\t\t(oldVNode._flags & MATCHED) === 0)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tif (x >= 0) {\n\t\t\t\toldVNode = oldChildren[x];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) === 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t\tx--;\n\t\t\t}\n\n\t\t\tif (y < oldChildren.length) {\n\t\t\t\toldVNode = oldChildren[y];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) === 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn y;\n\t\t\t\t}\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import {\n\tEMPTY_OBJ,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tRESET_MODE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent =\n\t\t\t\t'prototype' in newType && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!c._force &&\n\t\t\t\t\t((c.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\t\tnewVNode._original === oldVNode._original)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = null;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t: MODE_HYDRATE;\n\n\t\t\t\twhile (oldDom && oldDom.nodeType === 8 && oldDom.nextSibling) {\n\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t}\n\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == null &&\n\t\tnewVNode._original === oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\tnewVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\troot._nextDom = undefined;\n\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType === 'svg') namespace = 'http://www.w3.org/2000/svg';\n\telse if (nodeType === 'math')\n\t\tnamespace = 'http://www.w3.org/1998/Math/MathML';\n\telse if (!namespace) namespace = 'http://www.w3.org/1999/xhtml';\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value === !!nodeType &&\n\t\t\t\t(nodeType ? value.localName === nodeType : value.nodeType === 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (nodeType === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t}\n\n\tif (nodeType === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != null) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (!(i in newProps)) {\n\t\t\t\tif (\n\t\t\t\t\t(i == 'value' && 'defaultValue' in newProps) ||\n\t\t\t\t\t(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsetProperty(dom, i, null, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html !== oldHtml.__html &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType === 'foreignObject'\n\t\t\t\t\t? 'http://www.w3.org/1999/xhtml'\n\t\t\t\t\t: namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType === 'progress' && inputValue == null) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue !== undefined &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType === 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType === 'option' && inputValue !== oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked !== undefined && checked !== dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any> & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != null) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) {\n\t\t\tapplyRef(r, null, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._component = vnode._parent = vnode._dom = vnode._nextDom = undefined;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {ComponentChild} vnode The virtual node to render\n * @param {PreactElement} parentDom The DOM element to render into\n * @param {PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? null\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: null,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {ComponentChild} vnode The virtual node to render\n * @param {PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<ComponentChildren>} rest Any additional arguments will be used\n * as replacement children.\n * @returns {VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === undefined && defaultProps !== undefined) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n","/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {VNode} [oldVNode]\n * @param {ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {Component} */\n\tlet component,\n\t\t/** @type {ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\nconst RAF_TIMEOUT = 100;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.forEach(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.forEach(invokeCleanup);\n\t\t\thooks._pendingEffects.forEach(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.forEach(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.forEach(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer<S, A>} reducer\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\t/** @type {(x: import('./internal').HookState) => x is import('./internal').ReducerHookState} */\n\t\t\t\tconst isStateHook = x => !!x._component;\n\t\t\t\tconst stateHooks =\n\t\t\t\t\thookState._component.__hooks._list.filter(isStateHook);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = false;\n\t\t\t\tstateHooks.forEach(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn shouldUpdate || hookState._component.props !== p\n\t\t\t\t\t? prevScu\n\t\t\t\t\t\t? prevScu.call(this, p, s, c)\n\t\t\t\t\t\t: true\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tref(createHandle());\n\t\t\t\treturn () => ref(null);\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState<T>} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal.d').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tif (!component._parentDom || !component.__hooks) continue;\n\t\ttry {\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n","// An named symbol/brand for detecting Signal instances even when they weren't\n// created using the same signals library version.\nconst BRAND_SYMBOL = Symbol.for(\"preact-signals\");\n\n// Flags for Computed and Effect.\nconst RUNNING = 1 << 0;\nconst NOTIFIED = 1 << 1;\nconst OUTDATED = 1 << 2;\nconst DISPOSED = 1 << 3;\nconst HAS_ERROR = 1 << 4;\nconst TRACKING = 1 << 5;\n\n// A linked list node used to track dependencies (sources) and dependents (targets).\n// Also used to remember the source's last version number that the target saw.\ntype Node = {\n\t// A source whose value the target depends on.\n\t_source: Signal;\n\t_prevSource?: Node;\n\t_nextSource?: Node;\n\n\t// A target that depends on the source and should be notified when the source changes.\n\t_target: Computed | Effect;\n\t_prevTarget?: Node;\n\t_nextTarget?: Node;\n\n\t// The version number of the source that target has last seen. We use version numbers\n\t// instead of storing the source value, because source values can take arbitrary amount\n\t// of memory, and computeds could hang on to them forever because they're lazily evaluated.\n\t// Use the special value -1 to mark potentially unused but recyclable nodes.\n\t_version: number;\n\n\t// Used to remember & roll back the source's previous `._node` value when entering &\n\t// exiting a new evaluation context.\n\t_rollbackNode?: Node;\n};\n\nfunction startBatch() {\n\tbatchDepth++;\n}\n\nfunction endBatch() {\n\tif (batchDepth > 1) {\n\t\tbatchDepth--;\n\t\treturn;\n\t}\n\n\tlet error: unknown;\n\tlet hasError = false;\n\n\twhile (batchedEffect !== undefined) {\n\t\tlet effect: Effect | undefined = batchedEffect;\n\t\tbatchedEffect = undefined;\n\n\t\tbatchIteration++;\n\n\t\twhile (effect !== undefined) {\n\t\t\tconst next: Effect | undefined = effect._nextBatchedEffect;\n\t\t\teffect._nextBatchedEffect = undefined;\n\t\t\teffect._flags &= ~NOTIFIED;\n\n\t\t\tif (!(effect._flags & DISPOSED) && needsToRecompute(effect)) {\n\t\t\t\ttry {\n\t\t\t\t\teffect._callback();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!hasError) {\n\t\t\t\t\t\terror = err;\n\t\t\t\t\t\thasError = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\teffect = next;\n\t\t}\n\t}\n\tbatchIteration = 0;\n\tbatchDepth--;\n\n\tif (hasError) {\n\t\tthrow error;\n\t}\n}\n\n/**\n * Combine multiple value updates into one \"commit\" at the end of the provided callback.\n *\n * Batches can be nested and changes are only flushed once the outermost batch callback\n * completes.\n *\n * Accessing a signal that has been modified within a batch will reflect its updated\n * value.\n *\n * @param fn The callback function.\n * @returns The value returned by the callback.\n */\nfunction batch<T>(fn: () => T): T {\n\tif (batchDepth > 0) {\n\t\treturn fn();\n\t}\n\t/*@__INLINE__**/ startBatch();\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tendBatch();\n\t}\n}\n\n// Currently evaluated computed or effect.\nlet evalContext: Computed | Effect | undefined = undefined;\n\n/**\n * Run a callback function that can access signal values without\n * subscribing to the signal updates.\n *\n * @param fn The callback function.\n * @returns The value returned by the callback.\n */\nfunction untracked<T>(fn: () => T): T {\n\tconst prevContext = evalContext;\n\tevalContext = undefined;\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tevalContext = prevContext;\n\t}\n}\n\n// Effects collected into a batch.\nlet batchedEffect: Effect | undefined = undefined;\nlet batchDepth = 0;\nlet batchIteration = 0;\n\n// A global version number for signals, used for fast-pathing repeated\n// computed.peek()/computed.value calls when nothing has changed globally.\nlet globalVersion = 0;\n\nfunction addDependency(signal: Signal): Node | undefined {\n\tif (evalContext === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet node = signal._node;\n\tif (node === undefined || node._target !== evalContext) {\n\t\t/**\n\t\t * `signal` is a new dependency. Create a new dependency node, and set it\n\t\t * as the tail of the current context's dependency list. e.g:\n\t\t *\n\t\t * { A <-> B       }\n\t\t *         ↑     ↑\n\t\t *        tail  node (new)\n\t\t *               ↓\n\t\t * { A <-> B <-> C }\n\t\t *               ↑\n\t\t *              tail (evalContext._sources)\n\t\t */\n\t\tnode = {\n\t\t\t_version: 0,\n\t\t\t_source: signal,\n\t\t\t_prevSource: evalContext._sources,\n\t\t\t_nextSource: undefined,\n\t\t\t_target: evalContext,\n\t\t\t_prevTarget: undefined,\n\t\t\t_nextTarget: undefined,\n\t\t\t_rollbackNode: node,\n\t\t};\n\n\t\tif (evalContext._sources !== undefined) {\n\t\t\tevalContext._sources._nextSource = node;\n\t\t}\n\t\tevalContext._sources = node;\n\t\tsignal._node = node;\n\n\t\t// Subscribe to change notifications from this dependency if we're in an effect\n\t\t// OR evaluating a computed signal that in turn has subscribers.\n\t\tif (evalContext._flags & TRACKING) {\n\t\t\tsignal._subscribe(node);\n\t\t}\n\t\treturn node;\n\t} else if (node._version === -1) {\n\t\t// `signal` is an existing dependency from a previous evaluation. Reuse it.\n\t\tnode._version = 0;\n\n\t\t/**\n\t\t * If `node` is not already the current tail of the dependency list (i.e.\n\t\t * there is a next node in the list), then make the `node` the new tail. e.g:\n\t\t *\n\t\t * { A <-> B <-> C <-> D }\n\t\t *         ↑           ↑\n\t\t *        node   ┌─── tail (evalContext._sources)\n\t\t *         └─────│─────┐\n\t\t *               ↓     ↓\n\t\t * { A <-> C <-> D <-> B }\n\t\t *                     ↑\n\t\t *                    tail (evalContext._sources)\n\t\t */\n\t\tif (node._nextSource !== undefined) {\n\t\t\tnode._nextSource._prevSource = node._prevSource;\n\n\t\t\tif (node._prevSource !== undefined) {\n\t\t\t\tnode._prevSource._nextSource = node._nextSource;\n\t\t\t}\n\n\t\t\tnode._prevSource = evalContext._sources;\n\t\t\tnode._nextSource = undefined;\n\n\t\t\tevalContext._sources!._nextSource = node;\n\t\t\tevalContext._sources = node;\n\t\t}\n\n\t\t// We can assume that the currently evaluated effect / computed signal is already\n\t\t// subscribed to change notifications from `signal` if needed.\n\t\treturn node;\n\t}\n\treturn undefined;\n}\n\n/**\n * The base class for plain and computed signals.\n */\n// @ts-ignore: \"Cannot redeclare exported variable 'Signal'.\"\n//\n// A function with the same name is defined later, so we need to ignore TypeScript's\n// warning about a redeclared variable.\n//\n// The class is declared here, but later implemented with ES5-style prototypes.\n// This enables better control of the transpiled output size.\ndeclare class Signal<T = any> {\n\t/** @internal */\n\t_value: unknown;\n\n\t/**\n\t * @internal\n\t * Version numbers should always be >= 0, because the special value -1 is used\n\t * by Nodes to signify potentially unused but recyclable nodes.\n\t */\n\t_version: number;\n\n\t/** @internal */\n\t_node?: Node;\n\n\t/** @internal */\n\t_targets?: Node;\n\n\tconstructor(value?: T);\n\n\t/** @internal */\n\t_refresh(): boolean;\n\n\t/** @internal */\n\t_subscribe(node: Node): void;\n\n\t/** @internal */\n\t_unsubscribe(node: Node): void;\n\n\tsubscribe(fn: (value: T) => void): () => void;\n\n\tvalueOf(): T;\n\n\ttoString(): string;\n\n\ttoJSON(): T;\n\n\tpeek(): T;\n\n\tbrand: typeof BRAND_SYMBOL;\n\n\tget value(): T;\n\tset value(value: T);\n}\n\n/** @internal */\n// @ts-ignore: \"Cannot redeclare exported variable 'Signal'.\"\n//\n// A class with the same name has already been declared, so we need to ignore\n// TypeScript's warning about a redeclared variable.\n//\n// The previously declared class is implemented here with ES5-style prototypes.\n// This enables better control of the transpiled output size.\nfunction Signal(this: Signal, value?: unknown) {\n\tthis._value = value;\n\tthis._version = 0;\n\tthis._node = undefined;\n\tthis._targets = undefined;\n}\n\nSignal.prototype.brand = BRAND_SYMBOL;\n\nSignal.prototype._refresh = function () {\n\treturn true;\n};\n\nSignal.prototype._subscribe = function (node) {\n\tif (this._targets !== node && node._prevTarget === undefined) {\n\t\tnode._nextTarget = this._targets;\n\t\tif (this._targets !== undefined) {\n\t\t\tthis._targets._prevTarget = node;\n\t\t}\n\t\tthis._targets = node;\n\t}\n};\n\nSignal.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the signal has any subscribers to begin with.\n\tif (this._targets !== undefined) {\n\t\tconst prev = node._prevTarget;\n\t\tconst next = node._nextTarget;\n\t\tif (prev !== undefined) {\n\t\t\tprev._nextTarget = next;\n\t\t\tnode._prevTarget = undefined;\n\t\t}\n\t\tif (next !== undefined) {\n\t\t\tnext._prevTarget = prev;\n\t\t\tnode._nextTarget = undefined;\n\t\t}\n\t\tif (node === this._targets) {\n\t\t\tthis._targets = next;\n\t\t}\n\t}\n};\n\nSignal.prototype.subscribe = function (fn) {\n\treturn effect(() => {\n\t\tconst value = this.value;\n\n\t\tconst prevContext = evalContext;\n\t\tevalContext = undefined;\n\t\ttry {\n\t\t\tfn(value);\n\t\t} finally {\n\t\t\tevalContext = prevContext;\n\t\t}\n\t});\n};\n\nSignal.prototype.valueOf = function () {\n\treturn this.value;\n};\n\nSignal.prototype.toString = function () {\n\treturn this.value + \"\";\n};\n\nSignal.prototype.toJSON = function () {\n\treturn this.value;\n};\n\nSignal.prototype.peek = function () {\n\tconst prevContext = evalContext;\n\tevalContext = undefined;\n\ttry {\n\t\treturn this.value;\n\t} finally {\n\t\tevalContext = prevContext;\n\t}\n};\n\nObject.defineProperty(Signal.prototype, \"value\", {\n\tget(this: Signal) {\n\t\tconst node = addDependency(this);\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\treturn this._value;\n\t},\n\tset(this: Signal, value) {\n\t\tif (value !== this._value) {\n\t\t\tif (batchIteration > 100) {\n\t\t\t\tthrow new Error(\"Cycle detected\");\n\t\t\t}\n\n\t\t\tthis._value = value;\n\t\t\tthis._version++;\n\t\t\tglobalVersion++;\n\n\t\t\t/**@__INLINE__*/ startBatch();\n\t\t\ttry {\n\t\t\t\tfor (\n\t\t\t\t\tlet node = this._targets;\n\t\t\t\t\tnode !== undefined;\n\t\t\t\t\tnode = node._nextTarget\n\t\t\t\t) {\n\t\t\t\t\tnode._target._notify();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tendBatch();\n\t\t\t}\n\t\t}\n\t},\n});\n\n/**\n * Create a new plain signal.\n *\n * @param value The initial value for the signal.\n * @returns A new signal.\n */\nexport function signal<T>(value: T): Signal<T>;\nexport function signal<T = undefined>(): Signal<T | undefined>;\nexport function signal<T>(value?: T): Signal<T> {\n\treturn new Signal(value);\n}\n\nfunction needsToRecompute(target: Computed | Effect): boolean {\n\t// Check the dependencies for changed values. The dependency list is already\n\t// in order of use. Therefore if multiple dependencies have changed values, only\n\t// the first used dependency is re-evaluated at this point.\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\t// If there's a new version of the dependency before or after refreshing,\n\t\t// or the dependency has something blocking it from refreshing at all (e.g. a\n\t\t// dependency cycle), then we need to recompute.\n\t\tif (\n\t\t\tnode._source._version !== node._version ||\n\t\t\t!node._source._refresh() ||\n\t\t\tnode._source._version !== node._version\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// If none of the dependencies have changed values since last recompute then\n\t// there's no need to recompute.\n\treturn false;\n}\n\nfunction prepareSources(target: Computed | Effect) {\n\t/**\n\t * 1. Mark all current sources as re-usable nodes (version: -1)\n\t * 2. Set a rollback node if the current node is being used in a different context\n\t * 3. Point 'target._sources' to the tail of the doubly-linked list, e.g:\n\t *\n\t *    { undefined <- A <-> B <-> C -> undefined }\n\t *                   ↑           ↑\n\t *                   │           └──────┐\n\t * target._sources = A; (node is head)  │\n\t *                   ↓                  │\n\t * target._sources = C; (node is tail) ─┘\n\t */\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tconst rollbackNode = node._source._node;\n\t\tif (rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = rollbackNode;\n\t\t}\n\t\tnode._source._node = node;\n\t\tnode._version = -1;\n\n\t\tif (node._nextSource === undefined) {\n\t\t\ttarget._sources = node;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction cleanupSources(target: Computed | Effect) {\n\tlet node = target._sources;\n\tlet head = undefined;\n\n\t/**\n\t * At this point 'target._sources' points to the tail of the doubly-linked list.\n\t * It contains all existing sources + new sources in order of use.\n\t * Iterate backwards until we find the head node while dropping old dependencies.\n\t */\n\twhile (node !== undefined) {\n\t\tconst prev = node._prevSource;\n\n\t\t/**\n\t\t * The node was not re-used, unsubscribe from its change notifications and remove itself\n\t\t * from the doubly-linked list. e.g:\n\t\t *\n\t\t * { A <-> B <-> C }\n\t\t *         ↓\n\t\t *    { A <-> C }\n\t\t */\n\t\tif (node._version === -1) {\n\t\t\tnode._source._unsubscribe(node);\n\n\t\t\tif (prev !== undefined) {\n\t\t\t\tprev._nextSource = node._nextSource;\n\t\t\t}\n\t\t\tif (node._nextSource !== undefined) {\n\t\t\t\tnode._nextSource._prevSource = prev;\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * The new head is the last node seen which wasn't removed/unsubscribed\n\t\t\t * from the doubly-linked list. e.g:\n\t\t\t *\n\t\t\t * { A <-> B <-> C }\n\t\t\t *   ↑     ↑     ↑\n\t\t\t *   │     │     └ head = node\n\t\t\t *   │     └ head = node\n\t\t\t *   └ head = node\n\t\t\t */\n\t\t\thead = node;\n\t\t}\n\n\t\tnode._source._node = node._rollbackNode;\n\t\tif (node._rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = undefined;\n\t\t}\n\n\t\tnode = prev;\n\t}\n\n\ttarget._sources = head;\n}\n\ndeclare class Computed<T = any> extends Signal<T> {\n\t_fn: () => T;\n\t_sources?: Node;\n\t_globalVersion: number;\n\t_flags: number;\n\n\tconstructor(fn: () => T);\n\n\t_notify(): void;\n\tget value(): T;\n}\n\nfunction Computed(this: Computed, fn: () => unknown) {\n\tSignal.call(this, undefined);\n\n\tthis._fn = fn;\n\tthis._sources = undefined;\n\tthis._globalVersion = globalVersion - 1;\n\tthis._flags = OUTDATED;\n}\n\nComputed.prototype = new Signal() as Computed;\n\nComputed.prototype._refresh = function () {\n\tthis._flags &= ~NOTIFIED;\n\n\tif (this._flags & RUNNING) {\n\t\treturn false;\n\t}\n\n\t// If this computed signal has subscribed to updates from its dependencies\n\t// (TRACKING flag set) and none of them have notified about changes (OUTDATED\n\t// flag not set), then the computed value can't have changed.\n\tif ((this._flags & (OUTDATED | TRACKING)) === TRACKING) {\n\t\treturn true;\n\t}\n\tthis._flags &= ~OUTDATED;\n\n\tif (this._globalVersion === globalVersion) {\n\t\treturn true;\n\t}\n\tthis._globalVersion = globalVersion;\n\n\t// Mark this computed signal running before checking the dependencies for value\n\t// changes, so that the RUNNING flag can be used to notice cyclical dependencies.\n\tthis._flags |= RUNNING;\n\tif (this._version > 0 && !needsToRecompute(this)) {\n\t\tthis._flags &= ~RUNNING;\n\t\treturn true;\n\t}\n\n\tconst prevContext = evalContext;\n\ttry {\n\t\tprepareSources(this);\n\t\tevalContext = this;\n\t\tconst value = this._fn();\n\t\tif (\n\t\t\tthis._flags & HAS_ERROR ||\n\t\t\tthis._value !== value ||\n\t\t\tthis._version === 0\n\t\t) {\n\t\t\tthis._value = value;\n\t\t\tthis._flags &= ~HAS_ERROR;\n\t\t\tthis._version++;\n\t\t}\n\t} catch (err) {\n\t\tthis._value = err;\n\t\tthis._flags |= HAS_ERROR;\n\t\tthis._version++;\n\t}\n\tevalContext = prevContext;\n\tcleanupSources(this);\n\tthis._flags &= ~RUNNING;\n\treturn true;\n};\n\nComputed.prototype._subscribe = function (node) {\n\tif (this._targets === undefined) {\n\t\tthis._flags |= OUTDATED | TRACKING;\n\n\t\t// A computed signal subscribes lazily to its dependencies when it\n\t\t// gets its first subscriber.\n\t\tfor (\n\t\t\tlet node = this._sources;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextSource\n\t\t) {\n\t\t\tnode._source._subscribe(node);\n\t\t}\n\t}\n\tSignal.prototype._subscribe.call(this, node);\n};\n\nComputed.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the computed signal has any subscribers.\n\tif (this._targets !== undefined) {\n\t\tSignal.prototype._unsubscribe.call(this, node);\n\n\t\t// Computed signal unsubscribes from its dependencies when it loses its last subscriber.\n\t\t// This makes it possible for unreferences subgraphs of computed signals to get garbage collected.\n\t\tif (this._targets === undefined) {\n\t\t\tthis._flags &= ~TRACKING;\n\n\t\t\tfor (\n\t\t\t\tlet node = this._sources;\n\t\t\t\tnode !== undefined;\n\t\t\t\tnode = node._nextSource\n\t\t\t) {\n\t\t\t\tnode._source._unsubscribe(node);\n\t\t\t}\n\t\t}\n\t}\n};\n\nComputed.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= OUTDATED | NOTIFIED;\n\n\t\tfor (\n\t\t\tlet node = this._targets;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextTarget\n\t\t) {\n\t\t\tnode._target._notify();\n\t\t}\n\t}\n};\n\nObject.defineProperty(Computed.prototype, \"value\", {\n\tget(this: Computed) {\n\t\tif (this._flags & RUNNING) {\n\t\t\tthrow new Error(\"Cycle detected\");\n\t\t}\n\t\tconst node = addDependency(this);\n\t\tthis._refresh();\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\tif (this._flags & HAS_ERROR) {\n\t\t\tthrow this._value;\n\t\t}\n\t\treturn this._value;\n\t},\n});\n\n/**\n * An interface for read-only signals.\n */\ninterface ReadonlySignal<T = any> {\n\treadonly value: T;\n\tpeek(): T;\n\n\tsubscribe(fn: (value: T) => void): () => void;\n\tvalueOf(): T;\n\ttoString(): string;\n\ttoJSON(): T;\n\tbrand: typeof BRAND_SYMBOL;\n}\n\n/**\n * Create a new signal that is computed based on the values of other signals.\n *\n * The returned computed signal is read-only, and its value is automatically\n * updated when any signals accessed from within the callback function change.\n *\n * @param fn The effect callback.\n * @returns A new read-only signal.\n */\nfunction computed<T>(fn: () => T): ReadonlySignal<T> {\n\treturn new Computed(fn);\n}\n\nfunction cleanupEffect(effect: Effect) {\n\tconst cleanup = effect._cleanup;\n\teffect._cleanup = undefined;\n\n\tif (typeof cleanup === \"function\") {\n\t\t/*@__INLINE__**/ startBatch();\n\n\t\t// Run cleanup functions always outside of any context.\n\t\tconst prevContext = evalContext;\n\t\tevalContext = undefined;\n\t\ttry {\n\t\t\tcleanup();\n\t\t} catch (err) {\n\t\t\teffect._flags &= ~RUNNING;\n\t\t\teffect._flags |= DISPOSED;\n\t\t\tdisposeEffect(effect);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tevalContext = prevContext;\n\t\t\tendBatch();\n\t\t}\n\t}\n}\n\nfunction disposeEffect(effect: Effect) {\n\tfor (\n\t\tlet node = effect._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tnode._source._unsubscribe(node);\n\t}\n\teffect._fn = undefined;\n\teffect._sources = undefined;\n\n\tcleanupEffect(effect);\n}\n\nfunction endEffect(this: Effect, prevContext?: Computed | Effect) {\n\tif (evalContext !== this) {\n\t\tthrow new Error(\"Out-of-order effect\");\n\t}\n\tcleanupSources(this);\n\tevalContext = prevContext;\n\n\tthis._flags &= ~RUNNING;\n\tif (this._flags & DISPOSED) {\n\t\tdisposeEffect(this);\n\t}\n\tendBatch();\n}\n\ntype EffectFn = () => void | (() => void);\n\ndeclare class Effect {\n\t_fn?: EffectFn;\n\t_cleanup?: () => void;\n\t_sources?: Node;\n\t_nextBatchedEffect?: Effect;\n\t_flags: number;\n\n\tconstructor(fn: EffectFn);\n\n\t_callback(): void;\n\t_start(): () => void;\n\t_notify(): void;\n\t_dispose(): void;\n}\n\nfunction Effect(this: Effect, fn: EffectFn) {\n\tthis._fn = fn;\n\tthis._cleanup = undefined;\n\tthis._sources = undefined;\n\tthis._nextBatchedEffect = undefined;\n\tthis._flags = TRACKING;\n}\n\nEffect.prototype._callback = function () {\n\tconst finish = this._start();\n\ttry {\n\t\tif (this._flags & DISPOSED) return;\n\t\tif (this._fn === undefined) return;\n\n\t\tconst cleanup = this._fn();\n\t\tif (typeof cleanup === \"function\") {\n\t\t\tthis._cleanup = cleanup;\n\t\t}\n\t} finally {\n\t\tfinish();\n\t}\n};\n\nEffect.prototype._start = function () {\n\tif (this._flags & RUNNING) {\n\t\tthrow new Error(\"Cycle detected\");\n\t}\n\tthis._flags |= RUNNING;\n\tthis._flags &= ~DISPOSED;\n\tcleanupEffect(this);\n\tprepareSources(this);\n\n\t/*@__INLINE__**/ startBatch();\n\tconst prevContext = evalContext;\n\tevalContext = this;\n\treturn endEffect.bind(this, prevContext);\n};\n\nEffect.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= NOTIFIED;\n\t\tthis._nextBatchedEffect = batchedEffect;\n\t\tbatchedEffect = this;\n\t}\n};\n\nEffect.prototype._dispose = function () {\n\tthis._flags |= DISPOSED;\n\n\tif (!(this._flags & RUNNING)) {\n\t\tdisposeEffect(this);\n\t}\n};\n\n/**\n * Create an effect to run arbitrary code in response to signal changes.\n *\n * An effect tracks which signals are accessed within the given callback\n * function `fn`, and re-runs the callback when those signals change.\n *\n * The callback may return a cleanup function. The cleanup function gets\n * run once, either when the callback is next called or when the effect\n * gets disposed, whichever happens first.\n *\n * @param fn The effect callback.\n * @returns A function for disposing the effect.\n */\nfunction effect(fn: EffectFn): () => void {\n\tconst effect = new Effect(fn);\n\ttry {\n\t\teffect._callback();\n\t} catch (err) {\n\t\teffect._dispose();\n\t\tthrow err;\n\t}\n\t// Return a bound function instead of a wrapper like `() => effect._dispose()`,\n\t// because bound functions seem to be just as fast and take up a lot less memory.\n\treturn effect._dispose.bind(effect);\n}\n\nexport { computed, effect, batch, untracked, Signal, ReadonlySignal };\n","import { options, Component, isValidElement } from \"preact\";\nimport { useRef, useMemo, useEffect } from \"preact/hooks\";\nimport {\n\tsignal,\n\tcomputed,\n\tbatch,\n\teffect,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n} from \"@preact/signals-core\";\nimport {\n\tVNode,\n\tOptionsTypes,\n\tHookFn,\n\tEffect,\n\tPropertyUpdater,\n\tAugmentedComponent,\n\tAugmentedElement as Element,\n} from \"./internal\";\n\nexport {\n\tsignal,\n\tcomputed,\n\tbatch,\n\teffect,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n};\n\nconst HAS_PENDING_UPDATE = 1 << 0;\nconst HAS_HOOK_STATE = 1 << 1;\nconst HAS_COMPUTEDS = 1 << 2;\n\n// Install a Preact options hook\nfunction hook<T extends OptionsTypes>(hookName: T, hookFn: HookFn<T>) {\n\t// @ts-ignore-next-line private options hooks usage\n\toptions[hookName] = hookFn.bind(null, options[hookName] || (() => {}));\n}\n\nlet currentComponent: AugmentedComponent | undefined;\nlet finishUpdate: (() => void) | undefined;\n\nfunction setCurrentUpdater(updater?: Effect) {\n\t// end tracking for the current update:\n\tif (finishUpdate) finishUpdate();\n\t// start tracking the new update:\n\tfinishUpdate = updater && updater._start();\n}\n\nfunction createUpdater(update: () => void) {\n\tlet updater!: Effect;\n\teffect(function (this: Effect) {\n\t\tupdater = this;\n\t});\n\tupdater._callback = update;\n\treturn updater;\n}\n\n/** @todo This may be needed for complex prop value detection. */\n// function isSignalValue(value: any): value is Signal {\n// \tif (typeof value !== \"object\" || value == null) return false;\n// \tif (value instanceof Signal) return true;\n// \t// @TODO: uncomment this when we land Reactive (ideally behind a brand check)\n// \t// for (let i in value) if (value[i] instanceof Signal) return true;\n// \treturn false;\n// }\n\n/**\n * A wrapper component that renders a Signal directly as a Text node.\n * @todo: in Preact 11, just decorate Signal with `type:null`\n */\nfunction SignalValue(this: AugmentedComponent, { data }: { data: Signal }) {\n\t// hasComputeds.add(this);\n\n\t// Store the props.data signal in another signal so that\n\t// passing a new signal reference re-runs the text computed:\n\tconst currentSignal = useSignal(data);\n\tcurrentSignal.value = data;\n\n\tconst s = useMemo(() => {\n\t\t// mark the parent component as having computeds so it gets optimized\n\t\tlet v = this.__v;\n\t\twhile ((v = v.__!)) {\n\t\t\tif (v.__c) {\n\t\t\t\tv.__c._updateFlags |= HAS_COMPUTEDS;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._updater!._callback = () => {\n\t\t\tif (isValidElement(s.peek()) || this.base?.nodeType !== 3) {\n\t\t\t\tthis._updateFlags |= HAS_PENDING_UPDATE;\n\t\t\t\tthis.setState({});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t(this.base as Text).data = s.peek();\n\t\t};\n\n\t\treturn computed(() => {\n\t\t\tlet data = currentSignal.value;\n\t\t\tlet s = data.value;\n\t\t\treturn s === 0 ? 0 : s === true ? \"\" : s || \"\";\n\t\t});\n\t}, []);\n\n\treturn s.value;\n}\nSignalValue.displayName = \"_st\";\n\nObject.defineProperties(Signal.prototype, {\n\tconstructor: { configurable: true, value: undefined },\n\ttype: { configurable: true, value: SignalValue },\n\tprops: {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn { data: this };\n\t\t},\n\t},\n\t// Setting a VNode's _depth to 1 forces Preact to clone it before modifying:\n\t// https://github.com/preactjs/preact/blob/d7a433ee8463a7dc23a05111bb47de9ec729ad4d/src/diff/children.js#L77\n\t// @todo remove this for Preact 11\n\t__b: { configurable: true, value: 1 },\n});\n\n/** Inject low-level property/attribute bindings for Signals into Preact's diff */\nhook(OptionsTypes.DIFF, (old, vnode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet signalProps: Record<string, any> | undefined;\n\n\t\tlet props = vnode.props;\n\t\tfor (let i in props) {\n\t\t\tif (i === \"children\") continue;\n\n\t\t\tlet value = props[i];\n\t\t\tif (value instanceof Signal) {\n\t\t\t\tif (!signalProps) vnode.__np = signalProps = {};\n\t\t\t\tsignalProps[i] = value;\n\t\t\t\tprops[i] = value.peek();\n\t\t\t}\n\t\t}\n\t}\n\n\told(vnode);\n});\n\n/** Set up Updater before rendering a component */\nhook(OptionsTypes.RENDER, (old, vnode) => {\n\tsetCurrentUpdater();\n\n\tlet updater;\n\n\tlet component = vnode.__c;\n\tif (component) {\n\t\tcomponent._updateFlags &= ~HAS_PENDING_UPDATE;\n\n\t\tupdater = component._updater;\n\t\tif (updater === undefined) {\n\t\t\tcomponent._updater = updater = createUpdater(() => {\n\t\t\t\tcomponent._updateFlags |= HAS_PENDING_UPDATE;\n\t\t\t\tcomponent.setState({});\n\t\t\t});\n\t\t}\n\t}\n\n\tcurrentComponent = component;\n\tsetCurrentUpdater(updater);\n\told(vnode);\n});\n\n/** Finish current updater if a component errors */\nhook(OptionsTypes.CATCH_ERROR, (old, error, vnode, oldVNode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\told(error, vnode, oldVNode);\n});\n\n/** Finish current updater after rendering any VNode */\nhook(OptionsTypes.DIFFED, (old, vnode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\n\tlet dom: Element;\n\n\t// vnode._dom is undefined during string rendering,\n\t// so we use this to skip prop subscriptions during SSR.\n\tif (typeof vnode.type === \"string\" && (dom = vnode.__e as Element)) {\n\t\tlet props = vnode.__np;\n\t\tlet renderedProps = vnode.props;\n\t\tif (props) {\n\t\t\tlet updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater !== undefined && !(prop in props)) {\n\t\t\t\t\t\tupdater._dispose();\n\t\t\t\t\t\t// @todo we could just always invoke _dispose() here\n\t\t\t\t\t\tupdaters[prop] = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdaters = {};\n\t\t\t\tdom._updaters = updaters;\n\t\t\t}\n\t\t\tfor (let prop in props) {\n\t\t\t\tlet updater = updaters[prop];\n\t\t\t\tlet signal = props[prop];\n\t\t\t\tif (updater === undefined) {\n\t\t\t\t\tupdater = createPropUpdater(dom, prop, signal, renderedProps);\n\t\t\t\t\tupdaters[prop] = updater;\n\t\t\t\t} else {\n\t\t\t\t\tupdater._update(signal, renderedProps);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\nfunction createPropUpdater(\n\tdom: Element,\n\tprop: string,\n\tpropSignal: Signal,\n\tprops: Record<string, any>\n): PropertyUpdater {\n\tconst setAsProperty =\n\t\tprop in dom &&\n\t\t// SVG elements need to go through `setAttribute` because they\n\t\t// expect things like SVGAnimatedTransformList instead of strings.\n\t\t// @ts-ignore\n\t\tdom.ownerSVGElement === undefined;\n\n\tconst changeSignal = signal(propSignal);\n\treturn {\n\t\t_update: (newSignal: Signal, newProps: typeof props) => {\n\t\t\tchangeSignal.value = newSignal;\n\t\t\tprops = newProps;\n\t\t},\n\t\t_dispose: effect(() => {\n\t\t\tconst value = changeSignal.value.value;\n\t\t\t// If Preact just rendered this value, don't render it again:\n\t\t\tif (props[prop] === value) return;\n\t\t\tprops[prop] = value;\n\t\t\tif (setAsProperty) {\n\t\t\t\t// @ts-ignore-next-line silly\n\t\t\t\tdom[prop] = value;\n\t\t\t} else if (value) {\n\t\t\t\tdom.setAttribute(prop, value);\n\t\t\t} else {\n\t\t\t\tdom.removeAttribute(prop);\n\t\t\t}\n\t\t}),\n\t};\n}\n\n/** Unsubscribe from Signals when unmounting components/vnodes */\nhook(OptionsTypes.UNMOUNT, (old, vnode: VNode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet dom = vnode.__e as Element | undefined;\n\t\t// vnode._dom is undefined during string rendering\n\t\tif (dom) {\n\t\t\tconst updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tdom._updaters = undefined;\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater) updater._dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlet component = vnode.__c;\n\t\tif (component) {\n\t\t\tconst updater = component._updater;\n\t\t\tif (updater) {\n\t\t\t\tcomponent._updater = undefined;\n\t\t\t\tupdater._dispose();\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\n/** Mark components that use hook state so we can skip sCU optimization. */\nhook(OptionsTypes.HOOK, (old, component, index, type) => {\n\tif (type < 3 || type === 9)\n\t\t(component as AugmentedComponent)._updateFlags |= HAS_HOOK_STATE;\n\told(component, index, type);\n});\n\n/**\n * Auto-memoize components that use Signals/Computeds.\n * Note: Does _not_ optimize components that use hook/class state.\n */\nComponent.prototype.shouldComponentUpdate = function (\n\tthis: AugmentedComponent,\n\tprops,\n\tstate\n) {\n\t// @todo: Once preactjs/preact#3671 lands, this could just use `currentUpdater`:\n\tconst updater = this._updater;\n\tconst hasSignals = updater && updater._sources !== undefined;\n\n\t// let reason;\n\t// if (!hasSignals && !hasComputeds.has(this)) {\n\t// \treason = \"no signals or computeds\";\n\t// } else if (hasPendingUpdate.has(this)) {\n\t// \treason = \"has pending update\";\n\t// } else if (hasHookState.has(this)) {\n\t// \treason = \"has hook state\";\n\t// }\n\t// if (reason) {\n\t// \tif (!this) reason += \" (`this` bug)\";\n\t// \tconsole.log(\"not optimizing\", this?.constructor?.name, \": \", reason, {\n\t// \t\tdetails: {\n\t// \t\t\thasSignals,\n\t// \t\t\thasComputeds: hasComputeds.has(this),\n\t// \t\t\thasPendingUpdate: hasPendingUpdate.has(this),\n\t// \t\t\thasHookState: hasHookState.has(this),\n\t// \t\t\tdeps: Array.from(updater._deps),\n\t// \t\t\tupdater,\n\t// \t\t},\n\t// \t});\n\t// }\n\n\t// if this component used no signals or computeds, update:\n\tif (!hasSignals && !(this._updateFlags & HAS_COMPUTEDS)) return true;\n\n\t// if there is a pending re-render triggered from Signals,\n\t// or if there is hook or class state, update:\n\tif (this._updateFlags & (HAS_PENDING_UPDATE | HAS_HOOK_STATE)) return true;\n\n\t// @ts-ignore\n\tfor (let i in state) return true;\n\n\t// if any non-Signal props changed, update:\n\tfor (let i in props) {\n\t\tif (i !== \"__source\" && props[i] !== this.props[i]) return true;\n\t}\n\tfor (let i in this.props) if (!(i in props)) return true;\n\n\t// this is a purely Signal-driven component, don't update:\n\treturn false;\n};\n\nexport function useSignal<T>(value: T): Signal<T>;\nexport function useSignal<T = undefined>(): Signal<T | undefined>;\nexport function useSignal<T>(value?: T) {\n\treturn useMemo(() => signal<T | undefined>(value), []);\n}\n\nexport function useComputed<T>(compute: () => T) {\n\tconst $compute = useRef(compute);\n\t$compute.current = compute;\n\t(currentComponent as AugmentedComponent)._updateFlags |= HAS_COMPUTEDS;\n\treturn useMemo(() => computed<T>(() => $compute.current()), []);\n}\n\nexport function useSignalEffect(cb: () => void | (() => void)) {\n\tconst callback = useRef(cb);\n\tcallback.current = cb;\n\n\tuseEffect(() => {\n\t\treturn effect(() => callback.current());\n\t}, []);\n}\n\n/**\n * @todo Determine which Reactive implementation we'll be using.\n * @internal\n */\n// export function useReactive<T extends object>(value: T): Reactive<T> {\n// \treturn useMemo(() => reactive<T>(value), []);\n// }\n\n/**\n * @internal\n * Update a Reactive's using the properties of an object or other Reactive.\n * Also works for Signals.\n * @example\n *   // Update a Reactive with Object.assign()-like syntax:\n *   const r = reactive({ name: \"Alice\" });\n *   update(r, { name: \"Bob\" });\n *   update(r, { age: 42 }); // property 'age' does not exist in type '{ name?: string }'\n *   update(r, 2); // '2' has no properties in common with '{ name?: string }'\n *   console.log(r.name.value); // \"Bob\"\n *\n * @example\n *   // Update a Reactive with the properties of another Reactive:\n *   const A = reactive({ name: \"Alice\" });\n *   const B = reactive({ name: \"Bob\", age: 42 });\n *   update(A, B);\n *   console.log(`${A.name} is ${A.age}`); // \"Bob is 42\"\n *\n * @example\n *   // Update a signal with assign()-like syntax:\n *   const s = signal(42);\n *   update(s, \"hi\"); // Argument type 'string' not assignable to type 'number'\n *   update(s, {}); // Argument type '{}' not assignable to type 'number'\n *   update(s, 43);\n *   console.log(s.value); // 43\n *\n * @param obj The Reactive or Signal to be updated\n * @param update The value, Signal, object or Reactive to update `obj` to match\n * @param overwrite If `true`, any properties `obj` missing from `update` are set to `undefined`\n */\n/*\nexport function update<T extends SignalOrReactive>(\n\tobj: T,\n\tupdate: Partial<Unwrap<T>>,\n\toverwrite = false\n) {\n\tif (obj instanceof Signal) {\n\t\tobj.value = peekValue(update);\n\t} else {\n\t\tfor (let i in update) {\n\t\t\tif (i in obj) {\n\t\t\t\tobj[i].value = peekValue(update[i]);\n\t\t\t} else {\n\t\t\t\tlet sig = signal(peekValue(update[i]));\n\t\t\t\tsig[KEY] = i;\n\t\t\t\tobj[i] = sig;\n\t\t\t}\n\t\t}\n\t\tif (overwrite) {\n\t\t\tfor (let i in obj) {\n\t\t\t\tif (!(i in update)) {\n\t\t\t\t\tobj[i].value = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n*/\n","const namespaceStack: string[] = [];\n\nexport const getNamespace = () => namespaceStack.slice( -1 )[ 0 ];\n\nexport const setNamespace = ( namespace: string ) => {\n\tnamespaceStack.push( namespace );\n};\nexport const resetNamespace = () => {\n\tnamespaceStack.pop();\n};\n","/**\n * External dependencies\n */\nimport type { h as createElement, RefObject } from 'preact';\n\n/**\n * Internal dependencies\n */\nimport { getNamespace } from './namespaces';\nimport type { Evaluate } from './hooks';\n\nexport interface Scope {\n\tevaluate: Evaluate;\n\tcontext: object;\n\tserverContext: object;\n\tref: RefObject< HTMLElement >;\n\tattributes: createElement.JSX.HTMLAttributes;\n}\n\n// Store stacks for the current scope and the default namespaces and export APIs\n// to interact with them.\nconst scopeStack: Scope[] = [];\n\nexport const getScope = () => scopeStack.slice( -1 )[ 0 ];\n\nexport const setScope = ( scope: Scope ) => {\n\tscopeStack.push( scope );\n};\nexport const resetScope = () => {\n\tscopeStack.pop();\n};\n\n// Wrap the element props to prevent modifications.\nconst immutableMap = new WeakMap();\nconst immutableError = () => {\n\tthrow new Error(\n\t\t'Please use `data-wp-bind` to modify the attributes of an element.'\n\t);\n};\nconst immutableHandlers: ProxyHandler< object > = {\n\tget( target, key, receiver ) {\n\t\tconst value = Reflect.get( target, key, receiver );\n\t\treturn !! value && typeof value === 'object'\n\t\t\t? deepImmutable( value )\n\t\t\t: value;\n\t},\n\tset: immutableError,\n\tdeleteProperty: immutableError,\n};\nconst deepImmutable = < T extends object = {} >( target: T ): T => {\n\tif ( ! immutableMap.has( target ) ) {\n\t\timmutableMap.set( target, new Proxy( target, immutableHandlers ) );\n\t}\n\treturn immutableMap.get( target );\n};\n\n/**\n * Retrieves the context inherited by the element evaluating a function from the\n * store. The returned value depends on the element and the namespace where the\n * function calling `getContext()` exists.\n *\n * @param namespace Store namespace. By default, the namespace where the calling\n *                  function exists is used.\n * @return The context content.\n */\nexport const getContext = < T extends object >( namespace?: string ): T => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\treturn scope.context[ namespace || getNamespace() ];\n};\n\n/**\n * Retrieves a representation of the element where a function from the store\n * is being evaluated. Such representation is read-only, and contains a\n * reference to the DOM element, its props and a local reactive state.\n *\n * @return Element representation.\n */\nexport const getElement = () => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getElement()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\tconst { ref, attributes } = scope;\n\treturn Object.freeze( {\n\t\tref: ref.current,\n\t\tattributes: deepImmutable( attributes ),\n\t} );\n};\n\n/**\n * Retrieves the part of the inherited context defined and updated from the\n * server.\n *\n * The object returned is read-only, and includes the context defined in PHP\n * with `wp_interactivity_data_wp_context()`, including the corresponding\n * inherited properties. When `actions.navigate()` is called, this object is\n * updated to reflect the changes in the new visited page, without affecting the\n * context returned by `getContext()`. Directives can subscribe to those changes\n * to update the context if needed.\n *\n * @example\n * ```js\n *  store('...', {\n *    callbacks: {\n *      updateServerContext() {\n *        const context = getContext();\n *        const serverContext = getServerContext();\n *        // Override some property with the new value that came from the server.\n *        context.overridableProp = serverContext.overridableProp;\n *      },\n *    },\n *  });\n * ```\n *\n * @param namespace Store namespace. By default, the namespace where the calling\n *                  function exists is used.\n * @return The server context content.\n */\nexport const getServerContext = < T extends object >(\n\tnamespace?: string\n): T => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getServerContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\treturn scope.serverContext[ namespace || getNamespace() ];\n};\n","/**\n * External dependencies\n */\nimport {\n\tuseMemo as _useMemo,\n\tuseCallback as _useCallback,\n\tuseEffect as _useEffect,\n\tuseLayoutEffect as _useLayoutEffect,\n\ttype EffectCallback,\n\ttype Inputs,\n} from 'preact/hooks';\nimport { effect } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport { getScope, setScope, resetScope } from './scopes';\nimport { getNamespace, setNamespace, resetNamespace } from './namespaces';\n\ninterface Flusher {\n\treadonly flush: () => void;\n\treadonly dispose: () => void;\n}\n\ndeclare global {\n\tinterface Window {\n\t\tscheduler?: {\n\t\t\treadonly yield?: () => Promise< void >;\n\t\t};\n\t}\n}\n\ninterface SyncAwareFunction extends Function {\n\tsync?: boolean;\n}\n\n/**\n * Executes a callback function after the next frame is rendered.\n *\n * @param callback The callback function to be executed.\n * @return A promise that resolves after the callback function is executed.\n */\nconst afterNextFrame = ( callback: () => void ) => {\n\treturn new Promise< void >( ( resolve ) => {\n\t\tconst done = () => {\n\t\t\tclearTimeout( timeout );\n\t\t\twindow.cancelAnimationFrame( raf );\n\t\t\tsetTimeout( () => {\n\t\t\t\tcallback();\n\t\t\t\tresolve();\n\t\t\t} );\n\t\t};\n\t\tconst timeout = setTimeout( done, 100 );\n\t\tconst raf = window.requestAnimationFrame( done );\n\t} );\n};\n\n/**\n * Returns a promise that resolves after yielding to main.\n *\n * @return Promise<void>\n */\nexport const splitTask =\n\ttypeof window.scheduler?.yield === 'function'\n\t\t? window.scheduler.yield.bind( window.scheduler )\n\t\t: () => {\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tsetTimeout( resolve, 0 );\n\t\t\t\t} );\n\t\t  };\n\n/**\n * Creates a Flusher object that can be used to flush computed values and notify listeners.\n *\n * Using the mangled properties:\n * this.c: this._callback\n * this.x: this._compute\n * https://github.com/preactjs/signals/blob/main/mangle.json\n *\n * @param compute The function that computes the value to be flushed.\n * @param notify  The function that notifies listeners when the value is flushed.\n * @return The Flusher object with `flush` and `dispose` properties.\n */\nfunction createFlusher( compute: () => void, notify: () => void ): Flusher {\n\tlet flush: () => void = () => undefined;\n\tconst dispose = effect( function ( this: any ): void {\n\t\tflush = this.c.bind( this );\n\t\tthis.x = compute;\n\t\tthis.c = notify;\n\t\treturn compute();\n\t} );\n\treturn { flush, dispose } as const;\n}\n\n/**\n * Custom hook that executes a callback function whenever a signal is triggered.\n * Version of `useSignalEffect` with a `useEffect`-like execution. This hook\n * implementation comes from this PR, but we added short-cirtuiting to avoid\n * infinite loops: https://github.com/preactjs/signals/pull/290\n *\n * @param callback The callback function to be executed.\n */\nexport function useSignalEffect( callback: () => unknown ) {\n\t_useEffect( () => {\n\t\tlet eff: Flusher | null = null;\n\t\tlet isExecuting = false;\n\n\t\tconst notify = async () => {\n\t\t\tif ( eff && ! isExecuting ) {\n\t\t\t\tisExecuting = true;\n\t\t\t\tawait afterNextFrame( eff.flush );\n\t\t\t\tisExecuting = false;\n\t\t\t}\n\t\t};\n\n\t\teff = createFlusher( callback, notify );\n\t\treturn eff.dispose;\n\t}, [] );\n}\n\n/**\n * Returns the passed function wrapped with the current scope so it is\n * accessible whenever the function runs. This is primarily to make the scope\n * available inside hook callbacks.\n *\n * Asynchronous functions should use generators that yield promises instead of awaiting them.\n * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store\n *\n * @param func The passed function.\n * @return The wrapped function.\n */\nexport function withScope<\n\tFunc extends ( ...args: any[] ) => Generator< any, any >,\n>(\n\tfunc: Func\n): (\n\t...args: Parameters< Func >\n) => ReturnType< Func > extends Generator< any, infer Return >\n\t? Promise< Return >\n\t: never;\nexport function withScope< Func extends Function >( func: Func ): Func;\nexport function withScope< Func extends SyncAwareFunction >( func: Func ): Func;\nexport function withScope( func: ( ...args: unknown[] ) => unknown ) {\n\tconst scope = getScope();\n\tconst ns = getNamespace();\n\n\tlet wrapped: Function;\n\tif ( func?.constructor?.name === 'GeneratorFunction' ) {\n\t\twrapped = async ( ...args: Parameters< typeof func > ) => {\n\t\t\tconst gen = func( ...args ) as Generator;\n\t\t\tlet value: any;\n\t\t\tlet it: any;\n\t\t\twhile ( true ) {\n\t\t\t\tsetNamespace( ns );\n\t\t\t\tsetScope( scope );\n\t\t\t\ttry {\n\t\t\t\t\tit = gen.next( value );\n\t\t\t\t} finally {\n\t\t\t\t\tresetScope();\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvalue = await it.value;\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\tsetNamespace( ns );\n\t\t\t\t\tsetScope( scope );\n\t\t\t\t\tgen.throw( e );\n\t\t\t\t} finally {\n\t\t\t\t\tresetScope();\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\n\t\t\t\tif ( it.done ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn value;\n\t\t};\n\t} else {\n\t\twrapped = ( ...args: Parameters< typeof func > ) => {\n\t\t\tsetNamespace( ns );\n\t\t\tsetScope( scope );\n\t\t\ttry {\n\t\t\t\treturn func( ...args );\n\t\t\t} finally {\n\t\t\t\tresetNamespace();\n\t\t\t\tresetScope();\n\t\t\t}\n\t\t};\n\t}\n\n\t// If function was annotated via `withSyncEvent()`, maintain the annotation.\n\tconst syncAware = func as SyncAwareFunction;\n\tif ( syncAware.sync ) {\n\t\tconst syncAwareWrapped = wrapped as SyncAwareFunction;\n\t\tsyncAwareWrapped.sync = true;\n\t\treturn syncAwareWrapped;\n\t}\n\n\treturn wrapped;\n}\n\n/**\n * Accepts a function that contains imperative code which runs whenever any of\n * the accessed _reactive_ properties (e.g., values from the global state or the\n * context) is modified.\n *\n * This hook makes the element's scope available so functions like\n * `getElement()` and `getContext()` can be used inside the passed callback.\n *\n * @param callback The hook callback.\n */\nexport function useWatch( callback: () => unknown ) {\n\tuseSignalEffect( withScope( callback ) );\n}\n\n/**\n * Accepts a function that contains imperative code which runs only after the\n * element's first render, mainly useful for initialization logic.\n *\n * This hook makes the element's scope available so functions like\n * `getElement()` and `getContext()` can be used inside the passed callback.\n *\n * @param callback The hook callback.\n */\nexport function useInit( callback: EffectCallback ) {\n\t_useEffect( withScope( callback ), [] );\n}\n\n/**\n * Accepts a function that contains imperative, possibly effectful code. The\n * effects run after browser paint, without blocking it.\n *\n * This hook is equivalent to Preact's `useEffect` and makes the element's scope\n * available so functions like `getElement()` and `getContext()` can be used\n * inside the passed callback.\n *\n * @param callback Imperative function that can return a cleanup\n *                 function.\n * @param inputs   If present, effect will only activate if the\n *                 values in the list change (using `===`).\n */\nexport function useEffect( callback: EffectCallback, inputs: Inputs ) {\n\t_useEffect( withScope( callback ), inputs );\n}\n\n/**\n * Accepts a function that contains imperative, possibly effectful code. Use\n * this to read layout from the DOM and synchronously re-render.\n *\n * This hook is equivalent to Preact's `useLayoutEffect` and makes the element's\n * scope available so functions like `getElement()` and `getContext()` can be\n * used inside the passed callback.\n *\n * @param callback Imperative function that can return a cleanup\n *                 function.\n * @param inputs   If present, effect will only activate if the\n *                 values in the list change (using `===`).\n */\nexport function useLayoutEffect( callback: EffectCallback, inputs: Inputs ) {\n\t_useLayoutEffect( withScope( callback ), inputs );\n}\n\n/**\n * Returns a memoized version of the callback that only changes if one of the\n * inputs has changed (using `===`).\n *\n * This hook is equivalent to Preact's `useCallback` and makes the element's\n * scope available so functions like `getElement()` and `getContext()` can be\n * used inside the passed callback.\n *\n * @param callback Callback function.\n * @param inputs   If present, the callback will only be updated if the\n *                 values in the list change (using `===`).\n *\n * @return The callback function.\n */\nexport function useCallback< T extends Function >(\n\tcallback: T,\n\tinputs: Inputs\n): T {\n\treturn _useCallback< T >( withScope( callback ), inputs );\n}\n\n/**\n * Pass a factory function and an array of inputs. `useMemo` will only recompute\n * the memoized value when one of the inputs has changed.\n *\n * This hook is equivalent to Preact's `useMemo` and makes the element's scope\n * available so functions like `getElement()` and `getContext()` can be used\n * inside the passed factory function.\n *\n * @param factory Factory function that returns that value for memoization.\n * @param inputs  If present, the factory will only be run to recompute if\n *                the values in the list change (using `===`).\n *\n * @return The memoized value.\n */\nexport function useMemo< T >( factory: () => T, inputs: Inputs ): T {\n\treturn _useMemo( withScope( factory ), inputs );\n}\n\n/**\n * Creates a root fragment by replacing a node or an array of nodes in a parent element.\n * For wrapperless hydration.\n * See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c\n *\n * @param parent      The parent element where the nodes will be replaced.\n * @param replaceNode The node or array of nodes to replace in the parent element.\n * @return The created root fragment.\n */\nexport const createRootFragment = (\n\tparent: Element,\n\treplaceNode: Node | Node[]\n) => {\n\treplaceNode = ( [] as Node[] ).concat( replaceNode );\n\tconst sibling = replaceNode[ replaceNode.length - 1 ].nextSibling;\n\tfunction insert( child: any, root: any ) {\n\t\tparent.insertBefore( child, root || sibling );\n\t}\n\treturn ( ( parent as any ).__k = {\n\t\tnodeType: 1,\n\t\tparentNode: parent,\n\t\tfirstChild: replaceNode[ 0 ],\n\t\tchildNodes: replaceNode,\n\t\tinsertBefore: insert,\n\t\tappendChild: insert,\n\t\tremoveChild( c: Node ) {\n\t\t\tparent.removeChild( c );\n\t\t},\n\t} );\n};\n\n/**\n * Transforms a kebab-case string to camelCase.\n *\n * @param str The kebab-case string to transform to camelCase.\n * @return The transformed camelCase string.\n */\nexport function kebabToCamelCase( str: string ): string {\n\treturn str\n\t\t.replace( /^-+|-+$/g, '' )\n\t\t.toLowerCase()\n\t\t.replace( /-([a-z])/g, function ( _match, group1: string ) {\n\t\t\treturn group1.toUpperCase();\n\t\t} );\n}\n\nconst logged: Set< string > = new Set();\n\n/**\n * Shows a warning with `message` if environment is not `production`.\n *\n * Based on the `@wordpress/warning` package.\n *\n * @param message Message to show in the warning.\n */\nexport const warn = ( message: string ): void => {\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( logged.has( message ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn( message );\n\n\t\t// Throwing an error and catching it immediately to improve debugging\n\t\t// A consumer can use 'pause on caught exceptions'\n\t\ttry {\n\t\t\tthrow Error( message );\n\t\t} catch ( e ) {\n\t\t\t// Do nothing.\n\t\t}\n\t\tlogged.add( message );\n\t}\n};\n\n/**\n * Checks if the passed `candidate` is a plain object with just the `Object`\n * prototype.\n *\n * @param candidate The item to check.\n * @return Whether `candidate` is a plain object.\n */\nexport const isPlainObject = (\n\tcandidate: unknown\n): candidate is Record< string, unknown > =>\n\tBoolean(\n\t\tcandidate &&\n\t\t\ttypeof candidate === 'object' &&\n\t\t\tcandidate.constructor === Object\n\t);\n\n/**\n * Indicates that the passed `callback` requires synchronous access to the event object.\n *\n * @param callback The event callback.\n * @return Altered event callback.\n */\nexport function withSyncEvent( callback: Function ): SyncAwareFunction {\n\tconst syncAware = callback as SyncAwareFunction;\n\tsyncAware.sync = true;\n\treturn syncAware;\n}\n","/**\n * Proxies for each object.\n */\nconst objToProxy = new WeakMap< object, object >();\nconst proxyToObj = new WeakMap< object, object >();\n\n/**\n * Namespaces for each created proxy.\n */\nconst proxyToNs = new WeakMap< object, string >();\n\n/**\n * Object types that can be proxied.\n */\nconst supported = new Set( [ Object, Array ] );\n\n/**\n * Returns a proxy to the passed object with the given handlers, assigning the\n * specified namespace to it. If a proxy for the passed object was created\n * before, that proxy is returned.\n *\n * @param namespace The namespace that will be associated to this proxy.\n * @param obj       The object to proxify.\n * @param handlers  Handlers that the proxy will use.\n *\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n *         check if a proxy can be created for a specific object.\n *\n * @return The created proxy.\n */\nexport const createProxy = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\thandlers: ProxyHandler< T >\n): T => {\n\tif ( ! shouldProxy( obj ) ) {\n\t\tthrow Error( 'This object cannot be proxified.' );\n\t}\n\tif ( ! objToProxy.has( obj ) ) {\n\t\tconst proxy = new Proxy( obj, handlers );\n\t\tobjToProxy.set( obj, proxy );\n\t\tproxyToObj.set( proxy, obj );\n\t\tproxyToNs.set( proxy, namespace );\n\t}\n\treturn objToProxy.get( obj ) as T;\n};\n\n/**\n * Returns the proxy for the given object. If there is no associated proxy, the\n * function returns `undefined`.\n *\n * @param obj Object from which to know the proxy.\n * @return Associated proxy or `undefined`.\n */\nexport const getProxyFromObject = < T extends object >(\n\tobj: T\n): T | undefined => objToProxy.get( obj ) as T;\n\n/**\n * Gets the namespace associated with the given proxy.\n *\n * Proxies have a namespace assigned upon creation. See {@link createProxy}.\n *\n * @param proxy Proxy.\n * @return Namespace.\n */\nexport const getNamespaceFromProxy = ( proxy: object ): string =>\n\tproxyToNs.get( proxy )!;\n\n/**\n * Checks if a given object can be proxied.\n *\n * @param candidate Object to know whether it can be proxied.\n * @return True if the passed instance can be proxied.\n */\nexport const shouldProxy = (\n\tcandidate: any\n): candidate is Object | Array< unknown > => {\n\tif ( typeof candidate !== 'object' || candidate === null ) {\n\t\treturn false;\n\t}\n\treturn (\n\t\t! proxyToNs.has( candidate ) && supported.has( candidate.constructor )\n\t);\n};\n\n/**\n * Returns the target object for the passed proxy. If the passed object is not a registered proxy, the\n * function returns `undefined`.\n *\n * @param proxy Proxy from which to know the target.\n * @return The target object or `undefined`.\n */\nexport const getObjectFromProxy = < T extends object >(\n\tproxy: T\n): T | undefined => proxyToObj.get( proxy ) as T;\n","/**\n * External dependencies\n */\nimport {\n\tcomputed,\n\tsignal,\n\tbatch,\n\ttype Signal,\n\ttype ReadonlySignal,\n} from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport { getNamespaceFromProxy } from './registry';\nimport { getScope } from '../scopes';\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { withScope } from '../utils';\n\n/**\n * Identifier for property computeds not associated to any scope.\n */\nconst NO_SCOPE = {};\n\n/**\n * Structure that manages reactivity for a property in a state object. It uses\n * signals to keep track of property value or getter modifications.\n */\nexport class PropSignal {\n\t/**\n\t * Proxy that holds the property this PropSignal is associated with.\n\t */\n\tprivate owner: object;\n\n\t/**\n\t * Relation of computeds by scope. These computeds are read-only signals\n\t * that depend on whether the property is a value or a getter and,\n\t * therefore, can return different values depending on the scope in which\n\t * the getter is accessed.\n\t */\n\tprivate computedsByScope: WeakMap< WeakKey, ReadonlySignal >;\n\n\t/**\n\t * Signal with the value assigned to the related property.\n\t */\n\tprivate valueSignal?: Signal;\n\n\t/**\n\t * Signal with the getter assigned to the related property.\n\t */\n\tprivate getterSignal?: Signal< ( () => any ) | undefined >;\n\n\t/**\n\t * Structure that manages reactivity for a property in a state object, using\n\t * signals to keep track of property value or getter modifications.\n\t *\n\t * @param owner Proxy that holds the property this instance is associated\n\t *              with.\n\t */\n\tconstructor( owner: object ) {\n\t\tthis.owner = owner;\n\t\tthis.computedsByScope = new WeakMap();\n\t}\n\n\t/**\n\t * Changes the internal value. If a getter was set before, it is set to\n\t * `undefined`.\n\t *\n\t * @param value New value.\n\t */\n\tpublic setValue( value: unknown ) {\n\t\tthis.update( { value } );\n\t}\n\n\t/**\n\t * Changes the internal getter. If a value was set before, it is set to\n\t * `undefined`.\n\t *\n\t * @param getter New getter.\n\t */\n\tpublic setGetter( getter: () => any ) {\n\t\tthis.update( { get: getter } );\n\t}\n\n\t/**\n\t * Returns the computed that holds the result of evaluating the prop in the\n\t * current scope.\n\t *\n\t * These computeds are read-only signals that depend on whether the property\n\t * is a value or a getter and, therefore, can return different values\n\t * depending on the scope in which the getter is accessed.\n\t *\n\t * @return Computed that depends on the scope.\n\t */\n\tpublic getComputed(): ReadonlySignal {\n\t\tconst scope = getScope() || NO_SCOPE;\n\n\t\tif ( ! this.valueSignal && ! this.getterSignal ) {\n\t\t\tthis.update( {} );\n\t\t}\n\n\t\tif ( ! this.computedsByScope.has( scope ) ) {\n\t\t\tconst callback = () => {\n\t\t\t\tconst getter = this.getterSignal?.value;\n\t\t\t\treturn getter\n\t\t\t\t\t? getter.call( this.owner )\n\t\t\t\t\t: this.valueSignal?.value;\n\t\t\t};\n\n\t\t\tsetNamespace( getNamespaceFromProxy( this.owner ) );\n\t\t\tthis.computedsByScope.set(\n\t\t\t\tscope,\n\t\t\t\tcomputed( withScope( callback ) )\n\t\t\t);\n\t\t\tresetNamespace();\n\t\t}\n\n\t\treturn this.computedsByScope.get( scope )!;\n\t}\n\n\t/**\n\t *  Update the internal signals for the value and the getter of the\n\t *  corresponding prop.\n\t *\n\t * @param param0\n\t * @param param0.get   New getter.\n\t * @param param0.value New value.\n\t */\n\tprivate update( { get, value }: { get?: () => any; value?: unknown } ) {\n\t\tif ( ! this.valueSignal ) {\n\t\t\tthis.valueSignal = signal( value );\n\t\t\tthis.getterSignal = signal( get );\n\t\t} else if (\n\t\t\tvalue !== this.valueSignal.peek() ||\n\t\t\tget !== this.getterSignal!.peek()\n\t\t) {\n\t\t\tbatch( () => {\n\t\t\t\tthis.valueSignal!.value = value;\n\t\t\t\tthis.getterSignal!.value = get;\n\t\t\t} );\n\t\t}\n\t}\n}\n","/**\n * External dependencies\n */\nimport { batch, signal, type Signal } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateProxy,\n\tgetProxyFromObject,\n\tgetNamespaceFromProxy,\n\tshouldProxy,\n\tgetObjectFromProxy,\n} from './registry';\nimport { PropSignal } from './signals';\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { isPlainObject } from '../utils';\n\n/**\n * Set of built-in symbols.\n */\nconst wellKnownSymbols = new Set(\n\tObject.getOwnPropertyNames( Symbol )\n\t\t.map( ( key ) => Symbol[ key ] )\n\t\t.filter( ( value ) => typeof value === 'symbol' )\n);\n\n/**\n * Relates each proxy with a map of {@link PropSignal} instances, representing\n * the proxy's accessed properties.\n */\nconst proxyToProps: WeakMap<\n\tobject,\n\tMap< string | symbol, PropSignal >\n> = new WeakMap();\n\n/**\n *  Checks whether a {@link PropSignal | `PropSignal`} instance exists for the\n *  given property in the passed proxy.\n *\n * @param proxy Proxy of a state object or array.\n * @param key   The property key.\n * @return `true` when it exists; false otherwise.\n */\nexport const hasPropSignal = ( proxy: object, key: string ) =>\n\tproxyToProps.has( proxy ) && proxyToProps.get( proxy )!.has( key );\n\nconst readOnlyProxies = new WeakSet();\n\n/**\n * Returns the {@link PropSignal | `PropSignal`} instance associated with the\n * specified prop in the passed proxy.\n *\n * The `PropSignal` instance is generated if it doesn't exist yet, using the\n * `initial` parameter to initialize the internal signals.\n *\n * @param proxy   Proxy of a state object or array.\n * @param key     The property key.\n * @param initial Initial data for the `PropSignal` instance.\n * @return The `PropSignal` instance.\n */\nconst getPropSignal = (\n\tproxy: object,\n\tkey: string | number | symbol,\n\tinitial?: PropertyDescriptor\n) => {\n\tif ( ! proxyToProps.has( proxy ) ) {\n\t\tproxyToProps.set( proxy, new Map() );\n\t}\n\tkey = typeof key === 'number' ? `${ key }` : key;\n\tconst props = proxyToProps.get( proxy )!;\n\tif ( ! props.has( key ) ) {\n\t\tconst ns = getNamespaceFromProxy( proxy );\n\t\tconst prop = new PropSignal( proxy );\n\t\tprops.set( key, prop );\n\t\tif ( initial ) {\n\t\t\tconst { get, value } = initial;\n\t\t\tif ( get ) {\n\t\t\t\tprop.setGetter( get );\n\t\t\t} else {\n\t\t\t\tconst readOnly = readOnlyProxies.has( proxy );\n\t\t\t\tprop.setValue(\n\t\t\t\t\tshouldProxy( value )\n\t\t\t\t\t\t? proxifyState( ns, value, { readOnly } )\n\t\t\t\t\t\t: value\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn props.get( key )!;\n};\n\n/**\n * Relates each proxied object (i.e., the original object) with a signal that\n * tracks changes in the number of properties.\n */\nconst objToIterable = new WeakMap< object, Signal< number > >();\n\n/**\n * When this flag is `true`, it avoids any signal subscription, overriding state\n * props' \"reactive\" behavior.\n */\nlet peeking = false;\n\n/**\n * Handlers for reactive objects and arrays in the state.\n */\nconst stateHandlers: ProxyHandler< object > = {\n\tget( target: object, key: string | symbol, receiver: object ): any {\n\t\t/*\n\t\t * The property should not be reactive for the following cases:\n\t\t * 1. While using the `peek` function to read the property.\n\t\t * 2. The property exists but comes from the Object or Array prototypes.\n\t\t * 3. The property key is a known symbol.\n\t\t */\n\t\tif (\n\t\t\tpeeking ||\n\t\t\t( ! target.hasOwnProperty( key ) && key in target ) ||\n\t\t\t( typeof key === 'symbol' && wellKnownSymbols.has( key ) )\n\t\t) {\n\t\t\treturn Reflect.get( target, key, receiver );\n\t\t}\n\n\t\t// At this point, the property should be reactive.\n\t\tconst desc = Object.getOwnPropertyDescriptor( target, key );\n\t\tconst prop = getPropSignal( receiver, key, desc );\n\t\tconst result = prop.getComputed().value;\n\n\t\t/*\n\t\t * Check if the property is a synchronous function. If it is, set the\n\t\t * default namespace. Synchronous functions always run in the proper scope,\n\t\t * which is set by the Directives component.\n\t\t */\n\t\tif ( typeof result === 'function' ) {\n\t\t\tconst ns = getNamespaceFromProxy( receiver );\n\t\t\treturn ( ...args: unknown[] ) => {\n\t\t\t\tsetNamespace( ns );\n\t\t\t\ttry {\n\t\t\t\t\treturn result.call( receiver, ...args );\n\t\t\t\t} finally {\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tset(\n\t\ttarget: object,\n\t\tkey: string,\n\t\tvalue: unknown,\n\t\treceiver: object\n\t): boolean {\n\t\tif ( readOnlyProxies.has( receiver ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tsetNamespace( getNamespaceFromProxy( receiver ) );\n\t\ttry {\n\t\t\treturn Reflect.set( target, key, value, receiver );\n\t\t} finally {\n\t\t\tresetNamespace();\n\t\t}\n\t},\n\n\tdefineProperty(\n\t\ttarget: object,\n\t\tkey: string,\n\t\tdesc: PropertyDescriptor\n\t): boolean {\n\t\tif ( readOnlyProxies.has( getProxyFromObject( target )! ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isNew = ! ( key in target );\n\t\tconst result = Reflect.defineProperty( target, key, desc );\n\n\t\tif ( result ) {\n\t\t\tconst receiver = getProxyFromObject( target )!;\n\t\t\tconst prop = getPropSignal( receiver, key );\n\t\t\tconst { get, value } = desc;\n\t\t\tif ( get ) {\n\t\t\t\tprop.setGetter( get );\n\t\t\t} else {\n\t\t\t\tconst ns = getNamespaceFromProxy( receiver );\n\t\t\t\tprop.setValue(\n\t\t\t\t\tshouldProxy( value ) ? proxifyState( ns, value ) : value\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isNew && objToIterable.has( target ) ) {\n\t\t\t\tobjToIterable.get( target )!.value++;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Modify the `length` property value only if the related\n\t\t\t * `PropSignal` exists, which means that there are subscriptions to\n\t\t\t * this property.\n\t\t\t */\n\t\t\tif (\n\t\t\t\tArray.isArray( target ) &&\n\t\t\t\tproxyToProps.get( receiver )?.has( 'length' )\n\t\t\t) {\n\t\t\t\tconst length = getPropSignal( receiver, 'length' );\n\t\t\t\tlength.setValue( target.length );\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tdeleteProperty( target: object, key: string ): boolean {\n\t\tif ( readOnlyProxies.has( getProxyFromObject( target )! ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst result = Reflect.deleteProperty( target, key );\n\n\t\tif ( result ) {\n\t\t\tconst prop = getPropSignal( getProxyFromObject( target )!, key );\n\t\t\tprop.setValue( undefined );\n\n\t\t\tif ( objToIterable.has( target ) ) {\n\t\t\t\tobjToIterable.get( target )!.value++;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t},\n\n\townKeys( target: object ): ( string | symbol )[] {\n\t\tif ( ! objToIterable.has( target ) ) {\n\t\t\tobjToIterable.set( target, signal( 0 ) );\n\t\t}\n\t\t/*\n\t\t *This subscribes to the signal while preventing the minifier from\n\t\t * deleting this line in production.\n\t\t */\n\t\t( objToIterable as any )._ = objToIterable.get( target )!.value;\n\t\treturn Reflect.ownKeys( target );\n\t},\n};\n\n/**\n * Returns the proxy associated with the given state object, creating it if it\n * does not exist.\n *\n * @param namespace        The namespace that will be associated to this proxy.\n * @param obj              The object to proxify.\n * @param options          Options.\n * @param options.readOnly Read-only.\n *\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n *         check if a proxy can be created for a specific object.\n *\n * @return The associated proxy.\n */\nexport const proxifyState = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\toptions?: { readOnly?: boolean }\n): T => {\n\tconst proxy = createProxy( namespace, obj, stateHandlers ) as T;\n\tif ( options?.readOnly ) {\n\t\treadOnlyProxies.add( proxy );\n\t}\n\treturn proxy;\n};\n\n/**\n * Reads the value of the specified property without subscribing to it.\n *\n * @param obj The object to read the property from.\n * @param key The property key.\n * @return The property value.\n */\nexport const peek = < T extends object, K extends keyof T >(\n\tobj: T,\n\tkey: K\n): T[ K ] => {\n\tpeeking = true;\n\ttry {\n\t\treturn obj[ key ];\n\t} finally {\n\t\tpeeking = false;\n\t}\n};\n\n/**\n * Internal recursive implementation for {@link deepMerge | `deepMerge`}.\n *\n * @param target   The target object.\n * @param source   The source object containing new values and props.\n * @param override Whether existing props should be overwritten or not (`true`\n *                 by default).\n */\nconst deepMergeRecursive = (\n\ttarget: any,\n\tsource: any,\n\toverride: boolean = true\n) => {\n\t// If target is not a plain object and the source is, we don't need to merge\n\t// them because the source will be used as the new value of the target.\n\tif ( ! ( isPlainObject( target ) && isPlainObject( source ) ) ) {\n\t\treturn;\n\t}\n\n\tlet hasNewKeys = false;\n\n\tfor ( const key in source ) {\n\t\tconst isNew = ! ( key in target );\n\t\thasNewKeys = hasNewKeys || isNew;\n\n\t\tconst desc = Object.getOwnPropertyDescriptor( source, key )!;\n\t\tconst proxy = getProxyFromObject( target );\n\t\tconst propSignal =\n\t\t\t!! proxy &&\n\t\t\thasPropSignal( proxy, key ) &&\n\t\t\tgetPropSignal( proxy, key );\n\n\t\t// Handle getters and setters\n\t\tif (\n\t\t\ttypeof desc.get === 'function' ||\n\t\t\ttypeof desc.set === 'function'\n\t\t) {\n\t\t\tif ( override || isNew ) {\n\t\t\t\t// Because we are setting a getter or setter, we need to use\n\t\t\t\t// Object.defineProperty to define the property on the target object.\n\t\t\t\tObject.defineProperty( target, key, {\n\t\t\t\t\t...desc,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t} );\n\t\t\t\t// Update the getter in the property signal if it exists\n\t\t\t\tif ( desc.get && propSignal ) {\n\t\t\t\t\tpropSignal.setGetter( desc.get );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle nested objects\n\t\t} else if ( isPlainObject( source[ key ] ) ) {\n\t\t\tconst targetValue = Object.getOwnPropertyDescriptor( target, key )\n\t\t\t\t?.value;\n\t\t\tif ( isNew || ( override && ! isPlainObject( targetValue ) ) ) {\n\t\t\t\t// Create a new object if the property is new or needs to be overridden\n\t\t\t\ttarget[ key ] = {};\n\t\t\t\tif ( propSignal ) {\n\t\t\t\t\t// Create a new proxified state for the nested object\n\t\t\t\t\tconst ns = getNamespaceFromProxy( proxy );\n\t\t\t\t\tpropSignal.setValue(\n\t\t\t\t\t\tproxifyState( ns, target[ key ] as Object )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tdeepMergeRecursive( target[ key ], source[ key ], override );\n\t\t\t}\n\t\t\t// Both target and source are plain objects, merge them recursively\n\t\t\telse if ( isPlainObject( targetValue ) ) {\n\t\t\t\tdeepMergeRecursive( target[ key ], source[ key ], override );\n\t\t\t}\n\n\t\t\t// Handle primitive values and non-plain objects\n\t\t} else if ( override || isNew ) {\n\t\t\tObject.defineProperty( target, key, desc );\n\t\t\tif ( propSignal ) {\n\t\t\t\tconst { value } = desc;\n\t\t\t\tconst ns = getNamespaceFromProxy( proxy );\n\t\t\t\t// Proxify the value if necessary before setting it in the signal\n\t\t\t\tpropSignal.setValue(\n\t\t\t\t\tshouldProxy( value ) ? proxifyState( ns, value ) : value\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( hasNewKeys && objToIterable.has( target ) ) {\n\t\tobjToIterable.get( target )!.value++;\n\t}\n};\n\n/**\n * Recursively update prop values inside the passed `target` and nested plain\n * objects, using the values present in `source`. References to plain objects\n * are kept, only updating props containing primitives or arrays. Arrays are\n * replaced instead of merged or concatenated.\n *\n * If the `override` parameter is set to `false`, then all values in `target`\n * are preserved, and only new properties from `source` are added.\n *\n * @param target   The target object.\n * @param source   The source object containing new values and props.\n * @param override Whether existing props should be overwritten or not (`true`\n *                 by default).\n */\nexport const deepMerge = (\n\ttarget: any,\n\tsource: any,\n\toverride: boolean = true\n) =>\n\tbatch( () =>\n\t\tdeepMergeRecursive(\n\t\t\tgetObjectFromProxy( target ) || target,\n\t\t\tsource,\n\t\t\toverride\n\t\t)\n\t);\n","/**\n * Internal dependencies\n */\nimport { createProxy, getNamespaceFromProxy, shouldProxy } from './registry';\n/**\n * External dependencies\n */\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { withScope, isPlainObject } from '../utils';\n\n/**\n * Identifies the store proxies handling the root objects of each store.\n */\nconst storeRoots = new WeakSet();\n\n/**\n * Handlers for store proxies.\n */\nconst storeHandlers: ProxyHandler< object > = {\n\tget: ( target: any, key: string | symbol, receiver: any ) => {\n\t\tconst result = Reflect.get( target, key );\n\t\tconst ns = getNamespaceFromProxy( receiver );\n\n\t\t/*\n\t\t * Check if the proxy is the store root and no key with that name exist. In\n\t\t * that case, return an empty object for the requested key.\n\t\t */\n\t\tif ( typeof result === 'undefined' && storeRoots.has( receiver ) ) {\n\t\t\tconst obj = {};\n\t\t\tReflect.set( target, key, obj );\n\t\t\treturn proxifyStore( ns, obj, false );\n\t\t}\n\n\t\t/*\n\t\t * Check if the property is a function. If it is, add the store\n\t\t * namespace to the stack and wrap the function with the current scope.\n\t\t * The `withScope` util handles both synchronous functions and generator\n\t\t * functions.\n\t\t */\n\t\tif ( typeof result === 'function' ) {\n\t\t\tsetNamespace( ns );\n\t\t\tconst scoped = withScope( result );\n\t\t\tresetNamespace();\n\t\t\treturn scoped;\n\t\t}\n\n\t\t// Check if the property is an object. If it is, proxyify it.\n\t\tif ( isPlainObject( result ) && shouldProxy( result ) ) {\n\t\t\treturn proxifyStore( ns, result, false );\n\t\t}\n\n\t\treturn result;\n\t},\n};\n\n/**\n * Returns the proxy associated with the given store object, creating it if it\n * does not exist.\n *\n * @param namespace The namespace that will be associated to this proxy.\n * @param obj       The object to proxify.\n *\n * @param isRoot    Whether the passed object is the store root object.\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n *         check if a proxy can be created for a specific object.\n *\n * @return The associated proxy.\n */\nexport const proxifyStore = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\tisRoot = true\n): T => {\n\tconst proxy = createProxy( namespace, obj, storeHandlers );\n\tif ( proxy && isRoot ) {\n\t\tstoreRoots.add( proxy );\n\t}\n\treturn proxy as T;\n};\n","const contextObjectToProxy = new WeakMap();\nconst contextObjectToFallback = new WeakMap();\nconst contextProxies = new WeakSet();\n\nconst descriptor = Reflect.getOwnPropertyDescriptor;\n\n// TODO: Use the proxy registry to avoid multiple proxies on the same object.\nconst contextHandlers: ProxyHandler< object > = {\n\tget: ( target, key ) => {\n\t\tconst fallback = contextObjectToFallback.get( target );\n\t\t// Always subscribe to prop changes in the current context.\n\t\tconst currentProp = target[ key ];\n\n\t\t/*\n\t\t * Return the value from `target` if it exists, or from `fallback`\n\t\t * otherwise. This way, in the case the property doesn't exist either in\n\t\t * `target` or `fallback`, it also subscribes to changes in the parent\n\t\t * context.\n\t\t */\n\t\treturn key in target ? currentProp : fallback[ key ];\n\t},\n\tset: ( target, key, value ) => {\n\t\tconst fallback = contextObjectToFallback.get( target );\n\n\t\t// If the property exists in the current context, modify it. Otherwise,\n\t\t// add it to the current context.\n\t\tconst obj = key in target || ! ( key in fallback ) ? target : fallback;\n\t\tobj[ key ] = value;\n\n\t\treturn true;\n\t},\n\townKeys: ( target ) => [\n\t\t...new Set( [\n\t\t\t...Object.keys( contextObjectToFallback.get( target ) ),\n\t\t\t...Object.keys( target ),\n\t\t] ),\n\t],\n\tgetOwnPropertyDescriptor: ( target, key ) =>\n\t\tdescriptor( target, key ) ||\n\t\tdescriptor( contextObjectToFallback.get( target ), key ),\n\thas: ( target, key ) =>\n\t\tReflect.has( target, key ) ||\n\t\tReflect.has( contextObjectToFallback.get( target ), key ),\n};\n\n/**\n * Wrap a context object with a proxy to reproduce the context stack. The proxy\n * uses the passed `inherited` context as a fallback to look up for properties\n * that don't exist in the given context. Also, updated properties are modified\n * where they are defined, or added to the main context when they don't exist.\n *\n * @param current   Current context.\n * @param inherited Inherited context, used as fallback.\n *\n * @return The wrapped context object.\n */\nexport const proxifyContext = (\n\tcurrent: object,\n\tinherited: object = {}\n): object => {\n\tif ( contextProxies.has( current ) ) {\n\t\tthrow Error( 'This object cannot be proxified.' );\n\t}\n\t// Update the fallback object reference when it changes.\n\tcontextObjectToFallback.set( current, inherited );\n\tif ( ! contextObjectToProxy.has( current ) ) {\n\t\tconst proxy = new Proxy( current, contextHandlers );\n\t\tcontextObjectToProxy.set( current, proxy );\n\t\tcontextProxies.add( proxy );\n\t}\n\treturn contextObjectToProxy.get( current );\n};\n","/**\n * Internal dependencies\n */\nimport { proxifyState, proxifyStore, deepMerge } from './proxies';\n/**\n * External dependencies\n */\nimport { getNamespace } from './namespaces';\nimport { isPlainObject } from './utils';\n\nexport const stores = new Map();\nconst rawStores = new Map();\nconst storeLocks = new Map();\nconst storeConfigs = new Map();\nconst serverStates = new Map();\n\n/**\n * Get the defined config for the store with the passed namespace.\n *\n * @param namespace Store's namespace from which to retrieve the config.\n * @return Defined config for the given namespace.\n */\nexport const getConfig = ( namespace?: string ) =>\n\tstoreConfigs.get( namespace || getNamespace() ) || {};\n\n/**\n * Get the part of the state defined and updated from the server.\n *\n * The object returned is read-only, and includes the state defined in PHP with\n * `wp_interactivity_state()`. When using `actions.navigate()`, this object is\n * updated to reflect the changes in its properties, without affecting the state\n * returned by `store()`. Directives can subscribe to those changes to update\n * the state if needed.\n *\n * @example\n * ```js\n *  const { state } = store('myStore', {\n *    callbacks: {\n *      updateServerState() {\n *        const serverState = getServerState();\n *        // Override some property with the new value that came from the server.\n *        state.overridableProp = serverState.overridableProp;\n *      },\n *    },\n *  });\n * ```\n *\n * @param namespace Store's namespace from which to retrieve the server state.\n * @return The server state for the given namespace.\n */\nexport const getServerState = ( namespace?: string ) => {\n\tconst ns = namespace || getNamespace();\n\tif ( ! serverStates.has( ns ) ) {\n\t\tserverStates.set( ns, proxifyState( ns, {}, { readOnly: true } ) );\n\t}\n\treturn serverStates.get( ns );\n};\n\ninterface StoreOptions {\n\t/**\n\t * Property to block/unblock private store namespaces.\n\t *\n\t * If the passed value is `true`, it blocks the given namespace, making it\n\t * accessible only trough the returned variables of the `store()` call. In\n\t * the case a lock string is passed, it also blocks the namespace, but can\n\t * be unblocked for other `store()` calls using the same lock string.\n\t *\n\t * @example\n\t * ```\n\t * // The store can only be accessed where the `state` const can.\n\t * const { state } = store( 'myblock/private', { ... }, { lock: true } );\n\t * ```\n\t *\n\t * @example\n\t * ```\n\t * // Other modules knowing `SECRET_LOCK_STRING` can access the namespace.\n\t * const { state } = store(\n\t *   'myblock/private',\n\t *   { ... },\n\t *   { lock: 'SECRET_LOCK_STRING' }\n\t * );\n\t * ```\n\t */\n\tlock?: boolean | string;\n}\n\ntype Prettify< T > = { [ K in keyof T ]: T[ K ] } & {};\ntype DeepPartial< T > = T extends object\n\t? { [ P in keyof T ]?: DeepPartial< T[ P ] > }\n\t: T;\ntype DeepPartialState< T extends { state: object } > = Omit< T, 'state' > & {\n\tstate?: DeepPartial< T[ 'state' ] >;\n};\ntype ConvertGeneratorToPromise< T > = T extends (\n\t...args: infer A\n) => Generator< any, infer R, any >\n\t? ( ...args: A ) => Promise< R >\n\t: never;\ntype ConvertGeneratorsToPromises< T > = {\n\t[ K in keyof T ]: T[ K ] extends ( ...args: any[] ) => any\n\t\t? ConvertGeneratorToPromise< T[ K ] > extends never\n\t\t\t? T[ K ]\n\t\t\t: ConvertGeneratorToPromise< T[ K ] >\n\t\t: T[ K ] extends object\n\t\t? Prettify< ConvertGeneratorsToPromises< T[ K ] > >\n\t\t: T[ K ];\n};\ntype ConvertPromiseToGenerator< T > = T extends (\n\t...args: infer A\n) => Promise< infer R >\n\t? ( ...args: A ) => Generator< any, R, any >\n\t: never;\ntype ConvertPromisesToGenerators< T > = {\n\t[ K in keyof T ]: T[ K ] extends ( ...args: any[] ) => any\n\t\t? ConvertPromiseToGenerator< T[ K ] > extends never\n\t\t\t? T[ K ]\n\t\t\t: ConvertPromiseToGenerator< T[ K ] >\n\t\t: T[ K ] extends object\n\t\t? Prettify< ConvertPromisesToGenerators< T[ K ] > >\n\t\t: T[ K ];\n};\n\nexport const universalUnlock =\n\t'I acknowledge that using a private store means my plugin will inevitably break on the next store release.';\n\n/**\n * Extends the Interactivity API global store adding the passed properties to\n * the given namespace. It also returns stable references to the namespace\n * content.\n *\n * These props typically consist of `state`, which is the reactive part of the\n * store ― which means that any directive referencing a state property will be\n * re-rendered anytime it changes ― and function properties like `actions` and\n * `callbacks`, mostly used for event handlers. These props can then be\n * referenced by any directive to make the HTML interactive.\n *\n * @example\n * ```js\n *  const { state } = store( 'counter', {\n *    state: {\n *      value: 0,\n *      get double() { return state.value * 2; },\n *    },\n *    actions: {\n *      increment() {\n *        state.value += 1;\n *      },\n *    },\n *  } );\n * ```\n *\n * The code from the example above allows blocks to subscribe and interact with\n * the store by using directives in the HTML, e.g.:\n *\n * ```html\n * <div data-wp-interactive=\"counter\">\n *   <button\n *     data-wp-text=\"state.double\"\n *     data-wp-on--click=\"actions.increment\"\n *   >\n *     0\n *   </button>\n * </div>\n * ```\n * @param namespace The store namespace to interact with.\n * @param storePart Properties to add to the store namespace.\n * @param options   Options for the given namespace.\n *\n * @return A reference to the namespace content.\n */\n\n// Overload for when the types are inferred.\nexport function store< T extends object >(\n\tnamespace: string,\n\tstorePart: T,\n\toptions?: StoreOptions\n): Prettify< ConvertGeneratorsToPromises< T > >;\n\n// Overload for when types are passed via generics and they contain state.\nexport function store< T extends { state: object } >(\n\tnamespace: string,\n\tstorePart: ConvertPromisesToGenerators< DeepPartialState< T > >,\n\toptions?: StoreOptions\n): Prettify< ConvertGeneratorsToPromises< T > >;\n\n// Overload for when types are passed via generics and they don't contain state.\nexport function store< T extends object >(\n\tnamespace: string,\n\tstorePart: ConvertPromisesToGenerators< T >,\n\toptions?: StoreOptions\n): Prettify< ConvertGeneratorsToPromises< T > >;\n\n// Overload for when types are divided into multiple parts.\nexport function store< T extends object >(\n\tnamespace: string,\n\tstorePart: ConvertPromisesToGenerators< DeepPartial< T > >,\n\toptions?: StoreOptions\n): Prettify< ConvertGeneratorsToPromises< T > >;\n\nexport function store(\n\tnamespace: string,\n\t{ state = {}, ...block }: any = {},\n\t{ lock = false }: StoreOptions = {}\n) {\n\tif ( ! stores.has( namespace ) ) {\n\t\t// Lock the store if the passed lock is different from the universal\n\t\t// unlock. Once the lock is set (either false, true, or a given string),\n\t\t// it cannot change.\n\t\tif ( lock !== universalUnlock ) {\n\t\t\tstoreLocks.set( namespace, lock );\n\t\t}\n\t\tconst rawStore = {\n\t\t\tstate: proxifyState(\n\t\t\t\tnamespace,\n\t\t\t\tisPlainObject( state ) ? state : {}\n\t\t\t),\n\t\t\t...block,\n\t\t};\n\t\tconst proxifiedStore = proxifyStore( namespace, rawStore );\n\t\trawStores.set( namespace, rawStore );\n\t\tstores.set( namespace, proxifiedStore );\n\t} else {\n\t\t// Lock the store if it wasn't locked yet and the passed lock is\n\t\t// different from the universal unlock. If no lock is given, the store\n\t\t// will be public and won't accept any lock from now on.\n\t\tif ( lock !== universalUnlock && ! storeLocks.has( namespace ) ) {\n\t\t\tstoreLocks.set( namespace, lock );\n\t\t} else {\n\t\t\tconst storeLock = storeLocks.get( namespace );\n\t\t\tconst isLockValid =\n\t\t\t\tlock === universalUnlock ||\n\t\t\t\t( lock !== true && lock === storeLock );\n\n\t\t\tif ( ! isLockValid ) {\n\t\t\t\tif ( ! storeLock ) {\n\t\t\t\t\tthrow Error( 'Cannot lock a public store' );\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t'Cannot unlock a private store with an invalid lock code'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst target = rawStores.get( namespace );\n\t\tdeepMerge( target, block );\n\t\tdeepMerge( target.state, state );\n\t}\n\n\treturn stores.get( namespace );\n}\n\nexport const parseServerData = ( dom = document ) => {\n\tconst jsonDataScriptTag =\n\t\t// Preferred Script Module data passing form\n\t\tdom.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/interactivity'\n\t\t) ??\n\t\t// Legacy form\n\t\tdom.getElementById( 'wp-interactivity-data' );\n\tif ( jsonDataScriptTag?.textContent ) {\n\t\ttry {\n\t\t\treturn JSON.parse( jsonDataScriptTag.textContent );\n\t\t} catch {}\n\t}\n\treturn {};\n};\n\nexport const populateServerData = ( data?: {\n\tstate?: Record< string, unknown >;\n\tconfig?: Record< string, unknown >;\n} ) => {\n\tif ( isPlainObject( data?.state ) ) {\n\t\tObject.entries( data!.state ).forEach( ( [ namespace, state ] ) => {\n\t\t\tconst st = store< any >( namespace, {}, { lock: universalUnlock } );\n\t\t\tdeepMerge( st.state, state, false );\n\t\t\tdeepMerge( getServerState( namespace ), state );\n\t\t} );\n\t}\n\tif ( isPlainObject( data?.config ) ) {\n\t\tObject.entries( data!.config ).forEach( ( [ namespace, config ] ) => {\n\t\t\tstoreConfigs.set( namespace, config );\n\t\t} );\n\t}\n};\n\n// Parse and populate the initial state and config.\nconst data = parseServerData();\npopulateServerData( data );\n","// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable react-hooks/exhaustive-deps */\n\n/**\n * External dependencies\n */\nimport {\n\th as createElement,\n\toptions,\n\tcreateContext,\n\tcloneElement,\n\ttype ComponentChildren,\n} from 'preact';\nimport { useRef, useCallback, useContext } from 'preact/hooks';\nimport type { VNode, Context } from 'preact';\n\n/**\n * Internal dependencies\n */\nimport { store, stores, universalUnlock } from './store';\nimport { warn } from './utils';\nimport { getScope, setScope, resetScope, type Scope } from './scopes';\nexport interface DirectiveEntry {\n\tvalue: string | object;\n\tnamespace: string;\n\tsuffix: string | null;\n}\n\nexport interface NonDefaultSuffixDirectiveEntry extends DirectiveEntry {\n\tsuffix: string;\n}\n\nexport interface DefaultSuffixDirectiveEntry extends DirectiveEntry {\n\tsuffix: null;\n}\n\nexport function isNonDefaultDirectiveSuffix(\n\tentry: DirectiveEntry\n): entry is NonDefaultSuffixDirectiveEntry {\n\treturn entry.suffix !== null;\n}\n\nexport function isDefaultDirectiveSuffix(\n\tentry: DirectiveEntry\n): entry is DefaultSuffixDirectiveEntry {\n\treturn entry.suffix === null;\n}\n\ntype DirectiveEntries = Record< string, DirectiveEntry[] >;\n\ninterface DirectiveArgs {\n\t/**\n\t * Object map with the defined directives of the element being evaluated.\n\t */\n\tdirectives: DirectiveEntries;\n\t/**\n\t * Props present in the current element.\n\t */\n\tprops: { children?: ComponentChildren };\n\t/**\n\t * Virtual node representing the element.\n\t */\n\telement: VNode< {\n\t\tclass?: string;\n\t\tstyle?: string | Record< string, string | number >;\n\t\tcontent?: ComponentChildren;\n\t} >;\n\t/**\n\t * The inherited context.\n\t */\n\tcontext: Context< any >;\n\t/**\n\t * Function that resolves a given path to a value either in the store or the\n\t * context.\n\t */\n\tevaluate: Evaluate;\n}\n\nexport interface DirectiveCallback {\n\t( args: DirectiveArgs ): VNode< any > | VNode< any >[] | null | void;\n}\n\ninterface DirectiveOptions {\n\t/**\n\t * Value that specifies the priority to evaluate directives of this type.\n\t * Lower numbers correspond with earlier execution.\n\t *\n\t * @default 10\n\t */\n\tpriority?: number;\n}\n\nexport interface Evaluate {\n\t( entry: DirectiveEntry, ...args: any[] ): any;\n}\n\ninterface GetEvaluate {\n\t( args: { scope: Scope } ): Evaluate;\n}\n\ntype PriorityLevel = string[];\n\ninterface GetPriorityLevels {\n\t( directives: DirectiveEntries ): PriorityLevel[];\n}\n\ninterface DirectivesProps {\n\tdirectives: DirectiveEntries;\n\tpriorityLevels: PriorityLevel[];\n\telement: VNode;\n\toriginalProps: any;\n\tpreviousScope?: Scope;\n}\n\n// Main context.\nconst context = createContext< any >( { client: {}, server: {} } );\n\n// WordPress Directives.\nconst directiveCallbacks: Record< string, DirectiveCallback > = {};\nconst directivePriorities: Record< string, number > = {};\n\n/**\n * Register a new directive type in the Interactivity API runtime.\n *\n * @example\n * ```js\n * directive(\n *   'alert', // Name without the `data-wp-` prefix.\n *   ( { directives: { alert }, element, evaluate } ) => {\n *     const defaultEntry = alert.find( isDefaultDirectiveSuffix );\n *     element.props.onclick = () => { alert( evaluate( defaultEntry ) ); }\n *   }\n * )\n * ```\n *\n * The previous code registers a custom directive type for displaying an alert\n * message whenever an element using it is clicked. The message text is obtained\n * from the store under the inherited namespace, using `evaluate`.\n *\n * When the HTML is processed by the Interactivity API, any element containing\n * the `data-wp-alert` directive will have the `onclick` event handler, e.g.,\n *\n * ```html\n * <div data-wp-interactive=\"messages\">\n *   <button data-wp-alert=\"state.alert\">Click me!</button>\n * </div>\n * ```\n * Note that, in the previous example, the directive callback gets the path\n * value (`state.alert`) from the directive entry with suffix `null`. A\n * custom suffix can also be specified by appending `--` to the directive\n * attribute, followed by the suffix, like in the following HTML snippet:\n *\n * ```html\n * <div data-wp-interactive=\"myblock\">\n *   <button\n *     data-wp-color--text=\"state.text\"\n *     data-wp-color--background=\"state.background\"\n *   >Click me!</button>\n * </div>\n * ```\n *\n * This could be an hypothetical implementation of the custom directive used in\n * the snippet above.\n *\n * @example\n * ```js\n * directive(\n *   'color', // Name without prefix and suffix.\n *   ( { directives: { color: colors }, ref, evaluate } ) =>\n *     colors.forEach( ( color ) => {\n *       if ( color.suffix = 'text' ) {\n *         ref.style.setProperty(\n *           'color',\n *           evaluate( color.text )\n *         );\n *       }\n *       if ( color.suffix = 'background' ) {\n *         ref.style.setProperty(\n *           'background-color',\n *           evaluate( color.background )\n *         );\n *       }\n *     } );\n *   }\n * )\n * ```\n *\n * @param name             Directive name, without the `data-wp-` prefix.\n * @param callback         Function that runs the directive logic.\n * @param options          Options object.\n * @param options.priority Option to control the directive execution order. The\n *                         lesser, the highest priority. Default is `10`.\n */\nexport const directive = (\n\tname: string,\n\tcallback: DirectiveCallback,\n\t{ priority = 10 }: DirectiveOptions = {}\n) => {\n\tdirectiveCallbacks[ name ] = callback;\n\tdirectivePriorities[ name ] = priority;\n};\n\n// Resolve the path to some property of the store object.\nconst resolve = ( path: string, namespace: string ) => {\n\tif ( ! namespace ) {\n\t\twarn(\n\t\t\t`Namespace missing for \"${ path }\". The value for that path won't be resolved.`\n\t\t);\n\t\treturn;\n\t}\n\tlet resolvedStore = stores.get( namespace );\n\tif ( typeof resolvedStore === 'undefined' ) {\n\t\tresolvedStore = store(\n\t\t\tnamespace,\n\t\t\t{},\n\t\t\t{\n\t\t\t\tlock: universalUnlock,\n\t\t\t}\n\t\t);\n\t}\n\tconst current = {\n\t\t...resolvedStore,\n\t\tcontext: getScope().context[ namespace ],\n\t};\n\ttry {\n\t\t// TODO: Support lazy/dynamically initialized stores\n\t\treturn path.split( '.' ).reduce( ( acc, key ) => acc[ key ], current );\n\t} catch ( e ) {}\n};\n\n// Generate the evaluate function.\nexport const getEvaluate: GetEvaluate =\n\t( { scope } ) =>\n\t// TODO: When removing the temporarily remaining `value( ...args )` call below, remove the `...args` parameter too.\n\t( entry, ...args ) => {\n\t\tlet { value: path, namespace } = entry;\n\t\tif ( typeof path !== 'string' ) {\n\t\t\tthrow new Error( 'The `value` prop should be a string path' );\n\t\t}\n\t\t// If path starts with !, remove it and save a flag.\n\t\tconst hasNegationOperator =\n\t\t\tpath[ 0 ] === '!' && !! ( path = path.slice( 1 ) );\n\t\tsetScope( scope );\n\t\tconst value = resolve( path, namespace );\n\t\t// Functions are returned without invoking them.\n\t\tif ( typeof value === 'function' ) {\n\t\t\t// Except if they have a negation operator present, for backward compatibility.\n\t\t\t// This pattern is strongly discouraged and deprecated, and it will be removed in a near future release.\n\t\t\t// TODO: Remove this condition to effectively ignore negation operator when provided with a function.\n\t\t\tif ( hasNegationOperator ) {\n\t\t\t\twarn(\n\t\t\t\t\t'Using a function with a negation operator is deprecated and will stop working in WordPress 6.9. Please use derived state instead.'\n\t\t\t\t);\n\t\t\t\tconst functionResult = ! value( ...args );\n\t\t\t\tresetScope();\n\t\t\t\treturn functionResult;\n\t\t\t}\n\t\t\t// Reset scope before return and wrap the function so it will still run within the correct scope.\n\t\t\tresetScope();\n\t\t\treturn ( ...functionArgs: any[] ) => {\n\t\t\t\tsetScope( scope );\n\t\t\t\tconst functionResult = value( ...functionArgs );\n\t\t\t\tresetScope();\n\t\t\t\treturn functionResult;\n\t\t\t};\n\t\t}\n\t\tconst result = value;\n\t\tresetScope();\n\t\treturn hasNegationOperator ? ! result : result;\n\t};\n\n// Separate directives by priority. The resulting array contains objects\n// of directives grouped by same priority, and sorted in ascending order.\nconst getPriorityLevels: GetPriorityLevels = ( directives ) => {\n\tconst byPriority = Object.keys( directives ).reduce<\n\t\tRecord< number, string[] >\n\t>( ( obj, name ) => {\n\t\tif ( directiveCallbacks[ name ] ) {\n\t\t\tconst priority = directivePriorities[ name ];\n\t\t\t( obj[ priority ] = obj[ priority ] || [] ).push( name );\n\t\t}\n\t\treturn obj;\n\t}, {} );\n\n\treturn Object.entries( byPriority )\n\t\t.sort( ( [ p1 ], [ p2 ] ) => parseInt( p1 ) - parseInt( p2 ) )\n\t\t.map( ( [ , arr ] ) => arr );\n};\n\n// Component that wraps each priority level of directives of an element.\nconst Directives = ( {\n\tdirectives,\n\tpriorityLevels: [ currentPriorityLevel, ...nextPriorityLevels ],\n\telement,\n\toriginalProps,\n\tpreviousScope,\n}: DirectivesProps ) => {\n\t// Initialize the scope of this element. These scopes are different per each\n\t// level because each level has a different context, but they share the same\n\t// element ref, state and props.\n\tconst scope = useRef< Scope >( {} as Scope ).current;\n\tscope.evaluate = useCallback( getEvaluate( { scope } ), [] );\n\tconst { client, server } = useContext( context );\n\tscope.context = client;\n\tscope.serverContext = server;\n\t/* eslint-disable react-hooks/rules-of-hooks */\n\tscope.ref = previousScope?.ref || useRef( null );\n\t/* eslint-enable react-hooks/rules-of-hooks */\n\n\t// Create a fresh copy of the vnode element and add the props to the scope,\n\t// named as attributes (HTML Attributes).\n\telement = cloneElement( element, { ref: scope.ref } );\n\tscope.attributes = element.props;\n\n\t// Recursively render the wrapper for the next priority level.\n\tconst children =\n\t\tnextPriorityLevels.length > 0\n\t\t\t? createElement( Directives, {\n\t\t\t\t\tdirectives,\n\t\t\t\t\tpriorityLevels: nextPriorityLevels,\n\t\t\t\t\telement,\n\t\t\t\t\toriginalProps,\n\t\t\t\t\tpreviousScope: scope,\n\t\t\t  } )\n\t\t\t: element;\n\n\tconst props = { ...originalProps, children };\n\tconst directiveArgs = {\n\t\tdirectives,\n\t\tprops,\n\t\telement,\n\t\tcontext,\n\t\tevaluate: scope.evaluate,\n\t};\n\n\tsetScope( scope );\n\n\tfor ( const directiveName of currentPriorityLevel ) {\n\t\tconst wrapper = directiveCallbacks[ directiveName ]?.( directiveArgs );\n\t\tif ( wrapper !== undefined ) {\n\t\t\tprops.children = wrapper;\n\t\t}\n\t}\n\n\tresetScope();\n\n\treturn props.children;\n};\n\n// Preact Options Hook called each time a vnode is created.\nconst old = options.vnode;\noptions.vnode = ( vnode: VNode< any > ) => {\n\tif ( vnode.props.__directives ) {\n\t\tconst props = vnode.props;\n\t\tconst directives = props.__directives;\n\t\tif ( directives.key ) {\n\t\t\tvnode.key = directives.key.find( isDefaultDirectiveSuffix ).value;\n\t\t}\n\t\tdelete props.__directives;\n\t\tconst priorityLevels = getPriorityLevels( directives );\n\t\tif ( priorityLevels.length > 0 ) {\n\t\t\tvnode.props = {\n\t\t\t\tdirectives,\n\t\t\t\tpriorityLevels,\n\t\t\t\toriginalProps: props,\n\t\t\t\ttype: vnode.type,\n\t\t\t\telement: createElement( vnode.type as any, props ),\n\t\t\t\ttop: true,\n\t\t\t};\n\t\t\tvnode.type = Directives;\n\t\t}\n\t}\n\n\tif ( old ) {\n\t\told( vnode );\n\t}\n};\n","// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable react-hooks/exhaustive-deps */\n\n/**\n * External dependencies\n */\nimport { h as createElement, type VNode, type RefObject } from 'preact';\nimport { useContext, useMemo, useRef } from 'preact/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseWatch,\n\tuseInit,\n\tkebabToCamelCase,\n\twarn,\n\tsplitTask,\n\tisPlainObject,\n} from './utils';\nimport {\n\tdirective,\n\tgetEvaluate,\n\tisDefaultDirectiveSuffix,\n\tisNonDefaultDirectiveSuffix,\n\ttype DirectiveCallback,\n\ttype DirectiveEntry,\n} from './hooks';\nimport { getScope } from './scopes';\nimport { proxifyState, proxifyContext, deepMerge } from './proxies';\n\n/**\n * Recursively clone the passed object.\n *\n * @param source Source object.\n * @return Cloned object.\n */\nfunction deepClone< T >( source: T ): T {\n\tif ( isPlainObject( source ) ) {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries( source as object ).map( ( [ key, value ] ) => [\n\t\t\t\tkey,\n\t\t\t\tdeepClone( value ),\n\t\t\t] )\n\t\t) as T;\n\t}\n\tif ( Array.isArray( source ) ) {\n\t\treturn source.map( ( i ) => deepClone( i ) ) as T;\n\t}\n\treturn source;\n}\n\n/**\n * Wraps event object to warn about access of synchronous properties and methods.\n *\n * For all store actions attached to an event listener the event object is proxied via this function, unless the action\n * uses the `withSyncEvent()` utility to indicate that it requires synchronous access to the event object.\n *\n * At the moment, the proxied event only emits warnings when synchronous properties or methods are being accessed. In\n * the future this will be changed and result in an error. The current temporary behavior allows implementers to update\n * their relevant actions to use `withSyncEvent()`.\n *\n * For additional context, see https://github.com/WordPress/gutenberg/issues/64944.\n *\n * @param event Event object.\n * @return Proxied event object.\n */\nfunction wrapEventAsync( event: Event ) {\n\tconst handler = {\n\t\tget( target: Event, prop: string | symbol, receiver: any ) {\n\t\t\tconst value = target[ prop ];\n\t\t\tswitch ( prop ) {\n\t\t\t\tcase 'currentTarget':\n\t\t\t\t\twarn(\n\t\t\t\t\t\t`Accessing the synchronous event.${ prop } property in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 6.9. Please wrap the store action in withSyncEvent().`\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'preventDefault':\n\t\t\t\tcase 'stopImmediatePropagation':\n\t\t\t\tcase 'stopPropagation':\n\t\t\t\t\twarn(\n\t\t\t\t\t\t`Using the synchronous event.${ prop }() function in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 6.9. Please wrap the store action in withSyncEvent().`\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( value instanceof Function ) {\n\t\t\t\treturn function ( this: any, ...args: any[] ) {\n\t\t\t\t\treturn value.apply(\n\t\t\t\t\t\tthis === receiver ? target : this,\n\t\t\t\t\t\targs\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn value;\n\t\t},\n\t};\n\n\treturn new Proxy( event, handler );\n}\n\nconst newRule =\n\t/(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nconst ruleClean = /\\/\\*[^]*?\\*\\/|  +/g;\nconst ruleNewline = /\\n+/g;\nconst empty = ' ';\n\n/**\n * Convert a css style string into a object.\n *\n * Made by Cristian Bote (@cristianbote) for Goober.\n * https://unpkg.com/browse/goober@2.1.13/src/core/astish.js\n *\n * @param val CSS string.\n * @return CSS object.\n */\nconst cssStringToObject = (\n\tval: string\n): Record< string, string | number > => {\n\tconst tree = [ {} ];\n\tlet block, left;\n\n\twhile ( ( block = newRule.exec( val.replace( ruleClean, '' ) ) ) ) {\n\t\tif ( block[ 4 ] ) {\n\t\t\ttree.shift();\n\t\t} else if ( block[ 3 ] ) {\n\t\t\tleft = block[ 3 ].replace( ruleNewline, empty ).trim();\n\t\t\ttree.unshift( ( tree[ 0 ][ left ] = tree[ 0 ][ left ] || {} ) );\n\t\t} else {\n\t\t\ttree[ 0 ][ block[ 1 ] ] = block[ 2 ]\n\t\t\t\t.replace( ruleNewline, empty )\n\t\t\t\t.trim();\n\t\t}\n\t}\n\n\treturn tree[ 0 ];\n};\n\n/**\n * Creates a directive that adds an event listener to the global window or\n * document object.\n *\n * @param type 'window' or 'document'\n */\nconst getGlobalEventDirective = (\n\ttype: 'window' | 'document'\n): DirectiveCallback => {\n\treturn ( { directives, evaluate } ) => {\n\t\tdirectives[ `on-${ type }` ]\n\t\t\t.filter( isNonDefaultDirectiveSuffix )\n\t\t\t.forEach( ( entry ) => {\n\t\t\t\tconst eventName = entry.suffix.split( '--', 1 )[ 0 ];\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst cb = ( event: Event ) => {\n\t\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\t\tif ( ! result?.sync ) {\n\t\t\t\t\t\t\t\tevent = wrapEventAsync( event );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresult( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tconst globalVar = type === 'window' ? window : document;\n\t\t\t\t\tglobalVar.addEventListener( eventName, cb );\n\t\t\t\t\treturn () => globalVar.removeEventListener( eventName, cb );\n\t\t\t\t} );\n\t\t\t} );\n\t};\n};\n\n/**\n * Creates a directive that adds an async event listener to the global window or\n * document object.\n *\n * @param type 'window' or 'document'\n */\nconst getGlobalAsyncEventDirective = (\n\ttype: 'window' | 'document'\n): DirectiveCallback => {\n\treturn ( { directives, evaluate } ) => {\n\t\tdirectives[ `on-async-${ type }` ]\n\t\t\t.filter( isNonDefaultDirectiveSuffix )\n\t\t\t.forEach( ( entry ) => {\n\t\t\t\tconst eventName = entry.suffix.split( '--', 1 )[ 0 ];\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst cb = async ( event: Event ) => {\n\t\t\t\t\t\tawait splitTask();\n\t\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\t\tresult( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tconst globalVar = type === 'window' ? window : document;\n\t\t\t\t\tglobalVar.addEventListener( eventName, cb, {\n\t\t\t\t\t\tpassive: true,\n\t\t\t\t\t} );\n\t\t\t\t\treturn () => globalVar.removeEventListener( eventName, cb );\n\t\t\t\t} );\n\t\t\t} );\n\t};\n};\n\nexport default () => {\n\t// data-wp-context\n\tdirective(\n\t\t'context',\n\t\t( {\n\t\t\tdirectives: { context },\n\t\t\tprops: { children },\n\t\t\tcontext: inheritedContext,\n\t\t} ) => {\n\t\t\tconst { Provider } = inheritedContext;\n\t\t\tconst defaultEntry = context.find( isDefaultDirectiveSuffix );\n\t\t\tconst { client: inheritedClient, server: inheritedServer } =\n\t\t\t\tuseContext( inheritedContext );\n\n\t\t\tconst ns = defaultEntry!.namespace;\n\t\t\tconst client = useRef( proxifyState( ns, {} ) );\n\t\t\tconst server = useRef( proxifyState( ns, {}, { readOnly: true } ) );\n\n\t\t\t// No change should be made if `defaultEntry` does not exist.\n\t\t\tconst contextStack = useMemo( () => {\n\t\t\t\tconst result = {\n\t\t\t\t\tclient: { ...inheritedClient },\n\t\t\t\t\tserver: { ...inheritedServer },\n\t\t\t\t};\n\t\t\t\tif ( defaultEntry ) {\n\t\t\t\t\tconst { namespace, value } = defaultEntry;\n\t\t\t\t\t// Check that the value is a JSON object. Send a console warning if not.\n\t\t\t\t\tif ( ! isPlainObject( value ) ) {\n\t\t\t\t\t\twarn(\n\t\t\t\t\t\t\t`The value of data-wp-context in \"${ namespace }\" store must be a valid stringified JSON object.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tdeepMerge(\n\t\t\t\t\t\tclient.current,\n\t\t\t\t\t\tdeepClone( value ) as object,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t\tdeepMerge( server.current, deepClone( value ) as object );\n\t\t\t\t\tresult.client[ namespace ] = proxifyContext(\n\t\t\t\t\t\tclient.current,\n\t\t\t\t\t\tinheritedClient[ namespace ]\n\t\t\t\t\t);\n\t\t\t\t\tresult.server[ namespace ] = proxifyContext(\n\t\t\t\t\t\tserver.current,\n\t\t\t\t\t\tinheritedServer[ namespace ]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}, [ defaultEntry, inheritedClient, inheritedServer ] );\n\n\t\t\treturn createElement( Provider, { value: contextStack }, children );\n\t\t},\n\t\t{ priority: 5 }\n\t);\n\n\t// data-wp-watch--[name]\n\tdirective( 'watch', ( { directives: { watch }, evaluate } ) => {\n\t\twatch.forEach( ( entry ) => {\n\t\t\tuseWatch( () => {\n\t\t\t\tlet start;\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet result = evaluate( entry );\n\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\tresult = result();\n\t\t\t\t}\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t`interactivity api watch ${ entry.namespace }`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\ttrack: `IA: watch ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-init--[name]\n\tdirective( 'init', ( { directives: { init }, evaluate } ) => {\n\t\tinit.forEach( ( entry ) => {\n\t\t\t// TODO: Replace with useEffect to prevent unneeded scopes.\n\t\t\tuseInit( () => {\n\t\t\t\tlet start;\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet result = evaluate( entry );\n\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\tresult = result();\n\t\t\t\t}\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t`interactivity api init ${ entry.namespace }`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\ttrack: `IA: init ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-on--[event]\n\tdirective( 'on', ( { directives: { on }, element, evaluate } ) => {\n\t\tconst events = new Map< string, Set< DirectiveEntry > >();\n\t\ton.filter( isNonDefaultDirectiveSuffix ).forEach( ( entry ) => {\n\t\t\tconst event = entry.suffix.split( '--' )[ 0 ];\n\t\t\tif ( ! events.has( event ) ) {\n\t\t\t\tevents.set( event, new Set< DirectiveEntry >() );\n\t\t\t}\n\t\t\tevents.get( event )!.add( entry );\n\t\t} );\n\n\t\tevents.forEach( ( entries, eventType ) => {\n\t\t\tconst existingHandler = element.props[ `on${ eventType }` ];\n\t\t\telement.props[ `on${ eventType }` ] = ( event: Event ) => {\n\t\t\t\tentries.forEach( ( entry ) => {\n\t\t\t\t\tif ( existingHandler ) {\n\t\t\t\t\t\texistingHandler( event );\n\t\t\t\t\t}\n\t\t\t\t\tlet start;\n\t\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\tif ( ! result?.sync ) {\n\t\t\t\t\t\t\tevent = wrapEventAsync( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult( event );\n\t\t\t\t\t}\n\t\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t\t`interactivity api on ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\t\ttrack: `IA: on ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t} );\n\t} );\n\n\t// data-wp-on-async--[event]\n\tdirective(\n\t\t'on-async',\n\t\t( { directives: { 'on-async': onAsync }, element, evaluate } ) => {\n\t\t\tconst events = new Map< string, Set< DirectiveEntry > >();\n\t\t\tonAsync\n\t\t\t\t.filter( isNonDefaultDirectiveSuffix )\n\t\t\t\t.forEach( ( entry ) => {\n\t\t\t\t\tconst event = entry.suffix.split( '--' )[ 0 ];\n\t\t\t\t\tif ( ! events.has( event ) ) {\n\t\t\t\t\t\tevents.set( event, new Set< DirectiveEntry >() );\n\t\t\t\t\t}\n\t\t\t\t\tevents.get( event )!.add( entry );\n\t\t\t\t} );\n\n\t\t\tevents.forEach( ( entries, eventType ) => {\n\t\t\t\tconst existingHandler = element.props[ `on${ eventType }` ];\n\t\t\t\telement.props[ `on${ eventType }` ] = ( event: Event ) => {\n\t\t\t\t\tif ( existingHandler ) {\n\t\t\t\t\t\texistingHandler( event );\n\t\t\t\t\t}\n\t\t\t\t\tentries.forEach( async ( entry ) => {\n\t\t\t\t\t\tawait splitTask();\n\t\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\t\tresult( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t};\n\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-on-window--[event]\n\tdirective( 'on-window', getGlobalEventDirective( 'window' ) );\n\t// data-wp-on-document--[event]\n\tdirective( 'on-document', getGlobalEventDirective( 'document' ) );\n\n\t// data-wp-on-async-window--[event]\n\tdirective( 'on-async-window', getGlobalAsyncEventDirective( 'window' ) );\n\t// data-wp-on-async-document--[event]\n\tdirective(\n\t\t'on-async-document',\n\t\tgetGlobalAsyncEventDirective( 'document' )\n\t);\n\n\t// data-wp-class--[classname]\n\tdirective(\n\t\t'class',\n\t\t( { directives: { class: classNames }, element, evaluate } ) => {\n\t\t\tclassNames\n\t\t\t\t.filter( isNonDefaultDirectiveSuffix )\n\t\t\t\t.forEach( ( entry ) => {\n\t\t\t\t\tconst className = entry.suffix;\n\t\t\t\t\tlet result = evaluate( entry );\n\t\t\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\t\t\tresult = result();\n\t\t\t\t\t}\n\t\t\t\t\tconst currentClass = element.props.class || '';\n\t\t\t\t\tconst classFinder = new RegExp(\n\t\t\t\t\t\t`(^|\\\\s)${ className }(\\\\s|$)`,\n\t\t\t\t\t\t'g'\n\t\t\t\t\t);\n\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\telement.props.class = currentClass\n\t\t\t\t\t\t\t.replace( classFinder, ' ' )\n\t\t\t\t\t\t\t.trim();\n\t\t\t\t\t} else if ( ! classFinder.test( currentClass ) ) {\n\t\t\t\t\t\telement.props.class = currentClass\n\t\t\t\t\t\t\t? `${ currentClass } ${ className }`\n\t\t\t\t\t\t\t: className;\n\t\t\t\t\t}\n\n\t\t\t\t\tuseInit( () => {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * This seems necessary because Preact doesn't change the class\n\t\t\t\t\t\t * names on the hydration, so we have to do it manually. It doesn't\n\t\t\t\t\t\t * need deps because it only needs to do it the first time.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t\t ).current!.classList.remove( className );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t\t ).current!.classList.add( className );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-style--[style-prop]\n\tdirective( 'style', ( { directives: { style }, element, evaluate } ) => {\n\t\tstyle.filter( isNonDefaultDirectiveSuffix ).forEach( ( entry ) => {\n\t\t\tconst styleProp = entry.suffix;\n\t\t\tlet result = evaluate( entry );\n\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\tresult = result();\n\t\t\t}\n\t\t\telement.props.style = element.props.style || {};\n\t\t\tif ( typeof element.props.style === 'string' ) {\n\t\t\t\telement.props.style = cssStringToObject( element.props.style );\n\t\t\t}\n\t\t\tif ( ! result ) {\n\t\t\t\tdelete element.props.style[ styleProp ];\n\t\t\t} else {\n\t\t\t\telement.props.style[ styleProp ] = result;\n\t\t\t}\n\n\t\t\tuseInit( () => {\n\t\t\t\t/*\n\t\t\t\t * This seems necessary because Preact doesn't change the styles on\n\t\t\t\t * the hydration, so we have to do it manually. It doesn't need deps\n\t\t\t\t * because it only needs to do it the first time.\n\t\t\t\t */\n\t\t\t\tif ( ! result ) {\n\t\t\t\t\t(\n\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t ).current!.style.removeProperty( styleProp );\n\t\t\t\t} else {\n\t\t\t\t\t( element.ref as RefObject< HTMLElement > ).current!.style[\n\t\t\t\t\t\tstyleProp\n\t\t\t\t\t] = result;\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-bind--[attribute]\n\tdirective( 'bind', ( { directives: { bind }, element, evaluate } ) => {\n\t\tbind.filter( isNonDefaultDirectiveSuffix ).forEach( ( entry ) => {\n\t\t\tconst attribute = entry.suffix;\n\t\t\tlet result = evaluate( entry );\n\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\tresult = result();\n\t\t\t}\n\t\t\telement.props[ attribute ] = result;\n\n\t\t\t/*\n\t\t\t * This is necessary because Preact doesn't change the attributes on the\n\t\t\t * hydration, so we have to do it manually. It only needs to do it the\n\t\t\t * first time. After that, Preact will handle the changes.\n\t\t\t */\n\t\t\tuseInit( () => {\n\t\t\t\tconst el = ( element.ref as RefObject< HTMLElement > ).current!;\n\n\t\t\t\t/*\n\t\t\t\t * We set the value directly to the corresponding HTMLElement instance\n\t\t\t\t * property excluding the following special cases. We follow Preact's\n\t\t\t\t * logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129\n\t\t\t\t */\n\t\t\t\tif ( attribute === 'style' ) {\n\t\t\t\t\tif ( typeof result === 'string' ) {\n\t\t\t\t\t\tel.style.cssText = result;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t} else if (\n\t\t\t\t\tattribute !== 'width' &&\n\t\t\t\t\tattribute !== 'height' &&\n\t\t\t\t\tattribute !== 'href' &&\n\t\t\t\t\tattribute !== 'list' &&\n\t\t\t\t\tattribute !== 'form' &&\n\t\t\t\t\t/*\n\t\t\t\t\t * The value for `tabindex` follows the parsing rules for an\n\t\t\t\t\t * integer. If that fails, or if the attribute isn't present, then\n\t\t\t\t\t * the browsers should \"follow platform conventions to determine if\n\t\t\t\t\t * the element should be considered as a focusable area\",\n\t\t\t\t\t * practically meaning that most elements get a default of `-1` (not\n\t\t\t\t\t * focusable), but several also get a default of `0` (focusable in\n\t\t\t\t\t * order after all elements with a positive `tabindex` value).\n\t\t\t\t\t *\n\t\t\t\t\t * @see https://html.spec.whatwg.org/#tabindex-value\n\t\t\t\t\t */\n\t\t\t\t\tattribute !== 'tabIndex' &&\n\t\t\t\t\tattribute !== 'download' &&\n\t\t\t\t\tattribute !== 'rowSpan' &&\n\t\t\t\t\tattribute !== 'colSpan' &&\n\t\t\t\t\tattribute !== 'role' &&\n\t\t\t\t\tattribute in el\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tel[ attribute ] =\n\t\t\t\t\t\t\tresult === null || result === undefined\n\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t: result;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} catch ( err ) {}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * aria- and data- attributes have no boolean representation.\n\t\t\t\t * A `false` value is different from the attribute not being\n\t\t\t\t * present, so we can't remove it.\n\t\t\t\t * We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136\n\t\t\t\t */\n\t\t\t\tif (\n\t\t\t\t\tresult !== null &&\n\t\t\t\t\tresult !== undefined &&\n\t\t\t\t\t( result !== false || attribute[ 4 ] === '-' )\n\t\t\t\t) {\n\t\t\t\t\tel.setAttribute( attribute, result );\n\t\t\t\t} else {\n\t\t\t\t\tel.removeAttribute( attribute );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-ignore\n\tdirective(\n\t\t'ignore',\n\t\t( {\n\t\t\telement: {\n\t\t\t\ttype: Type,\n\t\t\t\tprops: { innerHTML, ...rest },\n\t\t\t},\n\t\t}: {\n\t\t\telement: any;\n\t\t} ) => {\n\t\t\t// Preserve the initial inner HTML.\n\t\t\tconst cached = useMemo( () => innerHTML, [] );\n\t\t\treturn createElement( Type, {\n\t\t\t\tdangerouslySetInnerHTML: { __html: cached },\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-text\n\tdirective( 'text', ( { directives: { text }, element, evaluate } ) => {\n\t\tconst entry = text.find( isDefaultDirectiveSuffix );\n\t\tif ( ! entry ) {\n\t\t\telement.props.children = null;\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tlet result = evaluate( entry );\n\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\tresult = result();\n\t\t\t}\n\t\t\telement.props.children =\n\t\t\t\ttypeof result === 'object' ? null : result.toString();\n\t\t} catch ( e ) {\n\t\t\telement.props.children = null;\n\t\t}\n\t} );\n\n\t// data-wp-run\n\tdirective( 'run', ( { directives: { run }, evaluate } ) => {\n\t\trun.forEach( ( entry ) => {\n\t\t\tlet result = evaluate( entry );\n\t\t\tif ( typeof result === 'function' ) {\n\t\t\t\tresult = result();\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\t} );\n\n\t// data-wp-each--[item]\n\tdirective(\n\t\t'each',\n\t\t( {\n\t\t\tdirectives: { each, 'each-key': eachKey },\n\t\t\tcontext: inheritedContext,\n\t\t\telement,\n\t\t\tevaluate,\n\t\t} ) => {\n\t\t\tif ( element.type !== 'template' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { Provider } = inheritedContext;\n\t\t\tconst inheritedValue = useContext( inheritedContext );\n\n\t\t\tconst [ entry ] = each;\n\t\t\tconst { namespace } = entry;\n\n\t\t\tlet iterable = evaluate( entry );\n\t\t\tif ( typeof iterable === 'function' ) {\n\t\t\t\titerable = iterable();\n\t\t\t}\n\n\t\t\tif ( typeof iterable?.[ Symbol.iterator ] !== 'function' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst itemProp = isNonDefaultDirectiveSuffix( entry )\n\t\t\t\t? kebabToCamelCase( entry.suffix )\n\t\t\t\t: 'item';\n\n\t\t\tconst result: VNode< any >[] = [];\n\n\t\t\tfor ( const item of iterable ) {\n\t\t\t\tconst itemContext = proxifyContext(\n\t\t\t\t\tproxifyState( namespace, {} ),\n\t\t\t\t\tinheritedValue.client[ namespace ]\n\t\t\t\t);\n\t\t\t\tconst mergedContext = {\n\t\t\t\t\tclient: {\n\t\t\t\t\t\t...inheritedValue.client,\n\t\t\t\t\t\t[ namespace ]: itemContext,\n\t\t\t\t\t},\n\t\t\t\t\tserver: { ...inheritedValue.server },\n\t\t\t\t};\n\n\t\t\t\t// Set the item after proxifying the context.\n\t\t\t\tmergedContext.client[ namespace ][ itemProp ] = item;\n\n\t\t\t\tconst scope = {\n\t\t\t\t\t...getScope(),\n\t\t\t\t\tcontext: mergedContext.client,\n\t\t\t\t\tserverContext: mergedContext.server,\n\t\t\t\t};\n\t\t\t\tconst key = eachKey\n\t\t\t\t\t? getEvaluate( { scope } )( eachKey[ 0 ] )\n\t\t\t\t\t: item;\n\n\t\t\t\tresult.push(\n\t\t\t\t\tcreateElement(\n\t\t\t\t\t\tProvider,\n\t\t\t\t\t\t{ value: mergedContext, key },\n\t\t\t\t\t\telement.props.content\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\t{ priority: 20 }\n\t);\n\n\tdirective( 'each-child', () => null, { priority: 1 } );\n};\n","export const directivePrefix: string = 'wp';\n","/**\n * External dependencies\n */\nimport { h, type ComponentChild, type JSX } from 'preact';\n/**\n * Internal dependencies\n */\nimport { directivePrefix as p } from './constants';\nimport { warn } from './utils';\nimport { type DirectiveEntry } from './hooks';\n\nconst ignoreAttr = `data-${ p }-ignore`;\nconst islandAttr = `data-${ p }-interactive`;\nconst fullPrefix = `data-${ p }-`;\nconst namespaces: Array< string | null > = [];\nconst currentNamespace = () => namespaces[ namespaces.length - 1 ] ?? null;\nconst isObject = ( item: unknown ): item is Record< string, unknown > =>\n\tBoolean( item && typeof item === 'object' && item.constructor === Object );\n\n/**\n * This regex pattern must be kept in sync with the server-side implementation in\n * wp-includes/interactivity-api/class-wp-interactivity-api.php.\n *\n * The pattern validates directive attribute names to ensure consistency between\n * client and server processing. Invalid directive names (containing characters like\n * square brackets or colons) should be ignored by both client and server.\n *\n * @see https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php\n */\nconst directiveParser = new RegExp(\n\t`^data-${ p }-` + // ${p} must be a prefix string, like 'wp'.\n\t\t// Match alphanumeric characters including hyphen-separated\n\t\t// segments. It excludes underscore intentionally to prevent confusion.\n\t\t// E.g., \"custom-directive\".\n\t\t'([a-z0-9]+(?:-[a-z0-9]+)*)' +\n\t\t// (Optional) Match '--' followed by any alphanumeric characters. It\n\t\t// excludes underscore intentionally to prevent confusion, but it can\n\t\t// contain multiple hyphens. E.g., \"--custom-prefix--with-more-info\".\n\t\t'(?:--([a-z0-9_-]+))?$',\n\t'i' // Case insensitive.\n);\n\n// Regular expression for reference parsing. It can contain a namespace before\n// the reference, separated by `::`, like `some-namespace::state.somePath`.\n// Namespaces can contain any alphanumeric characters, hyphens, underscores or\n// forward slashes. References don't have any restrictions.\nconst nsPathRegExp = /^([\\w_\\/-]+)::(.+)$/;\n\nexport const hydratedIslands = new WeakSet();\n\n/**\n * Recursive function that transforms a DOM tree into vDOM.\n *\n * @param root The root element or node to start traversing on.\n * @return The resulting vDOM tree.\n */\nexport function toVdom( root: Node ): Array< ComponentChild > {\n\tconst treeWalker = document.createTreeWalker(\n\t\troot,\n\t\t205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT\n\t);\n\n\tfunction walk(\n\t\tnode: Node\n\t): [ ComponentChild ] | [ ComponentChild, Node | null ] {\n\t\tconst { nodeType } = node;\n\n\t\t// TEXT_NODE (3)\n\t\tif ( nodeType === 3 ) {\n\t\t\treturn [ ( node as Text ).data ];\n\t\t}\n\n\t\t// CDATA_SECTION_NODE (4)\n\t\tif ( nodeType === 4 ) {\n\t\t\tconst next = treeWalker.nextSibling();\n\t\t\t( node as CDATASection ).replaceWith(\n\t\t\t\tnew window.Text( ( node as CDATASection ).nodeValue ?? '' )\n\t\t\t);\n\t\t\treturn [ node.nodeValue, next ];\n\t\t}\n\n\t\t// COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7)\n\t\tif ( nodeType === 8 || nodeType === 7 ) {\n\t\t\tconst next = treeWalker.nextSibling();\n\t\t\t( node as Comment | ProcessingInstruction ).remove();\n\t\t\treturn [ null, next ];\n\t\t}\n\n\t\tconst elementNode = node as HTMLElement;\n\t\tconst { attributes } = elementNode;\n\t\tconst localName = elementNode.localName as keyof JSX.IntrinsicElements;\n\n\t\tconst props: Record< string, any > = {};\n\t\tconst children: Array< ComponentChild > = [];\n\t\tconst directives: Array<\n\t\t\t[ name: string, namespace: string | null, value: unknown ]\n\t\t> = [];\n\t\tlet ignore = false;\n\t\tlet island = false;\n\n\t\tfor ( let i = 0; i < attributes.length; i++ ) {\n\t\t\tconst attributeName = attributes[ i ].name;\n\t\t\tconst attributeValue = attributes[ i ].value;\n\t\t\tif (\n\t\t\t\tattributeName[ fullPrefix.length ] &&\n\t\t\t\tattributeName.slice( 0, fullPrefix.length ) === fullPrefix\n\t\t\t) {\n\t\t\t\tif ( attributeName === ignoreAttr ) {\n\t\t\t\t\tignore = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst regexResult = nsPathRegExp.exec( attributeValue );\n\t\t\t\t\tconst namespace = regexResult?.[ 1 ] ?? null;\n\t\t\t\t\tlet value: any = regexResult?.[ 2 ] ?? attributeValue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst parsedValue = JSON.parse( value );\n\t\t\t\t\t\tvalue = isObject( parsedValue ) ? parsedValue : value;\n\t\t\t\t\t} catch {}\n\t\t\t\t\tif ( attributeName === islandAttr ) {\n\t\t\t\t\t\tisland = true;\n\t\t\t\t\t\tconst islandNamespace =\n\t\t\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\t\t\ttypeof value === 'string'\n\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t: typeof value?.namespace === 'string'\n\t\t\t\t\t\t\t\t? value.namespace\n\t\t\t\t\t\t\t\t: null;\n\t\t\t\t\t\tnamespaces.push( islandNamespace );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdirectives.push( [ attributeName, namespace, value ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( attributeName === 'ref' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprops[ attributeName ] = attributeValue;\n\t\t}\n\n\t\tif ( ignore && ! island ) {\n\t\t\treturn [\n\t\t\t\th< any, any >( localName, {\n\t\t\t\t\t...props,\n\t\t\t\t\tinnerHTML: elementNode.innerHTML,\n\t\t\t\t\t__directives: { ignore: true },\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t\tif ( island ) {\n\t\t\thydratedIslands.add( elementNode );\n\t\t}\n\n\t\tif ( directives.length ) {\n\t\t\tprops.__directives = directives.reduce<\n\t\t\t\tRecord< string, Array< DirectiveEntry > >\n\t\t\t>( ( obj, [ name, ns, value ] ) => {\n\t\t\t\tconst directiveMatch = directiveParser.exec( name );\n\t\t\t\tif ( directiveMatch === null ) {\n\t\t\t\t\twarn( `Found malformed directive name: ${ name }.` );\n\t\t\t\t\treturn obj;\n\t\t\t\t}\n\t\t\t\tconst prefix = directiveMatch[ 1 ] || '';\n\t\t\t\tconst suffix = directiveMatch[ 2 ] || null;\n\n\t\t\t\tobj[ prefix ] = obj[ prefix ] || [];\n\t\t\t\tobj[ prefix ].push( {\n\t\t\t\t\tnamespace: ns ?? currentNamespace()!,\n\t\t\t\t\tvalue: value as DirectiveEntry[ 'value' ],\n\t\t\t\t\tsuffix,\n\t\t\t\t} );\n\t\t\t\treturn obj;\n\t\t\t}, {} );\n\t\t}\n\n\t\tif ( localName === 'template' ) {\n\t\t\tprops.content = [\n\t\t\t\t...( elementNode as HTMLTemplateElement ).content.childNodes,\n\t\t\t].map( ( childNode ) => toVdom( childNode ) );\n\t\t} else {\n\t\t\tlet child = treeWalker.firstChild();\n\t\t\tif ( child ) {\n\t\t\t\twhile ( child ) {\n\t\t\t\t\tconst [ vnode, nextChild ] = walk( child );\n\t\t\t\t\tif ( vnode ) {\n\t\t\t\t\t\tchildren.push( vnode );\n\t\t\t\t\t}\n\t\t\t\t\tchild = nextChild || treeWalker.nextSibling();\n\t\t\t\t}\n\t\t\t\ttreeWalker.parentNode();\n\t\t\t}\n\t\t}\n\n\t\t// Restore previous namespace.\n\t\tif ( island ) {\n\t\t\tnamespaces.pop();\n\t\t}\n\n\t\treturn [ h( localName, props, children ) ];\n\t}\n\n\treturn walk( treeWalker.currentNode );\n}\n","/**\n * External dependencies\n */\nimport { hydrate, type ContainerNode, type ComponentChild } from 'preact';\n/**\n * Internal dependencies\n */\nimport { toVdom, hydratedIslands } from './vdom';\nimport { createRootFragment, splitTask } from './utils';\nimport { directivePrefix } from './constants';\n\n// Keep the same root fragment for each interactive region node.\nconst regionRootFragments = new WeakMap();\nexport const getRegionRootFragment = ( region: Element ): ContainerNode => {\n\tif ( ! region.parentElement ) {\n\t\tthrow Error( 'The passed region should be an element with a parent.' );\n\t}\n\tif ( ! regionRootFragments.has( region ) ) {\n\t\tregionRootFragments.set(\n\t\t\tregion,\n\t\t\tcreateRootFragment( region.parentElement, region )\n\t\t);\n\t}\n\treturn regionRootFragments.get( region );\n};\n\n// Initial vDOM regions associated with its DOM element.\nexport const initialVdom = new WeakMap< Element, ComponentChild[] >();\n\n// Initialize the router with the initial DOM.\nexport const init = async () => {\n\tconst nodes = document.querySelectorAll(\n\t\t`[data-${ directivePrefix }-interactive]`\n\t);\n\n\t/*\n\t * This `await` with setTimeout is required to apparently ensure that the interactive blocks have their stores\n\t * fully initialized prior to hydrating the blocks. If this is not present, then an error occurs, for example:\n\t * > view.js:46 Uncaught (in promise) ReferenceError: Cannot access 'state' before initialization\n\t * This occurs when splitTask() is implemented with scheduler.yield() as opposed to setTimeout(), as with the former\n\t * split tasks are added to the front of the task queue whereas with the latter they are added to the end of the queue.\n\t */\n\tawait new Promise( ( resolve ) => {\n\t\tsetTimeout( resolve, 0 );\n\t} );\n\n\tfor ( const node of nodes ) {\n\t\tif ( ! hydratedIslands.has( node ) ) {\n\t\t\tawait splitTask();\n\t\t\tconst fragment = getRegionRootFragment( node );\n\t\t\tconst vdom = toVdom( node );\n\t\t\tinitialVdom.set( node, vdom );\n\t\t\tawait splitTask();\n\t\t\thydrate( vdom, fragment );\n\t\t}\n\t}\n};\n","/**\n * External dependencies\n */\nimport { h, cloneElement, render } from 'preact';\nimport { batch } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport registerDirectives from './directives';\nimport { init, getRegionRootFragment, initialVdom } from './init';\nimport { directivePrefix } from './constants';\nimport { toVdom } from './vdom';\nimport { directive } from './hooks';\nimport { getNamespace } from './namespaces';\nimport { parseServerData, populateServerData } from './store';\nimport { proxifyState } from './proxies';\n\nexport { store, getConfig, getServerState } from './store';\nexport { getContext, getServerContext, getElement } from './scopes';\nexport {\n\twithScope,\n\tuseWatch,\n\tuseInit,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseCallback,\n\tuseMemo,\n\tsplitTask,\n\twithSyncEvent,\n} from './utils';\n\nexport { useState, useRef } from 'preact/hooks';\n\nconst requiredConsent =\n\t'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.';\n\nexport const privateApis = ( lock ): any => {\n\tif ( lock === requiredConsent ) {\n\t\treturn {\n\t\t\tdirectivePrefix,\n\t\t\tgetRegionRootFragment,\n\t\t\tinitialVdom,\n\t\t\ttoVdom,\n\t\t\tdirective,\n\t\t\tgetNamespace,\n\t\t\th,\n\t\t\tcloneElement,\n\t\t\trender,\n\t\t\tproxifyState,\n\t\t\tparseServerData,\n\t\t\tpopulateServerData,\n\t\t\tbatch,\n\t\t};\n\t}\n\n\tthrow new Error( 'Forbidden access.' );\n};\n\nregisterDirectives();\ninit();\n"],"names":["slice","options","vnodeId","isValidElement","rerenderQueue","prevDebounce","defer","depthSort","eventClock","eventProxy","eventProxyCapture","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__d","__c","constructor","__v","__i","__u","Fragment","BaseComponent","context","this","getDomSibling","childIndex","sibling","updateParentDomPointers","child","base","enqueueRender","c","push","process","__r","debounceRendering","renderQueueLength","component","newVNode","oldVNode","oldDom","commitQueue","refQueue","sort","shift","__P","diff","__n","namespaceURI","commitRoot","diffChildren","parentDom","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","String","findMatchingIndex","unmount","parentVNode","contains","insertBefore","nodeType","x","y","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","o","cssText","replace","toLowerCase","l","_attached","addEventListener","removeEventListener","e","removeAttribute","setAttribute","createEventProxy","eventHandler","_dispatched","event","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","isClassComponent","provider","componentContext","renderHook","count","newType","outer","prototype","render","contextType","__E","doRender","sub","state","__h","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","some","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","MODE_HYDRATE","indexOf","diffElementNodes","diffed","root","cb","newHtml","oldHtml","newChildren","inputValue","checked","localName","document","createTextNode","createElementNS","is","__m","data","childNodes","attributes","__html","innerHTML","hasRefUnmount","current","skipRemove","r","componentWillUnmount","replaceNode","firstChild","hydrate","cloneElement","createContext","defaultValue","contextId","Consumer","contextValue","Provider","subs","ctx","_props","old","splice","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","undefined","update","callback","s","forceUpdate","Promise","then","bind","resolve","setTimeout","a","b","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","d","definition","Object","defineProperty","enumerable","get","prop","hasOwnProperty","currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","_options","oldBeforeDiff","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","oldRoot","getHookState","index","hooks","__H","useState","initialState","reducer","hookState","_reducer","invokeOrReturn","action","currentValue","__N","nextValue","_hasScuFromHooks","updateHookState","p","stateHooks","filter","every","prevScu","shouldUpdate","forEach","hookItem","prevCWU","useReducer","useEffect","args","argsChanged","_pendingArgs","useRef","initialValue","useMemo","factory","useCallback","useContext","flushAfterPaintEffects","invokeCleanup","invokeEffect","requestAnimationFrame","afterNextFrame","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","hook","comp","cleanup","oldArgs","newArgs","arg","f","BRAND_SYMBOL","Symbol","for","endBatch","batchDepth","hasError","batchedEffect","effect","batchIteration","next","_nextBatchedEffect","_flags","needsToRecompute","_callback","err","batch","fn","finishUpdate","evalContext","globalVersion","addDependency","signal","_node","_target","_version","_source","_prevSource","_sources","_nextSource","_prevTarget","_nextTarget","_rollbackNode","_subscribe","Signal","_value","_targets","target","_refresh","prepareSources","rollbackNode","cleanupSources","head","prev","_unsubscribe","Computed","_fn","_globalVersion","computed","cleanupEffect","_cleanup","prevContext","disposeEffect","endEffect","Error","Effect","_dispose","hookName","hookFn","setCurrentUpdater","updater","_start","SignalValue","_ref","_this","currentSignal","useSignal","v","_updateFlags","_updater","_this$base","peek","createPropUpdater","propSignal","setAsProperty","ownerSVGElement","changeSignal","_update","newSignal","brand","subscribe","valueOf","toString","toJSON","set","_notify","OUTDATED","finish","displayName","defineProperties","configurable","signalProps","__np","renderedProps","updaters","_updaters","Component","HAS_PENDING_UPDATE","namespaceStack","getNamespace","setNamespace","resetNamespace","pop","scopeStack","getScope","setScope","scope","resetScope","immutableMap","WeakMap","immutableError","immutableHandlers","receiver","Reflect","deepImmutable","deleteProperty","has","Proxy","getContext","getElement","freeze","getServerContext","serverContext","window","splitTask","scheduler","yield","withScope","func","ns","wrapped","async","gen","it","throw","sync","syncAwareWrapped","useWatch","_useEffect","eff","isExecuting","compute","notify","flush","dispose","createFlusher","useSignalEffect","useInit","inputs","useLayoutEffect","_useLayoutEffect","_useCallback","_useMemo","Set","isPlainObject","candidate","Boolean","withSyncEvent","syncAware","objToProxy","proxyToObj","proxyToNs","supported","createProxy","handlers","shouldProxy","proxy","getProxyFromObject","getNamespaceFromProxy","NO_SCOPE","PropSignal","owner","computedsByScope","setValue","setGetter","getter","getComputed","valueSignal","getterSignal","wellKnownSymbols","getOwnPropertyNames","map","proxyToProps","hasPropSignal","readOnlyProxies","WeakSet","getPropSignal","initial","Map","readOnly","proxifyState","objToIterable","stateHandlers","desc","getOwnPropertyDescriptor","result","ownKeys","_","add","deepMergeRecursive","source","override","hasNewKeys","targetValue","deepMerge","storeRoots","storeHandlers","proxifyStore","scoped","isRoot","contextObjectToProxy","contextObjectToFallback","contextProxies","descriptor","contextHandlers","fallback","currentProp","keys","proxifyContext","inherited","stores","rawStores","storeLocks","storeConfigs","serverStates","getConfig","getServerState","universalUnlock","store","block","lock","storeLock","rawStore","proxifiedStore","parseServerData","_dom$getElementById","jsonDataScriptTag","getElementById","textContent","JSON","parse","populateServerData","entries","st","config","isNonDefaultDirectiveSuffix","entry","suffix","isDefaultDirectiveSuffix","client","server","directiveCallbacks","directivePriorities","directive","priority","getEvaluate","path","hasNegationOperator","resolvedStore","split","reduce","acc","functionResult","functionArgs","Directives","directives","priorityLevels","currentPriorityLevel","nextPriorityLevels","element","originalProps","previousScope","evaluate","directiveArgs","directiveName","wrapper","deepClone","fromEntries","wrapEventAsync","Function","apply","__directives","find","byPriority","p1","p2","parseInt","arr","getPriorityLevels","top","newRule","ruleClean","ruleNewline","getGlobalEventDirective","eventName","globalVar","getGlobalAsyncEventDirective","passive","directivePrefix","ignoreAttr","islandAttr","fullPrefix","namespaces","directiveParser","RegExp","nsPathRegExp","hydratedIslands","toVdom","treeWalker","createTreeWalker","walk","_nodeValue","replaceWith","Text","nodeValue","remove","elementNode","ignore","island","attributeName","attributeValue","_regexResult$","_regexResult$2","regexResult","exec","parsedValue","item","islandNamespace","h","directiveMatch","prefix","currentNamespace","_namespaces","content","childNode","nextChild","currentNode","regionRootFragments","getRegionRootFragment","region","parentElement","createRootFragment","parent","concat","appendChild","initialVdom","privateApis","inheritedContext","defaultEntry","inheritedClient","inheritedServer","contextStack","watch","init","on","events","eventType","existingHandler","onAsync","class","classNames","className","currentClass","classFinder","trim","classList","styleProp","val","tree","left","unshift","cssStringToObject","removeProperty","attribute","el","Type","rest","cached","dangerouslySetInnerHTML","text","run","each","eachKey","inheritedValue","iterable","iterator","itemProp","_match","group1","toUpperCase","itemContext","mergedContext","nodes","querySelectorAll","fragment","vdom"],"sourceRoot":""}