mutts 1.0.12 → 1.0.13

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 (55) hide show
  1. package/README.md +5 -2
  2. package/dist/browser.cjs +7 -3
  3. package/dist/browser.cjs.map +1 -1
  4. package/dist/browser.d.ts +1407 -2
  5. package/dist/browser.dev.cjs +7 -3
  6. package/dist/browser.dev.cjs.map +1 -1
  7. package/dist/browser.dev.d.ts +2 -2
  8. package/dist/browser.dev.esm.js +2 -2
  9. package/dist/browser.esm.js +3 -3
  10. package/dist/chunks/{index-yK0HVxHv.cjs → index-CAdnMJev.cjs} +202 -79
  11. package/dist/chunks/index-CAdnMJev.cjs.map +1 -0
  12. package/dist/chunks/{index-BUop6B2U.esm.js → index-XsYTUhHx.esm.js} +200 -77
  13. package/dist/chunks/index-XsYTUhHx.esm.js.map +1 -0
  14. package/dist/chunks/{node-Dd0esp5F.cjs → node-DrrphEPf.cjs} +2 -2
  15. package/dist/chunks/{node-Dd0esp5F.cjs.map → node-DrrphEPf.cjs.map} +1 -1
  16. package/dist/chunks/{node-Bo7WU5S2.esm.js → node-NEZvVo4M.esm.js} +2 -2
  17. package/dist/chunks/{node-Bo7WU5S2.esm.js.map → node-NEZvVo4M.esm.js.map} +1 -1
  18. package/dist/chunks/{proxy-D2C49sXH.esm.js → proxy-BtmPFjSr.esm.js} +307 -66
  19. package/dist/chunks/proxy-BtmPFjSr.esm.js.map +1 -0
  20. package/dist/chunks/{proxy-BvM4yewA.cjs → proxy-DBHj3kGK.cjs} +313 -66
  21. package/dist/chunks/proxy-DBHj3kGK.cjs.map +1 -0
  22. package/dist/debug.cjs +537 -166
  23. package/dist/debug.cjs.map +1 -1
  24. package/dist/debug.d.ts +96 -80
  25. package/dist/debug.esm.js +533 -166
  26. package/dist/debug.esm.js.map +1 -1
  27. package/dist/devtools/panel.js.map +1 -1
  28. package/dist/mutts.umd.js +508 -140
  29. package/dist/mutts.umd.js.map +1 -1
  30. package/dist/mutts.umd.min.js +1 -1
  31. package/dist/mutts.umd.min.js.map +1 -1
  32. package/dist/node.cjs +8 -4
  33. package/dist/node.cjs.map +1 -1
  34. package/dist/node.d.ts +2 -2
  35. package/dist/node.dev.cjs +8 -4
  36. package/dist/node.dev.cjs.map +1 -1
  37. package/dist/node.dev.d.ts +2 -2
  38. package/dist/node.dev.esm.js +3 -3
  39. package/dist/node.esm.js +3 -3
  40. package/dist/{types-Bx2PhORg.d.ts → types.d.ts} +12 -0
  41. package/docs/ai/api-reference.md +102 -12
  42. package/docs/ai/manual.md +60 -24
  43. package/docs/debug-getReason.md +161 -0
  44. package/docs/flavored.md +98 -1
  45. package/docs/reactive/advanced.md +15 -2
  46. package/docs/reactive/attend.md +32 -0
  47. package/docs/reactive/core.md +40 -6
  48. package/docs/reactive/debugging.md +25 -2
  49. package/docs/reactive.md +2 -0
  50. package/package.json +2 -3
  51. package/dist/chunks/index-BUop6B2U.esm.js.map +0 -1
  52. package/dist/chunks/index-yK0HVxHv.cjs.map +0 -1
  53. package/dist/chunks/proxy-BvM4yewA.cjs.map +0 -1
  54. package/dist/chunks/proxy-D2C49sXH.esm.js.map +0 -1
  55. package/dist/index.d.ts +0 -1322
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-XsYTUhHx.esm.js","sources":["../../src/destroyable.ts","../../src/diff.ts","../../src/eventful.ts","../../src/indexable.ts","../../src/promiseChain.ts","../../src/reactive/buffer.ts","../../src/reactive/deep-watch.ts","../../src/reactive/memoize.ts","../../src/reactive/record.ts","../../src/reactive/satellite.ts","../../src/reactive/iterator-helpers.ts","../../src/reactive/array.ts","../../src/reactive/map.ts","../../src/reactive/set.ts","../../src/reactive/index.ts","../../src/std-decorators.ts","../../src/index.ts"],"sourcesContent":["import { decorator } from './decorator'\n\n// Integrated with `using` statement via Symbol.dispose\nconst fr = new FinalizationRegistry<() => void>((f) => f())\n/**\n * Symbol for marking destructor methods\n */\nexport const destructor = Symbol('destructor')\n/**\n * Symbol for accessing allocated values in destroyable objects\n */\nexport const allocatedValues = Symbol('allocated')\n/**\n * Error thrown when attempting to access a destroyed object\n */\nexport class DestructionError extends Error {\n\tstatic throw<_T = void>(msg: string) {\n\t\treturn () => {\n\t\t\tthrow new DestructionError(msg)\n\t\t}\n\t}\n\tconstructor(msg: string) {\n\t\tsuper(`Object is destroyed. ${msg}`)\n\t\tthis.name = 'DestroyedAccessError'\n\t}\n}\nconst destroyedHandler = {\n\t[Symbol.toStringTag]: 'MutTs Destroyable',\n\tget: DestructionError.throw('Cannot access destroyed object'),\n\tset: DestructionError.throw('Cannot access destroyed object'),\n} as const\n\nabstract class AbstractDestroyable<Allocated> {\n\tabstract [destructor](allocated: Allocated): void\n\t[Symbol.dispose](): void {\n\t\tthis[destructor](this as unknown as Allocated)\n\t}\n}\n\ninterface Destructor<Allocated> {\n\tdestructor(allocated: Allocated): void\n}\n\n/**\n * Creates a destroyable class with a base class and destructor object\n * @param base - The base class to extend\n * @param destructorObj - Object containing the destructor method\n * @returns A destroyable class with static destroy and isDestroyable methods\n */\nexport function Destroyable<\n\tT extends new (\n\t\t...args: any[]\n\t) => any,\n\tAllocated extends Partial<InstanceType<T>>,\n>(\n\tbase: T,\n\tdestructorObj: Destructor<Allocated>\n): (new (\n\t...args: ConstructorParameters<T>\n) => InstanceType<T> & { [allocatedValues]: Allocated }) & {\n\tdestroy(obj: InstanceType<T>): boolean\n\tisDestroyable(obj: InstanceType<T>): boolean\n}\n\n/**\n * Creates a destroyable class with only a destructor object (no base class)\n * @param destructorObj - Object containing the destructor method\n * @returns A destroyable class with static destroy and isDestroyable methods\n */\nexport function Destroyable<Allocated extends Record<PropertyKey, any> = Record<PropertyKey, any>>(\n\tdestructorObj: Destructor<Allocated>\n): (new () => { [allocatedValues]: Allocated }) & {\n\tdestroy(obj: any): boolean\n\tisDestroyable(obj: any): boolean\n}\n\n/**\n * Creates a destroyable class with a base class (requires [destructor] method)\n * @param base - The base class to extend\n * @returns A destroyable class with static destroy and isDestroyable methods\n */\nexport function Destroyable<\n\tT extends new (\n\t\t...args: any[]\n\t) => any,\n\tAllocated extends Record<PropertyKey, any> = Record<PropertyKey, any>,\n>(\n\tbase: T\n): (new (\n\t...args: ConstructorParameters<T>\n) => AbstractDestroyable<Allocated> & InstanceType<T> & { [allocatedValues]: Allocated }) & {\n\tdestroy(obj: InstanceType<T>): boolean\n\tisDestroyable(obj: InstanceType<T>): boolean\n}\n\n/**\n * Creates an abstract destroyable base class\n * @returns An abstract destroyable class with static destroy and isDestroyable methods\n */\nexport function Destroyable<\n\tAllocated extends Record<PropertyKey, any> = Record<PropertyKey, any>,\n>(): abstract new () => (AbstractDestroyable<Allocated> & {\n\t[allocatedValues]: Allocated\n}) & {\n\tdestroy(obj: any): boolean\n\tisDestroyable(obj: any): boolean\n}\n\nexport function Destroyable<\n\tT extends new (\n\t\t...args: any[]\n\t) => any,\n\tAllocated extends Record<PropertyKey, any> = Record<PropertyKey, any>,\n>(base?: T | Destructor<Allocated>, destructorObj?: Destructor<Allocated>) {\n\tif (base && typeof base !== 'function') {\n\t\tdestructorObj = base as Destructor<Allocated>\n\t\tbase = undefined\n\t}\n\tif (!base) {\n\t\tbase = class {} as T\n\t}\n\n\treturn class Destroyable extends (base as T) {\n\t\tstatic readonly destructors = new WeakMap<any, () => void>()\n\t\tstatic destroy(obj: Destroyable) {\n\t\t\tconst destructor = Destroyable.destructors.get(obj)\n\t\t\tif (!destructor) return false\n\t\t\tfr.unregister(obj[allocatedValues])\n\t\t\tDestroyable.destructors.delete(obj)\n\t\t\tObject.setPrototypeOf(obj, new Proxy({}, destroyedHandler))\n\t\t\t// Clear all own properties\n\t\t\tfor (const key of Object.getOwnPropertyNames(obj)) {\n\t\t\t\tdelete (obj as any)[key]\n\t\t\t}\n\t\t\tdestructor()\n\t\t\treturn true\n\t\t}\n\t\tstatic isDestroyable(obj: Destroyable) {\n\t\t\treturn Destroyable.destructors.has(obj)\n\t\t}\n\n\t\t[forwardProperties]!: PropertyKey[]\n\t\treadonly [allocatedValues]: Allocated\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args)\n\t\t\tconst allocated = {} as Allocated\n\t\t\tthis[allocatedValues] = allocated\n\t\t\t// @ts-expect-error `this` is an AbstractDestroyable\n\t\t\tconst myDestructor = destructorObj?.destructor ?? this[destructor]\n\t\t\tif (!myDestructor) {\n\t\t\t\tthrow new DestructionError('Destructor is not defined')\n\t\t\t}\n\t\t\tfunction destruction() {\n\t\t\t\tmyDestructor(allocated)\n\t\t\t}\n\t\t\tDestroyable.destructors.set(this, destruction)\n\t\t\tfr.register(this, destruction, allocated)\n\t\t}\n\t}\n}\n\nconst forwardProperties = Symbol('forwardProperties')\n/**\n * Decorator that marks properties to be stored in the allocated object and passed to the destructor\n * Use with accessor properties or explicit get/set pairs\n */\nexport const allocated = decorator({\n\tsetter(original, _target, propertyKey) {\n\t\treturn function (value) {\n\t\t\tthis[allocatedValues][propertyKey] = value\n\t\t\treturn original.call(this, value)\n\t\t}\n\t},\n})\n\n/**\n * Registers a callback to be called when an object is garbage collected\n * @param cb - The callback function to execute on garbage collection\n * @returns The object whose reference can be collected\n */\nexport function callOnGC(cb: () => void) {\n\tlet called = false\n\tconst forward = () => {\n\t\tif (called) return\n\t\tcalled = true\n\t\tcb()\n\t}\n\tfr.register(forward, cb, cb)\n\treturn forward\n}\n\n/**\n * Context Manager Protocol for `using` statement integration\n * Provides automatic resource cleanup when used with the `using` statement\n */\nexport interface ContextManager<T = any> {\n\t[Symbol.dispose](): void\n\tvalue?: T\n}\n","export interface ArrayDiffResult<T> {\n\tindexA: number\n\tindexB: number\n\tsliceA: T[]\n\tsliceB: T[]\n}\n\n/** Max edit distance before bailing out to a single \"replace all\" patch */\nconst BAILOUT_D = 256\n\n/**\n * Myers' diff producing grouped patches: `{indexA, indexB, sliceA, sliceB}[]`.\n * - O(N) for identical or prefix/suffix-only differences\n * - O(ND) for small D, with a hard bailout at D=BAILOUT_D → single replacement patch\n */\nexport function arrayDiff<T>(A: readonly T[], B: readonly T[]): ArrayDiffResult<T>[] {\n\tlet start = 0\n\tlet endA = A.length\n\tlet endB = B.length\n\n\t// Trim common prefix\n\twhile (start < endA && start < endB && A[start] === B[start]) start++\n\t// Trim common suffix\n\twhile (endA > start && endB > start && A[endA - 1] === B[endB - 1]) {\n\t\tendA--\n\t\tendB--\n\t}\n\n\tconst lenA = endA - start\n\tconst lenB = endB - start\n\n\tif (lenA === 0 && lenB === 0) return []\n\tif (lenA === 0)\n\t\treturn [{ indexA: start, indexB: start, sliceA: [], sliceB: B.slice(start, endB) }]\n\tif (lenB === 0)\n\t\treturn [{ indexA: start, indexB: start, sliceA: A.slice(start, endA), sliceB: [] }]\n\n\t// Myers with bailout\n\tconst maxD = Math.min(lenA + lenB, BAILOUT_D)\n\tconst vSize = 2 * maxD + 1\n\tconst vOffset = maxD\n\tconst V = new Int32Array(vSize)\n\tV[vOffset + 1] = 0\n\tconst history: Int32Array[] = []\n\n\tfor (let d = 0; d <= maxD; d++) {\n\t\tfor (let k = -d; k <= d; k += 2) {\n\t\t\tlet x: number\n\t\t\tif (k === -d || (k !== d && V[vOffset + k - 1] < V[vOffset + k + 1])) {\n\t\t\t\tx = V[vOffset + k + 1]\n\t\t\t} else {\n\t\t\t\tx = V[vOffset + k - 1] + 1\n\t\t\t}\n\t\t\tlet y = x - k\n\t\t\twhile (x < lenA && y < lenB && A[start + x] === B[start + y]) {\n\t\t\t\tx++\n\t\t\t\ty++\n\t\t\t}\n\t\t\tV[vOffset + k] = x\n\t\t\tif (x >= lenA && y >= lenB) return buildPatches(history, A, B, start, x, y, d, k, vOffset)\n\t\t}\n\t\thistory.push(new Int32Array(V))\n\t}\n\n\t// Bailout: too many differences\n\treturn [\n\t\t{ indexA: start, indexB: start, sliceA: A.slice(start, endA), sliceB: B.slice(start, endB) },\n\t]\n}\n\nfunction buildPatches<T>(\n\thistory: Int32Array[],\n\tA: readonly T[],\n\tB: readonly T[],\n\toffset: number,\n\tfinalX: number,\n\tfinalY: number,\n\tfinalD: number,\n\tfinalK: number,\n\tvOffset: number\n): ArrayDiffResult<T>[] {\n\t// Backtrack from (finalX, finalY) at step finalD to step 0, collecting ops in reverse\n\tconst ops: (0 | 1 | 2)[] = [] // 0=eq, 1=ins, 2=del\n\tlet x = finalX\n\tlet y = finalY\n\tlet k = finalK\n\n\tfor (let d = finalD; d > 0; d--) {\n\t\tconst prev = history[d - 1]\n\t\tlet prevK: number\n\t\tlet down: boolean\n\t\tif (k === -d) {\n\t\t\tprevK = k + 1\n\t\t\tdown = true\n\t\t} else if (k === d) {\n\t\t\tprevK = k - 1\n\t\t\tdown = false\n\t\t} else if (prev[vOffset + k - 1] < prev[vOffset + k + 1]) {\n\t\t\tprevK = k + 1\n\t\t\tdown = true\n\t\t} else {\n\t\t\tprevK = k - 1\n\t\t\tdown = false\n\t\t}\n\n\t\tconst prevXEnd = prev[vOffset + prevK]\n\t\tconst prevYEnd = prevXEnd - prevK\n\t\tconst xStart = down ? prevXEnd : prevXEnd + 1\n\t\tconst yStart = down ? prevYEnd + 1 : prevXEnd + 1 - k\n\n\t\t// Diagonal matches (pushed in reverse)\n\t\twhile (x > xStart && y > yStart) {\n\t\t\tops.push(0)\n\t\t\tx--\n\t\t\ty--\n\t\t}\n\t\t// The edit step\n\t\tif (down) {\n\t\t\tops.push(1) // ins\n\t\t\ty--\n\t\t} else {\n\t\t\tops.push(2) // del\n\t\t\tx--\n\t\t}\n\t\tk = prevK\n\t}\n\n\t// Walk ops forward (they were pushed in reverse), grouping contiguous edits\n\tconst patches: ArrayDiffResult<T>[] = []\n\tlet currA = offset\n\tlet currB = offset\n\tlet sliceA: T[] = []\n\tlet sliceB: T[] = []\n\tlet patchA = -1\n\tlet patchB = -1\n\n\tconst flush = () => {\n\t\tif (patchA !== -1) {\n\t\t\tpatches.push({ indexA: patchA, indexB: patchB, sliceA, sliceB })\n\t\t\tsliceA = []\n\t\t\tsliceB = []\n\t\t\tpatchA = -1\n\t\t}\n\t}\n\n\tfor (let i = ops.length - 1; i >= 0; i--) {\n\t\tconst op = ops[i]\n\t\tif (op === 0) {\n\t\t\tflush()\n\t\t\tcurrA++\n\t\t\tcurrB++\n\t\t} else if (op === 1) {\n\t\t\tif (patchA === -1) {\n\t\t\t\tpatchA = currA\n\t\t\t\tpatchB = currB\n\t\t\t}\n\t\t\tsliceB.push(B[currB++])\n\t\t} else {\n\t\t\tif (patchA === -1) {\n\t\t\t\tpatchA = currA\n\t\t\t\tpatchB = currB\n\t\t\t}\n\t\t\tsliceA.push(A[currA++])\n\t\t}\n\t}\n\tflush()\n\treturn patches\n}\n","/**\n * Base type for event maps - all event handlers must be functions\n */\nexport type EventsBase = Record<string, (...args: any[]) => void>\n\nconst events = Symbol('events')\nconst hooks = Symbol('hooks')\n\ntype EventfulStore = {\n\t[events]: Map<PropertyKey, Set<(...args: any[]) => void>>\n\t[hooks]: Set<(...args: any[]) => void>\n}\n\nfunction getEventMap(target: object): EventfulStore[typeof events] {\n\treturn (target as EventfulStore)[events]\n}\n\nfunction getHookSet(target: object): EventfulStore[typeof hooks] {\n\treturn (target as EventfulStore)[hooks]\n}\n\nconst eventBehavior = {\n\ton<EventType extends keyof EventsBase>(\n\t\teventOrEvents: EventType | Partial<EventsBase>,\n\t\tcb?: EventsBase[EventType]\n\t): (this: Eventful<any>) => void {\n\t\tconst self = this as Eventful<any>\n\t\tconst eventMap = getEventMap(self)\n\t\tif (typeof eventOrEvents === 'object') {\n\t\t\tfor (const e of Object.keys(eventOrEvents) as (keyof EventsBase)[]) {\n\t\t\t\tthis.on(e, eventOrEvents[e]!)\n\t\t\t}\n\t\t} else if (cb !== undefined) {\n\t\t\tconst callbacks = eventMap.get(eventOrEvents) ?? new Set<EventsBase[EventType]>()\n\t\t\tif (!callbacks.has(cb)) callbacks.add(cb)\n\t\t\teventMap.set(eventOrEvents, callbacks)\n\t\t}\n\t\treturn () => this.off(eventOrEvents, cb)\n\t},\n\toff<EventType extends keyof EventsBase>(\n\t\teventOrEvents: EventType | Partial<EventsBase>,\n\t\tcb?: EventsBase[EventType]\n\t): void {\n\t\tconst self = this as Eventful<any>\n\t\tconst eventMap = getEventMap(self)\n\t\tif (typeof eventOrEvents === 'object') {\n\t\t\tfor (const e of Object.keys(eventOrEvents) as (keyof EventsBase)[]) {\n\t\t\t\tthis.off(e, eventOrEvents[e])\n\t\t\t}\n\t\t} else if (cb !== null && cb !== undefined) {\n\t\t\tconst callbacks = eventMap.get(eventOrEvents)\n\t\t\tif (callbacks) {\n\t\t\t\tcallbacks.delete(cb)\n\t\t\t\tif (!callbacks.size) eventMap.delete(eventOrEvents)\n\t\t\t}\n\t\t} else {\n\t\t\t// Remove all listeners for this event\n\t\t\teventMap.delete(eventOrEvents)\n\t\t}\n\t},\n\temit<EventType extends keyof EventsBase>(\n\t\tevent: EventType,\n\t\t...args: Parameters<EventsBase[EventType]>\n\t) {\n\t\tconst self = this as Eventful<any>\n\t\tconst callbacks = getEventMap(self).get(event)\n\t\tif (callbacks) for (const cb of callbacks) cb.apply(this, args)\n\t\tfor (const cb of getHookSet(self)) cb.call(this, event, ...args)\n\t},\n}\n\nfunction perEvent(\n\teventful: Eventful<any>,\n\tfct: (event: string, ...args: any[]) => void,\n\tuse?: 'use'\n) {\n\tconst cache = new Map<string, (...args: any[]) => any>()\n\treturn new Proxy(fct, {\n\t\tget(target, prop: PropertyKey) {\n\t\t\tif (typeof prop !== 'string')\n\t\t\t\treturn (target as typeof target & Record<PropertyKey, unknown>)[prop]\n\t\t\tif (use && !getEventMap(eventful).has(prop) && !getHookSet(eventful).size) return () => {}\n\n\t\t\t// Return cached function or create and cache\n\t\t\tlet cached = cache.get(prop)\n\t\t\tif (!cached) {\n\t\t\t\tcached = (...args: any[]) => fct.apply(eventful, [prop, ...args])\n\t\t\t\tcache.set(prop, cached)\n\t\t\t}\n\t\t\treturn cached\n\t\t},\n\t})\n}\n\n/**\n * A type-safe event system that provides a clean API for event handling\n * @template Events - The event map defining event names and their handler signatures\n */\nexport class Eventful<Events extends EventsBase> {\n\tprivate readonly [events] = new Map<keyof Events, Set<(...args: any[]) => void>>()\n\tprivate readonly [hooks] = new Set<(...args: any[]) => void>()\n\n\tpublic hook(\n\t\tcb: <EventType extends keyof Events>(\n\t\t\tevent: EventType,\n\t\t\t...args: Parameters<Events[EventType]>\n\t\t) => void\n\t): () => void {\n\t\tthis[hooks].add(cb)\n\t\treturn () => {\n\t\t\tthis[hooks].delete(cb)\n\t\t}\n\t}\n\n\tpublic on = perEvent(this, eventBehavior.on) as ((events: Partial<Events>) => void) &\n\t\t(<EventType extends keyof Events>(event: EventType, cb: Events[EventType]) => () => void) & {\n\t\t\t[event in keyof Events]: (cb: Events[event]) => () => void\n\t\t}\n\tpublic off = perEvent(this, eventBehavior.off) as ((events: Partial<Events>) => void) &\n\t\t(<EventType extends keyof Events>(event: EventType, cb?: Events[EventType]) => void) & {\n\t\t\t[event in keyof Events]: (cb?: Events[event]) => void\n\t\t}\n\n\tpublic emit = perEvent(this, eventBehavior.emit, 'use') as (<EventType extends keyof Events>(\n\t\tevent: EventType,\n\t\t...args: Parameters<Events[EventType]>\n\t) => void) &\n\t\tEvents\n}\n","/**\n * Symbol for defining custom getter logic for numeric index access\n */\nexport const getAt = Symbol('getAt')\n/**\n * Symbol for defining custom setter logic for numeric index access\n */\nexport const setAt = Symbol('setAt')\n\ninterface IndexingAt<Items = any> {\n\t[getAt](index: number): Items\n}\n\ninterface Accessor<T, Items> {\n\tget(this: T, index: number): Items\n\tset?(this: T, index: number, value: Items): void\n\tgetLength?(this: T): number\n\tsetLength?(this: T, value: number): void\n}\n\nabstract class AbstractGetAt<Items = any> {\n\tabstract [getAt](index: number): Items\n}\n\n/**\n * Creates an indexable class with a base class and accessor object\n * @param base - The base class to extend\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase: Base,\n\taccessor: Accessor<InstanceType<Base>, Items>\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: Items }\n\n/**\n * Creates an indexable class with only an accessor object (no base class)\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items>(accessor: Accessor<any, Items>): new () => { [x: number]: Items }\n\n/**\n * Creates an indexable class with a base class that has [getAt] method\n * @param base - The base class that implements [getAt] method\n * @returns A class that supports numeric index access using the base class's [getAt] method\n */\nexport function Indexable<Base extends new (...args: any[]) => IndexingAt>(\n\tbase: Base\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: AtReturnType<InstanceType<Base>> }\n\n/**\n * Creates an abstract indexable base class\n * @returns An abstract class that supports numeric index access\n */\nexport function Indexable<Items>(): abstract new (\n\t...args: any[]\n) => AbstractGetAt & { [x: number]: Items }\n\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase?: Base | Accessor<Base, Items>,\n\taccessor?: Accessor<Base, Items>\n) {\n\tif (base && typeof base !== 'function') {\n\t\taccessor = base as Accessor<Base, Items>\n\t\tbase = undefined\n\t}\n\tif (!base) {\n\t\t//@ts-expect-error\n\t\tbase = class {} as Base\n\t}\n\tif (!accessor) {\n\t\taccessor = {\n\t\t\tget(this: any, index: number) {\n\t\t\t\tif (typeof this[getAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class must have an [getAt] method')\n\t\t\t\t}\n\t\t\t\treturn this[getAt](index)\n\t\t\t},\n\t\t\tset(this: any, index: number, value: Items) {\n\t\t\t\tif (typeof this[setAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class has read-only numeric index access')\n\t\t\t\t}\n\t\t\t\tthis[setAt](index, value)\n\t\t\t},\n\t\t}\n\t}\n\n\tabstract class Indexable extends (base as Base) {\n\t\t[x: number]: Items\n\t}\n\n\tObject.setPrototypeOf(\n\t\tIndexable.prototype,\n\t\tnew Proxy((base as Base).prototype, {\n\t\t\t//@ts-expect-error\n\t\t\t[Symbol.toStringTag]: 'MutTs Indexable',\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst getter = Object.getOwnPropertyDescriptor(target, prop)?.get\n\t\t\t\t\treturn getter ? getter.call(receiver) : target[prop]\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.getLength) return accessor.getLength.call(receiver)\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\treturn accessor.get!.call(receiver, numProp) as Items\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined\n\t\t\t},\n\t\t\tset(target, prop, value, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst setter = Object.getOwnPropertyDescriptor(target, prop)?.set\n\t\t\t\t\tif (setter) setter.call(receiver, value)\n\t\t\t\t\telse target[prop] = value\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.setLength) {\n\t\t\t\t\t\taccessor.setLength.call(receiver, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\tif (!accessor.set) throw new Error('Indexable class has read-only numeric index access')\n\t\t\t\t\t\taccessor.set!.call(receiver, numProp, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tObject.defineProperty(receiver, prop, {\n\t\t\t\t\tvalue,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t})\n\t\t\t\treturn true\n\t\t\t},\n\t\t\thas(target, prop) {\n\t\t\t\tif (prop in target) return true\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.getLength) return true\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) return true\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\t},\n\t\t\townKeys(target) {\n\t\t\t\tconst keys = Reflect.ownKeys(target)\n\t\t\t\tif (accessor.getLength) {\n\t\t\t\t\tkeys.push('length')\n\t\t\t\t\tconst len = accessor.getLength.call(this as any)\n\t\t\t\t\tfor (let i = 0; i < len; i++) keys.push(String(i))\n\t\t\t\t}\n\t\t\t\treturn keys\n\t\t\t},\n\t\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\t\tif (prop in target) return Object.getOwnPropertyDescriptor(target, prop)\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.getLength) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tenumerable: false,\n\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\tget: () => accessor.getLength!.call(this as any),\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\t\tget: () => accessor.get!.call(this as any, numProp),\n\t\t\t\t\t\t\tset: accessor.set\n\t\t\t\t\t\t\t\t? (v: any) => accessor.set!.call(this as any, numProp, v)\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined\n\t\t\t},\n\t\t})\n\t)\n\treturn Indexable\n}\n\ntype AtReturnType<T> = T extends { [getAt](index: number): infer R } ? R : never\n\n/**\n * Symbol for accessing the forwarded array in ArrayReadForward\n */\nexport const forwardArray = Symbol('forwardArray')\n\n/**\n * A read-only array forwarder that implements all reading/iterating methods of Array\n * but does not implement modification methods.\n *\n * The constructor takes a callback that returns an array, and all methods forward\n * their behavior to the result of that callback.\n */\nexport class ArrayReadForward<T> {\n\tprotected get [forwardArray](): readonly T[] {\n\t\tthrow new Error('ArrayReadForward is not implemented')\n\t}\n\n\t/**\n\t * Get the length of the array\n\t */\n\tget length(): number {\n\t\treturn this[forwardArray].length\n\t}\n\n\t/**\n\t * Get an element at a specific index\n\t */\n\t[index: number]: T | undefined\n\n\t/**\n\t * Iterator protocol support\n\t */\n\t[Symbol.iterator](): Iterator<T> {\n\t\treturn this[forwardArray][Symbol.iterator]()\n\t}\n\n\t// Reading/Iterating methods\n\n\t/**\n\t * Creates a new array with the results of calling a provided function on every element\n\t */\n\tmap<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[] {\n\t\treturn this[forwardArray].map(callbackfn, thisArg)\n\t}\n\n\t/**\n\t * Creates a new array with all elements that pass the test implemented by the provided function\n\t */\n\tfilter<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S[]\n\tfilter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[]\n\tfilter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[] {\n\t\treturn this[forwardArray].filter(predicate, thisArg)\n\t}\n\n\t/**\n\t * Executes a reducer function on each element of the array, resulting in a single output value\n\t */\n\treduce(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T\n\t): T\n\treduce(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T,\n\t\tinitialValue: T\n\t): T\n\treduce<U>(\n\t\tcallbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U,\n\t\tinitialValue: U\n\t): U\n\treduce(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: any,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[]\n\t\t) => any,\n\t\tinitialValue?: any\n\t): any {\n\t\treturn initialValue !== undefined\n\t\t\t? this[forwardArray].reduce(callbackfn, initialValue)\n\t\t\t: this[forwardArray].reduce(callbackfn)\n\t}\n\n\t/**\n\t * Executes a reducer function on each element of the array (right-to-left), resulting in a single output value\n\t */\n\treduceRight(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T\n\t): T\n\treduceRight(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T,\n\t\tinitialValue: T\n\t): T\n\treduceRight<U>(\n\t\tcallbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U,\n\t\tinitialValue: U\n\t): U\n\treduceRight(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: any,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[]\n\t\t) => any,\n\t\tinitialValue?: any\n\t): any {\n\t\treturn initialValue !== undefined\n\t\t\t? this[forwardArray].reduceRight(callbackfn, initialValue)\n\t\t\t: this[forwardArray].reduceRight(callbackfn)\n\t}\n\n\t/**\n\t * Executes a provided function once for each array element\n\t */\n\tforEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void {\n\t\tthis[forwardArray].forEach(callbackfn, thisArg)\n\t}\n\n\t/**\n\t * Returns the value of the first element in the array that satisfies the provided testing function\n\t */\n\tfind<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S | undefined\n\tfind(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined\n\tfind(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined {\n\t\treturn this[forwardArray].find(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the index of the first element in the array that satisfies the provided testing function\n\t */\n\tfindIndex(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): number {\n\t\treturn this[forwardArray].findIndex(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the value of the last element in the array that satisfies the provided testing function\n\t */\n\tfindLast<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S | undefined\n\tfindLast(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined\n\tfindLast(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined {\n\t\treturn this[forwardArray].findLast(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the index of the last element in the array that satisfies the provided testing function\n\t */\n\tfindLastIndex(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): number {\n\t\treturn this[forwardArray].findLastIndex(predicate, thisArg)\n\t}\n\n\t/**\n\t * Determines whether an array includes a certain value among its entries\n\t */\n\tincludes(searchElement: T, fromIndex?: number): boolean {\n\t\treturn this[forwardArray].includes(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns the first index at which a given element can be found in the array\n\t */\n\tindexOf(searchElement: T, fromIndex?: number): number {\n\t\treturn this[forwardArray].indexOf(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns the last index at which a given element can be found in the array\n\t */\n\tlastIndexOf(searchElement: T, fromIndex?: number): number {\n\t\treturn this[forwardArray].lastIndexOf(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns a shallow copy of a portion of an array into a new array object\n\t */\n\tslice(start?: number, end?: number): T[] {\n\t\treturn this[forwardArray].slice(start, end)\n\t}\n\n\t/**\n\t * Returns a new array comprised of this array joined with other array(s) and/or value(s)\n\t */\n\tconcat(...items: ConcatArray<T>[]): T[]\n\tconcat(...items: (T | ConcatArray<T>)[]): T[]\n\tconcat(...items: (T | ConcatArray<T>)[]): T[] {\n\t\treturn this[forwardArray].concat(...items)\n\t}\n\n\t/**\n\t * Tests whether all elements in the array pass the test implemented by the provided function\n\t */\n\tevery(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): boolean {\n\t\treturn this[forwardArray].every(predicate, thisArg)\n\t}\n\n\t/**\n\t * Tests whether at least one element in the array passes the test implemented by the provided function\n\t */\n\tsome(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): boolean {\n\t\treturn this[forwardArray].some(predicate, thisArg)\n\t}\n\n\t/**\n\t * Joins all elements of an array into a string\n\t */\n\tjoin(separator?: string): string {\n\t\treturn this[forwardArray].join(separator)\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the keys for each index in the array\n\t */\n\tkeys(): IterableIterator<number> {\n\t\treturn this[forwardArray].keys()\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the values for each index in the array\n\t */\n\tvalues(): IterableIterator<T> {\n\t\treturn this[forwardArray].values()\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the key/value pairs for each index in the array\n\t */\n\tentries(): IterableIterator<[number, T]> {\n\t\treturn this[forwardArray].entries()\n\t}\n\n\t/**\n\t * Returns a string representation of the array\n\t */\n\ttoString(): string {\n\t\treturn this[forwardArray].toString()\n\t}\n\n\t/**\n\t * Returns a localized string representing the array\n\t */\n\ttoLocaleString(\n\t\tlocales?: string | string[],\n\t\toptions?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions\n\t): string {\n\t\treturn this[forwardArray].toLocaleString(locales as string | string[], options)\n\t}\n\n\t/**\n\t * Returns the element at the specified index, or undefined if the index is out of bounds\n\t */\n\tat(index: number): T | undefined {\n\t\treturn this[forwardArray].at(index)\n\t}\n\n\t/**\n\t * Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth\n\t */\n\tflat(depth?: number): T[] {\n\t\treturn this[forwardArray].flat(depth) as T[]\n\t}\n\n\t/**\n\t * Returns a new array formed by applying a given callback function to each element of the array,\n\t * and then flattening the result by one level\n\t */\n\tflatMap<U, This = undefined>(\n\t\tcallback: (this: This, value: T, index: number, array: readonly T[]) => U | ReadonlyArray<U>,\n\t\tthisArg?: This\n\t): U[] {\n\t\treturn this[forwardArray].flatMap(callback as any, thisArg)\n\t}\n\n\t/**\n\t * Returns a new array with elements in reversed order (ES2023)\n\t */\n\ttoReversed(): T[] {\n\t\treturn this[forwardArray].toReversed?.() ?? [...this[forwardArray]].reverse()\n\t}\n\n\t/**\n\t * Returns a new array with elements sorted (ES2023)\n\t */\n\ttoSorted(compareFn?: ((a: T, b: T) => number) | undefined): T[] {\n\t\treturn this[forwardArray].toSorted?.(compareFn) ?? [...this[forwardArray]].sort(compareFn)\n\t}\n\n\t/**\n\t * Returns a new array with some elements removed and/or replaced at a given index (ES2023)\n\t */\n\ttoSpliced(start: number, deleteCount?: number, ...items: T[]): T[] {\n\t\tif (deleteCount === undefined) return this[forwardArray].toSpliced(start)\n\t\treturn this[forwardArray].toSpliced(start, deleteCount, ...items)\n\t}\n\n\t/**\n\t * Returns a new array with the element at the given index replaced with the given value (ES2023)\n\t */\n\twith(index: number, value: T): T[] {\n\t\treturn this[forwardArray].with(index, value)\n\t}\n\tget [Symbol.unscopables]() {\n\t\treturn this[forwardArray][Symbol.unscopables]\n\t}\n}\n","type Resolved<T> =\n\tT extends Promise<infer U>\n\t\t? Resolved<U>\n\t\t: T extends (...args: infer Args) => infer R\n\t\t\t? (...args: Args) => Resolved<R>\n\t\t\t: T extends object\n\t\t\t\t? {\n\t\t\t\t\t\t[k in keyof T]: k extends 'then' | 'catch' | 'finally' ? T[k] : Resolved<T[k]>\n\t\t\t\t\t}\n\t\t\t\t: T\ntype PromiseAnd<T> = Resolved<T> & Promise<Resolved<T>>\n/**\n * Type that transforms promises into chainable objects\n * Allows calling methods directly on promise results without awaiting them first\n */\nexport type PromiseChain<T> = T extends (...args: infer Args) => infer R\n\t? PromiseAnd<(...args: Args) => PromiseChain<Resolved<R>>>\n\t: T extends object\n\t\t? PromiseAnd<{\n\t\t\t\t[k in keyof T]: k extends 'then' | 'catch' | 'finally' ? T[k] : PromiseChain<Resolved<T[k]>>\n\t\t\t}>\n\t\t: Promise<Resolved<T>>\n\nconst forward =\n\t(name: string, target: any) =>\n\t(...args: any[]) => {\n\t\treturn target[name](...args)\n\t}\n\nconst alreadyChained = new WeakMap<any, PromiseChain<any>>()\nconst originals = new WeakMap<Promise<any>, any>()\n\nfunction cache(target: any, rv: PromiseChain<any>) {\n\toriginals.set(rv, target)\n\talreadyChained.set(target, rv)\n}\n\ntype ChainedFunction<T> = ((...args: any[]) => PromiseChain<T>) & {\n\tthen: Promise<T>['then']\n\tcatch: Promise<T>['catch']\n\tfinally: Promise<T>['finally']\n}\n\nconst promiseProxyHandler: ProxyHandler<ChainedFunction<any>> = {\n\t//@ts-expect-error\n\t[Symbol.toStringTag]: 'MutTs PromiseChain function',\n\tget(target, prop) {\n\t\tif (prop === Symbol.toStringTag) return 'PromiseProxy'\n\t\tif (typeof prop === 'string' && ['then', 'catch', 'finally'].includes(prop))\n\t\t\treturn target[prop as keyof typeof target]\n\t\treturn chainPromise(target.then((r) => r[prop as keyof typeof r]))\n\t},\n}\nconst promiseForward = (target: any) => ({\n\t// biome-ignore lint/suspicious/noThenProperty: This one is the whole point\n\tthen: forward('then', target),\n\tcatch: forward('catch', target),\n\tfinally: forward('finally', target),\n})\nconst objectProxyHandler: ProxyHandler<any> = {\n\t//@ts-expect-error\n\t[Symbol.toStringTag]: 'MutTs PromiseChain object',\n\tget(target, prop, receiver) {\n\t\tconst getter = Object.getOwnPropertyDescriptor(target, prop)?.get\n\t\tconst rv = getter ? getter.call(receiver) : target[prop]\n\t\t// Allows fct.call or fct.apply to bypass the chain system\n\t\tif (typeof target === 'function') return rv\n\t\treturn chainPromise(rv)\n\t},\n\tapply(target, thisArg, args) {\n\t\treturn chainPromise(target.apply(thisArg, args))\n\t},\n}\nfunction chainObject<T extends object | Function>(given: T): PromiseChain<T> {\n\tconst rv = new Proxy(given, objectProxyHandler) as PromiseChain<T>\n\tcache(given, rv)\n\treturn rv\n}\n\nfunction chainable(x: any): x is object | Function {\n\treturn x && ['function', 'object'].includes(typeof x)\n}\n/**\n * Transforms a promise or value into a chainable object\n * Allows calling methods directly on promise results without awaiting them first\n * @param given - The promise or value to make chainable\n * @returns A chainable version of the input\n */\nexport function chainPromise<T>(given: Promise<T> | T): PromiseChain<T> {\n\tif (!chainable(given)) return given as PromiseChain<T>\n\tif (alreadyChained.has(given)) return alreadyChained.get(given) as PromiseChain<T>\n\tif (!(given instanceof Promise)) return chainObject(given)\n\t// @ts-expect-error It's ok as we check if it's an object above\n\tgiven = given.then((r) => (chainable(r) ? chainObject(r) : r))\n\tconst target = Object.assign(function (this: any, ...args: any[]) {\n\t\treturn chainPromise(\n\t\t\tgiven.then((r) => {\n\t\t\t\treturn this?.then\n\t\t\t\t\t? this.then((t: any) => (r as any).apply(t, args))\n\t\t\t\t\t: (r as any).apply(this, args)\n\t\t\t})\n\t\t)\n\t}, promiseForward(given)) as ChainedFunction<T>\n\tconst chained = new Proxy(\n\t\ttarget,\n\t\tpromiseProxyHandler as ProxyHandler<ChainedFunction<T>>\n\t) as PromiseChain<T>\n\tcache(given, chained as PromiseChain<any>)\n\treturn chained\n}\n","import { arrayDiff } from '../diff'\nimport { type Captioned, captioned, flavored } from '../flavored'\nimport { tag } from '../utils'\nimport type { GetterWrapper } from '../zone'\nimport { getState, touched, touched1 } from './change'\nimport { chainExternalReason, getActiveEffect, link } from './effect-context'\nimport { effect } from './effects'\nimport { reactive } from './proxy'\nimport { getEffectNode, markWithRoot } from './registry'\nimport { dependant } from './tracking'\nimport {\n\ttype CleanupReason,\n\ttype EffectAccess,\n\ttype EffectCloser,\n\tisReactive,\n\tkeysOf,\n\toptions,\n\ttype ScopedCallback,\n\ttype State,\n} from './types'\n\n/**\n * Reactively attends to each entry of a collection or each key yielded by an\n * enumeration callback. For each key, an inner effect runs the callback. When a\n * key disappears, its inner effect is disposed. The callback may return a cleanup\n * (like a regular effect closer).\n *\n * Accepts arrays, records, Maps, Sets, or a raw `() => Iterable<Key>` callback.\n *\n * @example\n * ```typescript\n * // Record shorthand\n * attend(record, (key) => { console.log(key, record[key]) })\n *\n * // Array shorthand\n * attend(array, (index) => { console.log(index, array[index]) })\n *\n * // Raw enumeration callback\n * attend(() => Object.keys(record), (key) => { ... })\n * ```\n */\nexport interface Attend\n\textends Captioned<\n\t\t(\n\t\t\tsource: any,\n\t\t\tcallback: (key: any, access: EffectAccess) => EffectCloser | void\n\t\t) => ScopedCallback\n\t> {\n\t<T>(\n\t\tsource: readonly T[],\n\t\tcallback: (index: number, access: EffectAccess) => EffectCloser | void\n\t): ScopedCallback\n\t<K, V>(\n\t\tsource: Map<K, V>,\n\t\tcallback: (key: K, access: EffectAccess) => EffectCloser | void\n\t): ScopedCallback\n\t<T>(\n\t\tsource: Set<T>,\n\t\tcallback: (value: T, access: EffectAccess) => EffectCloser | void\n\t): ScopedCallback\n\t<S extends object>(\n\t\tsource: S,\n\t\tcallback: (key: keyof S & string, access: EffectAccess) => EffectCloser | void\n\t): ScopedCallback\n\t<Key>(\n\t\tenumerate: () => Iterable<Key>,\n\t\tcallback: (key: Key, access: EffectAccess) => EffectCloser | void\n\t): ScopedCallback\n}\n\nexport const attend: Attend = captioned(\n\tfunction attend(\n\t\tsource: any,\n\t\tcallback: (key: any, access: EffectAccess) => EffectCloser | void\n\t): ScopedCallback {\n\t\tconst enumerate: () => Iterable<any> =\n\t\t\ttypeof source === 'function'\n\t\t\t\t? source\n\t\t\t\t: Array.isArray(source)\n\t\t\t\t\t? () => Array.from({ length: source.length }, (_, i) => i)\n\t\t\t\t\t: source instanceof Map\n\t\t\t\t\t\t? () => source.keys()\n\t\t\t\t\t\t: source instanceof Set\n\t\t\t\t\t\t\t? () => source.values()\n\t\t\t\t\t\t\t: () => Object.keys(source)\n\n\t\tconst keyEffects = new Map<any, ScopedCallback>()\n\t\tconst callbackLabel = callback.name ? callback.name : ''\n\n\t\tconst outer = effect`attend`(({ ascend }) => {\n\t\t\tconst keys = new Set<any>()\n\t\t\tfor (const key of enumerate()) keys.add(key)\n\n\t\t\tfor (const key of keys) {\n\t\t\t\tif (keyEffects.has(key)) continue\n\t\t\t\tconst indexRef = { value: key }\n\t\t\t\tkeyEffects.set(\n\t\t\t\t\tkey,\n\t\t\t\t\tascend(() =>\n\t\t\t\t\t\teffect`attend${callbackLabel ? `:${callbackLabel}` : ''}:${key}`(\n\t\t\t\t\t\t\t(access) => callback(indexRef.value, access)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tfor (const key of Array.from(keyEffects.keys())) {\n\t\t\t\tif (!keys.has(key)) {\n\t\t\t\t\tkeyEffects.get(key)!()\n\t\t\t\t\tkeyEffects.delete(key)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn (reason?: CleanupReason) => {\n\t\t\touter(reason)\n\t\t\tfor (const stop of keyEffects.values()) stop(reason)\n\t\t\tkeyEffects.clear()\n\t\t}\n\t},\n\t{\n\t\tname: 'attend',\n\t\tcallbackIndex: 1,\n\t\twarn: (message) => options.warn(`[reactive] ${message}`),\n\t}\n) as Attend\n\n/**\n * Lifts a callback that returns an array into a reactive array that automatically\n * synchronizes with the source array returned by the callback.\n *\n * The returned reactive array will update whenever the callback's dependencies change,\n * efficiently syncing only the elements that differ from the previous result.\n *\n * @example\n * ```typescript\n * const items = reactive([1, 2, 3])\n * const doubled = lift(() => items.map(x => x * 2))\n *\n * console.log([...doubled]) // [2, 4, 6]\n *\n * items.push(4)\n * console.log([...doubled]) // [2, 4, 6, 8]\n * ```\n *\n * @param cb Callback function that returns an array\n * @returns A reactive array synchronized with the callback's result, with a [cleanup] property to stop tracking\n */\nexport interface Lift {\n\t<Output extends any[]>(cb: (access: EffectAccess) => Output): Output\n\t<Output extends object>(cb: (access: EffectAccess) => Output): Output\n\t(strings: TemplateStringsArray, ...values: readonly unknown[]): Lift\n}\n\n/**\n * Lifts a callback that returns an object into a reactive object that automatically\n * synchronizes with the source object returned by the callback.\n *\n * The returned reactive object will update whenever the callback's dependencies change,\n * efficiently syncing only the properties that differ from the previous result using\n * Object.assign(). Properties that no longer exist in the source are automatically removed.\n *\n * @example\n * ```typescript\n * const user = reactive({ name: 'John', age: 30 })\n * const profile = lift(() => ({\n * displayName: user.name.toUpperCase(),\n * isAdult: user.age >= 18,\n * description: `${user.name} is ${user.age} years old`\n * }))\n *\n * console.log(profile.displayName) // JOHN\n * console.log(profile.isAdult) // true\n *\n * user.name = 'Jane'\n * console.log(profile.displayName) // JANE\n * console.log(profile.description) // Jane is 30 years old\n * ```\n *\n * @param cb Callback function that returns an object\n * @returns A reactive object synchronized with the callback's result, with a [cleanup] property to stop tracking\n */\nexport const lift: Lift = captioned(\n\tfunction lift<Output extends any[] | object>(cb: (access: EffectAccess) => Output): Output {\n\t\tlet result!: Output\n\t\tlet rawResult!: Output\n\t\tconst resultName = `lift:${cb.name || 'anonymous'}`\n\t\tconst liftCleanup = effect`lift:${cb.name}`(\n\t\t\tmarkWithRoot((access) => {\n\t\t\t\tconst source = cb(access)\n\t\t\t\tif (!source || typeof source !== 'object')\n\t\t\t\t\tthrow new Error('lift callback must return an array or object')\n\t\t\t\tconst sourceProto = Object.getPrototypeOf(source)\n\t\t\t\tif (!result) {\n\t\t\t\t\trawResult = tag(resultName, Array.isArray(source) ? [] : Object.create(sourceProto))\n\t\t\t\t\tresult = reactive(rawResult)\n\t\t\t\t}\n\t\t\t\tif (sourceProto !== Object.getPrototypeOf(result))\n\t\t\t\t\tthrow new Error('lift callback must return the same type as the previous result')\n\n\t\t\t\tif (Array.isArray(source)) {\n\t\t\t\t\tconst res = result as unknown[]\n\t\t\t\t\tfor (const { indexA, sliceA, sliceB } of arrayDiff(res, source).sort(\n\t\t\t\t\t\t(a, b) => a.indexA - b.indexA\n\t\t\t\t\t))\n\t\t\t\t\t\tres.splice(indexA, sliceA.length, ...sliceB)\n\t\t\t\t} else {\n\t\t\t\t\tconst recordResult = rawResult as Record<string, unknown>\n\t\t\t\t\tfor (const key of Object.keys(source)) {\n\t\t\t\t\t\tconst had = key in rawResult\n\t\t\t\t\t\tconst newDesc = Object.getOwnPropertyDescriptor(source, key)!\n\t\t\t\t\t\tif (had) {\n\t\t\t\t\t\t\tconst oldDesc = Object.getOwnPropertyDescriptor(rawResult, key)\n\t\t\t\t\t\t\tconst sameAccessor = oldDesc && newDesc.get && oldDesc.get === newDesc.get\n\t\t\t\t\t\t\tObject.defineProperty(rawResult, key, newDesc)\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!sameAccessor &&\n\t\t\t\t\t\t\t\trecordResult[key] !==\n\t\t\t\t\t\t\t\t\t(oldDesc ? (oldDesc.get ? oldDesc.get() : oldDesc.value) : undefined)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\ttouched1(rawResult, { type: 'set', prop: key }, key)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tObject.defineProperty(rawResult, key, newDesc)\n\t\t\t\t\t\t\ttouched1(rawResult, { type: 'add', prop: key }, key)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (const key of Object.keys(rawResult))\n\t\t\t\t\t\tif (!(key in source)) {\n\t\t\t\t\t\t\tdelete recordResult[key]\n\t\t\t\t\t\t\ttouched1(rawResult, { type: 'del', prop: key }, key)\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, cb)\n\t\t)\n\t\treturn link(result, liftCleanup)\n\t},\n\t{\n\t\tname: 'lift',\n\t\twarn: (message) => options.warn(`[reactive] ${message}`),\n\t}\n) as Lift\n\n/**\n * Options for `morph` and its variants.\n *\n * @property pure - When `true`, the mapping function is assumed pure (no reactive reads inside `fn`).\n * Per-item effects are skipped and items are computed eagerly. When a predicate `(i) => boolean`,\n * purity is evaluated per item — pure items skip the effect wrapper, non-pure items get their own.\n */\nexport type MorphOptions<I> = { pure?: boolean | ((i: I) => boolean) }\n\n/**\n * Reactively maps an array source through `fn`, producing a lazy reactive output array.\n *\n * Each source item gets its own isolated effect (via `root()`) so that changes to one item\n * only recompute that item's projection. Structural changes (push, splice, reorder) are detected\n * via `arrayDiff` and surgically applied to the output cache.\n *\n * The source can be a reactive array or a function returning an array. When a function is provided,\n * the function is re-evaluated inside an effect whenever its dependencies change.\n *\n * Output elements are computed lazily — accessing `result[i]` triggers computation if not yet cached.\n *\n * @param source - A reactive array or a function returning an array\n * @param fn - Mapping function applied to each element\n * @param options - Optional purity hints to skip per-item effects\n * @returns A readonly reactive array with a `[cleanup]` method to dispose all effects\n */\nexport function morphArray<I, O>(\n\tsource: readonly I[] | (() => readonly I[]),\n\tfn: (arg: I, access?: EffectAccess) => O,\n\toptions?: MorphOptions<I>\n): readonly O[] {\n\tif (typeof source !== 'function' && !isReactive(source) && options?.pure === true) {\n\t\treturn source.map((i) => fn(i)) as any\n\t}\n\n\tlet track!: GetterWrapper\n\tconst itemEffects = new Map<any, { stop: ScopedCallback; index: { value: number } }>()\n\tconst cache = tag(`morph:${fn.name || 'anonymous'}`, [] as O[])\n\tlet input: readonly I[] = []\n\n\tfunction stopItem(key: any) {\n\t\tconst entry = itemEffects.get(key)\n\t\tif (entry) {\n\t\t\tconst activeEffect = getActiveEffect()\n\t\t\tlet chain: CleanupReason | undefined\n\t\t\tif (activeEffect) {\n\t\t\t\tconst node = getEffectNode(activeEffect)\n\t\t\t\tchain = node.currentReason\n\t\t\t}\n\t\t\tentry.stop(chainExternalReason({ type: 'stopped', chain }))\n\t\t\titemEffects.delete(key)\n\t\t}\n\t}\n\n\tfunction computeItem(key: number, input: I) {\n\t\tconst isPure =\n\t\t\toptions?.pure === true || (typeof options?.pure === 'function' && options.pure(input))\n\t\tif (isPure) {\n\t\t\ttrack(() => {\n\t\t\t\tcache[key] = fn(input)\n\t\t\t})\n\t\t} else {\n\t\t\tconst indexRef = { value: key }\n\t\t\tconst stop = track(() =>\n\t\t\t\teffect.opaque`morph:${fn.name}:${key}`((access) => {\n\t\t\t\t\tcache[indexRef.value] = fn(input, access)\n\t\t\t\t\treturn (reason) => {\n\t\t\t\t\t\tdelete cache[indexRef.value]\n\t\t\t\t\t\ttouched1(cache, { type: 'invalidate', prop: 'morph' }, String(key))\n\t\t\t\t\t\tconst activeEffect = getActiveEffect()\n\t\t\t\t\t\tlet chain: CleanupReason | undefined\n\t\t\t\t\t\tif (activeEffect) {\n\t\t\t\t\t\t\tconst node = getEffectNode(activeEffect)\n\t\t\t\t\t\t\tchain = node.currentReason\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstop?.({\n\t\t\t\t\t\t\ttype: 'invalidate',\n\t\t\t\t\t\t\tcause: chainExternalReason(reason ?? { type: 'stopped', chain })!,\n\t\t\t\t\t\t\tchain: chainExternalReason(chain),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t)\n\t\t\titemEffects.set(key, { stop, index: indexRef })\n\t\t}\n\t}\n\n\tconst proxy = reactive(cache, {\n\t\tget(cache, prop) {\n\t\t\tconst n = typeof prop === 'string' ? Number(prop) : NaN\n\t\t\tif (Number.isNaN(n)) return cache[prop]\n\t\t\tif (!(n in cache)) computeItem(n, input[n])\n\t\t\treturn cache[n]\n\t\t},\n\t\thas(_cache, prop) {\n\t\t\treturn Reflect.has(input, prop)\n\t\t},\n\t})\n\n\tconst stopMain = effect`morph:${fn.name}`(({ ascend }) => {\n\t\ttrack = ascend\n\t\tconst newInput = [...(typeof source === 'function' ? source() : source)]\n\t\tconst diffs = arrayDiff(input, newInput).toSorted((a, b) => b.indexA - a.indexA)\n\n\t\tif (diffs.length > 0) {\n\t\t\tfor (const diff of diffs) {\n\t\t\t\t// Stop items in removed range\n\t\t\t\tfor (let i = diff.indexA; i < diff.indexA + diff.sliceA.length; i++) stopItem(i)\n\n\t\t\t\t// Shift existing itemEffects in the Map to match the new indices\n\t\t\t\tconst shift = diff.sliceB.length - diff.sliceA.length\n\t\t\t\tif (shift !== 0) {\n\t\t\t\t\t// We need to move entries in the Map.\n\t\t\t\t\tconst entries = Array.from(itemEffects.entries()).sort((a, b) => a[0] - b[0])\n\t\t\t\t\t// Remove entries that will be shifted\n\t\t\t\t\tfor (const [idx, _entry] of entries) {\n\t\t\t\t\t\tif (idx >= diff.indexA + diff.sliceA.length) {\n\t\t\t\t\t\t\titemEffects.delete(idx)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Re-add them with shifted indices\n\t\t\t\t\tfor (const [idx, entry] of entries) {\n\t\t\t\t\t\tif (idx >= diff.indexA + diff.sliceA.length) {\n\t\t\t\t\t\t\tconst newIdx = idx + shift\n\t\t\t\t\t\t\tentry.index.value = newIdx\n\t\t\t\t\t\t\titemEffects.set(newIdx, entry)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Splice the cache\n\t\t\t\tcache.splice(\n\t\t\t\t\tdiff.indexA,\n\t\t\t\t\tdiff.sliceA.length,\n\t\t\t\t\t...new Array(diff.sliceB.length).fill(undefined)\n\t\t\t\t)\n\n\t\t\t\t// Make holes for lazy computation\n\t\t\t\tfor (let i = diff.indexA; i < diff.indexA + diff.sliceB.length; i++) delete cache[i]\n\t\t\t}\n\n\t\t\tconst invalidates = new Set<PropertyKey>([keysOf])\n\t\t\tif (input.length !== newInput.length) invalidates.add('length')\n\t\t\tfor (const diff of diffs) {\n\t\t\t\tconst max = Math.max(diff.sliceA.length, diff.sliceB.length)\n\t\t\t\tfor (let i = 0; i < max; i++) invalidates.add(String(diff.indexA + i))\n\t\t\t}\n\t\t\ttouched(cache, { type: 'bunch', method: 'morph-input' }, invalidates)\n\t\t}\n\n\t\tinput = newInput\n\t})\n\n\treturn link(proxy, (reason) => {\n\t\tstopMain(reason)\n\t\tfor (const entry of itemEffects.values()) entry.stop(reason)\n\t\titemEffects.clear()\n\t})\n}\n\n/**\n * Reactively maps a `Map` source through `fn`, producing a reactive output Map.\n *\n * Each key gets its own isolated effect so that value changes for one key only recompute\n * that key's projection. Key additions and removals are tracked via `keysOf` dependency.\n *\n * @param source - A reactive Map\n * @param fn - Mapping function applied to each value\n * @param options - Optional purity hints to skip per-key effects\n * @returns A reactive Map with a `[cleanup]` method to dispose all effects\n */\nexport function morphMap<K, V, O>(\n\tsource: Map<K, V>,\n\tfn: (arg: V, key: K, access?: EffectAccess) => O,\n\toptions?: MorphOptions<V>\n): Map<K, O> {\n\tif (!isReactive(source) && options?.pure === true) {\n\t\tconst res = new Map<K, O>()\n\t\tfor (const [k, v] of source) res.set(k, fn(v, k))\n\t\treturn res as any\n\t}\n\n\tlet track!: GetterWrapper\n\tconst itemEffects = new Map<any, ScopedCallback>()\n\tconst cache = tag(`morph:${fn.name || 'anonymous'}`, new Map<K, O>())\n\tObject.defineProperty(cache, 'constructor', { value: Object, enumerable: false })\n\n\tfunction stopItem(key: any) {\n\t\tconst stop = itemEffects.get(key)\n\t\tif (stop) {\n\t\t\tconst activeEffect = getActiveEffect()\n\t\t\tlet chain: CleanupReason | undefined\n\t\t\tif (activeEffect) {\n\t\t\t\tconst node = getEffectNode(activeEffect)\n\t\t\t\tchain = node.currentReason\n\t\t\t}\n\t\t\tstop({ type: 'stopped', chain })\n\t\t\titemEffects.delete(key)\n\t\t}\n\t}\n\n\tfunction computeItem(key: any, val: any) {\n\t\tconst isPure =\n\t\t\toptions?.pure === true || (typeof options?.pure === 'function' && options.pure(val))\n\t\tif (isPure) {\n\t\t\tcache.set(\n\t\t\t\tkey,\n\t\t\t\ttrack(() => fn(val, key))\n\t\t\t)\n\t\t} else {\n\t\t\tconst stop = track(() =>\n\t\t\t\teffect.opaque`morph:${fn.name}:${key}`((access) => {\n\t\t\t\t\tconst next = source.get(key)\n\t\t\t\t\tif (next === undefined && !source.has(key)) return\n\t\t\t\t\tcache.set(key, fn(next as V, key, access))\n\t\t\t\t\treturn (reason) => {\n\t\t\t\t\t\tcache.delete(key)\n\t\t\t\t\t\ttouched1(cache, { type: 'invalidate', prop: 'morph' }, String(key))\n\t\t\t\t\t\tconst activeEffect = getActiveEffect()\n\t\t\t\t\t\tlet chain: CleanupReason | undefined\n\t\t\t\t\t\tif (activeEffect) {\n\t\t\t\t\t\t\tconst node = getEffectNode(activeEffect)\n\t\t\t\t\t\t\tchain = node.currentReason\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstop?.({\n\t\t\t\t\t\t\ttype: 'invalidate',\n\t\t\t\t\t\t\tcause: chainExternalReason(reason ?? { type: 'stopped', chain })!,\n\t\t\t\t\t\t\tchain: chainExternalReason(chain),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t)\n\t\t\titemEffects.set(key, stop)\n\t\t}\n\t}\n\n\tconst proxy = reactive(cache, {\n\t\tget(cache, prop) {\n\t\t\tif (prop === 'get')\n\t\t\t\treturn (key: any) => {\n\t\t\t\t\tif (!cache.has(key) && source.has(key)) computeItem(key, source.get(key))\n\t\t\t\t\treturn cache.get(key)\n\t\t\t\t}\n\t\t\tif (prop === 'has')\n\t\t\t\treturn (key: any) => {\n\t\t\t\t\treturn source.has(key)\n\t\t\t\t}\n\t\t\tif (prop === 'keys')\n\t\t\t\treturn () => {\n\t\t\t\t\treturn source.keys()\n\t\t\t\t}\n\t\t\tif (prop === 'values')\n\t\t\t\treturn function* () {\n\t\t\t\t\tfor (const key of source.keys()) {\n\t\t\t\t\t\tyield proxy.get(key)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (prop === 'entries')\n\t\t\t\treturn function* () {\n\t\t\t\t\tfor (const key of source.keys()) {\n\t\t\t\t\t\tyield [key, proxy.get(key)]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (prop === Symbol.iterator)\n\t\t\t\treturn function* () {\n\t\t\t\t\tfor (const key of source.keys()) {\n\t\t\t\t\t\tyield [key, proxy.get(key)]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\treturn (cache as any)[prop]\n\t\t},\n\t}) as any\n\n\tlet stateSnapshot: State = getState(source)\n\tconst stopMain = effect`morph:${fn.name}`(({ ascend }) => {\n\t\ttrack = ascend\n\t\tdependant(source, keysOf)\n\t\twhile ('evolution' in stateSnapshot) {\n\t\t\tconst { evolution } = stateSnapshot\n\t\t\tstateSnapshot = stateSnapshot.next\n\t\t\tif (evolution.type === 'add') {\n\t\t\t\ttouched1(cache, evolution, evolution.prop)\n\t\t\t} else if (evolution.type === 'del') {\n\t\t\t\tstopItem(evolution.prop)\n\t\t\t\tcache.delete(evolution.prop)\n\t\t\t\ttouched1(cache, evolution, evolution.prop)\n\t\t\t}\n\t\t}\n\t})\n\n\treturn link(proxy, (reason) => {\n\t\tstopMain(reason)\n\t\tfor (const stop of itemEffects.values()) stop(reason)\n\t\titemEffects.clear()\n\t})\n}\n\n/**\n * Reactively maps a record/object source through `fn`, producing a reactive output record.\n *\n * Each key gets its own isolated effect so that value changes for one key only recompute\n * that key's projection. Key additions and removals are tracked automatically.\n *\n * @param source - A reactive record\n * @param fn - Mapping function applied to each value\n * @param options - Optional purity hints to skip per-key effects\n * @returns A reactive record with a `[cleanup]` method to dispose all effects\n */\nexport function morphRecord<S extends Record<PropertyKey, any>, O>(\n\tsource: S,\n\tfn: (arg: S[keyof S], key: keyof S, access?: EffectAccess) => O,\n\toptions?: MorphOptions<S[keyof S]>\n): { [K in keyof S]: O } {\n\tif (!isReactive(source) && options?.pure === true) {\n\t\tconst res = {} as any\n\t\tfor (const k of Object.keys(source)) res[k] = fn(source[k], k)\n\t\treturn res\n\t}\n\n\tlet track!: GetterWrapper\n\tconst itemEffects = new Map<any, ScopedCallback>()\n\tconst cache = {} as any\n\n\tfunction stopItem(key: any) {\n\t\tconst stop = itemEffects.get(key)\n\t\tif (stop) {\n\t\t\tconst activeEffect = getActiveEffect()\n\t\t\tlet chain: CleanupReason | undefined\n\t\t\tif (activeEffect) {\n\t\t\t\tconst node = getEffectNode(activeEffect)\n\t\t\t\tchain = node.currentReason\n\t\t\t}\n\t\t\tstop({ type: 'stopped', chain })\n\t\t\titemEffects.delete(key)\n\t\t}\n\t}\n\n\tfunction computeItem(key: any, val: any) {\n\t\tconst isPure =\n\t\t\toptions?.pure === true || (typeof options?.pure === 'function' && options.pure(val))\n\t\tif (isPure) {\n\t\t\tcache[key] = track(() => fn(val, key))\n\t\t} else {\n\t\t\tconst stop = track(() =>\n\t\t\t\teffect.opaque`morph:${fn.name}:${key}`((access) => {\n\t\t\t\t\tcache[key] = fn(source[key], key, access)\n\t\t\t\t\treturn (reason) => {\n\t\t\t\t\t\tdelete cache[key]\n\t\t\t\t\t\ttouched1(cache, { type: 'invalidate', prop: 'morph' }, String(key))\n\t\t\t\t\t\tconst activeEffect = getActiveEffect()\n\t\t\t\t\t\tlet chain: CleanupReason | undefined\n\t\t\t\t\t\tif (activeEffect) {\n\t\t\t\t\t\t\tconst node = getEffectNode(activeEffect)\n\t\t\t\t\t\t\tchain = node.currentReason\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstop?.({\n\t\t\t\t\t\t\ttype: 'invalidate',\n\t\t\t\t\t\t\tcause: chainExternalReason(reason ?? { type: 'stopped', chain })!,\n\t\t\t\t\t\t\tchain: chainExternalReason(chain),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t)\n\t\t\titemEffects.set(key, stop)\n\t\t}\n\t}\n\tfunction get(prop: PropertyKey) {\n\t\tif (!(prop in cache) && prop in source) computeItem(prop, source[prop])\n\t\treturn cache[prop]\n\t}\n\tconst proxy = reactive(cache, {\n\t\tget(_, prop) {\n\t\t\treturn get(prop)\n\t\t},\n\t\thas(_, prop) {\n\t\t\treturn prop in source\n\t\t},\n\t\townKeys() {\n\t\t\treturn Reflect.ownKeys(source)\n\t\t},\n\t\tgetOwnPropertyDescriptor(_cache, prop) {\n\t\t\tif (prop in source) return { configurable: true, enumerable: true, get: () => get(prop) }\n\t\t},\n\t})\n\n\tlet stateSnapshot: State = getState(source)\n\tconst stopMain = effect`morph:${fn.name}`(({ ascend }) => {\n\t\ttrack = ascend\n\t\t// Track only structural changes on source\n\t\tdependant(source, keysOf)\n\t\twhile ('evolution' in stateSnapshot) {\n\t\t\tconst { evolution } = stateSnapshot\n\t\t\tstateSnapshot = stateSnapshot.next\n\t\t\tif (evolution.type === 'add') {\n\t\t\t\ttouched1(cache, evolution, evolution.prop)\n\t\t\t} else if (evolution.type === 'del') {\n\t\t\t\tstopItem(evolution.prop)\n\t\t\t\tdelete cache[evolution.prop]\n\t\t\t\ttouched1(cache, evolution, evolution.prop)\n\t\t\t}\n\t\t}\n\t})\n\n\treturn link(proxy, (reason) => {\n\t\tstopMain(reason)\n\t\tfor (const stop of itemEffects.values()) stop(reason)\n\t\titemEffects.clear()\n\t})\n}\n\n/**\n * Unified reactive collection mapper. Dispatches to `morphArray`, `morphMap`, or `morphRecord`\n * based on the source type. Access `morph.pure(source, fn)` for the `{ pure: true }` shorthand.\n *\n * @see morphArray\n * @see morphMap\n * @see morphRecord\n */\nexport type Morph = {\n\t<I, O>(\n\t\tsource: readonly I[] | (() => readonly I[]),\n\t\tfn: (arg: I, access?: EffectAccess) => O,\n\t\toptions?: MorphOptions<I>\n\t): readonly O[]\n\n\t<K, V, O>(\n\t\tsource: Map<K, V>,\n\t\tfn: (arg: V, key: K, access?: EffectAccess) => O,\n\t\toptions?: MorphOptions<V>\n\t): Map<K, O>\n\n\t<S extends Record<PropertyKey, any>, O>(\n\t\tsource: S,\n\t\tfn: (arg: S[keyof S], key: keyof S, access?: EffectAccess) => O,\n\t\toptions?: MorphOptions<S[keyof S]>\n\t): { [K in keyof S]: O }\n\n\t(strings: TemplateStringsArray, ...values: readonly unknown[]): Morph\n\tpure: Morph\n}\n\n/**\n * Reactively maps a collection (array, Map, or record) through a per-entry function.\n *\n * Each entry in the source gets its own reactive context — when only one entry's dependencies\n * change, only that entry's projection recomputes. Structural changes (additions, removals,\n * reorders) are detected via diffing and applied surgically.\n *\n * Use `morph.pure(source, fn)` when `fn` has no reactive reads (skips per-item effects).\n *\n * @example\n * ```ts\n * const users = reactive([{ name: 'John' }, { name: 'Jane' }])\n * const names = morph(users, u => u.name.toUpperCase())\n * // names[0] = 'JOHN', names[1] = 'JANE'\n * // Changing users[0].name only recomputes names[0]\n * ```\n */\nexport const morph = captioned(\n\tflavored(\n\t\tfunction morph(source: any, fn: any, options?: any): any {\n\t\t\tif (Array.isArray(source) || typeof source === 'function')\n\t\t\t\treturn morphArray(source, fn, options)\n\t\t\tif (source instanceof Map) return morphMap(source, fn, options)\n\t\t\treturn morphRecord(source, fn, options)\n\t\t},\n\t\t{\n\t\t\tget pure() {\n\t\t\t\treturn (source: any, fn: any, _opt: unknown) => this(source, fn, { pure: true })\n\t\t\t},\n\t\t}\n\t),\n\t{\n\t\tname: 'morph',\n\t\tcallbackIndex: 1,\n\t\twarn: (message) => options.warn(`[reactive] ${message}`),\n\t}\n) as Morph\n","import {\n\tdeepWatchers,\n\teffectToDeepWatchedObjects,\n\tobjectsWithDeepWatchers,\n\tregisterDeepWatcher,\n} from './deep-watch-state'\nimport { effect, untracked } from './effects'\nimport { isNonReactive } from './non-reactive'\nimport { reactive } from './proxy'\nimport { markWithRoot } from './registry'\nimport { dependant } from './tracking'\nimport { type EffectCleanup, type EffectTrigger, options, unwrap } from './types'\n\n/**\n * Deep watch an object and all its nested properties\n * @param target - The object to watch deeply\n * @param callback - The callback to call when any nested property changes\n * @param options - Options for the deep watch\n * @returns A cleanup function to stop watching\n */\n/**\n * Sets up deep watching for an object, tracking all nested property changes\n * @param target - The object to watch\n * @param callback - The callback to call when changes occur\n * @param options - Options for deep watching\n * @returns A cleanup function to stop deep watching\n */\nexport function deepWatch<T extends object>(\n\ttarget: T,\n\tcallback: (value: T) => void,\n\t{ immediate = false } = {}\n): EffectCleanup | undefined {\n\tif (target === null || target === undefined) return undefined\n\tif (typeof target !== 'object') throw new Error('Target of deep watching must be an object')\n\t// Create a wrapper callback that matches EffectTrigger signature\n\tconst wrappedCallback: EffectTrigger = markWithRoot(\n\t\t(() => callback(target)) as EffectTrigger,\n\t\tcallback\n\t)\n\n\tregisterDeepWatcher()\n\n\t// Use the existing effect system to register dependencies\n\treturn effect`deepWatch`(() => {\n\t\t// Mark the target object as having deep watchers\n\t\tobjectsWithDeepWatchers.add(target)\n\n\t\t// Track which objects this effect is watching for cleanup\n\t\tlet effectObjects = effectToDeepWatchedObjects.get(wrappedCallback)\n\t\tif (!effectObjects) {\n\t\t\teffectObjects = new Set()\n\t\t\teffectToDeepWatchedObjects.set(wrappedCallback, effectObjects)\n\t\t}\n\t\teffectObjects!.add(target)\n\n\t\t// Traverse the object graph and register dependencies\n\t\t// This will re-run every time the effect runs, ensuring we catch all changes\n\t\tconst visited = new WeakSet()\n\t\tfunction traverseAndTrack(obj: any, depth = 0) {\n\t\t\t// Prevent infinite recursion and excessive depth\n\t\t\tif (!obj || visited.has(obj) || typeof obj !== 'object' || depth > options.maxDeepWatchDepth)\n\t\t\t\treturn\n\t\t\t// Do not traverse into unreactive objects\n\t\t\tif (isNonReactive(obj)) return\n\t\t\tvisited.add(obj)\n\n\t\t\t// Mark this object as having deep watchers\n\t\t\tobjectsWithDeepWatchers.add(obj)\n\t\t\teffectObjects!.add(obj)\n\n\t\t\t// Traverse all properties to register dependencies\n\t\t\t// unwrap to avoid kicking dependency\n\t\t\tfor (const key in unwrap(obj)) {\n\t\t\t\tif (Object.hasOwn(obj, key)) {\n\t\t\t\t\t// Access the property to register dependency\n\t\t\t\t\tconst value = (obj as any)[key]\n\t\t\t\t\t// Make the value reactive if it's an object\n\t\t\t\t\tconst reactiveValue =\n\t\t\t\t\t\ttypeof value === 'object' && value !== null ? reactive(value) : value\n\t\t\t\t\ttraverseAndTrack(reactiveValue, depth + 1)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Also handle array indices and length\n\t\t\t// Handle arrays and collections using iterators to ensure proxy tracking is triggered\n\t\t\tif (typeof obj[Symbol.iterator] === 'function') {\n\t\t\t\t// Access the iterator to track additions/removals/collection changes\n\t\t\t\tfor (const value of obj) {\n\t\t\t\t\t// Make the value reactive if it's an object\n\t\t\t\t\tconst reactiveValue =\n\t\t\t\t\t\ttypeof value === 'object' && value !== null ? reactive(value) : value\n\t\t\t\t\ttraverseAndTrack(reactiveValue, depth + 1)\n\t\t\t\t}\n\n\t\t\t\t// Explicitly depend on length so array mutations changing count trigger re-evaluation\n\t\t\t\tif ('length' in obj) {\n\t\t\t\t\tdependant(obj, 'length')\n\t\t\t\t}\n\n\t\t\t\t// For Maps, also ensure we track values explicitly if the iterator yields entries\n\t\t\t\tif (obj instanceof Map) {\n\t\t\t\t\tfor (const value of obj.values()) {\n\t\t\t\t\t\tconst reactiveValue =\n\t\t\t\t\t\t\ttypeof value === 'object' && value !== null ? reactive(value) : value\n\t\t\t\t\t\ttraverseAndTrack(reactiveValue, depth + 1)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Note: WeakSet and WeakMap cannot be iterated, so we can't deep watch their contents\n\t\t\t// They will only trigger when the collection itself is replaced\n\t\t}\n\n\t\t// Traverse the target object to register all dependencies\n\t\t// This will register dependencies on all current properties and array elements\n\t\ttraverseAndTrack(target)\n\n\t\t// Only call the callback if immediate is true or if it's not the first run\n\t\tif (immediate) {\n\t\t\tuntracked`deepWatch:callback`(() => callback(target))\n\t\t}\n\t\timmediate = true\n\n\t\t// Return a cleanup function that properly removes deep watcher tracking\n\t\treturn () => {\n\t\t\t// Get the objects this effect was watching\n\t\t\tconst effectObjects = effectToDeepWatchedObjects.get(wrappedCallback)\n\t\t\tif (effectObjects) {\n\t\t\t\t// Remove deep watcher tracking from all objects this effect was watching\n\t\t\t\tfor (const obj of effectObjects) {\n\t\t\t\t\t// Check if this object still has other deep watchers\n\t\t\t\t\tconst watchers = deepWatchers.get(obj)\n\t\t\t\t\tif (watchers) {\n\t\t\t\t\t\t// Remove this effect's callback from the watchers\n\t\t\t\t\t\twatchers.delete(wrappedCallback)\n\n\t\t\t\t\t\t// If no more watchers, remove the object from deep watchers tracking\n\t\t\t\t\t\tif (watchers.size === 0) {\n\t\t\t\t\t\t\tdeepWatchers.delete(obj)\n\t\t\t\t\t\t\tobjectsWithDeepWatchers.delete(obj)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// No watchers found, remove from deep watchers tracking\n\t\t\t\t\t\tobjectsWithDeepWatchers.delete(obj)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Clean up the tracking data\n\t\t\t\teffectToDeepWatchedObjects.delete(wrappedCallback)\n\t\t\t}\n\t\t}\n\t})\n}\n","import { decorator } from '../decorator'\nimport { flavored } from '../flavored'\nimport { deepCompare, named } from '../utils'\nimport { touched1 } from './change'\nimport { chainExternalReason, getActiveEffect } from './effect-context'\nimport { effect, root, untracked } from './effects'\nimport {\n\tgetEffectNode,\n\tgetRoot,\n\tmarkWithRoot,\n\ttype RootMarkedFunction,\n\trootFunctionSymbol,\n} from './registry'\nimport { dependant } from './tracking'\nimport { type CleanupReason, optionCall, options, proxyToObject } from './types'\n\nexport type MemoizableArgument = object | any[] | ((...args: any[]) => any)\nexport type Memoizable = ((...args: MemoizableArgument[]) => unknown) | Record<string, any>\n\ntype MemoCacheTree<Result> = {\n\tresult?: Result\n\tcleanup?: (reason?: CleanupReason) => void\n\tbranches?: WeakMap<MemoizableArgument, MemoCacheTree<Result>>\n}\n\nconst memoizedRegistry = new WeakMap<any, Memoizable>()\nconst wrapperRegistry = new WeakMap<Function, (that: object) => unknown>()\n\nfunction getBranch<Result>(\n\ttree: MemoCacheTree<Result>,\n\tkey: MemoizableArgument\n): MemoCacheTree<Result> {\n\ttree.branches ??= new WeakMap()\n\tlet branch = tree.branches.get(key)\n\tif (!branch) {\n\t\tbranch = {}\n\t\ttree.branches.set(key, branch)\n\t}\n\treturn branch\n}\n\nfunction memoizeFunction<Result, Args extends MemoizableArgument[]>(\n\tfn: (...args: Args) => Result,\n\topts?: {\n\t\tlenient?: boolean\n\t}\n): (...args: Args) => Result {\n\tconst fnRoot = getRoot(fn)\n\tconst existing = memoizedRegistry.get(fnRoot)\n\tif (existing) return existing as (...args: Args) => Result\n\n\tconst cacheRoot: MemoCacheTree<Result> = {}\n\tconst memoized = markWithRoot(function memoized(this: unknown, ...args: Args): Result {\n\t\tif (args.some((arg) => !(arg && ['object', 'symbol', 'function'].includes(typeof arg)))) {\n\t\t\tif (opts?.lenient) return fn.apply(this, args)\n\t\t\tthrow new Error('memoize expects non-null object arguments')\n\t\t}\n\n\t\tlet node: MemoCacheTree<Result> = cacheRoot\n\t\t// Note: decorators add `this` as first argument\n\t\tfor (const arg of args) {\n\t\t\tnode = getBranch(node, arg)\n\t\t}\n\n\t\tdependant(node, 'memoize')\n\t\tif ('result' in node) {\n\t\t\tif (options.onMemoizationDiscrepancy) {\n\t\t\t\tconst wasVerification = options.isVerificationRun\n\t\t\t\toptions.isVerificationRun = true\n\t\t\t\ttry {\n\t\t\t\t\tconst fresh = untracked`memoize:verify-calculation`(() => fn.apply(this, args))\n\t\t\t\t\tif (!deepCompare(node.result, fresh)) {\n\t\t\t\t\t\toptionCall('onMemoizationDiscrepancy', node.result, fresh, fn, args, 'calculation')\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\toptions.isVerificationRun = wasVerification\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn node.result!\n\t\t}\n\n\t\t// Create memoize internal effect to track dependencies and invalidate cache\n\t\t// Use untracked to prevent the effect creation from being affected by parent effects\n\t\tnode.cleanup = root`memoize:root`(() =>\n\t\t\teffect`memoize`(\n\t\t\t\t() => {\n\t\t\t\t\t// Execute the function and track its dependencies\n\t\t\t\t\t// The function execution will automatically track dependencies on reactive objects\n\t\t\t\t\tnode.result = fn.apply(this, args)\n\t\t\t\t\treturn (reason) => {\n\t\t\t\t\t\t// When dependencies change, clear the cache and notify consumers\n\t\t\t\t\t\tdelete node.result\n\t\t\t\t\t\ttouched1(node, { type: 'invalidate', prop: args }, 'memoize')\n\t\t\t\t\t\t// Lazy memoization: stop the effect so it doesn't re-run immediately.\n\t\t\t\t\t\t// It will be re-created on next access.\n\t\t\t\t\t\tif (node.cleanup) {\n\t\t\t\t\t\t\tconst activeEffect = getActiveEffect()\n\t\t\t\t\t\t\tlet chain: CleanupReason | undefined\n\t\t\t\t\t\t\tif (activeEffect) {\n\t\t\t\t\t\t\t\tconst effectNode = getEffectNode(activeEffect)\n\t\t\t\t\t\t\t\tchain = effectNode.currentReason\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnode.cleanup({\n\t\t\t\t\t\t\t\ttype: 'invalidate',\n\t\t\t\t\t\t\t\tcause: chainExternalReason(reason ?? { type: 'stopped', chain })!,\n\t\t\t\t\t\t\t\tchain: chainExternalReason(chain),\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tnode.cleanup = undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ opaque: true }\n\t\t\t)\n\t\t)\n\n\t\tif (options.onMemoizationDiscrepancy) {\n\t\t\tconst wasVerification = options.isVerificationRun\n\t\t\toptions.isVerificationRun = true\n\t\t\ttry {\n\t\t\t\tconst fresh = untracked`memoize:verify-comparison`(() => fn.apply(this, args))\n\t\t\t\tif (!deepCompare(node.result, fresh)) {\n\t\t\t\t\toptionCall('onMemoizationDiscrepancy', node.result, fresh, fn, args, 'comparison')\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\toptions.isVerificationRun = wasVerification\n\t\t\t}\n\t\t}\n\n\t\treturn node.result!\n\t}, fn)\n\n\tmemoizedRegistry.set(fnRoot, memoized)\n\tmemoizedRegistry.set(memoized, memoized)\n\treturn memoized as (...args: Args) => Result\n}\n\nfunction memoizeObject<T extends Record<string, any>>(target: T, opts?: { lenient?: boolean }): T {\n\tconst existing = memoizedRegistry.get(target)\n\tif (existing) return existing as T\n\n\tconst proxy = new Proxy(target, {\n\t\tget(source, prop, receiver) {\n\t\t\t// 1. Walk prototype chain to find descriptor\n\t\t\tlet current = source\n\t\t\tlet desc: PropertyDescriptor | undefined\n\t\t\twhile (current) {\n\t\t\t\tdesc = Object.getOwnPropertyDescriptor(current, prop)\n\t\t\t\tif (desc) break\n\t\t\t\tcurrent = Object.getPrototypeOf(current)\n\t\t\t}\n\t\t\tif (!desc) return Reflect.get(source, prop, receiver)\n\t\t\t// 2. If getter, memoize\n\t\t\tif (desc.get) {\n\t\t\t\tconst originalGetter = desc.get\n\t\t\t\tlet wrapper = wrapperRegistry.get(originalGetter)\n\t\t\t\tif (!wrapper) {\n\t\t\t\t\twrapper = markWithRoot(\n\t\t\t\t\t\tnamed(\n\t\t\t\t\t\t\t`${String(source?.constructor?.name ?? 'Object')}.${String(prop)}`,\n\t\t\t\t\t\t\t(that: any) => {\n\t\t\t\t\t\t\t\treturn originalGetter.call(that)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpropertyKey: prop,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t\tconst origRoot = (originalGetter as RootMarkedFunction)[rootFunctionSymbol]\n\t\t\t\t\tif (origRoot) (wrapper as RootMarkedFunction)[rootFunctionSymbol] = origRoot\n\t\t\t\t\twrapperRegistry.set(originalGetter, wrapper)\n\t\t\t\t}\n\t\t\t\tconst memoized = memoizeFunction(wrapper, opts)\n\t\t\t\treturn memoized(receiver)\n\t\t\t}\n\n\t\t\t// 3. Otherwise forward\n\t\t\treturn Reflect.get(source, prop, receiver)\n\t\t},\n\t\t// Forward set to the target (source) to ensure it acts as the receiver for reactivity notifications\n\t\tset(source, prop, value, _receiver) {\n\t\t\t// By strictly passing `source` as receiver, we ensure that if `source` is a reactive proxy,\n\t\t\t// it recognizes itself and triggers change notifications.\n\t\t\treturn Reflect.set(source, prop, value, source)\n\t\t},\n\t})\n\n\tproxyToObject.set(proxy, target)\n\tmemoizedRegistry.set(target, proxy)\n\treturn proxy\n}\n\n/**\n * Decorator and function wrapper for memoizing computed values based on reactive dependencies.\n *\n * When used as a decorator on getters or methods, it caches the result and automatically\n * invalidates the cache when reactive dependencies change.\n *\n * When used as a function wrapper, it memoizes based on object arguments (WeakMap-based cache).\n *\n * @example\n * ```typescript\n * class User {\n * @memoize\n * get fullName() {\n * return `${this.firstName} ${this.lastName}`\n * }\n * }\n *\n * // Or as a function wrapper\n * const expensive = memoize((obj: SomeObject) => {\n * return heavyComputation(obj)\n * })\n * ```\n */\nfunction makeMemoizeDecorator(memoizeOpts?: { lenient?: boolean }) {\n\treturn decorator({\n\t\tgetter(original, target, propertyKey) {\n\t\t\treturn function (this: any) {\n\t\t\t\tlet wrapper = wrapperRegistry.get(original)\n\t\t\t\tif (!wrapper) {\n\t\t\t\t\twrapper = markWithRoot(\n\t\t\t\t\t\tnamed(\n\t\t\t\t\t\t\t`${String(target?.constructor?.name ?? target?.name ?? 'Object')}.${String(propertyKey)}`,\n\t\t\t\t\t\t\t(that: object) => {\n\t\t\t\t\t\t\t\treturn original.call(that)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmethod: original,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t\tconst origRoot = (original as RootMarkedFunction)[rootFunctionSymbol]\n\t\t\t\t\tif (origRoot) (wrapper as RootMarkedFunction)[rootFunctionSymbol] = origRoot\n\t\t\t\t\twrapperRegistry.set(original, wrapper)\n\t\t\t\t}\n\t\t\t\tconst memoized = memoizeFunction(wrapper as any, memoizeOpts)\n\t\t\t\treturn memoized(this)\n\t\t\t}\n\t\t},\n\t\tmethod(original, target, name) {\n\t\t\treturn function (this: any, ...args: object[]) {\n\t\t\t\tlet wrapper = wrapperRegistry.get(original)\n\t\t\t\tif (!wrapper) {\n\t\t\t\t\twrapper = markWithRoot(\n\t\t\t\t\t\tnamed(\n\t\t\t\t\t\t\t`${String(target?.constructor?.name ?? target?.name ?? 'Object')}.${String(name)}`,\n\t\t\t\t\t\t\t(that: object, ...args: object[]) => {\n\t\t\t\t\t\t\t\treturn original.call(that, ...args)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmethod: original,\n\t\t\t\t\t\t\tpropertyKey: name,\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t\tconst origRoot = (original as RootMarkedFunction)[rootFunctionSymbol]\n\t\t\t\t\tif (origRoot) (wrapper as RootMarkedFunction)[rootFunctionSymbol] = origRoot\n\t\t\t\t\twrapperRegistry.set(original, wrapper)\n\t\t\t\t}\n\t\t\t\tconst memoized = memoizeFunction(wrapper as any, memoizeOpts) as (\n\t\t\t\t\t...args: object[]\n\t\t\t\t) => unknown\n\t\t\t\treturn memoized(this, ...args)\n\t\t\t}\n\t\t},\n\t\tdefault: <T extends Memoizable>(target: T): T =>\n\t\t\ttypeof target === 'object'\n\t\t\t\t? (memoizeObject(target, memoizeOpts) as T)\n\t\t\t\t: (memoizeFunction(target, memoizeOpts) as T),\n\t})\n}\n\nexport const memoize: ReturnType<typeof makeMemoizeDecorator> & {\n\treadonly lenient: ReturnType<typeof makeMemoizeDecorator>\n} = flavored(makeMemoizeDecorator(), {\n\tget lenient() {\n\t\treturn makeMemoizeDecorator({ lenient: true })\n\t},\n})\n","import { FoolProof } from '../utils'\nimport { attend } from './buffer'\nimport { touched1 } from './change'\nimport { link } from './effect-context'\nimport { reactive } from './proxy'\nimport type { CleanupReason, EffectCloser } from './types'\n\n/**\n * Provides type-safe access to a source object's property within the organized callback.\n * @template Source - The type of the source object\n * @template Key - The type of the property key in the source object\n */\nexport type OrganizedAccess<Source extends Record<PropertyKey, any>, Key extends keyof Source> = {\n\t/** The property key being accessed */\n\treadonly key: Key\n\n\t/**\n\t * Gets the current value of the property from the source object\n\t * @returns The current value of the property\n\t */\n\tget(): Source[Key]\n\n\t/**\n\t * Updates the property value in the source object\n\t * @param value - The new value to set\n\t * @returns {boolean} True if the update was successful\n\t */\n\tset(value: Source[Key]): boolean\n\n\t/**\n\t * The current value of the property (equivalent to using get()/set() directly)\n\t */\n\tvalue: Source[Key]\n}\n\n/**\n * Callback function type for the organized function that processes each source property.\n * @template Source - The type of the source object\n * @template Target - The type of the target object\n */\nexport type OrganizedCallback<Source extends Record<PropertyKey, any>, Target extends object> = <\n\tKey extends keyof Source,\n>(\n\t/**\n\t * Accessor object for the current source property\n\t */\n\taccess: OrganizedAccess<Source, Key>,\n\n\t/**\n\t * The target object where organized data will be stored\n\t */\n\ttarget: Target\n) => EffectCloser | undefined\n\n/**\n * The result type of the organized function, combining the target object with cleanup capability.\n * @template Target - The type of the target object\n */\nexport type OrganizedResult<Target extends object> = Target\n\n/**\n * Organizes a source object's properties into a target object using a callback function.\n * This creates a reactive mapping between source properties and a target object,\n * automatically handling property additions, updates, and removals.\n *\n * @template Source - The type of the source object\n * @template Target - The type of the target object (defaults to Record<PropertyKey, any>)\n *\n * @param {Source} source - The source object to organize\n * @param {OrganizedCallback<Source, Target>} apply - Callback function that defines how each source property is mapped to the target\n * @param {Target} [baseTarget={}] - Optional base target object to use (will be made reactive if not already)\n *\n * @returns {OrganizedResult<Target>} The target object with cleanup capability\n *\n * @example\n * // Organize user permissions into role-based access\n * const user = reactive({ isAdmin: true, canEdit: false });\n * const permissions = organized(\n * user,\n * (access, target) => {\n * if (access.key === 'isAdmin') {\n * target.hasFullAccess = access.value;\n * }\n * target[`can${access.key.charAt(0).toUpperCase() + access.key.slice(1)}`] = access.value;\n * }\n * );\n *\n * @example\n * // Transform object structure with cleanup\n * const source = reactive({ firstName: 'John', lastName: 'Doe' });\n * const formatted = organized(\n * source,\n * (access, target) => {\n * if (access.key === 'firstName' || access.key === 'lastName') {\n * target.fullName = `${source.firstName} ${source.lastName}`.trim();\n * }\n * }\n * );\n *\n * @example\n * // Using with cleanup in a component\n * effect(() => {\n * const data = fetchData();\n * const organizedData = organized(data, (access, target) => {\n * // Transform data\n * });\n *\n * // The cleanup will be called automatically when the effect is disposed\n * return () => organizedData[cleanup]();\n * });\n */\nexport function organized<\n\tSource extends Record<PropertyKey, any>,\n\tTarget extends object = Record<PropertyKey, any>,\n>(\n\tsource: Source,\n\tapply: OrganizedCallback<Source, Target>,\n\tbaseTarget: Target = {} as Target\n): OrganizedResult<Target> {\n\tconst observedSource = reactive(source) as Source\n\tconst target = reactive(baseTarget) as Target\n\n\tconst stop = attend`organized:entries`(\n\t\tfunction enumerateObservedSourceKeys() {\n\t\t\tconst keys: PropertyKey[] = []\n\t\t\tfor (const key in observedSource) keys.push(key)\n\t\t\treturn keys\n\t\t},\n\t\tfunction applyObservedSourceKey(key) {\n\t\t\tconst sourceKey = key as keyof Source\n\t\t\tconst accessBase = {\n\t\t\t\tkey: sourceKey,\n\t\t\t\tget: () => FoolProof.get(observedSource, sourceKey, observedSource),\n\t\t\t\tset: (value: Source[typeof sourceKey]) =>\n\t\t\t\t\tFoolProof.set(observedSource, sourceKey, value, observedSource),\n\t\t\t}\n\t\t\tObject.defineProperty(accessBase, 'value', {\n\t\t\t\tget: accessBase.get,\n\t\t\t\tset: accessBase.set,\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t})\n\t\t\treturn apply(accessBase as OrganizedAccess<Source, typeof sourceKey>, target)\n\t\t}\n\t)\n\n\treturn link(target, (reason?: CleanupReason) => stop(reason)) as OrganizedResult<Target>\n}\n\n/**\n * Organizes a property on a target object\n * Shortcut for defineProperty/delete with touched signal\n * @param target - The target object\n * @param property - The property to organize\n * @param access - The access object\n * @returns The property descriptor\n */\nexport function organize<T>(\n\ttarget: object,\n\tproperty: PropertyKey,\n\taccess: { get?(): T; set?(value: T): boolean }\n) {\n\tObject.defineProperty(target, property, {\n\t\tget: access.get,\n\t\tset: access.set,\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t})\n\ttouched1(target, { type: 'set', prop: property }, property)\n\treturn () => delete (target as any)[property]\n}\n","import { decorator, type GenericClassDecorator } from '../decorator'\nimport { captioned, flavored, flavorOptions } from '../flavored'\nimport { deepWatch } from './deep-watch'\nimport { effectHistory, link } from './effect-context'\nimport { captured, effect, untracked } from './effects'\nimport { addUnreactiveProps, isNonReactive } from './non-reactive'\nimport { reactive } from './proxy'\nimport { markWithRoot } from './registry'\nimport { dependant } from './tracking'\nimport {\n\ttype EffectAccess,\n\ttype EffectCleanup,\n\toptions,\n\ttype ScopedCallback,\n\tunreactiveProperties,\n\tunwrap,\n} from './types'\n\n//#region watch\n\nconst unsetYet = Symbol('unset-yet')\n/**\n * Options for the watch function\n */\nexport interface WatchOptions {\n\t/** Whether to call the callback immediately */\n\timmediate?: boolean\n\t/** Whether to watch nested properties */\n\tdeep?: boolean\n}\n\n/**\n * Watches a reactive value and calls a callback when it changes\n */\nexport interface Watch {\n\t<T>(\n\t\tvalue: (dep: EffectAccess) => T,\n\t\tchanged: (value: T, oldValue?: T) => void,\n\t\toptions?: Omit<WatchOptions, 'deep'> & { deep?: false }\n\t): EffectCleanup\n\t/**\n\t * Watches a reactive value with deep watching enabled\n\t */\n\t<T extends object | any[]>(\n\t\tvalue: (dep: EffectAccess) => T,\n\t\tchanged: (value: T, oldValue?: T) => void,\n\t\toptions?: Omit<WatchOptions, 'deep'> & { deep: true }\n\t): EffectCleanup\n\t/**\n\t * Watches a reactive object directly\n\t */\n\t<T extends object | any[]>(\n\t\tvalue: T,\n\t\tchanged: (value: T) => void,\n\t\toptions?: WatchOptions\n\t): EffectCleanup\n\t(strings: TemplateStringsArray, ...values: readonly unknown[]): Watch\n\n\t/** Deep watch flavor */\n\tget deep(): Watch\n\t/** Immediate watch flavor */\n\tget immediate(): Watch\n}\n\nexport const watch = captioned(\n\tflavored(\n\t\tfunction watch(\n\t\t\tvalue: any, //object | ((dep: DependencyAccess) => object),\n\t\t\tchanged: (value?: object, oldValue?: object) => void,\n\t\t\toptions: any = {}\n\t\t) {\n\t\t\treturn typeof value === 'function'\n\t\t\t\t? watchCallBack(value, changed, options)\n\t\t\t\t: typeof value === 'object' && value !== null\n\t\t\t\t\t? watchObject(value, changed, options)\n\t\t\t\t\t: (() => {\n\t\t\t\t\t\t\tthrow new Error('watch: value must be a function or an object')\n\t\t\t\t\t\t})()\n\t\t},\n\t\t{\n\t\t\tget deep() {\n\t\t\t\treturn flavorOptions(this, { deep: true })\n\t\t\t},\n\t\t\tget immediate() {\n\t\t\t\treturn flavorOptions(this, { immediate: true })\n\t\t\t},\n\t\t}\n\t),\n\t{\n\t\tname: 'watch',\n\t\twarn: (message) => options.warn(`[reactive] ${message}`),\n\t}\n) as Watch\n\nfunction watchObject(\n\tvalue: object,\n\tchanged: (value: object) => void,\n\t{ immediate = false, deep = false } = {}\n): EffectCleanup {\n\tif (deep) return deepWatch(value, changed, { immediate })!\n\treturn effect`watch:object`(() => {\n\t\tdependant(value)\n\t\tif (immediate) changed(value)\n\t\timmediate = true\n\t})\n}\n\nfunction watchCallBack<T>(\n\tvalue: (dep: EffectAccess) => T,\n\tchanged: (value: T, oldValue?: T) => void,\n\t{ immediate = false, deep = false } = {}\n): EffectCleanup {\n\tlet oldValue: T | typeof unsetYet = unsetYet\n\tlet deepCleanup: EffectCleanup | undefined\n\tconst cbCleanup = effect`watch:callback`(\n\t\tmarkWithRoot((access) => {\n\t\t\tconst newValue = value(access)\n\t\t\tif (oldValue !== newValue) {\n\t\t\t\tconst old = oldValue\n\t\t\t\tif (old === unsetYet) {\n\t\t\t\t\tif (immediate) untracked`watch:changed`(() => changed(newValue))\n\t\t\t\t} else untracked`watch:changed`(() => changed(newValue, old as T))\n\t\t\t}\n\t\t\toldValue = newValue\n\t\t\tif (deep) {\n\t\t\t\tif (deepCleanup) deepCleanup()\n\t\t\t\tdeepCleanup = deepWatch(newValue as object, (value) => changed(value as T, value as T))\n\t\t\t}\n\t\t}, value)\n\t)\n\treturn (() => {\n\t\tcbCleanup()\n\t\tif (deepCleanup) deepCleanup()\n\t}) as EffectCleanup\n}\n\n//#endregion\n\n//#region when\n\n/**\n * Returns a promise that resolves when the predicate returns a truthy value.\n * The predicate is evaluated reactively — it re-runs whenever its dependencies change.\n * @param predicate - Reactive function that returns a value; resolves when truthy\n * @param timeout - Optional timeout in milliseconds — rejects if condition is not met within this duration\n * @returns Promise that resolves with the first truthy return value\n */\nexport function when<T>(predicate: (dep: EffectAccess) => T, timeout?: number): Promise<T> {\n\treturn new Promise<T>((resolve, reject) => {\n\t\tlet timer: ReturnType<typeof setTimeout> | undefined\n\t\tconst stop = effect`watch:when`((access) => {\n\t\t\ttry {\n\t\t\t\tconst value = predicate(access)\n\t\t\t\tif (value) {\n\t\t\t\t\tif (timer !== undefined) clearTimeout(timer)\n\t\t\t\t\ttimer = undefined\n\t\t\t\t\tqueueMicrotask(() => stop())\n\t\t\t\t\tresolve(value)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (timer !== undefined) clearTimeout(timer)\n\t\t\t\ttimer = undefined\n\t\t\t\treject(error)\n\t\t\t}\n\t\t})\n\t\tif (timeout !== undefined) {\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tstop()\n\t\t\t\ttimer = undefined\n\t\t\t\treject(new Error(`when: timed out after ${timeout}ms`))\n\t\t\t}, timeout)\n\t\t}\n\t})\n}\n\n//#endregion\n\n//#region nonReactive\n\n/**\n * Mark an object as non-reactive. This object and all its properties will never be made reactive.\n * @param obj - The object to mark as non-reactive\n */\nfunction shallowNonReactive<T>(obj: T): T {\n\tobj = unwrap(obj)\n\tif (isNonReactive(obj)) return obj\n\t;(obj as any)[unreactiveProperties] = true\n\treturn obj\n}\nfunction unreactiveApplication<T extends object>(...args: (keyof T)[]): GenericClassDecorator<T>\nfunction unreactiveApplication<T extends object>(obj: T): T\nfunction unreactiveApplication<T extends object>(\n\targ1: T | keyof T,\n\t...args: (keyof T)[]\n): GenericClassDecorator<T> | T {\n\treturn typeof arg1 === 'object'\n\t\t? shallowNonReactive(arg1)\n\t\t: (((original) => {\n\t\t\t\t// Copy the parent's unreactive properties if they exist\n\t\t\t\tconst parentMarker = (original.prototype as any)[unreactiveProperties]\n\t\t\t\t// If parent is fully unreactive, child is too\n\t\t\t\tif (parentMarker === true) {\n\t\t\t\t\t;(original.prototype as any)[unreactiveProperties] = true\n\t\t\t\t} else {\n\t\t\t\t\tconst set = new Set<PropertyKey>(parentMarker || [])\n\t\t\t\t\t// Add all arguments (including the first one)\n\t\t\t\t\tset.add(arg1)\n\t\t\t\t\tfor (const arg of args) set.add(arg)\n\t\t\t\t\taddUnreactiveProps(original.prototype, set)\n\t\t\t\t}\n\t\t\t\treturn original // Return the class\n\t\t\t}) as GenericClassDecorator<T>)\n}\n/**\n * Decorator that marks classes or properties as non-reactive\n * Prevents objects from being made reactive\n */\nexport const unreactive = decorator({\n\tclass(original) {\n\t\t// Called without arguments, mark entire class as non-reactive\n\t\t;(original.prototype as any)[unreactiveProperties] = true\n\t},\n\tdefault: unreactiveApplication,\n})\n\n//#endregion\n\n//#region resource\n\nexport function lazyInit<T extends object>(resource: T, load: ScopedCallback) {\n\tconst creation = effectHistory.active\n\tlet fresh = true\n\tconst target = resource as T & Record<PropertyKey, unknown>\n\treturn new Proxy(resource, {\n\t\t[Symbol.toStringTag]: 'LazyInit',\n\t\tget(target, prop) {\n\t\t\tif (fresh) {\n\t\t\t\tcaptured(creation, load)()\n\t\t\t\tfresh = false\n\t\t\t}\n\t\t\treturn (target as typeof target & Record<PropertyKey, unknown>)[prop]\n\t\t},\n\t} as ProxyHandler<T>)\n}\n\nexport interface Resource<T> {\n\tvalue: T | undefined\n\tloading: boolean\n\terror: any\n\tlatest: T | undefined\n\treload(): void\n\tpromise: Promise<void>\n}\n\n/**\n * Creates a reactive resource that automatically tracks async state.\n * @param fetcher - Async function that returns the value. Reactive dependencies are tracked.\n * @param options - Resource options (initialValue)\n * @returns Reactive Resource object with value, loading, error, latest properties\n */\nexport function resource<T>(\n\tfetcher: (access: EffectAccess) => Promise<T> | T,\n\toptions: { initialValue?: T } = {}\n): Resource<T> {\n\tconst resource: Partial<Resource<T>> = reactive({\n\t\tvalue: options.initialValue,\n\t\tloading: true,\n\t\terror: undefined as any,\n\t\tlatest: options.initialValue,\n\t\treload() {\n\t\t\treloadSignal.value++\n\t\t},\n\t})\n\n\tconst reloadSignal = reactive({ value: 0 })\n\t// Solve race conditions: make sure a new fast request is not overloaded by a slow old one\n\tlet counter = 0\n\n\treturn lazyInit(resource as Resource<T>, () => {\n\t\tlink(\n\t\t\tresource,\n\t\t\teffect`watch:resource`((access) => {\n\t\t\t\t// Track reload signal to enable manual reloading\n\t\t\t\tvoid reloadSignal.value\n\n\t\t\t\tconst id = ++counter\n\t\t\t\tresource.loading = true\n\t\t\t\tresource.error = undefined\n\n\t\t\t\ttry {\n\t\t\t\t\tconst result = fetcher(access)\n\n\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\tresource.promise = result\n\t\t\t\t\t\t\t.then((val) => {\n\t\t\t\t\t\t\t\tif (id === counter) {\n\t\t\t\t\t\t\t\t\tresource.value = val\n\t\t\t\t\t\t\t\t\tresource.latest = val\n\t\t\t\t\t\t\t\t\tresource.loading = false\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch((err) => {\n\t\t\t\t\t\t\t\tif (id === counter) {\n\t\t\t\t\t\t\t\t\tresource.error = err\n\t\t\t\t\t\t\t\t\tresource.loading = false\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresource.promise = Promise.resolve()\n\t\t\t\t\t\tresource.value = result\n\t\t\t\t\t\tresource.latest = result\n\t\t\t\t\t\tresource.loading = false\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\tresource.promise = Promise.reject(err)\n\t\t\t\t\tresource.error = err\n\t\t\t\t\tresource.loading = false\n\t\t\t\t}\n\t\t\t})\n\t\t) as Resource<T>\n\t})\n}\n\n//#endregion\n","import { reactive } from './proxy'\n\n/**\n * Converts an iterator to a generator that yields reactive values\n */\nexport function* makeReactiveIterator<T>(iterator: Iterator<T>): Generator<T> {\n\tlet result = iterator.next()\n\twhile (!result.done) {\n\t\tyield reactive(result.value)\n\t\tresult = iterator.next()\n\t}\n}\n\n/**\n * Converts an iterator of key-value pairs to a generator that yields reactive key-value pairs\n */\nexport function* makeReactiveEntriesIterator<K, V>(iterator: Iterator<[K, V]>): Generator<[K, V]> {\n\tlet result = iterator.next()\n\twhile (!result.done) {\n\t\tconst [key, value] = result.value\n\t\tyield [reactive(key), reactive(value)]\n\t\tresult = iterator.next()\n\t}\n}\n","import { FoolProof } from '../utils'\nimport { touched } from './change'\nimport { atomic } from './effects'\nimport { makeReactiveEntriesIterator, makeReactiveIterator } from './iterator-helpers'\nimport { reactive } from './proxy'\nimport { dependant } from './tracking'\nimport { keysOf, unwrap } from './types'\n\nfunction* index(i: number, { length = true } = {}): IterableIterator<number | 'length'> {\n\tif (length) yield 'length'\n\tyield i\n}\nexport abstract class Indexer extends Array {\n\tget(i: number): any {\n\t\tdependant(this, i)\n\t\treturn reactive(this[i])\n\t}\n\t// Returns undefined intentionally: signals the proxy handler that notifications\n\t// were already dispatched via touched(), preventing double notification\n\tset(i: number, value: any) {\n\t\tconst added = i >= this.length\n\t\tthis[i] = value\n\t\ttouched(this, { type: 'set', prop: i }, index(i, { length: added }))\n\t}\n}\nconst indexLess = { get: FoolProof.get, set: FoolProof.set }\n// Fast numeric-string check: first char is a digit (0-9)\nfunction asIndex(prop: string): number {\n\tconst c = prop.charCodeAt(0)\n\tif (c < 48 || c > 57) return -1 // not 0-9\n\tconst n = +prop // coerce — faster than parseInt, handles \"0\", \"12\", etc.\n\treturn n === (n | 0) && n >= 0 ? n : -1\n}\nObject.assign(FoolProof, {\n\tget(obj: any, prop: any, receiver: any) {\n\t\tif (Array.isArray(obj) && typeof prop === 'string') {\n\t\t\tconst i = asIndex(prop)\n\t\t\tif (i >= 0) return Indexer.prototype.get.call(obj, i)\n\t\t}\n\t\treturn indexLess.get(obj, prop, receiver)\n\t},\n\tset(obj: any, prop: any, value: any, receiver: any) {\n\t\tif (Array.isArray(obj) && typeof prop === 'string') {\n\t\t\tconst i = asIndex(prop)\n\t\t\tif (i >= 0) return Indexer.prototype.set.call(obj, i, value)\n\t\t}\n\t\treturn indexLess.set(obj, prop, value, receiver)\n\t},\n})\n\nexport abstract class ReactiveArray extends Array {\n\ttoJSON() {\n\t\treturn this\n\t}\n}\n/**\n * This is a wrapper class for Array that adds reactive behavior.\n * It extends Array and overrides methods to add reactive behavior, while making sure that the internal representation is not reactive.\n */\nexport abstract class ReactiveArrayWrapper extends Array {\n\tat(index: number): any {\n\t\treturn reactive(super.at(index))\n\t}\n\n\tconcat(...items: any[]): any[] {\n\t\treturn reactive(super.concat(...items.map(unwrap)))\n\t}\n\n\tentries(): any {\n\t\tdependant(this, keysOf)\n\t\treturn makeReactiveEntriesIterator(super.entries())\n\t}\n\n\tevery<S>(\n\t\tpredicate: (value: any, index: number, array: any[]) => value is S,\n\t\tthisArg?: any\n\t): this is S[]\n\tevery(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean\n\tevery(predicate: (value: any, index: number, array: any[]) => any, thisArg?: any): any {\n\t\treturn super.every((v, i, a) => predicate.call(thisArg, reactive(v), i, a), thisArg)\n\t}\n\n\t@atomic\n\tfill(value: any, start?: number, end?: number): this {\n\t\treturn super.fill(unwrap(value), start, end) as this\n\t}\n\n\t@atomic\n\tcopyWithin(target: number, start: number, end?: number): this {\n\t\treturn super.copyWithin(target, start, end) as this\n\t}\n\n\tfilter<S>(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): S[]\n\tfilter(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any[]\n\tfilter(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any {\n\t\treturn reactive(super.filter((v, i, a) => predicate.call(thisArg, reactive(v), i, a), thisArg))\n\t}\n\n\tfind<S>(\n\t\tpredicate: (value: any, index: number, array: any[]) => value is S,\n\t\tthisArg?: any\n\t): S | undefined\n\tfind(\n\t\tpredicate: (value: any, index: number, array: any[]) => unknown,\n\t\tthisArg?: any\n\t): any | undefined\n\tfind(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any {\n\t\treturn reactive(super.find((v, i, a) => predicate.call(thisArg, reactive(v), i, a), thisArg))\n\t}\n\n\tfindIndex(\n\t\tpredicate: (value: any, index: number, array: any[]) => unknown,\n\t\tthisArg?: any\n\t): number {\n\t\treturn super.findIndex((v, i, a) => predicate.call(thisArg, reactive(v), i, a), thisArg)\n\t}\n\n\tfindLast<S>(\n\t\tpredicate: (value: any, index: number, array: any[]) => value is S,\n\t\tthisArg?: any\n\t): S | undefined\n\tfindLast(\n\t\tpredicate: (value: any, index: number, array: any[]) => unknown,\n\t\tthisArg?: any\n\t): any | undefined\n\tfindLast(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any {\n\t\treturn reactive(\n\t\t\tsuper.findLast((v, i, a) => predicate.call(thisArg, reactive(v), i, a), thisArg)\n\t\t)\n\t}\n\n\tfindLastIndex(\n\t\tpredicate: (value: any, index: number, array: any[]) => unknown,\n\t\tthisArg?: any\n\t): number {\n\t\treturn super.findLastIndex((v, i, a) => predicate.call(thisArg, reactive(v), i, a), thisArg)\n\t}\n\n\tflat(depth?: number): any[] {\n\t\tdependant(this, keysOf)\n\t\treturn reactive(super.flat(depth))\n\t}\n\n\tflatMap(callbackfn: (value: any, index: number, array: any[]) => any, thisArg?: any): any[] {\n\t\treturn reactive(\n\t\t\tsuper.flatMap((v, i, a) => unwrap(callbackfn.call(thisArg, reactive(v), i, a)), thisArg)\n\t\t)\n\t}\n\n\tforEach(callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any): void {\n\t\tsuper.forEach((v, i, a) => {\n\t\t\tcallbackfn.call(thisArg, reactive(v), i, a)\n\t\t}, thisArg)\n\t}\n\n\tincludes(searchElement: any, fromIndex?: number): boolean {\n\t\treturn arguments.length > 1\n\t\t\t? super.includes(unwrap(searchElement), fromIndex)\n\t\t\t: super.includes(unwrap(searchElement))\n\t}\n\n\tindexOf(searchElement: any, fromIndex?: number): number {\n\t\treturn arguments.length > 1\n\t\t\t? super.indexOf(unwrap(searchElement), fromIndex)\n\t\t\t: super.indexOf(unwrap(searchElement))\n\t}\n\n\tjoin(separator?: string): string {\n\t\treturn super.join(separator)\n\t}\n\n\tkeys(): any {\n\t\tdependant(this, 'length')\n\t\treturn super.keys()\n\t}\n\n\tlastIndexOf(searchElement: any, fromIndex?: number): number {\n\t\treturn arguments.length > 1\n\t\t\t? super.lastIndexOf(unwrap(searchElement), fromIndex)\n\t\t\t: super.lastIndexOf(unwrap(searchElement))\n\t}\n\n\tmap<U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[] {\n\t\treturn reactive(\n\t\t\tsuper.map((v, i, a) => unwrap(callbackfn.call(thisArg, reactive(v), i, a)), thisArg)\n\t\t)\n\t}\n\n\t@atomic\n\tpop(): any {\n\t\treturn reactive(super.pop())\n\t}\n\n\t@atomic\n\tpush(...items: any[]): number {\n\t\treturn super.push(...items.map(unwrap))\n\t}\n\n\treduce(\n\t\tcallbackfn: (acc: any, value: any, index: number, array: any[]) => any,\n\t\tinitialValue?: any\n\t): any {\n\t\treturn reactive(\n\t\t\targuments.length > 1\n\t\t\t\t? super.reduce((acc, v, i, a) => unwrap(callbackfn(acc, reactive(v), i, a)), initialValue)\n\t\t\t\t: super.reduce((acc, v, i, a) => unwrap(callbackfn(acc, reactive(v), i, a)))\n\t\t)\n\t}\n\n\treduceRight(\n\t\tcallbackfn: (acc: any, value: any, index: number, array: any[]) => any,\n\t\tinitialValue?: any\n\t): any {\n\t\treturn reactive(\n\t\t\targuments.length > 1\n\t\t\t\t? super.reduceRight(\n\t\t\t\t\t\t(acc, v, i, a) => unwrap(callbackfn(acc, reactive(v), i, a)),\n\t\t\t\t\t\tinitialValue\n\t\t\t\t\t)\n\t\t\t\t: super.reduceRight((acc, v, i, a) => unwrap(callbackfn(acc, reactive(v), i, a)))\n\t\t)\n\t}\n\n\t@atomic\n\treverse(): any[] {\n\t\treturn reactive(super.reverse())\n\t}\n\n\t@atomic\n\tshift(): any {\n\t\treturn reactive(super.shift())\n\t}\n\n\tslice(start?: number, end?: number): any[] {\n\t\treturn reactive(super.slice(start, end))\n\t}\n\n\tsome<S>(\n\t\tpredicate: (value: any, index: number, array: any[]) => value is S,\n\t\tthisArg?: any\n\t): this is S[]\n\tsome(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean\n\tsome(predicate: (value: any, index: number, array: any[]) => any, thisArg?: any): any {\n\t\treturn super.some((v, i, a) => predicate.call(thisArg, reactive(v), i, a), thisArg)\n\t}\n\n\t@atomic\n\tsort(compareFn?: (a: any, b: any) => number): this {\n\t\tconst wrappedCompare = compareFn\n\t\t\t? (a: any, b: any) => compareFn(reactive(a), reactive(b))\n\t\t\t: undefined\n\t\treturn super.sort(wrappedCompare) as this\n\t}\n\n\t@atomic\n\tsplice(start: number, deleteCount?: number, ...items: any[]): any {\n\t\tif (arguments.length > 2)\n\t\t\treturn reactive(super.splice(start, deleteCount!, ...items.map(unwrap)))\n\t\tif (arguments.length === 2) return reactive(super.splice(start, deleteCount!))\n\t\tif (arguments.length === 1) return reactive(super.splice(start))\n\t\treturn reactive([])\n\t}\n\n\t@atomic\n\tunshift(...items: any[]): number {\n\t\treturn super.unshift(...items.map(unwrap))\n\t}\n\n\tvalues(): any {\n\t\tdependant(this, keysOf)\n\t\treturn makeReactiveIterator(super.values())\n\t}\n\n\t[Symbol.iterator](): any {\n\t\tdependant(this, keysOf)\n\t\treturn makeReactiveIterator(super[Symbol.iterator]())\n\t}\n\n\ttoReversed(): any[] {\n\t\treturn reactive(super.toReversed())\n\t}\n\n\ttoSorted(compareFn?: (a: any, b: any) => number): any[] {\n\t\tconst wrappedCompare = compareFn\n\t\t\t? (a: any, b: any) => compareFn(reactive(a), reactive(b))\n\t\t\t: undefined\n\t\treturn reactive(super.toSorted(wrappedCompare))\n\t}\n\n\ttoSpliced(start: number, deleteCount?: number, ...items: any[]): any {\n\t\tif (arguments.length > 2)\n\t\t\treturn reactive(super.toSpliced(start, deleteCount!, ...items.map(unwrap)))\n\t\tif (arguments.length === 2) return reactive(super.toSpliced(start, deleteCount!))\n\t\tif (arguments.length === 1) return reactive(super.toSpliced(start))\n\t\treturn reactive([...this])\n\t}\n\n\twith(index: number, value: any): any[] {\n\t\treturn reactive(super.with(index, unwrap(value)))\n\t}\n}\n","import { contentRef } from '../utils'\nimport { touched, touched1 } from './change'\nimport { notifyPropertyChange } from './deep-touch'\nimport { batch } from './effects'\nimport { makeReactiveEntriesIterator, makeReactiveIterator } from './iterator-helpers'\nimport { reactive } from './proxy'\nimport { dependant } from './tracking'\nimport { keysOf } from './types'\n\n/**\n * Reactive wrapper around JavaScript's WeakMap class\n * Only tracks individual key operations, no size tracking (WeakMap limitation)\n */\nexport abstract class ReactiveWeakMap<K extends object, V> extends WeakMap<K, V> {\n\t// Implement WeakMap interface methods with reactivity\n\tdelete(key: K): boolean {\n\t\tconst hadKey = this.has(key)\n\t\tconst result = super.delete(key)\n\n\t\tif (hadKey) touched1(contentRef(this), { type: 'del', prop: key }, key)\n\n\t\treturn result\n\t}\n\n\tget(key: K): V | undefined {\n\t\tdependant(contentRef(this), key)\n\t\treturn reactive(super.get(key))\n\t}\n\n\thas(key: K): boolean {\n\t\tdependant(contentRef(this), key)\n\t\treturn super.has(key)\n\t}\n\n\tset(key: K, value: V): this {\n\t\tconst hadKey = this.has(key)\n\t\tconst oldValue = this.get(key)\n\t\tconst reactiveValue = reactive(value)\n\t\tthis.set(key, reactiveValue)\n\n\t\tif (!hadKey || oldValue !== reactiveValue) {\n\t\t\tnotifyPropertyChange(contentRef(this), key, oldValue, reactiveValue, hadKey)\n\t\t}\n\n\t\treturn this\n\t}\n}\n\n/**\n * Reactive wrapper around JavaScript's Map class\n * Tracks size changes, individual key operations, and collection-wide operations\n */\nexport abstract class ReactiveMap<K, V> extends Map<K, V> {\n\t// Implement Map interface methods with reactivity\n\tget size(): number {\n\t\tdependant(this, 'size') // The ReactiveMap instance still goes through proxy\n\t\treturn super.size\n\t}\n\n\tclear(): void {\n\t\tconst hadEntries = this.size > 0\n\t\tsuper.clear()\n\n\t\tif (hadEntries) {\n\t\t\tconst evolution = { type: 'bunch', method: 'clear' } as const\n\t\t\t// Clear triggers all effects since all keys are affected\n\t\t\tbatch(() => {\n\t\t\t\ttouched1(this, evolution, 'size')\n\t\t\t\ttouched(contentRef(this), evolution)\n\t\t\t})\n\t\t}\n\t}\n\n\tentries(): Generator<[K, V]> {\n\t\tdependant(contentRef(this))\n\t\treturn makeReactiveEntriesIterator(this.entries())\n\t}\n\n\tforEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tdependant(contentRef(this))\n\t\tthis.forEach(callbackfn, thisArg)\n\t}\n\n\tkeys(): MapIterator<K> {\n\t\tdependant(contentRef(this), keysOf)\n\t\treturn this.keys()\n\t}\n\n\tvalues(): Generator<V> {\n\t\tdependant(contentRef(this))\n\t\treturn makeReactiveIterator(this.values())\n\t}\n\n\t[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tdependant(contentRef(this))\n\t\tconst it: MapIterator<[K, V]> = Map.prototype[Symbol.iterator].call(this)\n\t\tconst nativeNext = it.next.bind(it)\n\t\tit.next = () => {\n\t\t\tconst result = nativeNext()\n\t\t\tif (result.done) return result\n\t\t\tconst [key, value] = result.value\n\t\t\treturn { value: [reactive(key), reactive(value)], done: false }\n\t\t}\n\t\treturn it\n\t}\n\n\t// Implement Map methods with reactivity\n\tdelete(key: K): boolean {\n\t\tconst hadKey = this.has(key)\n\t\tconst result = super.delete(key)\n\n\t\tif (hadKey) {\n\t\t\tconst evolution = { type: 'del', prop: key } as const\n\t\t\tbatch(() => {\n\t\t\t\ttouched1(contentRef(this), evolution, key)\n\t\t\t\ttouched1(this, evolution, 'size')\n\t\t\t})\n\t\t}\n\n\t\treturn result\n\t}\n\n\tget(key: K): V | undefined {\n\t\tdependant(contentRef(this), key)\n\t\treturn reactive(super.get(key))\n\t}\n\n\thas(key: K): boolean {\n\t\tdependant(contentRef(this), key)\n\t\treturn super.has(key)\n\t}\n\n\tset(key: K, value: V): this {\n\t\tconst hadKey = this.has(key)\n\t\tconst oldValue = this.get(key)\n\t\tconst reactiveValue = reactive(value)\n\t\tsuper.set(key, reactiveValue)\n\n\t\tif (!hadKey || oldValue !== reactiveValue) {\n\t\t\tbatch(() => {\n\t\t\t\tnotifyPropertyChange(contentRef(this), key, oldValue, reactiveValue, hadKey)\n\t\t\t\t// Also notify size change for Map (WeakMap doesn't track size)\n\t\t\t\tconst evolution = { type: hadKey ? 'set' : 'add', prop: key } as const\n\t\t\t\ttouched1(this, evolution, 'size')\n\t\t\t})\n\t\t}\n\n\t\treturn this\n\t}\n}\n","import { contentRef } from '../utils'\nimport { touched, touched1 } from './change'\nimport { batch } from './effects'\nimport { makeReactiveEntriesIterator, makeReactiveIterator } from './iterator-helpers'\nimport { reactive } from './proxy'\nimport { dependant } from './tracking'\n\n/**\n * Reactive wrapper around JavaScript's WeakSet class\n * Only tracks individual value operations, no size tracking (WeakSet limitation)\n */\nexport abstract class ReactiveWeakSet<T extends object> extends WeakSet<T> {\n\tadd(value: T): this {\n\t\tconst had = this.has(value)\n\t\tsuper.add(value)\n\t\tif (!had) {\n\t\t\t// touch the specific value and the collection view\n\t\t\ttouched1(contentRef(this), { type: 'add', prop: value }, value)\n\t\t\t// no size/allProps for WeakSet\n\t\t}\n\t\treturn this\n\t}\n\n\tdelete(value: T): boolean {\n\t\tconst had = this.has(value)\n\t\tconst res = super.delete(value)\n\t\tif (had) touched1(contentRef(this), { type: 'del', prop: value }, value)\n\t\treturn res\n\t}\n\n\thas(value: T): boolean {\n\t\tdependant(contentRef(this), value)\n\t\treturn super.has(value)\n\t}\n}\n\n/**\n * Reactive wrapper around JavaScript's Set class\n * Tracks size changes, individual value operations, and collection-wide operations\n */\nexport abstract class ReactiveSet<T> extends Set<T> {\n\tget size(): number {\n\t\t// size depends on the wrapper instance, like Map counterpart\n\t\tdependant(this, 'size')\n\t\treturn this.size\n\t}\n\n\tadd(value: T): this {\n\t\tconst had = this.has(value)\n\t\tconst reactiveValue = reactive(value)\n\t\tsuper.add(reactiveValue)\n\t\tif (!had) {\n\t\t\tconst evolution = { type: 'add', prop: reactiveValue } as const\n\t\t\t// touch for value-specific and aggregate dependencies\n\t\t\tbatch(() => {\n\t\t\t\ttouched1(contentRef(this), evolution, reactiveValue)\n\t\t\t\ttouched1(this, evolution, 'size')\n\t\t\t})\n\t\t}\n\t\treturn this\n\t}\n\n\tclear(): void {\n\t\tconst hadEntries = this.size > 0\n\t\tsuper.clear()\n\t\tif (hadEntries) {\n\t\t\tconst evolution = { type: 'bunch', method: 'clear' } as const\n\t\t\tbatch(() => {\n\t\t\t\ttouched1(this, evolution, 'size')\n\t\t\t\ttouched(contentRef(this), evolution)\n\t\t\t})\n\t\t}\n\t}\n\n\tdelete(value: T): boolean {\n\t\tconst had = this.has(value)\n\t\tconst res = super.delete(value)\n\t\tif (had) {\n\t\t\tconst evolution = { type: 'del', prop: value } as const\n\t\t\tbatch(() => {\n\t\t\t\ttouched1(contentRef(this), evolution, value)\n\t\t\t\ttouched1(this, evolution, 'size')\n\t\t\t})\n\t\t}\n\t\treturn res\n\t}\n\n\thas(value: T): boolean {\n\t\tdependant(contentRef(this), value)\n\t\treturn this.has(value)\n\t}\n\n\tentries(): Generator<[T, T]> {\n\t\tdependant(contentRef(this))\n\t\treturn makeReactiveEntriesIterator(this.entries())\n\t}\n\n\tforEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void {\n\t\tdependant(contentRef(this))\n\t\tthis.forEach(callbackfn, thisArg)\n\t}\n\n\tkeys(): Generator<T> {\n\t\tdependant(contentRef(this))\n\t\treturn makeReactiveIterator(this.keys())\n\t}\n\n\tvalues(): Generator<T> {\n\t\tdependant(contentRef(this))\n\t\treturn makeReactiveIterator(this.values())\n\t}\n\n\t[Symbol.iterator](): SetIterator<T> {\n\t\tdependant(contentRef(this))\n\t\tconst it: SetIterator<T> = Set.prototype[Symbol.iterator].call(this)\n\t\tconst nativeNext = it.next.bind(it)\n\t\tit.next = () => {\n\t\t\tconst result = nativeNext()\n\t\t\tif (result.done) return result\n\t\t\treturn { value: reactive(result.value), done: false }\n\t\t}\n\t\treturn it\n\t}\n}\n","export { attend, lift, morph } from './buffer'\nexport { getState, touched, touched1 } from './change'\nexport { deepWatch } from './deep-watch'\nexport {\n\ttype EffectContext,\n\teffectAggregator,\n\teffectContext,\n\tgetActiveEffect,\n\tlink,\n\tunlink,\n\twithEffectContext,\n} from './effect-context'\nexport {\n\taddBatchCleanup,\n\tatom,\n\tatomic,\n\t//batch, - NEVER export batch, it deals with EffectTriggers who are internal types - mutts consumers use `atomic` or `atom`\n\tbiDi,\n\tcaptured,\n\tcaught,\n\tdefer,\n\teffect,\n\tgetActivationLog,\n\tonEffectThrow,\n\treset,\n\troot,\n\tuntracked,\n} from './effects'\nexport { type Memoizable, type MemoizableArgument, memoize } from './memoize'\nexport { addUnreactiveProps, isNonReactive } from './non-reactive'\nexport { ReactiveBase, reactive } from './proxy'\nexport { organize, organized } from './record'\nexport { type Resource, resource, unreactive, watch, when } from './satellite'\nexport { assertUntracked } from './tracking'\nexport {\n\ttype CleanupReason,\n\tdebugPreset,\n\tdevPreset,\n\ttype EffectAccess,\n\ttype EffectCleanup,\n\ttype EffectCloser,\n\ttype EffectOptions,\n\ttype EffectTrigger,\n\ttype Evolution,\n\tformatCleanupReason,\n\tisReactive,\n\tobjectToProxy,\n\toptions as reactiveOptions,\n\ttype PropTrigger,\n\tprodPreset,\n\tproxyToObject,\n\tReactiveError,\n\tReactiveErrorCode,\n\ttype ScopedCallback,\n\tunwrap,\n} from './types'\n\nimport { ReactiveArray, ReactiveArrayWrapper } from './array'\nimport {\n\tdeepWatchers,\n\teffectToDeepWatchedObjects,\n\tobjectParents,\n\tobjectsWithDeepWatchers,\n} from './deep-watch-state'\nimport { ReactiveMap, ReactiveWeakMap } from './map'\nimport { metaProtos, wrapProtos } from './proxy'\nimport { effectToReactiveObjects, watchers } from './registry'\nimport { ReactiveSet, ReactiveWeakSet } from './set'\nimport { objectToProxy, proxyToObject } from './types'\n\n// Register native collection types to use specialized reactive wrappers\nmetaProtos.set(Array, ReactiveArray.prototype)\nmetaProtos.set(Set, ReactiveSet.prototype)\nmetaProtos.set(WeakSet, ReactiveWeakSet.prototype)\nmetaProtos.set(Map, ReactiveMap.prototype)\nmetaProtos.set(WeakMap, ReactiveWeakMap.prototype)\nwrapProtos.set(Array, ReactiveArrayWrapper.prototype)\n\n/**\n * Object containing internal reactive system state for debugging and profiling\n */\nexport const profileInfo: any = {\n\tobjectToProxy,\n\tproxyToObject,\n\teffectToReactiveObjects,\n\twatchers,\n\tobjectParents,\n\tobjectsWithDeepWatchers,\n\tdeepWatchers,\n\teffectToDeepWatchedObjects,\n}\n","import { decorator, type GenericClassDecorator } from './decorator'\nimport { options } from './reactive/types'\n\n// In order to avoid async re-entrance, we could use zone.js or something like that.\nconst syncCalculating: { object: object; prop: PropertyKey }[] = []\n/**\n * Decorator that caches the result of a getter method and only recomputes when dependencies change\n * Prevents circular dependencies and provides automatic cache invalidation\n */\nexport const cached = decorator({\n\tgetter(original, _target, propertyKey) {\n\t\treturn function (this: any) {\n\t\t\tconst alreadyCalculating = syncCalculating.findIndex(\n\t\t\t\t(c) => c.object === this && c.prop === propertyKey\n\t\t\t)\n\t\t\tif (alreadyCalculating > -1)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Circular dependency detected: ${syncCalculating\n\t\t\t\t\t\t.slice(alreadyCalculating)\n\t\t\t\t\t\t.map((c) => `${c.object.constructor.name}.${String(c.prop)}`)\n\t\t\t\t\t\t.join(' -> ')} -> again`\n\t\t\t\t)\n\t\t\tsyncCalculating.push({ object: this, prop: propertyKey })\n\t\t\ttry {\n\t\t\t\tconst rv = original.call(this)\n\t\t\t\tcache(this, propertyKey, rv)\n\t\t\t\treturn rv\n\t\t\t} finally {\n\t\t\t\tsyncCalculating.pop()\n\t\t\t}\n\t\t}\n\t},\n})\n\n/**\n * Checks if a property is cached (has a cached value)\n * @param object - The object to check\n * @param propertyKey - The property key to check\n * @returns True if the property has a cached value\n */\nexport function isCached(object: Object, propertyKey: PropertyKey) {\n\treturn !!Object.getOwnPropertyDescriptor(object, propertyKey)\n}\n\n/**\n * Caches a value for a property on an object\n * @param object - The object to cache the value on\n * @param propertyKey - The property key to cache\n * @param value - The value to cache\n */\nexport function cache(object: Object, propertyKey: PropertyKey, value: any) {\n\tObject.defineProperty(object, propertyKey, { value })\n}\n\ntype DescriptorShape = {\n\tenumerable?: boolean\n\tconfigurable?: boolean\n\twritable?: boolean\n}\n\ntype DescriptorDecorator = <T>(...properties: (keyof T)[]) => GenericClassDecorator<T>\n\ntype DescriptorBuilder = ((descriptor: DescriptorShape) => DescriptorDecorator) & {\n\treadonly enumerable: DescriptorDecorator\n\treadonly hidden: DescriptorDecorator\n\treadonly configurable: DescriptorDecorator\n\treadonly frozen: DescriptorDecorator\n\treadonly writable: DescriptorDecorator\n\treadonly readonly: DescriptorDecorator\n}\n\nfunction descriptorBase(descriptor: DescriptorShape): DescriptorDecorator {\n\treturn function descriptorDecorator<T>(...properties: (keyof T)[]): GenericClassDecorator<T> {\n\t\treturn (Base) => {\n\t\t\treturn class extends Base {\n\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\tsuper(...args)\n\t\t\t\t\tfor (const key of properties) {\n\t\t\t\t\t\tconst existing = Object.getOwnPropertyDescriptor(this, key)\n\t\t\t\t\t\tObject.defineProperty(this, key, Object.assign(existing || {}, descriptor))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Creates a decorator that modifies property descriptors for specified properties\n * @param descriptor - The descriptor properties to apply\n * @returns A class decorator that applies the descriptor to specified properties\n */\nexport const descriptor: DescriptorBuilder = Object.assign(descriptorBase, {\n\t/**\n\t * enumerable: true\n\t */\n\tget enumerable(): DescriptorDecorator {\n\t\treturn descriptorBase({ enumerable: true })\n\t},\n\t/**\n\t * enumerable: false\n\t */\n\tget hidden(): DescriptorDecorator {\n\t\treturn descriptorBase({ enumerable: false })\n\t},\n\t/**\n\t * configurable: true\n\t */\n\tget configurable(): DescriptorDecorator {\n\t\treturn descriptorBase({ configurable: true })\n\t},\n\t/**\n\t * configurable: false\n\t */\n\tget frozen(): DescriptorDecorator {\n\t\treturn descriptorBase({ configurable: false })\n\t},\n\t/**\n\t * writable: true\n\t */\n\tget writable(): DescriptorDecorator {\n\t\treturn descriptorBase({ writable: true })\n\t},\n\t/**\n\t * writable: false\n\t */\n\tget readonly(): DescriptorDecorator {\n\t\treturn descriptorBase({ writable: false })\n\t},\n})\n\n/**\n * Decorator that marks methods, properties, or classes as deprecated\n * Provides warning messages when deprecated items are used\n */\nexport const deprecated = Object.assign(\n\tdecorator({\n\t\tmethod(original, _target, propertyKey) {\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.apply(this, args)\n\t\t\t}\n\t\t},\n\t\tgetter(original, _target, propertyKey) {\n\t\t\treturn function (this: any) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.call(this)\n\t\t\t}\n\t\t},\n\t\tsetter(original, _target, propertyKey) {\n\t\t\treturn function (this: any, value: any) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.call(this, value)\n\t\t\t}\n\t\t},\n\t\tclass(original) {\n\t\t\treturn class extends original {\n\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\tsuper(...args)\n\t\t\t\t\tdeprecated.warn(this, 'constructor')\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdefault(message: string) {\n\t\t\treturn decorator({\n\t\t\t\tmethod(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.apply(this, args)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgetter(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.call(this)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetter(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any, value: any) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.call(this, value)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tclass(original) {\n\t\t\t\t\treturn class extends original {\n\t\t\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\t\t\tsuper(...args)\n\t\t\t\t\t\t\tdeprecated.warn(this, 'constructor', message)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t})\n\t\t},\n\t}),\n\t{\n\t\twarn: (target: any, propertyKey: PropertyKey, message?: string) => {\n\t\t\toptions.warn(\n\t\t\t\t`${target.constructor.name}.${String(propertyKey)} is deprecated${message ? `: ${message}` : ''}`\n\t\t\t)\n\t\t},\n\t}\n)\n\n/**\n * Creates a debounced method decorator that delays execution until after the delay period has passed\n * @param delay - The delay in milliseconds\n * @returns A method decorator that debounces method calls\n */\nexport function debounce(delay: number) {\n\treturn decorator({\n\t\tmethod(original, _target, _propertyKey) {\n\t\t\tlet timeoutId: ReturnType<typeof setTimeout> | null = null\n\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\t// Clear existing timeout\n\t\t\t\tif (timeoutId) {\n\t\t\t\t\tclearTimeout(timeoutId)\n\t\t\t\t}\n\n\t\t\t\t// Set new timeout\n\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\toriginal.apply(this, args)\n\t\t\t\t\ttimeoutId = null\n\t\t\t\t}, delay)\n\t\t\t}\n\t\t},\n\t})\n}\n\n/**\n * Creates a throttled method decorator that limits execution to once per delay period\n * @param delay - The delay in milliseconds\n * @returns A method decorator that throttles method calls\n */\nexport function throttle(delay: number) {\n\treturn decorator({\n\t\tmethod(original, _target, _propertyKey) {\n\t\t\tlet lastCallTime = 0\n\t\t\tlet timeoutId: ReturnType<typeof setTimeout> | null = null\n\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\tconst now = Date.now()\n\n\t\t\t\t// If enough time has passed since last call, execute immediately\n\t\t\t\tif (now - lastCallTime >= delay) {\n\t\t\t\t\t// Clear any pending timeout since we're executing now\n\t\t\t\t\tif (timeoutId) {\n\t\t\t\t\t\tclearTimeout(timeoutId)\n\t\t\t\t\t\ttimeoutId = null\n\t\t\t\t\t}\n\t\t\t\t\tlastCallTime = now\n\t\t\t\t\treturn original.apply(this, args)\n\t\t\t\t}\n\n\t\t\t\t// Otherwise, schedule execution for when the delay period ends\n\t\t\t\tif (!timeoutId) {\n\t\t\t\t\tconst remainingTime = delay - (now - lastCallTime)\n\t\t\t\t\tconst scheduledArgs = [...args] // Capture args at scheduling time\n\t\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\t\tlastCallTime = Date.now()\n\t\t\t\t\t\toriginal.apply(this, scheduledArgs)\n\t\t\t\t\t\ttimeoutId = null\n\t\t\t\t\t}, remainingTime)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t})\n}\n","export * from './async'\nexport * from './decorator'\nexport * from './destroyable'\nexport * from './diff'\nexport * from './eventful'\nexport * from './flavored'\nexport * from './indexable'\nexport * from './iterableWeak'\nexport * from './mixins'\nexport * from './promiseChain'\nexport * from './reactive'\nexport * from './std-decorators'\nexport {\n\tarrayEquals,\n\tCompareSymbol,\n\tdeepCompare,\n\tisConstructor,\n\tisDev,\n\tisObject,\n\tisProd,\n\tisTest,\n\tnamed,\n\ttag,\n\tzip,\n} from './utils'\nexport * from './zone'\n\n// Important: let it here!\nimport pkg from '../package.json'\n\nconst { version } = pkg\n\nconst GLOBAL_MUTTS_KEY = '__MUTTS_INSTANCE__'\nconst runtimeGlobals = globalThis as typeof globalThis & {\n\twindow?: typeof window\n\tglobal?: typeof globalThis\n\t__filename?: string\n\t[GLOBAL_MUTTS_KEY]?: unknown\n}\nconst globalScope = (\n\ttypeof globalThis !== 'undefined'\n\t\t? globalThis\n\t\t: runtimeGlobals.window\n\t\t\t? runtimeGlobals.window\n\t\t\t: runtimeGlobals.global\n\t\t\t\t? runtimeGlobals.global\n\t\t\t\t: false\n) as any\nif (globalScope) {\n\tlet source = 'mutts/index'\n\ttry {\n\t\tif (runtimeGlobals.__filename) source = runtimeGlobals.__filename\n\t\telse if (typeof import.meta !== 'undefined' && import.meta.url) {\n\t\t\tsource = import.meta.url\n\t\t}\n\t} catch (_e) {}\n\n\tconst currentSourceInfo = { version, source, timestamp: Date.now() }\n\n\tif (globalScope[GLOBAL_MUTTS_KEY]) {\n\t\tconst existing = globalScope[GLOBAL_MUTTS_KEY]\n\t\tthrow new Error(\n\t\t\t`[Mutts] Multiple instances detected!\\n` +\n\t\t\t\t`Existing instance: ${JSON.stringify(existing, null, 2)}\\n` +\n\t\t\t\t`New instance: ${JSON.stringify(currentSourceInfo, null, 2)}\\n` +\n\t\t\t\t`This usually happens when 'mutts' is both installed as a dependency and bundled, ` +\n\t\t\t\t`or when different versions are loaded. ` +\n\t\t\t\t`Please check your build configuration (aliases, externals) to ensure a single source of truth.`\n\t\t)\n\t}\n\tglobalScope[GLOBAL_MUTTS_KEY] = currentSourceInfo\n}\n"],"names":["cache"],"mappings":";;AAEA;AACA,MAAM,EAAE,GAAG,IAAI,oBAAoB,CAAa,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3D;;AAEG;MACU,UAAU,GAAG,MAAM,CAAC,YAAY;AAC7C;;AAEG;MACU,eAAe,GAAG,MAAM,CAAC,WAAW;AACjD;;AAEG;AACG,MAAO,gBAAiB,SAAQ,KAAK,CAAA;IAC1C,OAAO,KAAK,CAAY,GAAW,EAAA;AAClC,QAAA,OAAO,MAAK;AACX,YAAA,MAA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,CAAC;cACf,KAAK,CACH;AACR,IAAI,WAAW,EAAE;IAChB,IAAI,MAAM,GAAG,aAAa;AAC1B,IAAA,IAAI;QACH,IAAI,cAAc,CAAC,UAAU;AAAE,YAAA,MAAM,GAAG,cAAc,CAAC,UAAU;AAC5D,aAAA,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;AAC/D,YAAA,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG;QACzB;IACD;AAAE,IAAA,OAAO,EAAE,EAAE,EAAC;AAEd,IAAA,MAAM,iBAAiB,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;AAEpE,IAAA,IAAI,WAAW,CAAC,gBAAgB,CAAC,EAAE;AAClC,QAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,CAAC;QAC9C,MAAM,IAAI,KAAK,CACd,CAAA,sCAAA,CAAwC;YACvC,CAAA,mBAAA,EAAsB,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA,EAAA,CAAI;YAC3D,CAAA,cAAA,EAAiB,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA,EAAA,CAAI;YAC/D,CAAA,iFAAA,CAAmF;YACnF,CAAA,uCAAA,CAAyC;AACzC,YAAA,CAAA,8FAAA,CAAgG,CACjG;IACF;AACA,IAAA,WAAW,CAAC,gBAAgB,CAAC,GAAG,iBAAiB;AAClD;;;;"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var node_async_hooks = require('node:async_hooks');
4
- var proxy = require('./proxy-BvM4yewA.cjs');
4
+ var proxy = require('./proxy-DBHj3kGK.cjs');
5
5
 
