@kunpeng-js/properties-panel 2026.0.0-alpha2 → 2026.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/LICENSE +9 -2
  2. package/dist/index.esm.js +3760 -3762
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +3724 -3804
  5. package/dist/index.js.map +1 -1
  6. package/package.json +22 -48
  7. package/preact/README.md +5 -5
  8. package/preact/compat/client.d.ts +1 -3
  9. package/preact/compat/dist/compat.mjs +2 -2
  10. package/preact/compat/dist/compat.mjs.map +1 -0
  11. package/preact/compat/package.json +2 -41
  12. package/preact/compat/scheduler.d.ts +12 -0
  13. package/preact/compat/server.d.ts +17 -0
  14. package/preact/compat/src/Children.js +3 -3
  15. package/preact/compat/src/PureComponent.js +20 -12
  16. package/preact/compat/src/forwardRef.js +4 -17
  17. package/preact/compat/src/hooks.js +17 -51
  18. package/preact/compat/src/index.d.ts +249 -164
  19. package/preact/compat/src/index.js +52 -43
  20. package/preact/compat/src/internal.d.ts +1 -2
  21. package/preact/compat/src/memo.js +2 -2
  22. package/preact/compat/src/portals.js +2 -68
  23. package/preact/compat/src/render.js +182 -73
  24. package/preact/compat/src/suspense.d.ts +1 -3
  25. package/preact/compat/src/suspense.js +169 -179
  26. package/preact/compat/src/util.js +5 -22
  27. package/preact/debug/dist/debug.mjs +2 -2
  28. package/preact/debug/dist/debug.mjs.map +1 -0
  29. package/preact/debug/package.json +3 -14
  30. package/preact/debug/src/check-props.js +2 -6
  31. package/preact/debug/src/component-stack.js +67 -16
  32. package/preact/debug/src/debug.js +80 -35
  33. package/preact/debug/src/index.d.ts +11 -1
  34. package/preact/debug/src/index.js +3 -1
  35. package/preact/debug/src/util.js +1 -11
  36. package/preact/devtools/dist/devtools.mjs +2 -2
  37. package/preact/devtools/dist/devtools.mjs.map +1 -0
  38. package/preact/devtools/package.json +3 -15
  39. package/preact/devtools/src/devtools.js +1 -1
  40. package/preact/dist/preact.mjs +2 -2
  41. package/preact/dist/preact.mjs.map +1 -0
  42. package/preact/hooks/dist/hooks.mjs +2 -2
  43. package/preact/hooks/dist/hooks.mjs.map +1 -0
  44. package/preact/hooks/package.json +5 -24
  45. package/preact/hooks/src/index.d.ts +6 -13
  46. package/preact/hooks/src/index.js +95 -73
  47. package/preact/hooks/src/internal.d.ts +8 -3
  48. package/preact/jsx-runtime/dist/jsxRuntime.mjs +2 -2
  49. package/preact/jsx-runtime/dist/jsxRuntime.mjs.map +1 -0
  50. package/preact/jsx-runtime/package.json +4 -16
  51. package/preact/jsx-runtime/src/index.d.ts +11 -11
  52. package/preact/jsx-runtime/src/index.js +25 -40
  53. package/preact/jsx-runtime/src/utils.js +3 -3
  54. package/preact/package.json +59 -115
  55. package/preact/src/component.js +54 -47
  56. package/preact/src/constants.js +17 -2
  57. package/preact/src/create-context.js +4 -14
  58. package/preact/src/create-element.js +42 -17
  59. package/preact/src/create-portal.js +20 -0
  60. package/preact/src/diff/catch-error.js +26 -8
  61. package/preact/src/diff/children.js +158 -96
  62. package/preact/src/diff/index.js +265 -146
  63. package/preact/src/diff/props.js +39 -50
  64. package/preact/src/dom.d.ts +796 -147
  65. package/preact/src/index.d.ts +7 -18
  66. package/preact/src/index.js +2 -1
  67. package/preact/src/internal.d.ts +16 -24
  68. package/preact/src/jsx.d.ts +222 -2910
  69. package/preact/src/render.js +30 -34
  70. package/preact/src/util.js +5 -20
  71. package/preact/test-utils/dist/testUtils.mjs +1 -1
  72. package/preact/test-utils/dist/testUtils.mjs.map +1 -0
  73. package/preact/test-utils/package.json +5 -17
  74. package/README.md +0 -35
  75. package/preact/compat/dist/compat.js +0 -2
  76. package/preact/compat/dist/compat.js.map +0 -1
  77. package/preact/compat/dist/compat.module.js +0 -2
  78. package/preact/compat/dist/compat.module.js.map +0 -1
  79. package/preact/compat/dist/compat.umd.js +0 -2
  80. package/preact/compat/dist/compat.umd.js.map +0 -1
  81. package/preact/compat/src/suspense-list.d.ts +0 -16
  82. package/preact/compat/src/suspense-list.js +0 -127
  83. package/preact/debug/dist/debug.js +0 -2
  84. package/preact/debug/dist/debug.js.map +0 -1
  85. package/preact/debug/dist/debug.module.js +0 -2
  86. package/preact/debug/dist/debug.module.js.map +0 -1
  87. package/preact/debug/dist/debug.umd.js +0 -2
  88. package/preact/debug/dist/debug.umd.js.map +0 -1
  89. package/preact/devtools/dist/devtools.js +0 -2
  90. package/preact/devtools/dist/devtools.js.map +0 -1
  91. package/preact/devtools/dist/devtools.module.js +0 -2
  92. package/preact/devtools/dist/devtools.module.js.map +0 -1
  93. package/preact/devtools/dist/devtools.umd.js +0 -2
  94. package/preact/devtools/dist/devtools.umd.js.map +0 -1
  95. package/preact/dist/preact.js +0 -2
  96. package/preact/dist/preact.js.map +0 -1
  97. package/preact/dist/preact.min.js +0 -2
  98. package/preact/dist/preact.min.js.map +0 -1
  99. package/preact/dist/preact.min.module.js +0 -2
  100. package/preact/dist/preact.min.module.js.map +0 -1
  101. package/preact/dist/preact.min.umd.js +0 -2
  102. package/preact/dist/preact.min.umd.js.map +0 -1
  103. package/preact/dist/preact.module.js +0 -2
  104. package/preact/dist/preact.module.js.map +0 -1
  105. package/preact/dist/preact.umd.js +0 -2
  106. package/preact/dist/preact.umd.js.map +0 -1
  107. package/preact/hooks/dist/hooks.js +0 -2
  108. package/preact/hooks/dist/hooks.js.map +0 -1
  109. package/preact/hooks/dist/hooks.module.js +0 -2
  110. package/preact/hooks/dist/hooks.module.js.map +0 -1
  111. package/preact/hooks/dist/hooks.umd.js +0 -2
  112. package/preact/hooks/dist/hooks.umd.js.map +0 -1
  113. package/preact/jsx-runtime/dist/jsxRuntime.js +0 -2
  114. package/preact/jsx-runtime/dist/jsxRuntime.js.map +0 -1
  115. package/preact/jsx-runtime/dist/jsxRuntime.module.js +0 -2
  116. package/preact/jsx-runtime/dist/jsxRuntime.module.js.map +0 -1
  117. package/preact/jsx-runtime/dist/jsxRuntime.umd.js +0 -2
  118. package/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +0 -1
  119. package/preact/src/cjs.js +0 -3
  120. package/preact/src/clone-element.js +0 -48
  121. package/preact/src/index-5.d.ts +0 -399
  122. package/preact/test-utils/dist/testUtils.js +0 -2
  123. package/preact/test-utils/dist/testUtils.js.map +0 -1
  124. package/preact/test-utils/dist/testUtils.module.js +0 -2
  125. package/preact/test-utils/dist/testUtils.module.js.map +0 -1
  126. package/preact/test-utils/dist/testUtils.umd.js +0 -2
  127. package/preact/test-utils/dist/testUtils.umd.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preact.mjs","sources":["../src/constants.js","../src/options.js","../src/create-element.js","../src/component.js","../src/diff/props.js","../src/create-context.js","../src/util.js","../src/diff/children.js","../src/diff/index.js","../src/render.js","../src/create-portal.js","../src/diff/catch-error.js"],"sourcesContent":["// Vnode._flags\n/** 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 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n/** Indicates that this vnode has been unmounted before indicating the loss of event listeners */\nexport const FORCE_PROPS_REVALIDATE = 1 << 0;\n/** The vnode's ref was detached while its subtree was parked by Suspense */\nexport const REF_DETACHED = 1 << 3;\n\n// component._bits\n/** Component is processing an exception */\nexport const COMPONENT_PROCESSING_EXCEPTION = 1 << 0;\n/** Component has a pending error */\nexport const COMPONENT_PENDING_ERROR = 1 << 1;\n/** Component should force update (skip shouldComponentUpdate) */\nexport const COMPONENT_FORCE = 1 << 2;\n/** Component is queued for update */\nexport const COMPONENT_DIRTY = 1 << 3;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\n\nexport const MATHML_TOKEN_ELEMENTS = /^m(i|n|o|s|text|space)$/;\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 {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { assign, slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').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 {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti,\n\t\tlength = arguments.length;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref' && typeof type != 'function') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (length > 2) {\n\t\tnormalizedProps.children = length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} children Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti,\n\t\tlength = arguments.length;\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref' && typeof vnode.type != 'function') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (length > 2) {\n\t\tnormalizedProps.children = length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey !== UNDEFINED ? key : vnode.key,\n\t\tref !== UNDEFINED ? ref : vnode.ref,\n\t\tNULL\n\t);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').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 {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').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 {import('./internal').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_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original || ++vnodeId,\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 && options.vnode) 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 {\n\tCOMPONENT_DIRTY,\n\tCOMPONENT_FORCE,\n\tMODE_HYDRATE,\n\tNULL,\n\tUNDEFINED\n} from './constants';\nimport { Fragment } from './create-element';\nimport { commitRoot, diff } from './diff/index';\nimport options from './options';\nimport { assign } from './util';\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\tthis._bits = 0;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').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 = this._nextState;\n\tif (!s || s == this.state) {\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} else {\n\t\treturn;\n\t}\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 {import('./internal').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._bits |= COMPONENT_FORCE;\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](https://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 {import('./internal').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 && sibling._dom) {\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). New roots (_parentDom) are a DOM boundary too.\n\treturn typeof vnode.type == 'function' && !vnode.props._parentDom\n\t\t? getDomSibling(vnode)\n\t\t: NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tconst oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tconst parentDom = component._parentDom;\n\tif (parentDom) {\n\t\tconst newVNode = assign({ constructor: UNDEFINED }, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom || getDomSibling(oldVNode),\n\t\t\toldVNode._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\t\toldVNode._parent = oldVNode._dom = NULL;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\t// Stop at root boundaries (_parentDom)\n\tif ((vnode = vnode._parent) && vnode._component && !vnode.props._parentDom) {\n\t\t// _dom starts nulled, so re-assigning a null child._dom is a no-op and\n\t\t// the first truthy _dom stops the walk.\n\t\tvnode._dom = NULL;\n\t\tvnode._children.some(child => child && (vnode._dom = child._dom));\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nconst 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\trerenderCount = 0;\n\nexport function resetRenderCount() {\n\trerenderCount = 0;\n}\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!(c._bits & COMPONENT_DIRTY) &&\n\t\t\t(c._bits |= COMPONENT_DIRTY) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || queueMicrotask)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').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\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\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// single pass\n\t\t\tif (rerenderQueue.length > l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\tif (c._bits & COMPONENT_DIRTY) {\n\t\t\t\trenderComponent(c);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\trerenderQueue.length = rerenderCount = 0;\n\t}\n}\n","import { NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\n// Per-instance unique key for the event clock stamp. Each Preact copy on the\n// page gets its own Symbol so that stamps on shared event objects can never\n// collide across instances.\nlet EVENT_DISPATCHED = Symbol();\n\nfunction setStyle(style, key, value) {\n\tif (value == NULL) value = '';\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value);\n\t} else {\n\t\tstyle[key] = value;\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\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 {import('../internal').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\t// Handlers are keyed by prop name and every prop name gets its own proxy,\n\t\t// so swapping one (e.g. an inline arrow function on every render) is a\n\t\t// single store. The event name is only derived to attach or remove it.\n\t\t(dom._listeners || (dom._listeners = {}))[name] = value;\n\n\t\tif (!value || !oldValue) {\n\t\t\tconst proxy =\n\t\t\t\teventProxies[name] || (eventProxies[name] = createEventProxy(name));\n\t\t\t// The attach time belongs to the listener, not to the handler: one\n\t\t\t// function can back several listeners that were attached at different\n\t\t\t// times. It lives outside `_listeners`, which unmount resets even when\n\t\t\t// a re-suspended Suspense boundary keeps the DOM and its listeners.\n\t\t\t(dom._attached || (dom._attached = {}))[name] = eventClock;\n\t\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\n\t\t\t// Infer correct casing for DOM built-in events: `onClick` -> `click`.\n\t\t\t// Only names starting with an uppercase letter are lowercased, so\n\t\t\t// camelCase custom events keep their casing: `onionChange` -> `ionChange`.\n\t\t\tname = name.slice(2);\n\t\t\tif (name[0] < 'a') name = name.toLowerCase();\n\n\t\t\tif (value) {\n\t\t\t\tdom.addEventListener(name, proxy, useCapture);\n\t\t\t} else {\n\t\t\t\tdom.removeEventListener(name, proxy, useCapture);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\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 {string} name The prop name the handler is stored under.\n * @private\n */\nfunction createEventProxy(name) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').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[name];\n\t\t\tif (e[EVENT_DISPATCHED] == NULL) {\n\t\t\t\te[EVENT_DISPATCHED] = eventClock++;\n\n\t\t\t\t// When `e[EVENT_DISPATCHED]` is smaller than the time when the targeted event\n\t\t\t\t// listener 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[EVENT_DISPATCHED] < this._attached[name]) {\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\n/** @type {Record<string, (e: Event) => any>} */\nconst eventProxies = {};\n","import { enqueueRender } from './component';\nimport { COMPONENT_FORCE } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._bits |= COMPONENT_FORCE;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\tContext.Provider = Context.Consumer.contextType = Context;\n\n\treturn Context;\n}\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\nexport const slice = EMPTY_ARR.slice;\nexport const assign = Object.assign;\n\n/**\n * Remove a child node from its parent if attached.\n * @param {import('./internal').PreactElement | null} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.remove();\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tREF_DETACHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\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 * @returns {PreactElement} The next sibling DOM element to insert new elements\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 != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`. Callers always pass at\n\t// least EMPTY_OBJ, so a null check isn't needed.\n\t/** @type {VNode[]} */\n\tlet oldChildren = oldParentVNode._children || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\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\t// ~_index guards the -1 case: a negative array index is a named property\n\t\t// access which V8 can't serve from the fast elements path.\n\t\toldVNode =\n\t\t\t(~childVNode._index && oldChildren[childVNode._index]) || EMPTY_OBJ;\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\tlet result = diff(\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\t// A ref detached while its subtree was parked by Suspense is attached\n\t\t// again on reveal.\n\t\tif (oldVNode.ref != childVNode.ref || oldVNode._flags & REF_DETACHED) {\n\t\t\tif (oldVNode.ref) applyRef(oldVNode.ref, NULL, childVNode, oldVNode);\n\t\t\tif (childVNode.ref) {\n\t\t\t\trefQueue.push(\n\t\t\t\t\tchildVNode.ref,\n\t\t\t\t\tchildVNode._component || newDom,\n\t\t\t\t\tchildVNode\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tfirstChildDom = firstChildDom || newDom;\n\n\t\tif (childVNode._flags & INSERT_VNODE) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, !oldVNode._original);\n\n\t\t\t// When a matched VNode is physically moved via INSERT_VNODE, its old\n\t\t\t// _dom pointer becomes a stale positional reference. Clear it so that\n\t\t\t// getDomSibling (called from nested diffs) won't return this stale\n\t\t\t// reference and mis-place subsequent DOM nodes. See #5065.\n\t\t\tif (oldVNode._dom) {\n\t\t\t\toldVNode._dom = NULL;\n\t\t\t}\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\t/** Whether any matched child was found far from its skewed index, i.e. a\n\t * real reorder happened and we need to compute the minimal set of moves. */\n\tlet moved = false;\n\n\t// Hoisted: every normalization branch below writes through this array, so\n\t// reading `_children` off the vnode each time is a wasted property load.\n\t/** @type {VNode[]} */\n\tlet newChildren = (newParentVNode._children = Array(newChildrenLength));\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\tnewChildren[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\t// Anything that isn't an object at this point is a string, number or\n\t\t// bigint (null, booleans and functions are handled above), String\n\t\t// objects are the lone object type rendered as text.\n\t\telse if (\n\t\t\ttypeof childVNode != 'object' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newChildren[i] = createVNode(NULL, childVNode);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newChildren[i] = createVNode(Fragment, {\n\t\t\t\tchildren: childVNode\n\t\t\t});\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth) {\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 = newChildren[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,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewChildren[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\t// ~matchingIndex is only falsy for -1, i.e. when no match was found\n\t\tif (~matchingIndex) {\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\tif (!oldVNode || !oldVNode._original) {\n\t\t\tif (!~matchingIndex) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\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 {\n\t\t\t// Matched children are candidates for the minimal-move pass below;\n\t\t\t// MATCHED on a _new_ vnode is cleared in diffChildren's placement loop.\n\t\t\tchildVNode._flags |= MATCHED;\n\n\t\t\t// The skew adjustments keep findMatchingIndex's search centered for\n\t\t\t// shift patterns (insertions/removals at the front). A match further\n\t\t\t// than one position away means children were genuinely reordered:\n\t\t\t// flag it so the minimal set of moves is computed below. Off-by-one\n\t\t\t// matches provably keep matched old indices in increasing order, so\n\t\t\t// no moves are needed for them.\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 if (matchingIndex != skewedIndex) {\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\tmoved = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (moved) {\n\t\t// Children were reordered: mark the minimal set of matched (MATCHED flag)\n\t\t// children for insertion by finding the longest increasing subsequence of\n\t\t// old indices (patience sorting). Children on the subsequence stay in\n\t\t// place, all others get INSERT_VNODE. `_index` still holds the\n\t\t// matchingIndex here.\n\t\t/** @type {number[]} tails[x] is the smallest old index ending an increasing subsequence of length x+1 */\n\t\tlet tails = [];\n\t\t/** @type {number[]} length of the longest increasing subsequence ending at child i */\n\t\tlet lisLengths = [];\n\t\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t\tchildVNode = newChildren[i];\n\t\t\tif (childVNode && childVNode._flags & MATCHED) {\n\t\t\t\t// Binary search for the insertion point, keeping the pass at\n\t\t\t\t// O(n log n) even for pathological reorders.\n\t\t\t\tlet lo = 0,\n\t\t\t\t\thi = tails.length;\n\t\t\t\twhile (lo < hi) {\n\t\t\t\t\tconst mid = (lo + hi) >> 1;\n\t\t\t\t\tif (tails[mid] < childVNode._index) {\n\t\t\t\t\t\tlo = mid + 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\thi = mid;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttails[lo] = childVNode._index;\n\t\t\t\tlisLengths[i] = lo + 1;\n\t\t\t}\n\t\t}\n\n\t\t// `skew` is dead after the main loop; reuse it as the remaining\n\t\t// subsequence length while walking backwards. Likewise `i` is left at\n\t\t// newChildrenLength by the loop above.\n\t\tskew = tails.length;\n\t\twhile (i--) {\n\t\t\tif (lisLengths[i]) {\n\t\t\t\tif (lisLengths[i] == skew) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tnewChildren[i]._flags |= INSERT_VNODE;\n\t\t\t\t}\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. Keep this a plain loop: an arrow function here would capture\n\t// `oldDom`, forcing V8 to context-allocate it on every call to this function.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode && !(oldVNode._flags & MATCHED)) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = 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\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} isMounting\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, isMounting) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\tif (typeof parentVNode.type == 'function') {\n\t\t// Root children live in another container, they never move with the\n\t\t// host tree and contribute nothing to the host insertion cursor.\n\t\tif (parentVNode.props._parentDom) return oldDom;\n\t\tlet children = parentVNode._children;\n\t\tif (children) {\n\t\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\t\tif (children[i]) {\n\t\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t\t// here).\n\t\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\t\toldDom = insert(children[i], oldDom, parentDom, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else {\n\t\t// A cursor a parked Suspense subtree detached can't be a reference node:\n\t\t// retry from the vnode tree, then give up and append.\n\t\tif (oldDom && !oldDom.parentNode) {\n\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\tif (oldDom && !oldDom.parentNode) oldDom = NULL;\n\t\t}\n\n\t\t// Comments (e.g. server `$s` markers) are never ours: a node right after\n\t\t// them is already in place.\n\t\tlet next = oldDom;\n\t\twhile (next && next.nodeType == 8) next = next.nextSibling;\n\n\t\tif (parentVNode._dom != next) {\n\t\t\t// Containers that aren't DOM nodes may not implement moveBefore()\n\t\t\tif (!isMounting && parentDom.moveBefore && parentVNode._dom.parentNode) {\n\t\t\t\t// @ts-expect-error This isn't added to TypeScript lib.d.ts yet\n\t\t\t\tparentDom.moveBefore(parentVNode._dom, oldDom);\n\t\t\t} else {\n\t\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t\t}\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\twhile ((oldDom = oldDom && oldDom.nextSibling) && 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\tif (isArray(children)) {\n\t\t\tchildren.some(child => {\n\t\t\t\ttoChildArray(child, out);\n\t\t\t});\n\t\t} else {\n\t\t\tout.push(children);\n\t\t}\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 oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode && !(oldVNode._flags & MATCHED);\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\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\t// The ternary keeps this a Smi comparison; `> matched` would compare\n\t\t// number to boolean which V8 can't serve from the fast path.\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == NULL) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode &&\n\t\t\t\t!(oldVNode._flags & MATCHED) &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import { BaseComponent, getDomSibling } from '../component';\nimport {\n\tCOMPONENT_DIRTY,\n\tCOMPONENT_FORCE,\n\tCOMPONENT_PENDING_ERROR,\n\tCOMPONENT_PROCESSING_EXCEPTION,\n\tEMPTY_ARR,\n\tEMPTY_OBJ,\n\tFORCE_PROPS_REVALIDATE,\n\tMATHML_TOKEN_ELEMENTS,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { Fragment } from '../create-element';\nimport options from '../options';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\n\n/**\n * @typedef {import('../internal').ComponentType} ComponentType\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref<T>} Ref<T>\n */\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\tresumed,\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 into the DOM\n\t// that was kept while suspended (server-rendered, or already in the\n\t// container we rendered into). `tmp` holds the stored excess node until the\n\t// options._diff call below.\n\tif (\n\t\toldVNode._flags & MODE_SUSPENDED &&\n\t\t// @ts-expect-error This is MODE_HYDRATE or 0\n\t\t((isHydrating = oldVNode._flags & MODE_HYDRATE),\n\t\t(tmp = oldVNode._component._excess))\n\t) {\n\t\tnewVNode._flags |= isHydrating;\n\t\tresumed = excessDomChildren = [];\n\t\tif (tmp.nodeType == 8) {\n\t\t\t// Re-scan DOM from stored start marker for streamed hydration.\n\t\t\t// `depth` only ever reaches 0 through the `break` below, so it\n\t\t\t// doesn't need to be re-tested in the loop condition.\n\t\t\tfor (\n\t\t\t\tlet depth = 1, node = tmp.nextSibling;\n\t\t\t\tnode;\n\t\t\t\tnode = node.nextSibling\n\t\t\t) {\n\t\t\t\tif (node.nodeType == 8) {\n\t\t\t\t\tif (node.data.startsWith('$s')) depth++;\n\t\t\t\t\telse if (node.data.startsWith('/$s') && !--depth) break;\n\t\t\t\t}\n\t\t\t\texcessDomChildren.push(node);\n\t\t\t}\n\t\t} else {\n\t\t\texcessDomChildren.push(tmp);\n\t\t}\n\t\toldDom = excessDomChildren[0];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\tlet oldCommitQueueLength = commitQueue.length;\n\t\ttry {\n\t\t\tlet c,\n\t\t\t\toldProps,\n\t\t\t\toldState,\n\t\t\t\tsnapshot,\n\t\t\t\tnewProps = newVNode.props;\n\t\t\tconst isClassComponent = (tmp = newType.prototype) && tmp.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\tconst provider = tmp && globalContext[tmp._id];\n\t\t\tconst 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\tif (c._bits & COMPONENT_PENDING_ERROR) {\n\t\t\t\t\tc._bits |= COMPONENT_PROCESSING_EXCEPTION;\n\t\t\t\t}\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 Trust me, Component implements the interface we want\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\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\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tc._bits |= COMPONENT_DIRTY;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\tif (isClassComponent) {\n\t\t\t\tif (!c._nextState) c._nextState = c.state;\n\n\t\t\t\t// Invoke getDerivedStateFromProps\n\t\t\t\tif (newType.getDerivedStateFromProps) {\n\t\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t\t}\n\n\t\t\t\t\tassign(\n\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t\t);\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 (!oldVNode._component) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\t!newType.getDerivedStateFromProps &&\n\t\t\t\t\tc.componentWillMount\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) {\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\t!newType.getDerivedStateFromProps &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps\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(newVNode._original == oldVNode._original &&\n\t\t\t\t\t\t!(c._bits & COMPONENT_DIRTY)) ||\n\t\t\t\t\t(!(c._bits & COMPONENT_FORCE) &&\n\t\t\t\t\t\tc.shouldComponentUpdate &&\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) {\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._bits &= ~COMPONENT_DIRTY;\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\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\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\t// Skip over the retained subtree without traversing it; the\n\t\t\t\t\t// `result` branch in diffChildren picks this up as the next\n\t\t\t\t\t// oldDom.\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate) {\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) {\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._bits &= ~COMPONENT_FORCE;\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._bits &= ~COMPONENT_DIRTY;\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\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._bits &= ~COMPONENT_DIRTY;\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._bits & COMPONENT_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) {\n\t\t\t\tglobalContext = assign({}, globalContext, c.getChildContext());\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tisClassComponent &&\n\t\t\t\toldVNode._component &&\n\t\t\t\tc.getSnapshotBeforeUpdate\n\t\t\t) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tconst renderResult =\n\t\t\t\ttmp && tmp.type === Fragment && tmp.key == NULL\n\t\t\t\t\t? tmp.props.children\n\t\t\t\t\t: tmp;\n\n\t\t\t// A vnode carrying a `_parentDom` prop, considered a new root,\n\t\t\t// continues rendering into that container. The subtree must stay\n\t\t\t// invisible to the host tree's DOM bookkeeping: the portal vnode\n\t\t\t// keeps a `null` `_dom` and the host insertion cursor (`oldDom`)\n\t\t\t// passes through unchanged.\n\t\t\t// `tmp` (the raw render result, already unwrapped into renderResult)\n\t\t\t// doubles as the saved host insertion cursor while we render into\n\t\t\t// the portal's container.\n\t\t\tif (newProps._parentDom) {\n\t\t\t\ttmp = oldDom;\n\t\t\t\tparentDom = newProps._parentDom;\n\t\t\t\t// If we portal into a math or svg element we need\n\t\t\t\t// to swap the namespace (chart libraries often do this).\n\t\t\t\t// The document follows the container too (e.g. iframes) as\n\t\t\t\t// diffElementNodes derives it from its parentDom.\n\t\t\t\tnamespace = parentDom.namespaceURI;\n\t\t\t\t// Portals are never server-rendered: hydration must not claim the\n\t\t\t\t// host parent's excess nodes for the container's children.\n\t\t\t\tisHydrating = excessDomChildren = NULL;\n\n\t\t\t\t// Changing the container remounts the children into the new one\n\t\t\t\tif (oldVNode.props && oldVNode.props._parentDom != parentDom) {\n\t\t\t\t\t/** @type {VNode[]} */ (oldVNode._children).some(child => {\n\t\t\t\t\t\tif (child) unmount(child, child);\n\t\t\t\t\t});\n\t\t\t\t\toldVNode._children = NULL;\n\t\t\t\t}\n\n\t\t\t\toldDom = oldVNode._children ? getDomSibling(oldVNode, 0) : NULL;\n\t\t\t}\n\n\t\t\toldDom = diffChildren(\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\t// When we exit a portal we\n\t\t\t// change up the oldDom\n\t\t\tif (newProps._parentDom) {\n\t\t\t\tnewVNode._dom = NULL;\n\t\t\t\toldDom = tmp;\n\t\t\t}\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\t\t\tif (oldVNode._flags & MODE_SUSPENDED) c._excess = NULL;\n\n\t\t\t// Remove the kept DOM this resumed render didn't claim\n\t\t\tif (resumed) resumed.some(removeNode);\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\t// Only clear when this render was the retry; PENDING_ERROR set by a\n\t\t\t// descendant during this render must survive until then.\n\t\t\tif (c._bits & COMPONENT_PROCESSING_EXCEPTION) {\n\t\t\t\tc._bits &= ~(COMPONENT_PROCESSING_EXCEPTION | COMPONENT_PENDING_ERROR);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// We remove any componentDidMount, ...\n\t\t\t// that have been invalidated by us\n\t\t\t// intercepting the error.\n\t\t\tcommitQueue.length = oldCommitQueueLength;\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) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tlet commentMarkersToFind = 0,\n\t\t\t\t\t\tstartMarker;\n\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\tif (excessDomChildren) {\n\t\t\t\t\t\tlet i = excessDomChildren.indexOf(oldDom || UNDEFINED),\n\t\t\t\t\t\t\tchild;\n\t\t\t\t\t\tif (!~i) i = excessDomChildren.length;\n\n\t\t\t\t\t\t// The cursor skips comments: step back to this component's markers.\n\t\t\t\t\t\twhile ((child = excessDomChildren[i - 1]) && child.nodeType == 8) {\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (; i < excessDomChildren.length; i++) {\n\t\t\t\t\t\t\tchild = excessDomChildren[i];\n\t\t\t\t\t\t\tif (!child) continue;\n\t\t\t\t\t\t\texcessDomChildren[i] = NULL;\n\n\t\t\t\t\t\t\tif (child.nodeType == 8) {\n\t\t\t\t\t\t\t\tif (child.data.startsWith('$s')) {\n\t\t\t\t\t\t\t\t\tif (!commentMarkersToFind++) startMarker = child;\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\tcommentMarkersToFind &&\n\t\t\t\t\t\t\t\t\tchild.data.startsWith('/$s') &&\n\t\t\t\t\t\t\t\t\t!--commentMarkersToFind\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\toldDom = child;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (!commentMarkersToFind) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!startMarker) {\n\t\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstartMarker = oldDom;\n\t\t\t\t\t}\n\t\t\t\t\t// Store the start marker directly; children re-scanned on resume.\n\t\t\t\t\t// A re-suspension keeps the marker it originally started from.\n\t\t\t\t\tif (!newVNode._component._excess) {\n\t\t\t\t\t\tnewVNode._component._excess = startMarker;\n\t\t\t\t\t}\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else if (excessDomChildren) {\n\t\t\t\t\texcessDomChildren.some(removeNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t}\n\n\t\t\tif (!newVNode._children) {\n\t\t\t\tnewVNode._children = oldVNode._children || [];\n\t\t\t}\n\n\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else {\n\t\toldDom = newVNode._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\tparentDom\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? UNDEFINED : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component) vnode._component._bits |= COMPONENT_FORCE;\n\t\tif (vnode._children) vnode._children.some(markAsForce);\n\t}\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\tfor (let i = 0; i < refQueue.length; ) {\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 * @param {PreactElement} parentDom The parent this element will be inserted\n * into; new nodes are created from its ownerDocument (e.g. iframes), or from\n * the global document for containers that don't have one\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\tparentDom\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tconst newProps = newVNode.props;\n\tconst 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 = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren) {\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\t// `localName` is only present on elements, so it doubles as the\n\t\t\t// element check for the non-text branch.\n\t\t\tif (\n\t\t\t\tvalue &&\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) {\n\t\tconst doc = parentDom.ownerDocument || document;\n\t\tif (!nodeType) {\n\t\t\treturn doc.createTextNode(newProps);\n\t\t}\n\n\t\tdom = doc.createElementNS(namespace, nodeType, newProps.is && newProps);\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) {\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// A <template> holds its children in a separate document-fragment, both\n\t\t// when reading existing DOM and when inserting new nodes. `parentDom` is\n\t\t// unused from here on, so we reuse it as the container for our children.\n\t\t// @ts-expect-error\n\t\tparentDom = nodeType == 'template' ? dom.content : dom;\n\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren =\n\t\t\tnodeType == 'textarea' && newProps.defaultValue != NULL\n\t\t\t\t? NULL\n\t\t\t\t: excessDomChildren && slice.call(parentDom.childNodes);\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) {\n\t\t\t// Keep this a plain loop: an arrow function here would capture\n\t\t\t// `oldProps`, forcing V8 to context-allocate it and slowing down the\n\t\t\t// hot `for (i in oldProps)` loop below for every element we diff.\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 == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (\n\t\t\t\ti != 'children' &&\n\t\t\t\t!(i in newProps) &&\n\t\t\t\t!(i == 'value' && 'defaultValue' in newProps) &&\n\t\t\t\t!(i == 'checked' && 'defaultChecked' in newProps)\n\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\tconst shouldRevalidateProps = oldVNode._flags & FORCE_PROPS_REVALIDATE;\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\t(oldProps[i] !== value || (shouldRevalidateProps && value != NULL))\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 && newHtml.__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.textContent = '';\n\n\t\t\tif (\n\t\t\t\tnodeType == 'foreignObject' ||\n\t\t\t\t(namespace == MATH_NAMESPACE && MATHML_TOKEN_ELEMENTS.test(nodeType))\n\t\t\t) {\n\t\t\t\tnamespace = XHTML_NAMESPACE;\n\t\t\t}\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\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\tnamespace,\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) excessDomChildren.some(removeNode);\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating || nodeType == 'textarea') {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute(i);\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] || (nodeType == 'progress' && !inputValue))\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>} ref\n * @param {any} value The element or component to attach, or `null` to detach\n * @param {VNode} vnode\n * @param {any} [owner] The vnode the ref is detached from\n */\nexport function applyRef(ref, value, vnode, owner) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\t// Store the cleanup on the element or component rather than on the\n\t\t\t// ref function, which can be shared between several of them. The\n\t\t\t// slot is cleared on detach, so detaching twice is a no-op.\n\t\t\tif (value) value._refCleanup = ref(value) || 1;\n\t\t\telse if (\n\t\t\t\towner &&\n\t\t\t\t(owner = owner._component || owner._dom) &&\n\t\t\t\t(value = owner._refCleanup)\n\t\t\t) {\n\t\t\t\towner._refCleanup = NULL;\n\t\t\t\tif (typeof value == 'function') value();\n\t\t\t\telse ref(NULL);\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) && (!r.current || r.current == vnode._dom)) {\n\t\tapplyRef(r, NULL, parentVNode, vnode);\n\t}\n\n\tif ((r = vnode._component)) {\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._parentDom = r._globalContext = 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\t// A portal's children live in another container, so a removed\n\t\t\t\t\t// host ancestor doesn't detach them; always remove them.\n\t\t\t\t\ttypeof vnode.type == 'function'\n\t\t\t\t\t\t? skipRemove && !vnode.props._parentDom\n\t\t\t\t\t\t: true\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ((r = vnode._dom)) {\n\t\tif (!skipRemove) removeNode(r);\n\t\tif (r._listeners) r._listeners = NULL;\n\t}\n\n\tvnode._dom = vnode._component = vnode._parent = NULL;\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, MODE_HYDRATE, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createVNode, 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 {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n */\nexport function render(vnode, parentDom) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// https://github.com/preactjs/preact/issues/3794\n\t// https://github.com/preactjs/preact/issues/5118\n\tif (parentDom.nodeType == 9) {\n\t\tparentDom = parentDom.documentElement;\n\t}\n\n\t// @ts-expect-error\n\tlet isHydrating = vnode && vnode._flags & MODE_HYDRATE;\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 ? NULL : parentDom._children;\n\n\tparentDom._children = createVNode(Fragment, { children: [vnode] });\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\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\tparentDom._children,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\toldVNode\n\t\t\t? NULL\n\t\t\t: parentDom.firstChild\n\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\toldVNode ? oldVNode._dom : parentDom.firstChild,\n\t\t// @ts-expect-error we are doing a bit-wise operation so it's either 0 or true\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, parentDom._children, refQueue);\n\n\t// The live children are tracked on _children after diffing.\n\tparentDom._children.props.children = NULL;\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\t// Only objects can carry the flag. Primitives (null, strings, numbers,\n\t// booleans) render into the existing DOM the same way hydrating would.\n\tif (vnode && typeof vnode == 'object') {\n\t\t// @ts-expect-error\n\t\tvnode._flags |= MODE_HYDRATE;\n\t}\n\trender(vnode, parentDom);\n}\n","import { createVNode } from './create-element';\n\n/**\n * Portal component. A unique type is used instead of Fragment so that a\n * portal returned directly from a component isn't collapsed into the\n * component's children array by the Fragment unwrapping in `diff()`.\n * @param {object} props\n */\nfunction Portal(props) {\n\treturn props.children;\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').ComponentChildren} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to\n */\nexport function createPortal(vnode, container) {\n\treturn createVNode(Portal, { _parentDom: container, children: vnode });\n}\n","import { resetRenderCount } from '../component';\nimport {\n\tCOMPONENT_DIRTY,\n\tCOMPONENT_PENDING_ERROR,\n\tCOMPONENT_PROCESSING_EXCEPTION,\n\tCOMPONENT_FORCE\n} from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').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 {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {number} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif (\n\t\t\t(component = vnode._component) &&\n\t\t\t!(component._bits & COMPONENT_PROCESSING_EXCEPTION)\n\t\t) {\n\t\t\tcomponent._bits |= COMPONENT_FORCE;\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._bits & COMPONENT_DIRTY;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._bits & 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\tcomponent._bits |= COMPONENT_PENDING_ERROR;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t\t// This component failed to handle the error, so what its\n\t\t\t\t// getDerivedStateFromError did must not make the next ancestor a\n\t\t\t\t// boundary.\n\t\t\t\thandled = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Reset rerender count to 0, so that the next render will not be skipped\n\t// when we leverage prefresh\n\tresetRenderCount();\n\tthrow error;\n}\n"],"names":["options","vnodeId","isValidElement","rerenderQueue","prevDebounce","rerenderCount","depthSort","EVENT_DISPATCHED","CAPTURE_REGEX","eventClock","eventProxies","i","EMPTY_OBJ","EMPTY_ARR","MATHML_TOKEN_ELEMENTS","isArray","Array","slice","assign","Object","removeNode","node","parentNode","remove","createElement","type","props","children","key","ref","normalizedProps","length","arguments","call","createVNode","cloneElement","vnode","undefined","original","__k","__","__b","__e","__c","constructor","__v","__i","__u","createRef","current","Fragment","BaseComponent","context","this","__g","getDomSibling","childIndex","sibling","__P","updateParentDomPointers","some","child","enqueueRender","c","push","debounceRendering","queueMicrotask","process","l","component","newVNode","oldVNode","oldDom","commitQueue","refQueue","parentDom","sort","shift","diff","__n","namespaceURI","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","result","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","tails","lisLengths","lo","hi","mid","oldChildrenLength","remainingOldChildren","skew","moved","newChildren","String","findMatchingIndex","unmount","parentVNode","isMounting","next","nodeType","moveBefore","insertBefore","toChildArray","out","x","y","matched","setStyle","style","value","setProperty","dom","name","oldValue","useCapture","proxy","o","cssText","createEventProxy","__a","replace","toLowerCase","addEventListener","removeEventListener","e","removeAttribute","setAttribute","eventHandler","event","tmp","resumed","depth","oldCommitQueueLength","oldProps","oldState","snapshot","newProps","isClassComponent","provider","componentContext","renderHook","count","commentMarkersToFind","startMarker","newType","__z","data","startsWith","outer","prototype","render","contextType","doRender","sub","state","__h","__s","getDerivedStateFromProps","componentWillReceiveProps","shouldComponentUpdate","apply","componentWillUpdate","componentDidUpdate","componentWillMount","componentDidMount","__r","getChildContext","getSnapshotBeforeUpdate","then","MODE_HYDRATE","indexOf","markAsForce","diffElementNodes","diffed","root","cb","newHtml","oldHtml","inputValue","checked","doc","shouldRevalidateProps","localName","ownerDocument","document","createTextNode","createElementNS","is","__m","content","defaultValue","childNodes","attributes","__html","innerHTML","textContent","test","owner","__x","skipRemove","r","componentWillUnmount","documentElement","firstChild","hydrate","createContext","Context","subs","ctx","Set","_props","forEach","add","old","delete","Provider","Consumer","contextValue","Portal","createPortal","container","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","update","callback","s","forceUpdate","a","b","Symbol"],"mappings":"AAEO,ICSDA,ECPFC,EAoHSC,EC+DPC,EAWFC,EACHC,EA2BKC,ECxNFC,EAWEC,EAaFC,EA8IEC,ECzKKC,EL8BEC,EAAgC,CAAA,EAChCC,EAAY,GAEZC,EAAwB,0BMlCxBC,EAAUC,MAAMD,QAChBE,EAAQJ,EAAUI,MAClBC,EAASC,OAAOD,OAMtB,SAASE,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DyB,EGqDzBkM,GAAUnM,KAAIyH,IAAkB9G,KAAKwL,GACzC1L,EAAcT,MAEhB,EAYAF,EAAcqH,UAAUC,OAASvH,EA+F3B/C,EAAgB,GAYrBE,EAAgB,EA2BXC,EAAY,SAACqP,EAAGC,GAAC,OAAKD,EAAC9M,IAAAJ,IAAiBmN,EAAC/M,IAAAJ,GAAc,ECxNzDlC,EAAmBsP,SAWjBrP,EAAgB,8BAalBC,EAAa,EA8IXC,EAAe,CAAA,ECzKVC,EAAI"}
