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AMxO,GACnB,GAAIsR,EAAI7C,IACP,IAAK,IAAIghB,EAAI,EAAGA,EAAIne,EAAI7C,IAAOrN,OAAQquB,IAEtC,IEvderpB,EFsdHkL,EAAI7C,IAAOghB,KErdZrpB,EFsdK,CACf,IAAM6nB,EAAgBtC,EAAelqB,GACrC,MAAU,IAAAyT,MAAK,4GAC8FlV,EAAkBiuB,iBAAAA,EAC/H,wBACD,CAGH,CAEF,CACD,CACD,CAxbO,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/./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","webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/./node_modules/preact/devtools/src/devtools.js","webpack://wp/./node_modules/preact/debug/src/check-props.js","webpack://wp/./node_modules/preact/debug/src/component-stack.js","webpack://wp/./node_modules/preact/debug/src/debug.js","webpack://wp/./node_modules/preact/debug/src/constants.js","webpack://wp/./node_modules/preact/debug/src/util.js"],"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","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","// 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 { Component, Fragment, options } from 'preact';\n\nexport function initDevTools() {\n\tconst globalVar =\n\t\ttypeof globalThis !== 'undefined'\n\t\t\t? globalThis\n\t\t\t: typeof window !== 'undefined'\n\t\t\t\t? window\n\t\t\t\t: undefined;\n\n\tif (\n\t\tglobalVar !== null &&\n\t\tglobalVar !== undefined &&\n\t\tglobalVar.__PREACT_DEVTOOLS__\n\t) {\n\t\tglobalVar.__PREACT_DEVTOOLS__.attachPreact('10.24.2', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nlet loggedTypeFailures = {};\n\n/**\n * Reset the history of which prop type warnings have been logged.\n */\nexport function resetPropWarnings() {\n\tloggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n */\nexport function checkPropTypes(\n\ttypeSpecs,\n\tvalues,\n\tlocation,\n\tcomponentName,\n\tgetStack\n) {\n\tObject.keys(typeSpecs).forEach(typeSpecName => {\n\t\tlet error;\n\t\ttry {\n\t\t\terror = typeSpecs[typeSpecName](\n\t\t\t\tvalues,\n\t\t\t\ttypeSpecName,\n\t\t\t\tcomponentName,\n\t\t\t\tlocation,\n\t\t\t\tnull,\n\t\t\t\tReactPropTypesSecret\n\t\t\t);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\t\tif (error && !(error.message in loggedTypeFailures)) {\n\t\t\tloggedTypeFailures[error.message] = true;\n\t\t\tconsole.error(\n\t\t\t\t`Failed ${location} type: ${error.message}${\n\t\t\t\t\t(getStack && `\\n${getStack()}`) || ''\n\t\t\t\t}`\n\t\t\t);\n\t\t}\n\t});\n}\n","import { options, Fragment } from 'preact';\n\n/**\n * Get human readable name of the component/dom node\n * @param {import('./internal').VNode} vnode\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getDisplayName(vnode) {\n\tif (vnode.type === Fragment) {\n\t\treturn 'Fragment';\n\t} else if (typeof vnode.type == 'function') {\n\t\treturn vnode.type.displayName || vnode.type.name;\n\t} else if (typeof vnode.type == 'string') {\n\t\treturn vnode.type;\n\t}\n\n\treturn '#text';\n}\n\n/**\n * Used to keep track of the currently rendered `vnode` and print it\n * in debug messages.\n */\nlet renderStack = [];\n\n/**\n * Keep track of the current owners. An owner describes a component\n * which was responsible to render a specific `vnode`. This exclude\n * children that are passed via `props.children`, because they belong\n * to the parent owner.\n *\n * ```jsx\n * const Foo = props => <div>{props.children}</div> // div's owner is Foo\n * const Bar = props => {\n * return (\n * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar\n * )\n * }\n * ```\n *\n * Note: A `vnode` may be hoisted to the root scope due to compiler\n * optimiztions. In these cases the `_owner` will be different.\n */\nlet ownerStack = [];\n\n/**\n * Get the currently rendered `vnode`\n * @returns {import('./internal').VNode | null}\n */\nexport function getCurrentVNode() {\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\n}\n\n/**\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\n * somewhere in his tool chain we can't print the filename and source\n * location of a component. In that case we just omit that, but we'll\n * print a helpful message to the console, notifying the user of it.\n */\nlet showJsxSourcePluginWarning = true;\n\n/**\n * Check if a `vnode` is a possible owner.\n * @param {import('./internal').VNode} vnode\n */\nfunction isPossibleOwner(vnode) {\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\n}\n\n/**\n * Return the component stack that was captured up to this point.\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getOwnerStack(vnode) {\n\tconst stack = [vnode];\n\tlet next = vnode;\n\twhile (next._owner != null) {\n\t\tstack.push(next._owner);\n\t\tnext = next._owner;\n\t}\n\n\treturn stack.reduce((acc, owner) => {\n\t\tacc += ` in ${getDisplayName(owner)}`;\n\n\t\tconst source = owner.__source;\n\t\tif (source) {\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\n\t\t} else if (showJsxSourcePluginWarning) {\n\t\t\tconsole.warn(\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\n\t\t\t);\n\t\t}\n\t\tshowJsxSourcePluginWarning = false;\n\n\t\treturn (acc += '\\n');\n\t}, '');\n}\n\n/**\n * Setup code to capture the component trace while rendering. Note that\n * we cannot simply traverse `vnode._parent` upwards, because we have some\n * debug messages for `this.setState` where the `vnode` is `undefined`.\n */\nexport function setupComponentStack() {\n\tlet oldDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldRoot = options._root;\n\tlet oldVNode = options.vnode;\n\tlet oldRender = options._render;\n\n\toptions.diffed = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.pop();\n\t\t}\n\t\trenderStack.pop();\n\t\tif (oldDiffed) oldDiffed(vnode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\trenderStack.push(vnode);\n\t\t}\n\t\tif (oldDiff) oldDiff(vnode);\n\t};\n\n\toptions._root = (vnode, parent) => {\n\t\townerStack = [];\n\t\tif (oldRoot) oldRoot(vnode, parent);\n\t};\n\n\toptions.vnode = vnode => {\n\t\tvnode._owner =\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\n\t\tif (oldVNode) oldVNode(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.push(vnode);\n\t\t}\n\n\t\tif (oldRender) oldRender(vnode);\n\t};\n}\n","import { checkPropTypes } from './check-props';\nimport { options, Component } from 'preact';\nimport {\n\tELEMENT_NODE,\n\tDOCUMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE\n} from './constants';\nimport {\n\tgetOwnerStack,\n\tsetupComponentStack,\n\tgetCurrentVNode,\n\tgetDisplayName\n} from './component-stack';\nimport { assign, isNaN } from './util';\n\nconst isWeakMapSupported = typeof WeakMap == 'function';\n\n/**\n * @param {import('./internal').VNode} vnode\n * @returns {Array<string>}\n */\nfunction getDomChildren(vnode) {\n\tlet domChildren = [];\n\n\tif (!vnode._children) return domChildren;\n\n\tvnode._children.forEach(child => {\n\t\tif (child && typeof child.type === 'function') {\n\t\t\tdomChildren.push.apply(domChildren, getDomChildren(child));\n\t\t} else if (child && typeof child.type === 'string') {\n\t\t\tdomChildren.push(child.type);\n\t\t}\n\t});\n\n\treturn domChildren;\n}\n\n/**\n * @param {import('./internal').VNode} parent\n * @returns {string}\n */\nfunction getClosestDomNodeParentName(parent) {\n\tif (!parent) return '';\n\tif (typeof parent.type == 'function') {\n\t\tif (parent._parent == null) {\n\t\t\tif (parent._dom != null && parent._dom.parentNode != null) {\n\t\t\t\treturn parent._dom.parentNode.localName;\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t\treturn getClosestDomNodeParentName(parent._parent);\n\t}\n\treturn /** @type {string} */ (parent.type);\n}\n\nexport function initDebug() {\n\tsetupComponentStack();\n\n\tlet hooksAllowed = false;\n\n\t/* eslint-disable no-console */\n\tlet oldBeforeDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldVnode = options.vnode;\n\tlet oldRender = options._render;\n\tlet oldCatchError = options._catchError;\n\tlet oldRoot = options._root;\n\tlet oldHook = options._hook;\n\tconst warnedComponents = !isWeakMapSupported\n\t\t? null\n\t\t: {\n\t\t\t\tuseEffect: new WeakMap(),\n\t\t\t\tuseLayoutEffect: new WeakMap(),\n\t\t\t\tlazyPropTypes: new WeakMap()\n\t\t\t};\n\tconst deprecations = [];\n\n\toptions._catchError = (error, vnode, oldVNode, errorInfo) => {\n\t\tlet component = vnode && vnode._component;\n\t\tif (component && typeof error.then == 'function') {\n\t\t\tconst promise = error;\n\t\t\terror = new Error(\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\n\t\t\t);\n\n\t\t\tlet parent = vnode;\n\t\t\tfor (; parent; parent = parent._parent) {\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\n\t\t\t\t\terror = promise;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We haven't recovered and we know at this point that there is no\n\t\t\t// Suspense component higher up in the tree\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\terrorInfo = errorInfo || {};\n\t\t\terrorInfo.componentStack = getOwnerStack(vnode);\n\t\t\toldCatchError(error, vnode, oldVNode, errorInfo);\n\n\t\t\t// when an error was handled by an ErrorBoundary we will nonetheless emit an error\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\n\t\t\t// and thus make the Next.js dev overlay work.\n\t\t\tif (typeof error.then != 'function') {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t};\n\n\toptions._root = (vnode, parentNode) => {\n\t\tif (!parentNode) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\n\t\t\t);\n\t\t}\n\n\t\tlet isValid;\n\t\tswitch (parentNode.nodeType) {\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tcase DOCUMENT_NODE:\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisValid = false;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\tlet componentName = getDisplayName(vnode);\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\n\t\t\t);\n\t\t}\n\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tlet { type } = vnode;\n\n\t\thooksAllowed = true;\n\n\t\tif (type === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type != null && typeof type == 'object') {\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\n\t\t\t\t\t\t` let vnode = <My${getDisplayName(vnode)} />;\\n\\n` +\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t'Invalid type passed to createElement(): ' +\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvnode.ref !== undefined &&\n\t\t\ttypeof vnode.ref != 'function' &&\n\t\t\ttypeof vnode.ref != 'object' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tfor (const key in vnode.props) {\n\t\t\t\tif (\n\t\t\t\t\tkey[0] === 'o' &&\n\t\t\t\t\tkey[1] === 'n' &&\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\n\t\t\t\t\tvnode.props[key] != null\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check prop-types if available\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\n\t\t\tif (\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\n\t\t\t\twarnedComponents &&\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\n\t\t\t) {\n\t\t\t\tconst m =\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\n\t\t\t\ttry {\n\t\t\t\t\tconst lazyVNode = vnode.type();\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\n\t\t\t\t\t);\n\t\t\t\t} catch (promise) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet values = vnode.props;\n\t\t\tif (vnode.type._forwarded) {\n\t\t\t\tvalues = assign({}, values);\n\t\t\t\tdelete values.ref;\n\t\t\t}\n\n\t\t\tcheckPropTypes(\n\t\t\t\tvnode.type.propTypes,\n\t\t\t\tvalues,\n\t\t\t\t'prop',\n\t\t\t\tgetDisplayName(vnode),\n\t\t\t\t() => getOwnerStack(vnode)\n\t\t\t);\n\t\t}\n\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n\t};\n\n\tlet renderCount = 0;\n\tlet currentComponent;\n\toptions._render = vnode => {\n\t\tif (oldRender) {\n\t\t\toldRender(vnode);\n\t\t}\n\t\thooksAllowed = true;\n\n\t\tconst nextComponent = vnode._component;\n\t\tif (nextComponent === currentComponent) {\n\t\t\trenderCount++;\n\t\t} else {\n\t\t\trenderCount = 1;\n\t\t}\n\n\t\tif (renderCount >= 25) {\n\t\t\tthrow new Error(\n\t\t\t\t`Too many re-renders. This is limited to prevent an infinite loop ` +\n\t\t\t\t\t`which may lock up your browser. The component causing this is: ${getDisplayName(\n\t\t\t\t\t\tvnode\n\t\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tcurrentComponent = nextComponent;\n\t};\n\n\toptions._hook = (comp, index, type) => {\n\t\tif (!comp || !hooksAllowed) {\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\n\t\t}\n\n\t\tif (oldHook) oldHook(comp, index, type);\n\t};\n\n\t// Ideally we'd want to print a warning once per component, but we\n\t// don't have access to the vnode that triggered it here. As a\n\t// compromise and to avoid flooding the console with warnings we\n\t// print each deprecation warning only once.\n\tconst warn = (property, message) => ({\n\t\tget() {\n\t\t\tconst key = 'get' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\n\t\t\t}\n\t\t},\n\t\tset() {\n\t\t\tconst key = 'set' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst deprecatedAttributes = {\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\n\t\tattributes: warn('attributes', 'use vnode.props'),\n\t\tchildren: warn('children', 'use vnode.props.children')\n\t};\n\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\n\n\toptions.vnode = vnode => {\n\t\tconst props = vnode.props;\n\t\tif (\n\t\t\tvnode.type !== null &&\n\t\t\tprops != null &&\n\t\t\t('__source' in props || '__self' in props)\n\t\t) {\n\t\t\tconst newProps = (vnode.props = {});\n\t\t\tfor (let i in props) {\n\t\t\t\tconst v = props[i];\n\t\t\t\tif (i === '__source') vnode.__source = v;\n\t\t\t\telse if (i === '__self') vnode.__self = v;\n\t\t\t\telse newProps[i] = v;\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line\n\t\tvnode.__proto__ = deprecatedProto;\n\t\tif (oldVnode) oldVnode(vnode);\n\t};\n\n\toptions.diffed = vnode => {\n\t\tconst { type, _parent: parent } = vnode;\n\t\t// Check if the user passed plain objects as children. Note that we cannot\n\t\t// move this check into `options.vnode` because components can receive\n\t\t// children in any shape they want (e.g.\n\t\t// `<MyJSONFormatter>{{ foo: 123, bar: \"abc\" }}</MyJSONFormatter>`).\n\t\t// Putting this check in `options.diffed` ensures that\n\t\t// `vnode._children` is set and that we only validate the children\n\t\t// that were actually rendered.\n\t\tif (vnode._children) {\n\t\t\tvnode._children.forEach(child => {\n\t\t\t\tif (typeof child === 'object' && child && child.type === undefined) {\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (vnode._component === currentComponent) {\n\t\t\trenderCount = 0;\n\t\t}\n\n\t\tif (\n\t\t\ttypeof type === 'string' &&\n\t\t\t(isTableElement(type) ||\n\t\t\t\ttype === 'p' ||\n\t\t\t\ttype === 'a' ||\n\t\t\t\ttype === 'button')\n\t\t) {\n\t\t\t// Avoid false positives when Preact only partially rendered the\n\t\t\t// HTML tree. Whilst we attempt to include the outer DOM in our\n\t\t\t// validation, this wouldn't work on the server for\n\t\t\t// `preact-render-to-string`. There we'd otherwise flood the terminal\n\t\t\t// with false positives, which we'd like to avoid.\n\t\t\tlet domParentName = getClosestDomNodeParentName(parent);\n\t\t\tif (domParentName !== '' && isTableElement(type)) {\n\t\t\t\tif (\n\t\t\t\t\ttype === 'table' &&\n\t\t\t\t\t// Tables can be nested inside each other if it's inside a cell.\n\t\t\t\t\t// See https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced#nesting_tables\n\t\t\t\t\tdomParentName !== 'td' &&\n\t\t\t\t\tisTableElement(domParentName)\n\t\t\t\t) {\n\t\t\t\t\tconsole.log(domParentName, parent._dom);\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your <table> should not have a table-node parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\n\t\t\t\t\tdomParentName !== 'table'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\ttype === 'tr' &&\n\t\t\t\t\tdomParentName !== 'thead' &&\n\t\t\t\t\tdomParentName !== 'tfoot' &&\n\t\t\t\t\tdomParentName !== 'tbody'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot> parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'td' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your <td> should have a <tr> parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'th' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your <th> should have a <tr>.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'p') {\n\t\t\t\tlet illegalDomChildrenTypes = getDomChildren(vnode).filter(childType =>\n\t\t\t\t\tILLEGAL_PARAGRAPH_CHILD_ELEMENTS.test(childType)\n\t\t\t\t);\n\t\t\t\tif (illegalDomChildrenTypes.length) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of paragraph. Your <p> should not have ' +\n\t\t\t\t\t\t\tillegalDomChildrenTypes.join(', ') +\n\t\t\t\t\t\t\t'as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'a' || type === 'button') {\n\t\t\t\tif (getDomChildren(vnode).indexOf(type) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Improper nesting of interactive content. Your <${type}>` +\n\t\t\t\t\t\t\t` should not have other ${type === 'a' ? 'anchor' : 'button'}` +\n\t\t\t\t\t\t\t' tags as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\thooksAllowed = false;\n\n\t\tif (oldDiffed) oldDiffed(vnode);\n\n\t\tif (vnode._children != null) {\n\t\t\tconst keys = [];\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\t\tconst child = vnode._children[i];\n\t\t\t\tif (!child || child.key == null) continue;\n\n\t\t\t\tconst key = child.key;\n\t\t\t\tif (keys.indexOf(key) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\n\t\t\t\t\t// Break early to not spam the console\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\n\t\tif (vnode._component != null && vnode._component.__hooks != null) {\n\t\t\t// Validate that none of the hooks in this component contain arguments that are NaN.\n\t\t\t// This is a common mistake that can be hard to debug, so we want to catch it early.\n\t\t\tconst hooks = vnode._component.__hooks._list;\n\t\t\tif (hooks) {\n\t\t\t\tfor (let i = 0; i < hooks.length; i += 1) {\n\t\t\t\t\tconst hook = hooks[i];\n\t\t\t\t\tif (hook._args) {\n\t\t\t\t\t\tfor (let j = 0; j < hook._args.length; j++) {\n\t\t\t\t\t\t\tconst arg = hook._args[j];\n\t\t\t\t\t\t\tif (isNaN(arg)) {\n\t\t\t\t\t\t\t\tconst componentName = getDisplayName(vnode);\n\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t`Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index ${i} in component ${componentName} was called with NaN.`\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\nconst setState = Component.prototype.setState;\nComponent.prototype.setState = function (update, callback) {\n\tif (this._vnode == null) {\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\n\t\t// is perfectly valid to call `setState` during cWM. So we\n\t\t// need an additional check to verify that we are dealing with a\n\t\t// call inside constructor.\n\t\tif (this.state == null) {\n\t\t\tconsole.warn(\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\n\t\t\t);\n\t\t}\n\t}\n\n\treturn setState.call(this, update, callback);\n};\n\nfunction isTableElement(type) {\n\treturn (\n\t\ttype === 'table' ||\n\t\ttype === 'tfoot' ||\n\t\ttype === 'tbody' ||\n\t\ttype === 'thead' ||\n\t\ttype === 'td' ||\n\t\ttype === 'tr' ||\n\t\ttype === 'th'\n\t);\n}\n\nconst ILLEGAL_PARAGRAPH_CHILD_ELEMENTS =\n\t/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/;\n\nconst forceUpdate = Component.prototype.forceUpdate;\nComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode == null) {\n\t\tconsole.warn(\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\n\t\t\t\t\tgetCurrentVNode()\n\t\t\t\t)}`\n\t\t);\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\treturn forceUpdate.call(this, callback);\n};\n\n/**\n * Serialize a vnode tree to a string\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function serializeVNode(vnode) {\n\tlet { props } = vnode;\n\tlet name = getDisplayName(vnode);\n\n\tlet attrs = '';\n\tfor (let prop in props) {\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\n\t\t\tlet value = props[prop];\n\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\tif (typeof value == 'function') {\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t}\n\n\t\t\tvalue =\n\t\t\t\tObject(value) === value && !value.toString\n\t\t\t\t\t? Object.prototype.toString.call(value)\n\t\t\t\t\t: value + '';\n\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\n\t\t}\n\t}\n\n\tlet children = props.children;\n\treturn `<${name}${attrs}${\n\t\tchildren && children.length ? '>..</' + name + '>' : ' />'\n\t}`;\n}\n\noptions._hydrationMismatch = (newVNode, excessDomChildren) => {\n\tconst { type } = newVNode;\n\tconst availableTypes = excessDomChildren\n\t\t.map(child => child && child.localName)\n\t\t.filter(Boolean);\n\tconsole.error(\n\t\t`Expected a DOM node of type ${type} but found ${availableTypes.join(', ')}as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\\n\\n${getOwnerStack(newVNode)}`\n\t);\n};\n","export const ELEMENT_NODE = 1;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\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\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\nexport function isNaN(value) {\n\treturn value !== value;\n}\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","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","prop","propSignal","setAsProperty","ownerSVGElement","changeSignal","_update","newSignal","brand","subscribe","valueOf","toString","toJSON","Object","defineProperty","get","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","hasOwnProperty","desc","getOwnPropertyDescriptor","result","ownKeys","_","add","deepMergeRecursive","source","override","hasNewKeys","enumerable","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","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","d","definition","globalThis","__PREACT_DEVTOOLS__","attachPreact","loggedTypeFailures","getDisplayName","renderStack","ownerStack","getCurrentVNode","showJsxSourcePluginWarning","isPossibleOwner","getOwnerStack","stack","__o","__source","fileName","lineNumber","console","warn","isWeakMapSupported","getDomChildren","domChildren","getClosestDomNodeParentName","isTableElement","ILLEGAL_PARAGRAPH_CHILD_ELEMENTS","serializeVNode","attrs","stringify","availableTypes","join","oldDiff","oldDiffed","oldRender","hooksAllowed","oldVnode","oldCatchError","oldHook","warnedComponents","lazyPropTypes","deprecations","promise","componentStack","isValid","componentName","propTypes","m","lazyVNode","values","__f","typeSpecs","location","getStack","typeSpecName","message","renderCount","nextComponent","property","deprecatedAttributes","nodeName","deprecatedProto","create","__self","__proto__","domParentName","log","illegalDomChildrenTypes","childType","j"],"sourceRoot":""}