6
6
  // 1. Generic async_hooks implementation for Hooks
7
7
  // This maintains support for 'asyncHooks.addHook' for generic use cases.
@@ -95,4 +95,4 @@ OriginalPromise.prototype.catch = function (onRejected) {
95
95
  OriginalPromise.prototype.finally = function (onFinally) {
96
96
  return originalMethods.finally.call(this, wrap(onFinally));
97
97
  };
98
- //# sourceMappingURL=node-Dd0esp5F.cjs.map
98
+ //# sourceMappingURL=node-DrrphEPf.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-Dd0esp5F.cjs","sources":["../../src/async/node.ts"],"sourcesContent":["import { createHook } from 'node:async_hooks'\nimport { hooks, type Restorer } from '.'\n\n// 1. Generic async_hooks implementation for Hooks\n// This maintains support for 'asyncHooks.addHook' for generic use cases.\n\nconst contexts = new Map<number, Restorer[]>()\nconst activeUndoers = new Map<number, (() => void)[]>()\n\n// Helper to capture current hooks state\nfunction captureRestorers() {\n\tif (hooks.size === 0) return []\n\tconst restorers: Restorer[] = []\n\tfor (const h of hooks) {\n\t\tconst r = h()\n\t\tif (r) restorers.push(r)\n\t}\n\treturn restorers\n}\n\n// Manual Wrap function to handle Promise callbacks\nfunction wrap<Args extends any[], R>(fn: ((...args: Args) => R) | null | undefined) {\n\tif (typeof fn !== 'function') return fn\n\tconst restorers = captureRestorers()\n\tif (restorers.length === 0) return fn\n\n\treturn function (this: any, ...args: Args) {\n\t\tconst undoers: (() => void)[] = []\n\t\tfor (const restore of restorers) {\n\t\t\tconst u = restore()\n\t\t\tif (u) undoers.push(u)\n\t\t}\n\t\ttry {\n\t\t\treturn fn.apply(this, args)\n\t\t} finally {\n\t\t\tfor (let i = undoers.length - 1; i >= 0; i--) undoers[i]()\n\t\t}\n\t}\n}\n\nconst hook = createHook({\n\tinit(asyncId, _type, _triggerId, _resource) {\n\t\t// Used for native resources like Timers\n\t\tconst restorers = captureRestorers()\n\t\tif (restorers.length > 0) contexts.set(asyncId, restorers)\n\t},\n\tbefore(asyncId) {\n\t\tconst restorers = contexts.get(asyncId)\n\t\tif (!restorers) return\n\t\tconst undoers: (() => void)[] = []\n\t\tfor (const restore of restorers) {\n\t\t\tconst u = restore()\n\t\t\tif (u) undoers.push(u)\n\t\t}\n\t\tif (undoers.length > 0) activeUndoers.set(asyncId, undoers)\n\t},\n\tafter(asyncId) {\n\t\tconst undoers = activeUndoers.get(asyncId)\n\t\tif (!undoers) return\n\t\tfor (let i = undoers.length - 1; i >= 0; i--) undoers[i]()\n\t\tactiveUndoers.delete(asyncId)\n\t},\n\tdestroy(asyncId) {\n\t\tcontexts.delete(asyncId)\n\t\tactiveUndoers.delete(asyncId)\n\t},\n})\nhook.enable()\n\n// 2. Shadow Promise Implementation\n// Ensures V8 await resumptions are visible as .then callbacks, wrapping them to restore context.\n\nconst OriginalPromise = globalThis.Promise\nconst originalMethods = {\n\t// biome-ignore lint/suspicious/noThenProperty: Intentional Promise.prototype patching\n\tthen: OriginalPromise.prototype.then,\n\tcatch: OriginalPromise.prototype.catch,\n\tfinally: OriginalPromise.prototype.finally,\n\tresolve: OriginalPromise.resolve,\n\treject: OriginalPromise.reject,\n\tall: OriginalPromise.all,\n}\n\n// Patch prototype\n// biome-ignore lint/suspicious/noThenProperty: Intentional Promise.prototype patching\nOriginalPromise.prototype.then = function (onFulfilled, onRejected) {\n\treturn originalMethods.then.call(this, wrap(onFulfilled), wrap(onRejected))\n} as any\nOriginalPromise.prototype.catch = function (onRejected) {\n\treturn originalMethods.catch.call(this, wrap(onRejected))\n} as any\nOriginalPromise.prototype.finally = function (onFinally) {\n\treturn originalMethods.finally.call(this, wrap(onFinally))\n} as any\n"],"names":["hooks","createHook"],"mappings":";;;;;AAGA;AACA;AAEA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAsB;AAC9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAA0B;AAEvD;AACA,SAAS,gBAAgB,GAAA;AACxB,IAAA,IAAIA,WAAK,CAAC,IAAI,KAAK,CAAC;AAAE,QAAA,OAAO,EAAE;IAC/B,MAAM,SAAS,GAAe,EAAE;AAChC,IAAA,KAAK,MAAM,CAAC,IAAIA,WAAK,EAAE;AACtB,QAAA,MAAM,CA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eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAC5E,CAAQ;AACR,eAAe,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,UAAU,EAAA;AACrD,IAAA,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAC1D,CAAQ;AACR,eAAe,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAA;AACtD,IAAA,OAAO,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3D,CAAQ;;"}
1
+ {"version":3,"file":"node-DrrphEPf.cjs","sources":["../../src/async/node.ts"],"sourcesContent":["import { createHook } from 'node:async_hooks'\nimport { hooks, type Restorer } from '.'\n\n// 1. Generic async_hooks implementation for Hooks\n// This maintains support for 'asyncHooks.addHook' for generic use cases.\n\nconst contexts = new Map<number, Restorer[]>()\nconst activeUndoers = new Map<number, (() => void)[]>()\n\n// Helper to capture current hooks state\nfunction captureRestorers() {\n\tif (hooks.size === 0) return []\n\tconst restorers: Restorer[] = []\n\tfor (const h of hooks) {\n\t\tconst r = h()\n\t\tif (r) restorers.push(r)\n\t}\n\treturn restorers\n}\n\n// Manual Wrap function to handle Promise callbacks\nfunction wrap<Args extends any[], R>(fn: ((...args: Args) => R) | null | undefined) {\n\tif (typeof fn !== 'function') return fn\n\tconst restorers = captureRestorers()\n\tif (restorers.length === 0) return fn\n\n\treturn function (this: any, ...args: Args) {\n\t\tconst undoers: (() => void)[] = []\n\t\tfor (const restore of restorers) {\n\t\t\tconst u = restore()\n\t\t\tif (u) undoers.push(u)\n\t\t}\n\t\ttry {\n\t\t\treturn fn.apply(this, args)\n\t\t} finally {\n\t\t\tfor (let i = undoers.length - 1; i >= 0; i--) undoers[i]()\n\t\t}\n\t}\n}\n\nconst hook = createHook({\n\tinit(asyncId, _type, _triggerId, _resource) {\n\t\t// Used for native resources like Timers\n\t\tconst restorers = captureRestorers()\n\t\tif (restorers.length > 0) contexts.set(asyncId, restorers)\n\t},\n\tbefore(asyncId) {\n\t\tconst restorers = contexts.get(asyncId)\n\t\tif (!restorers) return\n\t\tconst undoers: (() => void)[] = []\n\t\tfor (const restore of restorers) {\n\t\t\tconst u = restore()\n\t\t\tif (u) undoers.push(u)\n\t\t}\n\t\tif (undoers.length > 0) activeUndoers.set(asyncId, undoers)\n\t},\n\tafter(asyncId) {\n\t\tconst undoers = activeUndoers.get(asyncId)\n\t\tif (!undoers) return\n\t\tfor (let i = undoers.length - 1; i >= 0; i--) undoers[i]()\n\t\tactiveUndoers.delete(asyncId)\n\t},\n\tdestroy(asyncId) {\n\t\tcontexts.delete(asyncId)\n\t\tactiveUndoers.delete(asyncId)\n\t},\n})\nhook.enable()\n\n// 2. Shadow Promise Implementation\n// Ensures V8 await resumptions are visible as .then callbacks, wrapping them to restore context.\n\nconst OriginalPromise = globalThis.Promise\nconst originalMethods = {\n\t// biome-ignore lint/suspicious/noThenProperty: Intentional Promise.prototype patching\n\tthen: OriginalPromise.prototype.then,\n\tcatch: OriginalPromise.prototype.catch,\n\tfinally: OriginalPromise.prototype.finally,\n\tresolve: OriginalPromise.resolve,\n\treject: OriginalPromise.reject,\n\tall: OriginalPromise.all,\n}\n\n// Patch prototype\n// biome-ignore lint/suspicious/noThenProperty: Intentional Promise.prototype patching\nOriginalPromise.prototype.then = function (onFulfilled, onRejected) {\n\treturn originalMethods.then.call(this, wrap(onFulfilled), wrap(onRejected))\n} as any\nOriginalPromise.prototype.catch = function (onRejected) {\n\treturn originalMethods.catch.call(this, wrap(onRejected))\n} as any\nOriginalPromise.prototype.finally = function (onFinally) {\n\treturn originalMethods.finally.call(this, wrap(onFinally))\n} as any\n"],"names":["hooks","createHook"],"mappings":";;;;;AAGA;AACA;AAEA,MAAM,QAAQ,GAAG,IAAI,GAAG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EvB,IAAA,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,IAAI;AACpC,IAAA,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,KAAK;AACtC,IAAA,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,QAInC;AAED;AACA;AACA,eAAe,CAAC,SAAS,CAAC,IAAI,GAAG,UAAU,WAAW,EAAE,UAAU,EAAA;AACjE,IAAA,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAC5E,CAAQ;AACR,eAAe,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,UAAU,EAAA;AACrD,IAAA,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAC1D,CAAQ;AACR,eAAe,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAA;AACtD,IAAA,OAAO,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3D,CAAQ;;"}
@@ -1,5 +1,5 @@
1
1
  import { createHook } from 'node:async_hooks';
2
- import { H as hooks } from './proxy-D2C49sXH.esm.js';
2
+ import { L as hooks } from './proxy-BtmPFjSr.esm.js';
3
3
 
4
4
  // 1. Generic async_hooks implementation for Hooks
5
5
  // This maintains support for 'asyncHooks.addHook' for generic use cases.
@@ -93,4 +93,4 @@ OriginalPromise.prototype.catch = function (onRejected) {
93
93
  OriginalPromise.prototype.finally = function (onFinally) {
94
94
  return originalMethods.finally.call(this, wrap(onFinally));
95
95
  };
96
- //# sourceMappingURL=node-Bo7WU5S2.esm.js.map
96
+ //# sourceMappingURL=node-NEZvVo4M.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-Bo7WU5S2.esm.js","sources":["../../src/async/node.ts"],"sourcesContent":["import { createHook } from 'node:async_hooks'\nimport { hooks, type Restorer } from '.'\n\n// 1. Generic async_hooks implementation for Hooks\n// This maintains support for 'asyncHooks.addHook' for generic use cases.\n\nconst contexts = new Map<number, Restorer[]>()\nconst activeUndoers = new Map<number, (() => void)[]>()\n\n// Helper to capture current hooks state\nfunction captureRestorers() {\n\tif (hooks.size === 0) return []\n\tconst restorers: Restorer[] = []\n\tfor (const h of hooks) {\n\t\tconst r = h()\n\t\tif (r) restorers.push(r)\n\t}\n\treturn restorers\n}\n\n// Manual Wrap function to handle Promise callbacks\nfunction wrap<Args extends any[], R>(fn: ((...args: Args) => R) | null | undefined) {\n\tif (typeof fn !== 'function') return fn\n\tconst restorers = captureRestorers()\n\tif (restorers.length === 0) return fn\n\n\treturn function (this: any, ...args: Args) {\n\t\tconst undoers: (() => void)[] = []\n\t\tfor (const restore of restorers) {\n\t\t\tconst u = restore()\n\t\t\tif (u) undoers.push(u)\n\t\t}\n\t\ttry {\n\t\t\treturn fn.apply(this, args)\n\t\t} finally {\n\t\t\tfor (let i = undoers.length - 1; i >= 0; i--) undoers[i]()\n\t\t}\n\t}\n}\n\nconst hook = createHook({\n\tinit(asyncId, _type, _triggerId, _resource) {\n\t\t// Used for native resources like Timers\n\t\tconst restorers = captureRestorers()\n\t\tif (restorers.length > 0) contexts.set(asyncId, restorers)\n\t},\n\tbefore(asyncId) {\n\t\tconst restorers = contexts.get(asyncId)\n\t\tif (!restorers) return\n\t\tconst undoers: (() => void)[] = []\n\t\tfor (const restore of restorers) {\n\t\t\tconst u = restore()\n\t\t\tif (u) undoers.push(u)\n\t\t}\n\t\tif (undoers.length > 0) activeUndoers.set(asyncId, undoers)\n\t},\n\tafter(asyncId) {\n\t\tconst undoers = activeUndoers.get(asyncId)\n\t\tif (!undoers) return\n\t\tfor (let i = undoers.length - 1; i >= 0; i--) undoers[i]()\n\t\tactiveUndoers.delete(asyncId)\n\t},\n\tdestroy(asyncId) {\n\t\tcontexts.delete(asyncId)\n\t\tactiveUndoers.delete(asyncId)\n\t},\n})\nhook.enable()\n\n// 2. Shadow Promise Implementation\n// Ensures V8 await resumptions are visible as .then callbacks, wrapping them to restore context.\n\nconst OriginalPromise = globalThis.Promise\nconst originalMethods = {\n\t// biome-ignore lint/suspicious/noThenProperty: Intentional Promise.prototype patching\n\tthen: OriginalPromise.prototype.then,\n\tcatch: OriginalPromise.prototype.catch,\n\tfinally: OriginalPromise.prototype.finally,\n\tresolve: OriginalPromise.resolve,\n\treject: OriginalPromise.reject,\n\tall: OriginalPromise.all,\n}\n\n// Patch prototype\n// biome-ignore lint/suspicious/noThenProperty: Intentional Promise.prototype patching\nOriginalPromise.prototype.then = function (onFulfilled, onRejected) {\n\treturn originalMethods.then.call(this, wrap(onFulfilled), wrap(onRejected))\n} as any\nOriginalPromise.prototype.catch = function (onRejected) {\n\treturn originalMethods.catch.call(this, wrap(onRejected))\n} as any\nOriginalPromise.prototype.finally = function (onFinally) {\n\treturn originalMethods.finally.call(this, wrap(onFinally))\n} as any\n"],"names":[],"mappings":";;;AAGA;AACA;AAEA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAsB;AAC9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAA0B;AAEvD;AACA,SAAS,gBAAgB,GAAA;AACxB,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC;AAAE,QAAA,OAAO,EAAE;IAC/B,MAAM,SAAS,GAAe,EAAE;AAChC,IAAA,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;AACtB,QAAA,MAAM,CAAC,GAAG,CAAC,EAAE;AACb,QAAA,IAAI,CAAC;AAAE,YAAA,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACzB;AACA,IAAA,OAAO,SAAS;AACjB;AAEA;AACA,SAAS,IAAI,CAAwB,EAA6C,EAAA;IACjF,IAAI,OAAO,EAAE,KAAK,UAAU;AAAE,QAAA,OAAO,EAAE;AACvC,IAAA,MAAM,SAAS,GAAG,gBAAgB,EAAE;AACpC,IAAA,IAAI,SAAS,CA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AAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAA;AACtD,IAAA,OAAO,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;AAC3D,CAAQ"}
1
+ {"version":3,"file":"node-NEZvVo4M.esm.js","sources":["../../src/async/node.ts"],"sourcesContent":["import { createHook } from 'node:async_hooks'\nimport { hooks, type Restorer } from '.'\n\n// 1. Generic async_hooks implementation for Hooks\n// This maintains support for 'asyncHooks.addHook' for generic use cases.\n\nconst contexts = new Map<number, Restorer[]>()\nconst activeUndoers = new Map<number, (() => void)[]>()\n\n// Helper to capture current hooks state\nfunction captureRestorers() {\n\tif (hooks.size === 0) return []\n\tconst restorers: Restorer[] = []\n\tfor (const h of hooks) {\n\t\tconst r = h()\n\t\tif (r) restorers.push(r)\n\t}\n\treturn restorers\n}\n\n// Manual Wrap function to handle Promise callbacks\nfunction wrap<Args extends any[], R>(fn: ((...args: Args) => R) | null | undefined) {\n\tif (typeof fn !== 'function') return fn\n\tconst restorers = captureRestorers()\n\tif (restorers.length === 0) return fn\n\n\treturn function (this: any, ...args: Args) {\n\t\tconst undoers: (() => void)[] = []\n\t\tfor (const restore of restorers) {\n\t\t\tconst u = restore()\n\t\t\tif (u) undoers.push(u)\n\t\t}\n\t\ttry {\n\t\t\treturn fn.apply(this, args)\n\t\t} finally {\n\t\t\tfor (let i = undoers.length - 1; i >= 0; i--) undoers[i]()\n\t\t}\n\t}\n}\n\nconst hook = createHook({\n\tinit(asyncId, _type, _triggerId, _resource) {\n\t\t// Used for native resources like Timers\n\t\tconst restorers = captureRestorers()\n\t\tif (restorers.length > 0) contexts.set(asyncId, restorers)\n\t},\n\tbefore(asyncId) {\n\t\tconst restorers = contexts.get(asyncId)\n\t\tif (!restorers) return\n\t\tconst undoers: (() => void)[] = []\n\t\tfor (const restore of restorers) {\n\t\t\tconst u = restore()\n\t\t\tif (u) undoers.push(u)\n\t\t}\n\t\tif (undoers.length > 0) activeUndoers.set(asyncId, undoers)\n\t},\n\tafter(asyncId) {\n\t\tconst undoers = activeUndoers.get(asyncId)\n\t\tif (!undoers) return\n\t\tfor (let i = undoers.length - 1; i >= 0; i--) undoers[i]()\n\t\tactiveUndoers.delete(asyncId)\n\t},\n\tdestroy(asyncId) {\n\t\tcontexts.delete(asyncId)\n\t\tactiveUndoers.delete(asyncId)\n\t},\n})\nhook.enable()\n\n// 2. Shadow Promise Implementation\n// Ensures V8 await resumptions are visible as .then callbacks, wrapping them to restore context.\n\nconst OriginalPromise = globalThis.Promise\nconst originalMethods = {\n\t// biome-ignore lint/suspicious/noThenProperty: Intentional Promise.prototype patching\n\tthen: OriginalPromise.prototype.then,\n\tcatch: OriginalPromise.prototype.catch,\n\tfinally: OriginalPromise.prototype.finally,\n\tresolve: OriginalPromise.resolve,\n\treject: OriginalPromise.reject,\n\tall: OriginalPromise.all,\n}\n\n// Patch prototype\n// biome-ignore lint/suspicious/noThenProperty: Intentional Promise.prototype patching\nOriginalPromise.prototype.then = function (onFulfilled, onRejected) {\n\treturn originalMethods.then.call(this, wrap(onFulfilled), wrap(onRejected))\n} as any\nOriginalPromise.prototype.catch = function (onRejected) {\n\treturn originalMethods.catch.call(this, wrap(onRejected))\n} as any\nOriginalPromise.prototype.finally = function (onFinally) {\n\treturn originalMethods.finally.call(this, wrap(onFinally))\n} as any\n"],"names":[],"mappings":";;;AAGA;AACA;AAEA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAsB;AAC9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAA0B;AAEvD;AACA,SAAS,gBAAgB,GAAA;AACxB,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC;AAAE,QAAA,OAAO,EAAE;IAC/B,MAAM,SAAS,GAAe,EAAE;AAChC,IAAA,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;AACtB,QAAA,MAAM,CAAC,GAAG,CAAC,EAAE;AACb,QAAA,IAAI,CAAC;AAAE,YAAA,SA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