@@ -1,2 +1,2 @@
1
- import{options as n}from"../..";var t,r,u,i,o=0,f=[],c=n,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,p=c.__;function s(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,y(D,n)}function y(n,u,i){var o=s(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=!1,i=o.__c.props!==n;if(o.__c.__H.__.some(function(n){if(n.__N){u=!0;var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c){var f=c.call(this,n,t,r);return u?f||i:f}return!u||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function h(n,u){var i=s(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=s(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return o=5,T(function(){return{current:n}},[])}function F(n,t,r){o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=s(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=s(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)}function b(n){var u=s(t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=s(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=f.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(z),t.__h.some(B),t.__h=[]}catch(r){t.__h=[],c.__e(r,n.__v)}}}c.__b=function(n){r=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t)},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.some(z),i.__h.some(B),i.__h=[],t=0)),u=r},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),u=r=null},c.__c=function(n,t){t.some(function(n){try{n.__h.some(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),l&&l(n,t)},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t}export{q as useCallback,x as useContext,P as useDebugValue,h as useEffect,b as useErrorBoundary,g as useId,F as useImperativeHandle,_ as useLayoutEffect,T as useMemo,y as useReducer,A as useRef,d as useState};
2
- //# sourceMappingURL=hooks.module.js.map
1
+ import{options as n}from"../..";var t,r,u,i,o=Object.is,f=0,c=[],e=[],a=n,v=a.__b,l=a.__r,m=a.diffed,s=a.__c,h=a.unmount,p=a.__;function y(n,t){a.__h&&a.__h(r,n,f||t),f=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return f=1,_(G,n)}function _(n,u,i){var f=y(t++,2);if(f.t=n,!f.__c&&(f.__=[i?i(u):G(void 0,u),function(n){var t=f.__N?f.__N[0]:f.__[0],r=f.t(t,n);o(t,r)||(f.__N=[r,f.__[1]],f.__c.setState({}))}],f.__c=r,!r.__f)){r.__f=!0;var c=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){var u=this.__H;if(!u)return!0;var i=!1,f=this.props!=n;if(u.__.some(function(n){n.__N&&(i=!0,o(n.__[0],n.__N[0])||(f=!0))}),c){var e=c.call(this,n,t,r);return i?e||f:e}return!i||f}}return f.__}function A(n,u){var i=y(t++,3);!a.__s&&E(i.__H,u)&&(i.__P=!0,i.__=n,i.u=u,r.__H.__h.push(i))}function F(n,u){var i=y(t++,4);!a.__s&&E(i.__H,u)&&(i.__P=!1,i.__=n,i.u=u,r.__h.push(i))}function T(n){return f=5,b(function(){return{current:n}},[])}function q(n,t,r){f=6,F(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function b(n,r){var u=y(t++,7);return E(u.__H,r)&&(u.__=n(),u.__H=r),u.__}function j(n,t){return f=8,b(function(){return n},t)}function w(n){var u=r.context[n.__c],i=y(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function x(n,t){a.useDebugValue&&a.useDebugValue(t?t(n):n)}function O(n){var u=y(t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function P(){var n=y(t++,11);if(!n.__){for(var u=r.__v;!u.__m&&u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function g(){var n;do{for(;n=e.shift();)try{C(n)}catch(t){a.__e(t,{__:(n=n.__P)&&n.__v})}for(;n=c.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(C),t.__h.some(D),t.__h=[]}catch(r){t.__h=[],a.__e(r,n.__v)}}}while(e.length)}a.__b=function(n){r=null,v&&v(n)},a.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t)},a.__r=function(n){l&&l(n),t=0;var i=(r=n.__c).__H;i&&(u==r?r.__h=[]:(i.__h.some(C),i.__h.some(D),t=0),i.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})),u=r},a.diffed=function(n){m&&m(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&B(c.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u)})),u=r=null},a.__c=function(n,t){t.some(function(n){try{n.__h.some(C),n.__h=n.__h.filter(function(n){return!n.__||D(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],a.__e(r,n.__v)}}),s&&s(n,t)},a.unmount=function(n){h&&h(n);var t,r,u=n.__c;u&&u.__H&&(u.__H.__.some(function(u){try{if(u.__P&&u.__c){if(void 0===r){for(r=n.__;r&&(!r.__c||!r.__c.__P);)r=r.__;r=r&&r.__c}u.__P=r,B(e.push(u))}else C(u)}catch(n){t=n}}),u.__H=void 0,t&&a.__e(t,u.__v))};var k="function"==typeof requestAnimationFrame;function z(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function B(n){1!=n&&i==a.requestAnimationFrame||((i=a.requestAnimationFrame)||z)(g)}function C(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function D(n){var t=r;n.__c=n.__(),r=t}function E(n,t){return!n||n.length!=t.length||t.some(function(t,r){return!o(t,n[r])})}function G(n,t){return"function"==typeof t?t(n):t}export{j as useCallback,w as useContext,x as useDebugValue,A as useEffect,O as useErrorBoundary,P as useId,q as useImperativeHandle,F as useLayoutEffect,b as useMemo,_ as useReducer,T as useRef,d as useState};
2
+ //# sourceMappingURL=hooks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.mjs","sources":["../src/index.js"],"sourcesContent":["import { options as _options } from 'preact';\n\nconst ObjectIs = Object.is;\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/**\n * Passive (useEffect) hook states of unmounted components whose cleanup is\n * still pending. Deferred to the after-paint flush to match React, which runs\n * passive destroys after the commit has painted. Each state's `_passive` holds\n * the surviving component its errors should be routed to.\n * @type {Array<import('./internal').EffectHookState>}\n */\nlet unmountCleanups = [];\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\n// We take the minimum timeout for requestAnimationFrame to ensure that\n// the callback is invoked after the next frame. 35ms is based on a 30hz\n// refresh rate, which is the minimum rate for a smooth user experience.\nconst RAF_TIMEOUT = 35;\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\tcurrentComponent._renderCallbacks = [];\n\t\t} else {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t\thooks._pendingEffects = [];\n\n\t\t// Runs before every render, forced or not, so `shouldComponentUpdate`\n\t\t// never has to apply these itself.\n\t\thooks._list.some(hookItem => {\n\t\t\tif (hookItem._nextValue) {\n\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t}\n\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\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\t// `_pendingArgs` is cleared again by `options._render` before anything\n\t\t// can read it, so committing it here is enough.\n\t\tc.__hooks._list.some(hookItem => {\n\t\t\tif (hookItem._pendingArgs) hookItem._args = hookItem._pendingArgs;\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.some(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, errorParent;\n\t\tc.__hooks._list.some(s => {\n\t\t\ttry {\n\t\t\t\t// Layout cleanups have to run before the new DOM is in place, so\n\t\t\t\t// they stay in the commit phase (see #1886). Passive cleanups run\n\t\t\t\t// after paint, before any new passive effect (see #4299), with\n\t\t\t\t// `_passive` repurposed to hold the error-routing component.\n\t\t\t\tif (s._passive && s._cleanup) {\n\t\t\t\t\tif (errorParent === undefined) {\n\t\t\t\t\t\terrorParent = vnode._parent;\n\t\t\t\t\t\twhile (\n\t\t\t\t\t\t\terrorParent &&\n\t\t\t\t\t\t\t!(errorParent._component && errorParent._component._parentDom)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\terrorParent = errorParent._parent;\n\t\t\t\t\t\t}\n\t\t\t\t\t\terrorParent = errorParent && errorParent._component;\n\t\t\t\t\t}\n\t\t\t\t\ts._passive = errorParent;\n\t\t\t\t\tafterPaint(unmountCleanups.push(s));\n\t\t\t\t} else {\n\t\t\t\t\tinvokeCleanup(s);\n\t\t\t\t}\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 type 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 (!ObjectIs(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\tconst prevScu = currentComponent.shouldComponentUpdate;\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks. We store the next value in `_nextValue[0]` and\n\t\t\t// keep doing that for all state setters; if we have next states and\n\t\t\t// all next states within a component end up being equal to their\n\t\t\t// original state we are safe to bail out for this specific component.\n\t\t\tcurrentComponent.shouldComponentUpdate = function (p, s, c) {\n\t\t\t\tconst hooks = this.__hooks;\n\t\t\t\tif (!hooks) return true;\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 updatedHook = false;\n\t\t\t\tlet shouldUpdate = this.props != p;\n\t\t\t\thooks._list.some(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tupdatedHook = true;\n\t\t\t\t\t\tif (!ObjectIs(hookItem._value[0], hookItem._nextValue[0])) {\n\t\t\t\t\t\t\tshouldUpdate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (prevScu) {\n\t\t\t\t\tconst result = prevScu.call(this, p, s, c);\n\t\t\t\t\treturn updatedHook ? result || shouldUpdate : result;\n\t\t\t\t}\n\n\t\t\t\treturn !updatedHook || shouldUpdate;\n\t\t\t};\n\t\t}\n\t}\n\n\treturn 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._passive = true;\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._passive = false;\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\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\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}\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').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (!root._mask && root._parent) {\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\t// The loop picks up components unmounted by an effect we just invoked, which\n\t// don't necessarily schedule a flush of their own.\n\tdo {\n\t\t// Unmounted components' passive cleanups run before any new passive\n\t\t// effect, mirroring React running all destroys before any create.\n\t\twhile ((component = unmountCleanups.shift())) {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(component);\n\t\t\t} catch (e) {\n\t\t\t\tcomponent = /** @type {any} */ (component._passive);\n\t\t\t\toptions._catchError(e, { _parent: component && component._vnode });\n\t\t\t}\n\t\t}\n\n\t\twhile ((component = afterPaintEffects.shift())) {\n\t\t\tconst hooks = component.__hooks;\n\t\t\tif (!component._parentDom || !hooks) continue;\n\t\t\ttry {\n\t\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\t\thooks._pendingEffects = [];\n\t\t\t} catch (e) {\n\t\t\t\thooks._pendingEffects = [];\n\t\t\t\toptions._catchError(e, component._vnode);\n\t\t\t}\n\t\t}\n\t} while (unmountCleanups.length);\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) => !ObjectIs(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"],"names":["currentIndex","currentComponent","previousComponent","prevRaf","ObjectIs","Object","is","currentHook","afterPaintEffects","unmountCleanups","options","_options","oldBeforeDiff","__b","oldBeforeRender","__r","oldAfterDiff","diffed","oldCommit","__c","oldBeforeUnmount","unmount","oldRoot","__","getHookState","index","type","__h","hooks","__H","length","push","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","undefined","action","currentValue","__N","nextValue","setState","__f","prevScu","shouldComponentUpdate","p","s","c","this","updatedHook","shouldUpdate","props","some","hookItem","result","call","useEffect","callback","args","state","__s","argsChanged","__P","_pendingArgs","useLayoutEffect","useRef","initialValue","useMemo","current","useImperativeHandle","ref","createHandle","concat","factory","useCallback","useContext","context","provider","sub","value","useDebugValue","formatter","useErrorBoundary","cb","errState","componentDidCatch","err","errorInfo","useId","root","__v","__m","mask","flushAfterPaintEffects","component","shift","invokeCleanup","e","__e","invokeEffect","vnode","parentDom","__k","afterPaint","commitQueue","filter","hasErrored","errorParent","HAS_RAF","requestAnimationFrame","afterNextFrame","raf","done","clearTimeout","timeout","cancelAnimationFrame","setTimeout","newQueueLength","hook","comp","cleanup","oldArgs","newArgs","arg","f"],"mappings":"iCAEA,IAGIA,EAGAC,EAGAC,EA+BAC,EAxCEC,EAAWC,OAAOC,GAYpBC,EAAc,EAGdC,EAAoB,GASpBC,EAAkB,GAGhBC,EAAuDC,EAEzDC,EAAgBF,EAAOG,IACvBC,EAAkBJ,EAAOK,IACzBC,EAAeN,EAAQO,OACvBC,EAAYR,EAAOS,IACnBC,EAAmBV,EAAQW,QAC3BC,EAAUZ,EAAOa,GAqIrB,SAASC,EAAaC,EAAOC,GACxBhB,EAAOiB,KACVjB,EAAOiB,IAAO1B,EAAkBwB,EAAOlB,GAAemB,GA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F,EAAIvG,SAAYqB,EAChBoF,KAGD3H,EAAmB0H,CACpB,CAOA,SAASpB,EAAamB,GAGrB,IAAMC,EAAO1H,EACbyH,EAAIvG,IAAYuG,EAAInG,KACpBtB,EAAmB0H,CACpB,CAOA,SAAS1D,EAAY4D,EAASC,GAC7B,OACED,GACDA,EAAQ/F,QAAUgG,EAAQhG,QAC1BgG,EAAQtE,KAAK,SAACuE,EAAKtG,GAAK,OAAMrB,EAAS2H,EAAKF,EAAQpG,GAAO,EAE7D,CAQA,SAASU,EAAe4F,EAAKC,GAC5B,MAAmB,mBAALA,EAAkBA,EAAED,GAAOC,CAC1C"}
@@ -1,35 +1,16 @@
1
1
  {
2
2
  "name": "preact-hooks",
3
- "amdName": "preactHooks",
4
- "version": "0.1.0",
5
3
  "private": true,
6
4
  "description": "Hook addon for Preact",
7
- "main": "dist/hooks.js",
8
- "module": "dist/hooks.module.js",
9
- "umd:main": "dist/hooks.umd.js",
5
+ "main": "dist/hooks.mjs",
6
+ "module": "dist/hooks.mjs",
10
7
  "source": "src/index.js",
11
- "license": "MIT",
12
8
  "types": "src/index.d.ts",
13
- "scripts": {
14
- "build": "microbundle build --raw",
15
- "dev": "microbundle watch --raw --format cjs",
16
- "test": "npm-run-all build --parallel test:karma",
17
- "test:karma": "karma start test/karma.conf.js --single-run",
18
- "test:karma:watch": "karma start test/karma.conf.js --no-single-run"
19
- },
20
- "peerDependencies": {
21
- "preact": "^10.0.0"
22
- },
9
+ "license": "MIT",
23
10
  "mangle": {
24
11
  "regex": "^_"
25
12
  },
26
- "exports": {
27
- ".": {
28
- "types": "./src/index.d.ts",
29
- "browser": "./dist/hooks.module.js",
30
- "umd": "./dist/hooks.umd.js",
31
- "import": "./dist/hooks.mjs",
32
- "require": "./dist/hooks.js"
33
- }
13
+ "peerDependencies": {
14
+ "preact": "^10.0.0"
34
15
  }
35
16
  }
@@ -1,6 +1,4 @@
1
- // Intentionally not using a relative path to take advantage of
2
- // the TS version resolution mechanism
3
- import { ErrorInfo, PreactContext, Ref, RefObject } from 'preact';
1
+ import { ErrorInfo, PreactContext, Ref, RefObject } from '../../src/index';
4
2
 
5
3
  type Inputs = ReadonlyArray<unknown>;
6
4
 
@@ -52,13 +50,6 @@ export function useReducer<S, A, I>(
52
50
  init: (arg: I) => S
53
51
  ): [S, Dispatch<A>];
54
52
 
55
- /** @deprecated Use the `Ref` type instead. */
56
- type PropRef<T> = MutableRef<T>;
57
-
58
- interface MutableRef<T> {
59
- current: T;
60
- }
61
-
62
53
  /**
63
54
  * `useRef` returns a mutable ref object whose `.current` property is initialized to the passed argument
64
55
  * (`initialValue`). The returned object will persist for the full lifetime of the component.
@@ -68,9 +59,11 @@ interface MutableRef<T> {
68
59
  *
69
60
  * @param initialValue the initial value to store in the ref object
70
61
  */
71
- export function useRef<T>(initialValue: T): MutableRef<T>;
72
- export function useRef<T>(initialValue: T | null): RefObject<T>;
73
- export function useRef<T = undefined>(): MutableRef<T | undefined>;
62
+ export function useRef<T>(initialValue: T): RefObject<T>;
63
+ export function useRef<T>(initialValue: T | null): RefObject<T | null>;
64
+ export function useRef<T>(
65
+ initialValue: T | undefined
66
+ ): RefObject<T | undefined>;
74
67
 
75
68
  type EffectCallback = () => void | (() => void);
76
69
  /**