gestament 0.2.0 → 0.3.0
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.
- package/README.md +4 -6
- package/dist/displaySession.d.ts +18 -0
- package/dist/displaySession.d.ts.map +1 -0
- package/dist/element.d.ts +2 -2
- package/dist/errors-6gj5YuLw.cjs +36 -0
- package/dist/errors-6gj5YuLw.cjs.map +1 -0
- package/dist/errors-CCW4ATME.js +37 -0
- package/dist/errors-CCW4ATME.js.map +1 -0
- package/dist/errors.d.ts +2 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/generated/packageMetadata.d.ts +4 -4
- package/dist/gestament-config.d.ts +2 -2
- package/dist/gestament-launcher-driver.cjs +656 -0
- package/dist/gestament-launcher-driver.cjs.map +1 -0
- package/dist/gestament-launcher-driver.d.ts +13 -0
- package/dist/gestament-launcher-driver.d.ts.map +1 -0
- package/dist/gestament-launcher-driver.mjs +655 -0
- package/dist/gestament-launcher-driver.mjs.map +1 -0
- package/dist/gestament-tray-host.cjs +1 -1
- package/dist/gestament-tray-host.d.ts +2 -2
- package/dist/gestament-tray-host.mjs +1 -1
- package/dist/gestament-xvfb-pool-probe.cjs +29 -0
- package/dist/gestament-xvfb-pool-probe.cjs.map +1 -0
- package/dist/gestament-xvfb-pool-probe.d.ts +13 -0
- package/dist/gestament-xvfb-pool-probe.d.ts.map +1 -0
- package/dist/gestament-xvfb-pool-probe.mjs +28 -0
- package/dist/gestament-xvfb-pool-probe.mjs.map +1 -0
- package/dist/gestament-xvfb-worker.d.ts +2 -2
- package/dist/gestament-xvfb.cjs +8 -2
- package/dist/gestament-xvfb.cjs.map +1 -1
- package/dist/gestament-xvfb.d.ts +2 -2
- package/dist/gestament-xvfb.mjs +8 -2
- package/dist/gestament-xvfb.mjs.map +1 -1
- package/dist/index.cjs +4 -1147
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +4 -1147
- package/dist/index.mjs.map +1 -1
- package/dist/launchGtkApp-BIO_5Xjn.cjs +2479 -0
- package/dist/launchGtkApp-BIO_5Xjn.cjs.map +1 -0
- package/dist/launchGtkApp-qi1qm5G4.js +2479 -0
- package/dist/launchGtkApp-qi1qm5G4.js.map +1 -0
- package/dist/launchGtkApp.d.ts +2 -2
- package/dist/launchGtkApp.d.ts.map +1 -1
- package/dist/launcherDriverProtocol.d.ts +107 -0
- package/dist/launcherDriverProtocol.d.ts.map +1 -0
- package/dist/{native-ie_XIt1J.cjs → native-CBXaFWP-.cjs} +14 -40
- package/dist/native-CBXaFWP-.cjs.map +1 -0
- package/dist/{native-DUeVYIBs.js → native-CWdUmdty.js} +48 -74
- package/dist/native-CWdUmdty.js.map +1 -0
- package/dist/native.d.ts +4 -2
- package/dist/native.d.ts.map +1 -1
- package/dist/prerequisites-BuZST2Dy.cjs +15 -0
- package/dist/prerequisites-BuZST2Dy.cjs.map +1 -0
- package/dist/prerequisites-JB0SKPVd.js +16 -0
- package/dist/prerequisites-JB0SKPVd.js.map +1 -0
- package/dist/prerequisites.d.ts +23 -0
- package/dist/prerequisites.d.ts.map +1 -0
- package/dist/testing.cjs +3 -0
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.ts +4 -2
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.mjs +4 -1
- package/dist/testing.mjs.map +1 -1
- package/dist/tray.d.ts +2 -2
- package/dist/types.d.ts +64 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/wait-DV5gkXs8.js +113 -0
- package/dist/wait-DV5gkXs8.js.map +1 -0
- package/dist/wait-eOIz4nZm.cjs +112 -0
- package/dist/wait-eOIz4nZm.cjs.map +1 -0
- package/dist/wait.d.ts +67 -0
- package/dist/wait.d.ts.map +1 -0
- package/package.json +7 -7
- package/prebuilds/linux-arm/gtk3/node.napi.armv7.glibc.node +0 -0
- package/prebuilds/linux-arm/gtk4/node.napi.armv7.glibc.node +0 -0
- package/prebuilds/linux-arm64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-arm64/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-ia32/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-ia32/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-riscv64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-riscv64/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/gtk4/node.napi.glibc.node +0 -0
- package/dist/native-DUeVYIBs.js.map +0 -1
- package/dist/native-ie_XIt1J.cjs.map +0 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../node_modules/async-primitives/dist/index.mjs","../src/element.ts","../src/tray.ts","../src/launchGtkApp.ts"],"sourcesContent":["/*!\n* name: async-primitives\n* version: 1.7.0\n* description: A collection of primitive functions for asynchronous operations\n* author: Kouji Matsui (@kekyo@mi.kekyo.net)\n* license: MIT\n* repository.url: https://github.com/kekyo/async-primitives.git\n* git.commit.hash: 9472fbd5310b92690d84aaafb897429a04c013c5\n*/\n//#region src/primitives/internal/utils.ts\n/**\n* A no-op Releasable object that does nothing when released or disposed\n*/\nvar __NOOP_HANDLER = () => {};\nvar __NOOP_RELEASABLE = {\n\trelease: __NOOP_HANDLER,\n\t[Symbol.dispose]: __NOOP_HANDLER\n};\n//#endregion\n//#region src/primitives/abort-hook.ts\nvar toAbortError = (reason) => {\n\tif (reason instanceof Error) return reason;\n\tif (typeof reason === \"string\") return new Error(reason);\n\treturn /* @__PURE__ */ new Error(\"Operation aborted\");\n};\n/**\n* Hooks up an abort handler to an AbortSignal and returns a handle for early cleanup\n* @param signal - The AbortSignal to hook up to\n* @param callback - The callback to call when the signal is aborted\n* @returns A Releasable handle that can be used to remove the abort listener early\n*/\nvar onAbort = (signal, callback) => {\n\tif (!signal) return __NOOP_RELEASABLE;\n\tif (signal.aborted) {\n\t\ttry {\n\t\t\tcallback(toAbortError(signal.reason));\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"AbortHook callback error: \", error);\n\t\t}\n\t\treturn __NOOP_RELEASABLE;\n\t}\n\tlet abortHandler = () => {\n\t\tif (abortHandler) {\n\t\t\tconst reason = signal.reason;\n\t\t\tsignal.removeEventListener(\"abort\", abortHandler);\n\t\t\tabortHandler = void 0;\n\t\t\ttry {\n\t\t\t\tcallback(toAbortError(reason));\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn(\"AbortHook callback error: \", error);\n\t\t\t}\n\t\t}\n\t};\n\tconst release = () => {\n\t\tif (abortHandler) {\n\t\t\tsignal.removeEventListener(\"abort\", abortHandler);\n\t\t\tabortHandler = void 0;\n\t\t}\n\t};\n\tsignal.addEventListener(\"abort\", abortHandler, { once: true });\n\treturn {\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\n//#endregion\n//#region src/primitives/delay.ts\n/**\n* Helper function to create a delay\n* @param msec - The number of milliseconds to delay\n* @param signal - Optional AbortSignal to cancel the delay\n* @returns A promise that resolves after the delay or rejects if aborted\n*/\nvar delay = (msec, signal) => {\n\tif (signal) {\n\t\tif (signal.aborted) throw new Error(\"Delay was aborted\");\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\treject(/* @__PURE__ */ new Error(\"Delay was aborted\"));\n\t\t\t});\n\t\t\tconst timeoutId = setTimeout(() => {\n\t\t\t\tabortHandle.release();\n\t\t\t\tresolve();\n\t\t\t}, msec);\n\t\t});\n\t} else return new Promise((resolve) => {\n\t\tsetTimeout(resolve, msec);\n\t});\n};\n//#endregion\n//#region src/primitives/defer.ts\nvar runtimeGlobal$1 = globalThis;\nvar defer = (fn) => {\n\tconst setImmediateHandler = runtimeGlobal$1.setImmediate;\n\tif (typeof setImmediateHandler === \"function\") {\n\t\tsetImmediateHandler(fn);\n\t\treturn;\n\t}\n\tglobalThis.setTimeout(fn, 0);\n};\n//#endregion\n//#region src/primitives/mutex.ts\nvar ABORTED_ERROR$2 = () => /* @__PURE__ */ new Error(\"Lock acquisition was aborted\");\n/**\n* Creates a new LockHandle instance\n* @param releaseCallback Callback function to release the lock\n* @returns A LockHandle object with release and dispose functionality\n*/\nvar createLockHandle = (releaseCallback) => {\n\tlet isActive = true;\n\tconst release = () => {\n\t\tif (!isActive) return;\n\t\tisActive = false;\n\t\treleaseCallback();\n\t};\n\treturn {\n\t\tget isActive() {\n\t\t\treturn isActive;\n\t\t},\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\n/**\n* Creates a new Mutex instance\n* @param maxConsecutiveCalls - The maximum number of consecutive calls to the lockAsync method before yielding control to the next item in the queue\n* @returns A new Mutex for promise-based mutex operations\n*/\nvar createMutex = (maxConsecutiveCalls = 20) => {\n\tlet isLocked = false;\n\tconst queue = [];\n\tlet count = 0;\n\tconst processQueue = () => {\n\t\tvar _item$signal;\n\t\tif (isLocked || queue.length === 0) return;\n\t\tconst item = queue.shift();\n\t\tif ((_item$signal = item.signal) === null || _item$signal === void 0 ? void 0 : _item$signal.aborted) {\n\t\t\titem.reject(ABORTED_ERROR$2());\n\t\t\tscheduleNextProcess();\n\t\t\treturn;\n\t\t}\n\t\tisLocked = true;\n\t\tconst lockHandle = createLockHandle(releaseLock);\n\t\titem.resolve(lockHandle);\n\t};\n\tconst scheduleNextProcess = () => {\n\t\tcount++;\n\t\tif (count >= maxConsecutiveCalls) {\n\t\t\tcount = 0;\n\t\t\tdefer(processQueue);\n\t\t} else processQueue();\n\t};\n\tconst releaseLock = () => {\n\t\tif (!isLocked) return;\n\t\tisLocked = false;\n\t\tscheduleNextProcess();\n\t};\n\tconst removeFromQueue = (item) => {\n\t\tconst index = queue.indexOf(item);\n\t\tif (index !== -1) queue.splice(index, 1);\n\t};\n\tconst lock = async (signal) => {\n\t\tif (signal) {\n\t\t\tif (signal.aborted) throw ABORTED_ERROR$2();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst queueItem = {\n\t\t\t\t\tresolve: void 0,\n\t\t\t\t\treject: void 0,\n\t\t\t\t\tsignal\n\t\t\t\t};\n\t\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\t\tremoveFromQueue(queueItem);\n\t\t\t\t\treject(ABORTED_ERROR$2());\n\t\t\t\t});\n\t\t\t\tqueueItem.resolve = (handle) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\tresolve(handle);\n\t\t\t\t};\n\t\t\t\tqueueItem.reject = (error) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\treject(error);\n\t\t\t\t};\n\t\t\t\tqueue.push(queueItem);\n\t\t\t\tprocessQueue();\n\t\t\t});\n\t\t} else return new Promise((resolve, reject) => {\n\t\t\tqueue.push({\n\t\t\t\tresolve,\n\t\t\t\treject\n\t\t\t});\n\t\t\tprocessQueue();\n\t\t});\n\t};\n\treturn {\n\t\tlock,\n\t\twaiter: { wait: lock },\n\t\tget isLocked() {\n\t\t\treturn isLocked;\n\t\t},\n\t\tget pendingCount() {\n\t\t\treturn queue.length;\n\t\t}\n\t};\n};\n//#endregion\n//#region src/primitives/deferred.ts\n/**\n* Creates a new deferred object\n* @param T - The type of the result\n* @param signal - Optional AbortSignal for cancelling the wait\n* @returns A deferred object with a promise, resolve, and reject methods\n*/\nvar createDeferred = (signal) => {\n\tlet resolve;\n\tlet reject;\n\tconst promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\tconst disposer = onAbort(signal, () => {\n\t\tconst _reject = reject;\n\t\tif (_reject) {\n\t\t\tresolve = void 0;\n\t\t\treject = void 0;\n\t\t\t_reject(/* @__PURE__ */ new Error(\"Deferred aborted\"));\n\t\t}\n\t});\n\treturn {\n\t\tpromise,\n\t\tresolve: (value) => {\n\t\t\tconst _resolve = resolve;\n\t\t\tif (_resolve) {\n\t\t\t\tresolve = void 0;\n\t\t\t\treject = void 0;\n\t\t\t\tdisposer.release();\n\t\t\t\t_resolve(value);\n\t\t\t}\n\t\t},\n\t\treject: (error) => {\n\t\t\tconst _reject = reject;\n\t\t\tif (_reject) {\n\t\t\t\tresolve = void 0;\n\t\t\t\treject = void 0;\n\t\t\t\tdisposer.release();\n\t\t\t\t_reject(error);\n\t\t\t}\n\t\t}\n\t};\n};\n//#endregion\n//#region src/primitives/conditional.ts\nvar __NOOP_DUMMY_HANDLE = {\n\tget isActive() {\n\t\treturn false;\n\t},\n\trelease: __NOOP_HANDLER,\n\t[Symbol.dispose]: __NOOP_HANDLER\n};\n/**\n* Creates a conditional that can be automatically triggered\n* @returns A conditional that can be automatically triggered\n*/\nvar createConditional = () => {\n\tconst waiters = [];\n\tconst trigger = () => {\n\t\tif (waiters.length >= 1) waiters.shift().resolve();\n\t};\n\tconst wait = async (signal) => {\n\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) throw new Error(\"Conditional aborted\");\n\t\tconst waiter = createDeferred();\n\t\twaiters.push(waiter);\n\t\tconst disposer = onAbort(signal, () => {\n\t\t\twaiters.splice(waiters.indexOf(waiter), 1);\n\t\t\twaiter.reject(/* @__PURE__ */ new Error(\"Conditional aborted\"));\n\t\t});\n\t\ttry {\n\t\t\tawait waiter.promise;\n\t\t} finally {\n\t\t\tdisposer.release();\n\t\t}\n\t\treturn __NOOP_DUMMY_HANDLE;\n\t};\n\treturn {\n\t\ttrigger,\n\t\twait,\n\t\twaiter: { wait }\n\t};\n};\n/**\n* Creates a conditional that can be manually set and reset\n* @param initialState - Optional initial state of the conditional (Default: false, dropped)\n* @returns A conditional that can be manually set and reset\n*/\nvar createManuallyConditional = (initialState) => {\n\tconst waiters = [];\n\tlet raised = initialState !== null && initialState !== void 0 ? initialState : false;\n\tconst trigger = () => {\n\t\traised = false;\n\t\tconst waiter = waiters.shift();\n\t\tif (waiter) {\n\t\t\twaiter.resolve();\n\t\t\traised = false;\n\t\t}\n\t};\n\tconst raise = () => {\n\t\twhile (waiters.length >= 1) {\n\t\t\traised = true;\n\t\t\twaiters.shift().resolve();\n\t\t}\n\t\traised = true;\n\t};\n\tconst drop = () => {\n\t\traised = false;\n\t};\n\tconst wait = async (signal) => {\n\t\tif (raised) return __NOOP_DUMMY_HANDLE;\n\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) throw new Error(\"Conditional aborted\");\n\t\tconst waiter = createDeferred();\n\t\twaiters.push(waiter);\n\t\tconst disposer = onAbort(signal, () => {\n\t\t\twaiters.splice(waiters.indexOf(waiter), 1);\n\t\t\twaiter.reject(/* @__PURE__ */ new Error(\"Conditional aborted\"));\n\t\t});\n\t\ttry {\n\t\t\tawait waiter.promise;\n\t\t} finally {\n\t\t\tdisposer.release();\n\t\t}\n\t\treturn __NOOP_DUMMY_HANDLE;\n\t};\n\treturn {\n\t\ttrigger,\n\t\traise,\n\t\tdrop,\n\t\twait,\n\t\twaiter: { wait }\n\t};\n};\n//#endregion\n//#region src/primitives/deferred-generator.ts\n/**\n* Creates a new deferred generator object\n* @param T - The type of the yielded values\n* @param options - Optional options for the deferred generator\n* @returns A deferred generator object with an async generator and control functions\n*/\nvar createDeferredGenerator = (options) => {\n\tconst maxItemReserved = options === null || options === void 0 ? void 0 : options.maxItemReserved;\n\tconst signal = options === null || options === void 0 ? void 0 : options.signal;\n\tconst queue = [];\n\tconst arrived = createManuallyConditional();\n\tconst canReserve = maxItemReserved ? createManuallyConditional(true) : void 0;\n\tconst generator = (async function* () {\n\t\twhile (true) {\n\t\t\twhile (true) {\n\t\t\t\tconst item = queue.shift();\n\t\t\t\tif (maxItemReserved && queue.length === maxItemReserved - 1) canReserve.raise();\n\t\t\t\tif (!item) break;\n\t\t\t\tswitch (item.kind) {\n\t\t\t\t\tcase \"value\":\n\t\t\t\t\t\tyield item.value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"completed\": return;\n\t\t\t\t\tcase \"error\": throw item.error;\n\t\t\t\t}\n\t\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) throw new Error(\"Deferred generator aborted\");\n\t\t\t}\n\t\t\tarrived.drop();\n\t\t\ttry {\n\t\t\t\tawait arrived.wait(signal);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error && error.message === \"Conditional aborted\") error.message = \"Deferred generator aborted\";\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t})();\n\tconst enqueue = async (item, signal) => {\n\t\twhile (true) {\n\t\t\tif (!maxItemReserved || queue.length < maxItemReserved) {\n\t\t\t\tconst remains = queue.push(item);\n\t\t\t\tif (remains === 1) arrived.raise();\n\t\t\t\tif (remains === maxItemReserved) canReserve.drop();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait canReserve.wait(signal);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error && error.message === \"Conditional aborted\") error.message = \"Deferred generator aborted\";\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t};\n\treturn {\n\t\tgenerator,\n\t\tyield: (value, signal) => enqueue({\n\t\t\tkind: \"value\",\n\t\t\tvalue\n\t\t}, signal),\n\t\treturn: (signal) => enqueue({ kind: \"completed\" }, signal),\n\t\tthrow: (error, signal) => enqueue({\n\t\t\tkind: \"error\",\n\t\t\terror\n\t\t}, signal)\n\t};\n};\n//#endregion\n//#region src/primitives/internal/logical-context.ts\nvar runtimeGlobal = globalThis;\nvar LOGICAL_CONTEXT_HOOK = Symbol(\"logical-context-hook\");\nvar isHooked = (callback) => {\n\treturn callback[LOGICAL_CONTEXT_HOOK] === true;\n};\nvar markAsHooked = (callback) => {\n\tcallback[LOGICAL_CONTEXT_HOOK] = true;\n\treturn callback;\n};\nvar createLogicalContext = (id) => {\n\treturn {\n\t\tid,\n\t\tdata: /* @__PURE__ */ new Map()\n\t};\n};\nvar currentLogicalContext = createLogicalContext(Symbol(\"[root]\"));\nvar setCurrentLogicalContext = (context) => {\n\tcurrentLogicalContext = context;\n};\nvar trampoline = (adjustment, callback, thisArg, ...args) => {\n\tconst previousLogicalContext = currentLogicalContext;\n\tcurrentLogicalContext = adjustment.contextToUse;\n\ttry {\n\t\treturn callback.call(thisArg, ...args);\n\t} finally {\n\t\tadjustment.contextAfter = currentLogicalContext;\n\t\tcurrentLogicalContext = previousLogicalContext;\n\t}\n};\nvar isPrepared = false;\nvar prepareRuntimeHooks = () => {\n\tif (typeof globalThis.setTimeout !== \"undefined\" && !isHooked(globalThis.setTimeout)) {\n\t\tconst __setTimeout = globalThis.setTimeout;\n\t\tglobalThis.setTimeout = markAsHooked(((handler, timeout, ...args) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __setTimeout((...callbackArgs) => {\n\t\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, handler, void 0, ...callbackArgs);\n\t\t\t}, timeout, ...args);\n\t\t}));\n\t}\n\tif (typeof globalThis.setInterval !== \"undefined\" && !isHooked(globalThis.setInterval)) {\n\t\tconst __setInterval = globalThis.setInterval;\n\t\tglobalThis.setInterval = markAsHooked(((handler, timeout, ...args) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __setInterval((...callbackArgs) => {\n\t\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, handler, void 0, ...callbackArgs);\n\t\t\t}, timeout, ...args);\n\t\t}));\n\t}\n\tif (typeof globalThis.queueMicrotask !== \"undefined\" && !isHooked(globalThis.queueMicrotask)) {\n\t\tconst __queueMicrotask = globalThis.queueMicrotask;\n\t\tglobalThis.queueMicrotask = markAsHooked((callback) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __queueMicrotask(() => {\n\t\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, callback, void 0);\n\t\t\t});\n\t\t});\n\t}\n\tconst __setImmediate = runtimeGlobal.setImmediate;\n\tif (typeof __setImmediate === \"function\" && !isHooked(__setImmediate)) runtimeGlobal.setImmediate = markAsHooked(((callback, ...args) => {\n\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\treturn __setImmediate((...callbackArgs) => {\n\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, callback, void 0, ...callbackArgs);\n\t\t}, ...args);\n\t}));\n\tconst runtimeProcess = runtimeGlobal.process;\n\tif (runtimeProcess && typeof runtimeProcess.nextTick === \"function\" && !isHooked(runtimeProcess.nextTick)) {\n\t\tconst __nextTick = runtimeProcess.nextTick;\n\t\truntimeProcess.nextTick = markAsHooked((callback, ...args) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __nextTick(() => {\n\t\t\t\ttrampoline({ contextToUse: capturedLogicalContext }, callback, void 0, ...args);\n\t\t\t});\n\t\t});\n\t}\n\tif (typeof globalThis.requestAnimationFrame !== \"undefined\" && !isHooked(globalThis.requestAnimationFrame)) {\n\t\tconst __requestAnimationFrame = globalThis.requestAnimationFrame;\n\t\tglobalThis.requestAnimationFrame = markAsHooked((callback) => {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __requestAnimationFrame((time) => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, callback, void 0, time);\n\t\t\t});\n\t\t});\n\t}\n};\nvar prepare = () => {\n\tprepareRuntimeHooks();\n\tif (isPrepared) return;\n\tisPrepared = true;\n\tif (typeof Promise !== \"undefined\") {\n\t\tconst __then = Promise.prototype.then;\n\t\tconst __catch = Promise.prototype.catch;\n\t\tconst __finally = Promise.prototype.finally;\n\t\tPromise.prototype.then = function(onFulfilled, onRejected) {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __then.call(this, onFulfilled ? (value) => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, onFulfilled, void 0, value);\n\t\t\t} : void 0, onRejected ? (reason) => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, onRejected, void 0, reason);\n\t\t\t} : void 0);\n\t\t};\n\t\tPromise.prototype.catch = function(onRejected) {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __catch.call(this, onRejected ? (reason) => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, onRejected, void 0, reason);\n\t\t\t} : void 0);\n\t\t};\n\t\tPromise.prototype.finally = function(onFinally) {\n\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\treturn __finally.call(this, onFinally ? () => {\n\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, onFinally, void 0);\n\t\t\t} : void 0);\n\t\t};\n\t}\n\tif (typeof EventTarget !== \"undefined\" && EventTarget.prototype && EventTarget.prototype.addEventListener) {\n\t\tconst __eventTargetAddEventListener = EventTarget.prototype.addEventListener;\n\t\tEventTarget.prototype.addEventListener = function(type, listener, options) {\n\t\t\tif (listener === null || listener === void 0) return __eventTargetAddEventListener.call(this, type, listener, options);\n\t\t\tif (typeof listener === \"function\") {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t};\n\t\t\t\treturn __eventTargetAddEventListener.call(this, type, wrappedListener, options);\n\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\treturn __eventTargetAddEventListener.call(this, type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t}\n\t\t\treturn __eventTargetAddEventListener.call(this, type, listener, options);\n\t\t};\n\t}\n\tif (typeof Element !== \"undefined\" && Element.prototype && Element.prototype.addEventListener) {\n\t\tconst __elementAddEventListener = Element.prototype.addEventListener;\n\t\tElement.prototype.addEventListener = function(type, listener, options) {\n\t\t\tif (listener === null || listener === void 0) return __elementAddEventListener.call(this, type, listener, options);\n\t\t\tif (typeof listener === \"function\") {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t};\n\t\t\t\treturn __elementAddEventListener.call(this, type, wrappedListener, options);\n\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\treturn __elementAddEventListener.call(this, type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t}\n\t\t\treturn __elementAddEventListener.call(this, type, listener, options);\n\t\t};\n\t}\n\tif (typeof globalThis.XMLHttpRequest !== \"undefined\") {\n\t\tconst __XMLHttpRequest = globalThis.XMLHttpRequest;\n\t\tglobalThis.XMLHttpRequest = class extends __XMLHttpRequest {\n\t\t\tconstructor() {\n\t\t\t\tsuper();\n\t\t\t\tthis._userHandlers = /* @__PURE__ */ new Map();\n\t\t\t\t[\n\t\t\t\t\t\"onreadystatechange\",\n\t\t\t\t\t\"onloadstart\",\n\t\t\t\t\t\"onprogress\",\n\t\t\t\t\t\"onabort\",\n\t\t\t\t\t\"onerror\",\n\t\t\t\t\t\"onload\",\n\t\t\t\t\t\"ontimeout\",\n\t\t\t\t\t\"onloadend\"\n\t\t\t\t].forEach((prop) => {\n\t\t\t\t\tObject.defineProperty(this, prop, {\n\t\t\t\t\t\tget: () => this._userHandlers.get(prop) || null,\n\t\t\t\t\t\tset: (newHandler) => {\n\t\t\t\t\t\t\tthis._userHandlers.set(prop, newHandler);\n\t\t\t\t\t\t\tif (newHandler && typeof newHandler === \"function\") {\n\t\t\t\t\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\t\t\t\t\tconst wrappedHandler = function(event) {\n\t\t\t\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, newHandler, this, event);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, wrappedHandler);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = wrappedHandler;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, null);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\taddEventListener(type, listener, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tif (!listener) return super.addEventListener(type, listener, options);\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t\t};\n\t\t\t\t\treturn super.addEventListener(type, wrappedListener, options);\n\t\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) return super.addEventListener(type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t\treturn super.addEventListener(type, listener, options);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.WebSocket !== \"undefined\") {\n\t\tconst __WebSocket = globalThis.WebSocket;\n\t\tglobalThis.WebSocket = class extends __WebSocket {\n\t\t\tconstructor(url, protocols) {\n\t\t\t\tsuper(url, protocols);\n\t\t\t\tthis._userHandlers = /* @__PURE__ */ new Map();\n\t\t\t\t[\n\t\t\t\t\t\"onopen\",\n\t\t\t\t\t\"onmessage\",\n\t\t\t\t\t\"onerror\",\n\t\t\t\t\t\"onclose\"\n\t\t\t\t].forEach((prop) => {\n\t\t\t\t\tObject.defineProperty(this, prop, {\n\t\t\t\t\t\tget: () => this._userHandlers.get(prop) || null,\n\t\t\t\t\t\tset: (newHandler) => {\n\t\t\t\t\t\t\tthis._userHandlers.set(prop, newHandler);\n\t\t\t\t\t\t\tif (newHandler && typeof newHandler === \"function\") {\n\t\t\t\t\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\t\t\t\t\tconst wrappedHandler = function(event) {\n\t\t\t\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, newHandler, this, event);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, wrappedHandler);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = wrappedHandler;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, null);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\taddEventListener(type, listener, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tif (!listener) return super.addEventListener(type, listener, options);\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t\t};\n\t\t\t\t\treturn super.addEventListener(type, wrappedListener, options);\n\t\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) return super.addEventListener(type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t\treturn super.addEventListener(type, listener, options);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.MutationObserver !== \"undefined\") {\n\t\tconst __MutationObserver = globalThis.MutationObserver;\n\t\tglobalThis.MutationObserver = class extends __MutationObserver {\n\t\t\tconstructor(callback) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedCallback = (mutations, observer) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, callback, void 0, mutations, observer);\n\t\t\t\t};\n\t\t\t\tsuper(wrappedCallback);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.ResizeObserver !== \"undefined\") {\n\t\tconst __ResizeObserver = globalThis.ResizeObserver;\n\t\tglobalThis.ResizeObserver = class extends __ResizeObserver {\n\t\t\tconstructor(callback) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedCallback = (entries, observer) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, callback, void 0, entries, observer);\n\t\t\t\t};\n\t\t\t\tsuper(wrappedCallback);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.IntersectionObserver !== \"undefined\") {\n\t\tconst __IntersectionObserver = globalThis.IntersectionObserver;\n\t\tglobalThis.IntersectionObserver = class extends __IntersectionObserver {\n\t\t\tconstructor(callback, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tconst wrappedCallback = (entries, observer) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, callback, void 0, entries, observer);\n\t\t\t\t};\n\t\t\t\tsuper(wrappedCallback, options);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.Worker !== \"undefined\") {\n\t\tconst __Worker = globalThis.Worker;\n\t\tglobalThis.Worker = class extends __Worker {\n\t\t\tconstructor(scriptURL, options) {\n\t\t\t\tsuper(scriptURL, options);\n\t\t\t\tthis._userHandlers = /* @__PURE__ */ new Map();\n\t\t\t\t[\n\t\t\t\t\t\"onmessage\",\n\t\t\t\t\t\"onmessageerror\",\n\t\t\t\t\t\"onerror\"\n\t\t\t\t].forEach((prop) => {\n\t\t\t\t\tObject.defineProperty(this, prop, {\n\t\t\t\t\t\tget: () => this._userHandlers.get(prop) || null,\n\t\t\t\t\t\tset: (newHandler) => {\n\t\t\t\t\t\t\tthis._userHandlers.set(prop, newHandler);\n\t\t\t\t\t\t\tif (newHandler && typeof newHandler === \"function\") {\n\t\t\t\t\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\t\t\t\t\tconst wrappedHandler = function(event) {\n\t\t\t\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, newHandler, this, event);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, wrappedHandler);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = wrappedHandler;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(this)), prop);\n\t\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(this, null);\n\t\t\t\t\t\t\t\telse this[`_${prop}`] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\taddEventListener(type, listener, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tif (!listener) return super.addEventListener(type, listener, options);\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t\t};\n\t\t\t\t\treturn super.addEventListener(type, wrappedListener, options);\n\t\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) return super.addEventListener(type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t\treturn super.addEventListener(type, listener, options);\n\t\t\t}\n\t\t};\n\t}\n\tif (typeof globalThis.MessagePort !== \"undefined\") {\n\t\tconst __MessagePort = globalThis.MessagePort;\n\t\tconst createMessagePortWrapper = (originalPort) => {\n\t\t\tconst _userHandlers = /* @__PURE__ */ new Map();\n\t\t\t[\"onmessage\", \"onmessageerror\"].forEach((prop) => {\n\t\t\t\tObject.defineProperty(originalPort, prop, {\n\t\t\t\t\tget: () => _userHandlers.get(prop) || null,\n\t\t\t\t\tset: (newHandler) => {\n\t\t\t\t\t\t_userHandlers.set(prop, newHandler);\n\t\t\t\t\t\tif (newHandler && typeof newHandler === \"function\") {\n\t\t\t\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\t\t\t\tconst wrappedHandler = function(event) {\n\t\t\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, newHandler, this, event);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(__MessagePort.prototype, prop);\n\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(originalPort, wrappedHandler);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(__MessagePort.prototype, prop);\n\t\t\t\t\t\t\tif (descriptor && descriptor.set) descriptor.set.call(originalPort, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst originalAddEventListener = originalPort.addEventListener;\n\t\t\toriginalPort.addEventListener = function(type, listener, options) {\n\t\t\t\tconst capturedLogicalContext = currentLogicalContext;\n\t\t\t\tif (!listener) return originalAddEventListener.call(this, type, listener, options);\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\tconst wrappedListener = (event) => {\n\t\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, listener, event.currentTarget, event);\n\t\t\t\t\t};\n\t\t\t\t\treturn originalAddEventListener.call(this, type, wrappedListener, options);\n\t\t\t\t} else if (typeof listener === \"object\" && \"handleEvent\" in listener) return originalAddEventListener.call(this, type, { handleEvent: (event) => {\n\t\t\t\t\treturn trampoline({ contextToUse: capturedLogicalContext }, () => listener.handleEvent(event));\n\t\t\t\t} }, options);\n\t\t\t\treturn originalAddEventListener.call(this, type, listener, options);\n\t\t\t};\n\t\t\treturn originalPort;\n\t\t};\n\t\tif (typeof globalThis.MessageChannel !== \"undefined\") {\n\t\t\tconst __MessageChannel = globalThis.MessageChannel;\n\t\t\tglobalThis.MessageChannel = class extends __MessageChannel {\n\t\t\t\tconstructor() {\n\t\t\t\t\tsuper();\n\t\t\t\t\tcreateMessagePortWrapper(this.port1);\n\t\t\t\t\tcreateMessagePortWrapper(this.port2);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n};\n//#endregion\n//#region src/primitives/logical-context.ts\n/**\n* Set a value in the current logical context\n* @param key The symbol key for the value\n* @param value The value to store\n*/\nvar setLogicalContextValue = (key, value) => {\n\tprepare();\n\tif (value !== void 0) currentLogicalContext.data.set(key, value);\n\telse currentLogicalContext.data.delete(key);\n};\n/**\n* Get a value from the current logical context\n* @param key The symbol key for the value\n* @returns The stored value or undefined if not found\n*/\nvar getLogicalContextValue = (key) => {\n\tprepare();\n\treturn currentLogicalContext.data.get(key);\n};\n/**\n* Run a handler on a new logical context\n* @param prefix The prefix for the new logical context\n* @param handler The handler to run\n* @returns The result of the handler\n*/\nvar runOnNewLogicalContext = (prefix, handler) => {\n\tconst previousLogicalContext = currentLogicalContext;\n\tsetCurrentLogicalContext(createLogicalContext(Symbol(`${prefix}-${crypto.randomUUID()}`)));\n\ttry {\n\t\treturn handler();\n\t} finally {\n\t\tsetCurrentLogicalContext(previousLogicalContext);\n\t}\n};\n/**\n* Get the current logical context id\n* @returns The current logical context id\n*/\nvar getCurrentLogicalContextId = () => {\n\tprepare();\n\treturn currentLogicalContext.id;\n};\n//#endregion\n//#region src/primitives/async-local.ts\n/**\n* Creates a new AsyncLocal instance\n* @template T The type of the value to store in the async context\n* @returns A new AsyncLocal instance\n*/\nvar createAsyncLocal = () => {\n\tconst key = Symbol(`async-local-${crypto.randomUUID()}`);\n\treturn {\n\t\tsetValue: (value) => {\n\t\t\tsetLogicalContextValue(key, value);\n\t\t},\n\t\tgetValue: () => {\n\t\t\treturn getLogicalContextValue(key);\n\t\t}\n\t};\n};\n//#endregion\n//#region src/primitives/semaphore.ts\nvar ABORTED_ERROR$1 = () => /* @__PURE__ */ new Error(\"Semaphore acquisition was aborted\");\nvar INVALID_COUNT_ERROR = () => /* @__PURE__ */ new Error(\"Semaphore count must be greater than 0\");\n/**\n* Creates a new SemaphoreHandle instance\n* @param releaseCallback Callback function to release the semaphore resource\n* @returns A SemaphoreHandle object with release and dispose functionality\n*/\nvar createSemaphoreHandle = (releaseCallback) => {\n\tlet isActive = true;\n\tconst release = () => {\n\t\tif (!isActive) return;\n\t\tisActive = false;\n\t\treleaseCallback();\n\t};\n\treturn {\n\t\tget isActive() {\n\t\t\treturn isActive;\n\t\t},\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\n/**\n* Creates a new Semaphore instance for managing limited concurrent access\n* @param count The maximum number of concurrent acquisitions allowed (must be greater than 0)\n* @param maxConsecutiveCalls The maximum number of consecutive calls before yielding control\n* @returns A new Semaphore for managing concurrent resource access\n*/\nvar createSemaphore = (count, maxConsecutiveCalls = 20) => {\n\tif (count < 1) throw INVALID_COUNT_ERROR();\n\tlet availableCount = count;\n\tconst queue = [];\n\tlet consecutiveCallCount = 0;\n\tconst processQueue = () => {\n\t\twhile (availableCount > 0 && queue.length > 0) {\n\t\t\tvar _item$signal;\n\t\t\tconst item = queue.shift();\n\t\t\tif ((_item$signal = item.signal) === null || _item$signal === void 0 ? void 0 : _item$signal.aborted) {\n\t\t\t\titem.reject(ABORTED_ERROR$1());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tavailableCount--;\n\t\t\tconst semaphoreHandle = createSemaphoreHandle(releaseSemaphore);\n\t\t\titem.resolve(semaphoreHandle);\n\t\t}\n\t};\n\tconst scheduleNextProcess = () => {\n\t\tconsecutiveCallCount++;\n\t\tif (consecutiveCallCount >= maxConsecutiveCalls) {\n\t\t\tconsecutiveCallCount = 0;\n\t\t\tdefer(processQueue);\n\t\t} else processQueue();\n\t};\n\tconst releaseSemaphore = () => {\n\t\tavailableCount++;\n\t\tscheduleNextProcess();\n\t};\n\tconst removeFromQueue = (item) => {\n\t\tconst index = queue.indexOf(item);\n\t\tif (index !== -1) queue.splice(index, 1);\n\t};\n\tconst acquire = async (signal) => {\n\t\tif (signal) {\n\t\t\tif (signal.aborted) throw ABORTED_ERROR$1();\n\t\t\tif (availableCount > 0) {\n\t\t\t\tavailableCount--;\n\t\t\t\treturn createSemaphoreHandle(releaseSemaphore);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst queueItem = {\n\t\t\t\t\tresolve: void 0,\n\t\t\t\t\treject: void 0,\n\t\t\t\t\tsignal\n\t\t\t\t};\n\t\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\t\tremoveFromQueue(queueItem);\n\t\t\t\t\treject(ABORTED_ERROR$1());\n\t\t\t\t});\n\t\t\t\tqueueItem.resolve = (handle) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\tresolve(handle);\n\t\t\t\t};\n\t\t\t\tqueueItem.reject = (error) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\treject(error);\n\t\t\t\t};\n\t\t\t\tqueue.push(queueItem);\n\t\t\t\tprocessQueue();\n\t\t\t});\n\t\t} else {\n\t\t\tif (availableCount > 0) {\n\t\t\t\tavailableCount--;\n\t\t\t\treturn createSemaphoreHandle(releaseSemaphore);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tqueue.push({\n\t\t\t\t\tresolve,\n\t\t\t\t\treject\n\t\t\t\t});\n\t\t\t\tprocessQueue();\n\t\t\t});\n\t\t}\n\t};\n\treturn {\n\t\tacquire,\n\t\twaiter: { wait: acquire },\n\t\tget availableCount() {\n\t\t\treturn availableCount;\n\t\t},\n\t\tget pendingCount() {\n\t\t\treturn queue.length;\n\t\t}\n\t};\n};\n//#endregion\n//#region src/primitives/reader-writer-lock.ts\nvar ABORTED_ERROR = () => /* @__PURE__ */ new Error(\"Lock acquisition was aborted\");\n/**\n* Creates a new ReadLockHandle instance\n* @param releaseCallback Callback function to release the read lock\n* @returns A ReadLockHandle object with release and dispose functionality\n*/\nvar createReadLockHandle = (releaseCallback) => {\n\tlet isActive = true;\n\tconst release = () => {\n\t\tif (!isActive) return;\n\t\tisActive = false;\n\t\treleaseCallback();\n\t};\n\treturn {\n\t\tget isActive() {\n\t\t\treturn isActive;\n\t\t},\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\n/**\n* Creates a new WriteLockHandle instance\n* @param releaseCallback Callback function to release the write lock\n* @returns A WriteLockHandle object with release and dispose functionality\n*/\nvar createWriteLockHandle = (releaseCallback) => {\n\tlet isActive = true;\n\tconst release = () => {\n\t\tif (!isActive) return;\n\t\tisActive = false;\n\t\treleaseCallback();\n\t};\n\treturn {\n\t\tget isActive() {\n\t\t\treturn isActive;\n\t\t},\n\t\trelease,\n\t\t[Symbol.dispose]: release\n\t};\n};\nfunction createReaderWriterLock(optionsOrMaxCalls) {\n\tlet policy = \"write-preferring\";\n\tlet maxConsecutiveCalls = 20;\n\tif (typeof optionsOrMaxCalls === \"number\") maxConsecutiveCalls = optionsOrMaxCalls;\n\telse if (optionsOrMaxCalls) {\n\t\tvar _optionsOrMaxCalls$po, _optionsOrMaxCalls$ma;\n\t\tpolicy = (_optionsOrMaxCalls$po = optionsOrMaxCalls.policy) !== null && _optionsOrMaxCalls$po !== void 0 ? _optionsOrMaxCalls$po : \"write-preferring\";\n\t\tmaxConsecutiveCalls = (_optionsOrMaxCalls$ma = optionsOrMaxCalls.maxConsecutiveCalls) !== null && _optionsOrMaxCalls$ma !== void 0 ? _optionsOrMaxCalls$ma : 20;\n\t}\n\tlet currentReaders = 0;\n\tlet hasWriter = false;\n\tconst readQueue = [];\n\tconst writeQueue = [];\n\tlet consecutiveCallCount = 0;\n\tconst processQueues = () => {\n\t\tif (policy === \"write-preferring\") {\n\t\t\tif (!hasWriter && currentReaders === 0 && writeQueue.length > 0) {\n\t\t\t\tvar _item$signal;\n\t\t\t\tconst item = writeQueue.shift();\n\t\t\t\tif ((_item$signal = item.signal) === null || _item$signal === void 0 ? void 0 : _item$signal.aborted) {\n\t\t\t\t\titem.reject(ABORTED_ERROR());\n\t\t\t\t\tscheduleNextProcess();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasWriter = true;\n\t\t\t\tconst writeLockHandle = createWriteLockHandle(releaseWriteLock);\n\t\t\t\titem.resolve(writeLockHandle);\n\t\t\t} else if (!hasWriter && writeQueue.length === 0 && readQueue.length > 0) {\n\t\t\t\tconst readersToProcess = [];\n\t\t\t\twhile (readQueue.length > 0) {\n\t\t\t\t\tvar _item$signal2;\n\t\t\t\t\tconst item = readQueue.shift();\n\t\t\t\t\tif ((_item$signal2 = item.signal) === null || _item$signal2 === void 0 ? void 0 : _item$signal2.aborted) item.reject(ABORTED_ERROR());\n\t\t\t\t\telse readersToProcess.push(item);\n\t\t\t\t}\n\t\t\t\tfor (const item of readersToProcess) {\n\t\t\t\t\tcurrentReaders++;\n\t\t\t\t\tconst readLockHandle = createReadLockHandle(releaseReadLock);\n\t\t\t\t\titem.resolve(readLockHandle);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!hasWriter && readQueue.length > 0) {\n\t\t\tconst readersToProcess = [];\n\t\t\twhile (readQueue.length > 0) {\n\t\t\t\tvar _item$signal3;\n\t\t\t\tconst item = readQueue.shift();\n\t\t\t\tif ((_item$signal3 = item.signal) === null || _item$signal3 === void 0 ? void 0 : _item$signal3.aborted) item.reject(ABORTED_ERROR());\n\t\t\t\telse readersToProcess.push(item);\n\t\t\t}\n\t\t\tfor (const item of readersToProcess) {\n\t\t\t\tcurrentReaders++;\n\t\t\t\tconst readLockHandle = createReadLockHandle(releaseReadLock);\n\t\t\t\titem.resolve(readLockHandle);\n\t\t\t}\n\t\t} else if (!hasWriter && currentReaders === 0 && writeQueue.length > 0) {\n\t\t\tvar _item$signal4;\n\t\t\tconst item = writeQueue.shift();\n\t\t\tif ((_item$signal4 = item.signal) === null || _item$signal4 === void 0 ? void 0 : _item$signal4.aborted) {\n\t\t\t\titem.reject(ABORTED_ERROR());\n\t\t\t\tscheduleNextProcess();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thasWriter = true;\n\t\t\tconst writeLockHandle = createWriteLockHandle(releaseWriteLock);\n\t\t\titem.resolve(writeLockHandle);\n\t\t}\n\t};\n\tconst scheduleNextProcess = () => {\n\t\tconsecutiveCallCount++;\n\t\tif (consecutiveCallCount >= maxConsecutiveCalls) {\n\t\t\tconsecutiveCallCount = 0;\n\t\t\tdefer(processQueues);\n\t\t} else processQueues();\n\t};\n\tconst releaseReadLock = () => {\n\t\tif (currentReaders > 0) {\n\t\t\tcurrentReaders--;\n\t\t\tif (currentReaders === 0) scheduleNextProcess();\n\t\t}\n\t};\n\tconst releaseWriteLock = () => {\n\t\tif (hasWriter) {\n\t\t\thasWriter = false;\n\t\t\tscheduleNextProcess();\n\t\t}\n\t};\n\tconst removeFromReadQueue = (item) => {\n\t\tconst index = readQueue.indexOf(item);\n\t\tif (index !== -1) readQueue.splice(index, 1);\n\t};\n\tconst removeFromWriteQueue = (item) => {\n\t\tconst index = writeQueue.indexOf(item);\n\t\tif (index !== -1) writeQueue.splice(index, 1);\n\t};\n\tconst readLock = async (signal) => {\n\t\tif (signal) {\n\t\t\tif (signal.aborted) throw ABORTED_ERROR();\n\t\t\tif (policy === \"read-preferring\" ? !hasWriter : !hasWriter && writeQueue.length === 0) {\n\t\t\t\tcurrentReaders++;\n\t\t\t\treturn createReadLockHandle(releaseReadLock);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst queueItem = {\n\t\t\t\t\tresolve: void 0,\n\t\t\t\t\treject: void 0,\n\t\t\t\t\tsignal\n\t\t\t\t};\n\t\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\t\tremoveFromReadQueue(queueItem);\n\t\t\t\t\treject(ABORTED_ERROR());\n\t\t\t\t});\n\t\t\t\tqueueItem.resolve = (handle) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\tresolve(handle);\n\t\t\t\t};\n\t\t\t\tqueueItem.reject = (error) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\treject(error);\n\t\t\t\t};\n\t\t\t\treadQueue.push(queueItem);\n\t\t\t\tprocessQueues();\n\t\t\t});\n\t\t} else {\n\t\t\tif (policy === \"read-preferring\" ? !hasWriter : !hasWriter && writeQueue.length === 0) {\n\t\t\t\tcurrentReaders++;\n\t\t\t\treturn createReadLockHandle(releaseReadLock);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treadQueue.push({\n\t\t\t\t\tresolve,\n\t\t\t\t\treject\n\t\t\t\t});\n\t\t\t\tprocessQueues();\n\t\t\t});\n\t\t}\n\t};\n\tconst writeLock = async (signal) => {\n\t\tif (signal) {\n\t\t\tif (signal.aborted) throw ABORTED_ERROR();\n\t\t\tif (!hasWriter && currentReaders === 0) {\n\t\t\t\thasWriter = true;\n\t\t\t\treturn createWriteLockHandle(releaseWriteLock);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst queueItem = {\n\t\t\t\t\tresolve: void 0,\n\t\t\t\t\treject: void 0,\n\t\t\t\t\tsignal\n\t\t\t\t};\n\t\t\t\tconst abortHandle = onAbort(signal, () => {\n\t\t\t\t\tremoveFromWriteQueue(queueItem);\n\t\t\t\t\treject(ABORTED_ERROR());\n\t\t\t\t});\n\t\t\t\tqueueItem.resolve = (handle) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\tresolve(handle);\n\t\t\t\t};\n\t\t\t\tqueueItem.reject = (error) => {\n\t\t\t\t\tabortHandle.release();\n\t\t\t\t\treject(error);\n\t\t\t\t};\n\t\t\t\twriteQueue.push(queueItem);\n\t\t\t\tprocessQueues();\n\t\t\t});\n\t\t} else {\n\t\t\tif (!hasWriter && currentReaders === 0) {\n\t\t\t\thasWriter = true;\n\t\t\t\treturn createWriteLockHandle(releaseWriteLock);\n\t\t\t}\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\twriteQueue.push({\n\t\t\t\t\tresolve,\n\t\t\t\t\treject\n\t\t\t\t});\n\t\t\t\tprocessQueues();\n\t\t\t});\n\t\t}\n\t};\n\treturn {\n\t\treadLock,\n\t\twriteLock,\n\t\treadWaiter: { wait: readLock },\n\t\twriteWaiter: { wait: writeLock },\n\t\tget currentReaders() {\n\t\t\treturn currentReaders;\n\t\t},\n\t\tget hasWriter() {\n\t\t\treturn hasWriter;\n\t\t},\n\t\tget pendingReadersCount() {\n\t\t\treturn readQueue.length;\n\t\t},\n\t\tget pendingWritersCount() {\n\t\t\treturn writeQueue.length;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/primitives/async-operator.ts\nvar __NO_INITIAL_VALUE = Symbol(\"no-initial-value\");\nvar __LINEAR_SKIP = Symbol(\"linear-skip\");\nvar __LINEAR_STOP = Symbol(\"linear-stop\");\nvar createAsyncIterable = (iteratorFactory) => ({ [Symbol.asyncIterator]: iteratorFactory });\nvar createSyncIterable = (iteratorFactory) => ({ [Symbol.iterator]: iteratorFactory });\nvar createIteratorFactories = (source) => isAsyncIterable(source) ? {\n\tsyncFactory: void 0,\n\tasyncFactory: () => toAsyncIterable(source)\n} : {\n\tsyncFactory: () => source,\n\tasyncFactory: () => toAsyncIterable(source)\n};\nvar createAsyncOnlyFactories = (asyncFactory) => ({\n\tsyncFactory: void 0,\n\tasyncFactory\n});\nvar normalizeIteratorFactories = (iteratorFactoriesOrAsyncFactory) => typeof iteratorFactoriesOrAsyncFactory === \"function\" ? createAsyncOnlyFactories(iteratorFactoriesOrAsyncFactory) : iteratorFactoriesOrAsyncFactory;\nvar identity = (value) => value;\nvar sameValueZero = (left, right) => left === right || left !== left && right !== right;\nvar isArraySource = (source) => Array.isArray(source);\nvar isPromiseLike = (value) => (typeof value === \"object\" && value !== null || typeof value === \"function\") && typeof value.then === \"function\";\nvar isAsyncIterable = (source) => typeof source[Symbol.asyncIterator] === \"function\";\nvar toAsyncIterable = (source) => createAsyncIterable(async function* () {\n\tif (isAsyncIterable(source)) for await (const value of source) yield value;\n\telse for (const value of source) yield isPromiseLike(value) ? await value : value;\n});\nvar toIntegerOrInfinity = (value) => {\n\tif (Number.isNaN(value) || value === 0) return 0;\n\tif (!Number.isFinite(value)) return value;\n\treturn Math.trunc(value);\n};\nvar normalizeCount = (count) => {\n\tif (Number.isNaN(count) || count <= 0) return 0;\n\treturn Math.trunc(count);\n};\nvar normalizeRequiredCount = (count, name) => {\n\tif (!Number.isFinite(count) || count <= 0) throw new RangeError(`${name} must be greater than 0`);\n\treturn Math.trunc(count);\n};\nvar isNonNullish = (value) => value !== null && value !== void 0;\nvar compareValues = (left, right) => {\n\tif (left < right) return -1;\n\tif (left > right) return 1;\n\treturn 0;\n};\nvar createLinearRuntimeState = (operation) => {\n\tswitch (operation.kind) {\n\t\tcase \"map\":\n\t\tcase \"filter\":\n\t\tcase \"choose\":\n\t\tcase \"takeWhile\": return {\n\t\t\tkind: operation.kind,\n\t\t\tindex: 0\n\t\t};\n\t\tcase \"skipWhile\": return {\n\t\t\tkind: operation.kind,\n\t\t\tindex: 0,\n\t\t\tskipping: true\n\t\t};\n\t}\n};\nvar createLinearPipelineFactories = (pipeline) => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\tconst runtimeStates = pipeline.operations.map(createLinearRuntimeState);\n\tconst applyOperations = async (input) => {\n\t\tlet current = input;\n\t\tfor (let operationIndex = 0; operationIndex < pipeline.operations.length; operationIndex++) {\n\t\t\tconst operation = pipeline.operations[operationIndex];\n\t\t\tconst runtimeState = runtimeStates[operationIndex];\n\t\t\tswitch (operation.kind) {\n\t\t\t\tcase \"map\": {\n\t\t\t\t\tconst selected = operation.selector(current, runtimeState.index);\n\t\t\t\t\tcurrent = isPromiseLike(selected) ? await selected : selected;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"filter\": {\n\t\t\t\t\tconst result = operation.predicate(current, runtimeState.index);\n\t\t\t\t\tconst included = isPromiseLike(result) ? await result : result;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tif (!included) return __LINEAR_SKIP;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"choose\": {\n\t\t\t\t\tconst result = operation.selector(current, runtimeState.index);\n\t\t\t\t\tconst selected = isPromiseLike(result) ? await result : result;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tif (!isNonNullish(selected)) return __LINEAR_SKIP;\n\t\t\t\t\tcurrent = selected;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"skipWhile\": {\n\t\t\t\t\tconst skipState = runtimeState;\n\t\t\t\t\tconst result = operation.predicate(current, runtimeState.index);\n\t\t\t\t\tconst shouldSkip = isPromiseLike(result) ? await result : result;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tif (skipState.skipping && shouldSkip) return __LINEAR_SKIP;\n\t\t\t\t\tskipState.skipping = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"takeWhile\": {\n\t\t\t\t\tconst result = operation.predicate(current, runtimeState.index);\n\t\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return __LINEAR_STOP;\n\t\t\t\t\truntimeState.index++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn current;\n\t};\n\tconst { syncFactory, asyncFactory } = pipeline.sourceFactories;\n\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\tconst processedValue = await applyOperations(isPromiseLike(value) ? await value : value);\n\t\tif (processedValue === __LINEAR_STOP) return;\n\t\tif (processedValue !== __LINEAR_SKIP) yield processedValue;\n\t}\n\telse for await (const value of asyncFactory()) {\n\t\tconst processedValue = await applyOperations(value);\n\t\tif (processedValue === __LINEAR_STOP) return;\n\t\tif (processedValue !== __LINEAR_SKIP) yield processedValue;\n\t}\n}));\nvar collectKeysFromSource = async (source, selector) => {\n\tconst { syncFactory, asyncFactory } = createIteratorFactories(source);\n\tlet index = 0;\n\tconst keys = /* @__PURE__ */ new Set();\n\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\tconst key = selector(isPromiseLike(value) ? await value : value, index);\n\t\tkeys.add(isPromiseLike(key) ? await key : key);\n\t\tindex++;\n\t}\n\telse for await (const value of asyncFactory()) {\n\t\tconst key = selector(value, index);\n\t\tkeys.add(isPromiseLike(key) ? await key : key);\n\t\tindex++;\n\t}\n\treturn keys;\n};\nvar collectValuesFromSource = async (source) => {\n\tconst { syncFactory, asyncFactory } = createIteratorFactories(source);\n\tconst values = /* @__PURE__ */ new Set();\n\tif (syncFactory !== void 0) for (const value of syncFactory()) values.add(isPromiseLike(value) ? await value : value);\n\telse for await (const value of asyncFactory()) values.add(value);\n\treturn values;\n};\nvar materializeValues = async (iteratorFactories) => {\n\tconst { syncFactory, asyncFactory } = iteratorFactories;\n\tconst values = [];\n\tif (syncFactory !== void 0) for (const value of syncFactory()) values.push(isPromiseLike(value) ? await value : value);\n\telse for await (const value of asyncFactory()) values.push(value);\n\treturn values;\n};\nvar findExtremeBy = async (iteratorFactories, selector, direction) => {\n\tconst { syncFactory, asyncFactory } = iteratorFactories;\n\tlet index = 0;\n\tlet hasBestValue = false;\n\tlet bestValue;\n\tlet bestKey;\n\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\tconst selectedKey = selector(resolvedValue, index);\n\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\tif (!hasBestValue || (direction === \"min\" ? compareValues(key, bestKey) < 0 : compareValues(key, bestKey) > 0)) {\n\t\t\thasBestValue = true;\n\t\t\tbestValue = resolvedValue;\n\t\t\tbestKey = key;\n\t\t}\n\t\tindex++;\n\t}\n\telse for await (const value of asyncFactory()) {\n\t\tconst selectedKey = selector(value, index);\n\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\tif (!hasBestValue || (direction === \"min\" ? compareValues(key, bestKey) < 0 : compareValues(key, bestKey) > 0)) {\n\t\t\thasBestValue = true;\n\t\t\tbestValue = value;\n\t\t\tbestKey = key;\n\t\t}\n\t\tindex++;\n\t}\n\treturn bestValue;\n};\nvar createAsyncOperator = (iteratorFactoriesOrAsyncFactory, linearPipeline) => {\n\tconst iteratorFactories = normalizeIteratorFactories(iteratorFactoriesOrAsyncFactory);\n\tconst { syncFactory, asyncFactory } = iteratorFactories;\n\tconst iterableFactory = asyncFactory;\n\tconst appendLinearOperation = (operation, createFallbackIteratorFactories) => {\n\t\tconst nextLinearPipeline = linearPipeline === void 0 ? {\n\t\t\tsourceFactories: iteratorFactories,\n\t\t\toperations: [operation]\n\t\t} : {\n\t\t\tsourceFactories: linearPipeline.sourceFactories,\n\t\t\toperations: [...linearPipeline.operations, operation]\n\t\t};\n\t\treturn createAsyncOperator(linearPipeline === void 0 ? createFallbackIteratorFactories() : createLinearPipelineFactories(nextLinearPipeline), nextLinearPipeline);\n\t};\n\tconst reduce = (async (...args) => {\n\t\tconst [reducer] = args;\n\t\tlet accumulator = args.length === 2 ? args[1] : __NO_INITIAL_VALUE;\n\t\tlet index = 0;\n\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\tif (accumulator === __NO_INITIAL_VALUE) accumulator = resolvedValue;\n\t\t\telse {\n\t\t\t\tconst reduced = reducer(accumulator, resolvedValue, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\telse for await (const value of asyncFactory()) {\n\t\t\tif (accumulator === __NO_INITIAL_VALUE) accumulator = value;\n\t\t\telse {\n\t\t\t\tconst reduced = reducer(accumulator, value, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\tif (accumulator === __NO_INITIAL_VALUE) throw new TypeError(\"Reduce of empty AsyncOperator with no initial value\");\n\t\treturn accumulator;\n\t});\n\tconst reduceRight = (async (...args) => {\n\t\tconst [reducer] = args;\n\t\tconst hasInitialValue = args.length === 2;\n\t\tconst values = await materializeValues(iteratorFactories);\n\t\tlet accumulator = hasInitialValue ? args[1] : __NO_INITIAL_VALUE;\n\t\tfor (let index = values.length - 1; index >= 0; index--) {\n\t\t\tconst value = values[index];\n\t\t\tif (accumulator === __NO_INITIAL_VALUE) accumulator = value;\n\t\t\telse {\n\t\t\t\tconst reduced = reducer(accumulator, value, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t}\n\t\t}\n\t\tif (accumulator === __NO_INITIAL_VALUE) throw new TypeError(\"ReduceRight of empty AsyncOperator with no initial value\");\n\t\treturn accumulator;\n\t});\n\tconst flat = ((depth) => createAsyncOperator(createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\tconst values = await materializeValues(iteratorFactories);\n\t\tfor (const value of values.flat(depth)) yield value;\n\t}))));\n\treturn {\n\t\t[Symbol.asyncIterator]: () => asyncFactory()[Symbol.asyncIterator](),\n\t\tmap: (selector) => appendLinearOperation({\n\t\t\tkind: \"map\",\n\t\t\tselector\n\t\t}, () => {\n\t\t\tconst mappedSyncFactory = syncFactory === void 0 ? void 0 : () => createSyncIterable(function* () {\n\t\t\t\tlet index = 0;\n\t\t\t\tfor (const value of syncFactory()) {\n\t\t\t\t\tconst currentIndex = index;\n\t\t\t\t\tif (isPromiseLike(value)) yield value.then((resolvedValue) => selector(resolvedValue, currentIndex));\n\t\t\t\t\telse yield selector(value, currentIndex);\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (mappedSyncFactory !== void 0) return {\n\t\t\t\tsyncFactory: mappedSyncFactory,\n\t\t\t\tasyncFactory: () => toAsyncIterable(mappedSyncFactory())\n\t\t\t};\n\t\t\treturn createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\t\tlet index = 0;\n\t\t\t\tfor await (const value of iterableFactory()) {\n\t\t\t\t\tconst selected = selector(value, index);\n\t\t\t\t\tyield isPromiseLike(selected) ? await selected : selected;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t}));\n\t\t}),\n\t\tflatMap: (selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) {\n\t\t\t\tconst source = syncFactory();\n\t\t\t\tif (Array.isArray(source)) for (let outerIndex = 0; outerIndex < source.length; outerIndex++) {\n\t\t\t\t\tconst value = source[outerIndex];\n\t\t\t\t\tconst selected = selector(isPromiseLike(value) ? await value : value, index);\n\t\t\t\t\tconst innerSource = isPromiseLike(selected) ? await selected : selected;\n\t\t\t\t\tif (isArraySource(innerSource)) for (let innerIndex = 0; innerIndex < innerSource.length; innerIndex++) {\n\t\t\t\t\t\tconst innerValue = innerSource[innerIndex];\n\t\t\t\t\t\tyield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t\t}\n\t\t\t\t\telse if (isAsyncIterable(innerSource)) for await (const innerValue of innerSource) yield innerValue;\n\t\t\t\t\telse for (const innerValue of innerSource) yield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\telse for (const value of source) {\n\t\t\t\t\tconst selected = selector(isPromiseLike(value) ? await value : value, index);\n\t\t\t\t\tconst innerSource = isPromiseLike(selected) ? await selected : selected;\n\t\t\t\t\tif (isArraySource(innerSource)) for (let innerIndex = 0; innerIndex < innerSource.length; innerIndex++) {\n\t\t\t\t\t\tconst innerValue = innerSource[innerIndex];\n\t\t\t\t\t\tyield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t\t}\n\t\t\t\t\telse if (isAsyncIterable(innerSource)) for await (const innerValue of innerSource) yield innerValue;\n\t\t\t\t\telse for (const innerValue of innerSource) yield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t} else for await (const value of iterableFactory()) {\n\t\t\t\tconst selected = selector(value, index);\n\t\t\t\tconst innerSource = isPromiseLike(selected) ? await selected : selected;\n\t\t\t\tif (isArraySource(innerSource)) for (let innerIndex = 0; innerIndex < innerSource.length; innerIndex++) {\n\t\t\t\t\tconst innerValue = innerSource[innerIndex];\n\t\t\t\t\tyield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\t}\n\t\t\t\telse if (isAsyncIterable(innerSource)) for await (const innerValue of innerSource) yield innerValue;\n\t\t\t\telse for (const innerValue of innerSource) yield isPromiseLike(innerValue) ? await innerValue : innerValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tfilter: (predicate) => appendLinearOperation({\n\t\t\tkind: \"filter\",\n\t\t\tpredicate\n\t\t}, () => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) yield resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) yield value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}))),\n\t\tconcat: (...sources) => {\n\t\t\tconst concatenatedSyncFactory = syncFactory !== void 0 && sources.every((source) => !isAsyncIterable(source)) ? () => createSyncIterable(function* () {\n\t\t\t\tfor (const value of syncFactory()) yield value;\n\t\t\t\tfor (const source of sources) for (const value of source) yield value;\n\t\t\t}) : void 0;\n\t\t\tif (concatenatedSyncFactory !== void 0) return createAsyncOperator({\n\t\t\t\tsyncFactory: concatenatedSyncFactory,\n\t\t\t\tasyncFactory: () => toAsyncIterable(concatenatedSyncFactory())\n\t\t\t});\n\t\t\treturn createAsyncOperator(createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) yield isPromiseLike(value) ? await value : value;\n\t\t\t\telse for await (const value of iterableFactory()) yield value;\n\t\t\t\tfor (const source of sources) if (isAsyncIterable(source)) for await (const value of source) yield value;\n\t\t\t\telse for (const value of source) yield isPromiseLike(value) ? await value : value;\n\t\t\t})));\n\t\t},\n\t\tchoose: (selector) => appendLinearOperation({\n\t\t\tkind: \"choose\",\n\t\t\tselector\n\t\t}, () => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = selector(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tconst selected = isPromiseLike(result) ? await result : result;\n\t\t\t\tif (isNonNullish(selected)) yield selected;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = selector(value, index);\n\t\t\t\tconst selected = isPromiseLike(result) ? await result : result;\n\t\t\t\tif (isNonNullish(selected)) yield selected;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}))),\n\t\tslice: (start, end) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedStart = toIntegerOrInfinity(start);\n\t\t\tconst normalizedEnd = end === void 0 ? void 0 : toIntegerOrInfinity(end);\n\t\t\tif (normalizedStart < 0 || normalizedEnd !== void 0 && normalizedEnd < 0) {\n\t\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\t\tfor (const value of values.slice(start, end)) yield value;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst startIndex = Math.max(normalizedStart, 0);\n\t\t\tif (startIndex === Infinity) return;\n\t\t\tconst endIndex = normalizedEnd === void 0 ? void 0 : Math.max(normalizedEnd, 0);\n\t\t\tif (endIndex !== void 0 && endIndex !== Infinity && endIndex <= startIndex) return;\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) {\n\t\t\t\tconst iterator = syncFactory()[Symbol.iterator]();\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (endIndex !== void 0 && endIndex !== Infinity && index >= endIndex) return;\n\t\t\t\t\tconst result = iterator.next();\n\t\t\t\t\tif (result.done) return;\n\t\t\t\t\tconst value = result.value;\n\t\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\t\tif (index >= startIndex) yield resolvedValue;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst iterator = iterableFactory()[Symbol.asyncIterator]();\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (endIndex !== void 0 && endIndex !== Infinity && index >= endIndex) return;\n\t\t\t\t\tconst result = await iterator.next();\n\t\t\t\t\tif (result.done) return;\n\t\t\t\t\tconst value = result.value;\n\t\t\t\t\tif (index >= startIndex) yield value;\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t}\n\t\t})),\n\t\tdistinct: () => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!seenValues.has(resolvedValue)) {\n\t\t\t\t\tseenValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) if (!seenValues.has(value)) {\n\t\t\t\tseenValues.add(value);\n\t\t\t\tyield value;\n\t\t\t}\n\t\t})),\n\t\tdistinctBy: (selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tconst seenKeys = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tskip: (count) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedCount = normalizeCount(count);\n\t\t\tlet skippedCount = 0;\n\t\t\tfor await (const value of iterableFactory()) {\n\t\t\t\tif (skippedCount < normalizedCount) {\n\t\t\t\t\tskippedCount++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tyield value;\n\t\t\t}\n\t\t})),\n\t\tskipWhile: (predicate) => appendLinearOperation({\n\t\t\tkind: \"skipWhile\",\n\t\t\tpredicate\n\t\t}, () => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tlet skipping = true;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (skipping && (isPromiseLike(result) ? await result : result)) {\n\t\t\t\t\tindex++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tskipping = false;\n\t\t\t\tyield resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (skipping && (isPromiseLike(result) ? await result : result)) {\n\t\t\t\t\tindex++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tskipping = false;\n\t\t\t\tyield value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}))),\n\t\ttake: (count) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedCount = normalizeCount(count);\n\t\t\tif (normalizedCount === 0) return;\n\t\t\tlet takenCount = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tyield isPromiseLike(value) ? await value : value;\n\t\t\t\ttakenCount++;\n\t\t\t\tif (takenCount >= normalizedCount) return;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tyield value;\n\t\t\t\ttakenCount++;\n\t\t\t\tif (takenCount >= normalizedCount) return;\n\t\t\t}\n\t\t})),\n\t\ttakeWhile: (predicate) => appendLinearOperation({\n\t\t\tkind: \"takeWhile\",\n\t\t\tpredicate\n\t\t}, () => createAsyncOnlyFactories(() => createAsyncIterable(async function* () {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return;\n\t\t\t\tyield resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return;\n\t\t\t\tyield value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}))),\n\t\tpairwise: () => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tlet hasPreviousValue = false;\n\t\t\tlet previousValue;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (hasPreviousValue) yield [previousValue, resolvedValue];\n\t\t\t\tpreviousValue = resolvedValue;\n\t\t\t\thasPreviousValue = true;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tif (hasPreviousValue) yield [previousValue, value];\n\t\t\t\tpreviousValue = value;\n\t\t\t\thasPreviousValue = true;\n\t\t\t}\n\t\t})),\n\t\tzip: (source) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tif (isAsyncIterable(source)) {\n\t\t\t\tconst otherIterator = source[Symbol.asyncIterator]();\n\t\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\t\tconst otherResult = await otherIterator.next();\n\t\t\t\t\tif (otherResult.done) return;\n\t\t\t\t\tyield [isPromiseLike(value) ? await value : value, otherResult.value];\n\t\t\t\t}\n\t\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\t\tconst otherResult = await otherIterator.next();\n\t\t\t\t\tif (otherResult.done) return;\n\t\t\t\t\tyield [value, otherResult.value];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst otherIterator = source[Symbol.iterator]();\n\t\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\t\tconst otherResult = otherIterator.next();\n\t\t\t\t\tif (otherResult.done) return;\n\t\t\t\t\tyield [isPromiseLike(value) ? await value : value, isPromiseLike(otherResult.value) ? await otherResult.value : otherResult.value];\n\t\t\t\t}\n\t\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\t\tconst otherResult = otherIterator.next();\n\t\t\t\t\tif (otherResult.done) return;\n\t\t\t\t\tyield [value, isPromiseLike(otherResult.value) ? await otherResult.value : otherResult.value];\n\t\t\t\t}\n\t\t\t}\n\t\t})),\n\t\tscan: (reducer, initialValue) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tlet accumulator = initialValue;\n\t\t\tlet index = 0;\n\t\t\tyield accumulator;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst reduced = reducer(accumulator, resolvedValue, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t\tyield accumulator;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst reduced = reducer(accumulator, value, index);\n\t\t\t\taccumulator = isPromiseLike(reduced) ? await reduced : reduced;\n\t\t\t\tyield accumulator;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tunion: (source) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!seenValues.has(resolvedValue)) {\n\t\t\t\t\tseenValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) if (!seenValues.has(value)) {\n\t\t\t\tseenValues.add(value);\n\t\t\t\tyield value;\n\t\t\t}\n\t\t\tif (isAsyncIterable(source)) {\n\t\t\t\tfor await (const value of source) if (!seenValues.has(value)) {\n\t\t\t\t\tseenValues.add(value);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t} else for (const value of source) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!seenValues.has(resolvedValue)) {\n\t\t\t\t\tseenValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t})),\n\t\tunionBy: (source, selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst seenKeys = /* @__PURE__ */ new Set();\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tindex = 0;\n\t\t\tif (isAsyncIterable(source)) for await (const value of source) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for (const value of source) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!seenKeys.has(key)) {\n\t\t\t\t\tseenKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tintersect: (source) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst rightValues = await collectValuesFromSource(source);\n\t\t\tconst yieldedValues = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (rightValues.has(resolvedValue) && !yieldedValues.has(resolvedValue)) {\n\t\t\t\t\tyieldedValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) if (rightValues.has(value) && !yieldedValues.has(value)) {\n\t\t\t\tyieldedValues.add(value);\n\t\t\t\tyield value;\n\t\t\t}\n\t\t})),\n\t\tintersectBy: (source, selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst rightKeys = await collectKeysFromSource(source, selector);\n\t\t\tconst yieldedKeys = /* @__PURE__ */ new Set();\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (rightKeys.has(key) && !yieldedKeys.has(key)) {\n\t\t\t\t\tyieldedKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (rightKeys.has(key) && !yieldedKeys.has(key)) {\n\t\t\t\t\tyieldedKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\texcept: (source) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst excludedValues = await collectValuesFromSource(source);\n\t\t\tconst yieldedValues = /* @__PURE__ */ new Set();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!excludedValues.has(resolvedValue) && !yieldedValues.has(resolvedValue)) {\n\t\t\t\t\tyieldedValues.add(resolvedValue);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) if (!excludedValues.has(value) && !yieldedValues.has(value)) {\n\t\t\t\tyieldedValues.add(value);\n\t\t\t\tyield value;\n\t\t\t}\n\t\t})),\n\t\texceptBy: (source, selector) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst excludedKeys = await collectKeysFromSource(source, selector);\n\t\t\tconst yieldedKeys = /* @__PURE__ */ new Set();\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!excludedKeys.has(key) && !yieldedKeys.has(key)) {\n\t\t\t\t\tyieldedKeys.add(key);\n\t\t\t\t\tyield resolvedValue;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tif (!excludedKeys.has(key) && !yieldedKeys.has(key)) {\n\t\t\t\t\tyieldedKeys.add(key);\n\t\t\t\t\tyield value;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t})),\n\t\tchunkBySize: (size) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedSize = normalizeRequiredCount(size, \"Chunk size\");\n\t\t\tlet chunk = [];\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tchunk.push(isPromiseLike(value) ? await value : value);\n\t\t\t\tif (chunk.length >= normalizedSize) {\n\t\t\t\t\tyield chunk;\n\t\t\t\t\tchunk = [];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tchunk.push(value);\n\t\t\t\tif (chunk.length >= normalizedSize) {\n\t\t\t\t\tyield chunk;\n\t\t\t\t\tchunk = [];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (chunk.length > 0) yield chunk;\n\t\t})),\n\t\twindowed: (size) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst normalizedSize = normalizeRequiredCount(size, \"Window size\");\n\t\t\tconst buffer = new Array(normalizedSize);\n\t\t\tlet count = 0;\n\t\t\tlet nextIndex = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tbuffer[nextIndex] = isPromiseLike(value) ? await value : value;\n\t\t\t\tnextIndex = (nextIndex + 1) % normalizedSize;\n\t\t\t\tcount = Math.min(count + 1, normalizedSize);\n\t\t\t\tif (count < normalizedSize) continue;\n\t\t\t\tconst window = new Array(normalizedSize);\n\t\t\t\tfor (let index = 0; index < normalizedSize; index++) window[index] = buffer[(nextIndex + index) % normalizedSize];\n\t\t\t\tyield window;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tbuffer[nextIndex] = value;\n\t\t\t\tnextIndex = (nextIndex + 1) % normalizedSize;\n\t\t\t\tcount = Math.min(count + 1, normalizedSize);\n\t\t\t\tif (count < normalizedSize) continue;\n\t\t\t\tconst window = new Array(normalizedSize);\n\t\t\t\tfor (let index = 0; index < normalizedSize; index++) window[index] = buffer[(nextIndex + index) % normalizedSize];\n\t\t\t\tyield window;\n\t\t\t}\n\t\t})),\n\t\tflat,\n\t\treverse: () => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\tvalues.reverse();\n\t\t\tfor (const value of values) yield value;\n\t\t})),\n\t\ttoReversed: () => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\tfor (const value of [...values].reverse()) yield value;\n\t\t})),\n\t\tsort: (compareFn) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\tcompareFn === void 0 ? values.sort() : values.sort(compareFn);\n\t\t\tfor (const value of values) yield value;\n\t\t})),\n\t\ttoSorted: (compareFn) => createAsyncOperator(() => createAsyncIterable(async function* () {\n\t\t\tconst sortedValues = [...await materializeValues(iteratorFactories)];\n\t\t\tcompareFn === void 0 ? sortedValues.sort() : sortedValues.sort(compareFn);\n\t\t\tfor (const value of sortedValues) yield value;\n\t\t})),\n\t\tforEach: async (action) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = action(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (isPromiseLike(result)) await result;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = action(value, index);\n\t\t\t\tif (isPromiseLike(result)) await result;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t},\n\t\treduce,\n\t\treduceRight,\n\t\tsome: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = predicate(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return true;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return true;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tevery: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = predicate(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return false;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (!(isPromiseLike(result) ? await result : result)) return false;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tfind: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t},\n\t\tfindIndex: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = predicate(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) return index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn -1;\n\t\t},\n\t\tat: async (index) => {\n\t\t\tconst normalizedIndex = toIntegerOrInfinity(index);\n\t\t\tif (normalizedIndex >= 0) {\n\t\t\t\tif (normalizedIndex === Infinity) return;\n\t\t\t\tlet currentIndex = 0;\n\t\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\t\tif (currentIndex === normalizedIndex) return resolvedValue;\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\t\tif (currentIndex === normalizedIndex) return value;\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (normalizedIndex === -Infinity) return;\n\t\t\tconst lookback = Math.abs(normalizedIndex);\n\t\t\tconst buffer = new Array(lookback);\n\t\t\tlet count = 0;\n\t\t\tlet nextIndex = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tbuffer[nextIndex] = isPromiseLike(value) ? await value : value;\n\t\t\t\tnextIndex = (nextIndex + 1) % lookback;\n\t\t\t\tcount = Math.min(count + 1, lookback);\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tbuffer[nextIndex] = value;\n\t\t\t\tnextIndex = (nextIndex + 1) % lookback;\n\t\t\t\tcount = Math.min(count + 1, lookback);\n\t\t\t}\n\t\t\treturn count === lookback ? buffer[nextIndex] : void 0;\n\t\t},\n\t\tincludes: async (searchElement, fromIndex) => {\n\t\t\tconst normalizedFromIndex = toIntegerOrInfinity(fromIndex !== null && fromIndex !== void 0 ? fromIndex : 0);\n\t\t\tif (normalizedFromIndex < 0) return (await materializeValues(iteratorFactories)).includes(searchElement, normalizedFromIndex);\n\t\t\tif (normalizedFromIndex === Infinity) return false;\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (index >= normalizedFromIndex && sameValueZero(resolvedValue, searchElement)) return true;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tif (index >= normalizedFromIndex && sameValueZero(value, searchElement)) return true;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tindexOf: async (searchElement, fromIndex) => {\n\t\t\tconst normalizedFromIndex = toIntegerOrInfinity(fromIndex !== null && fromIndex !== void 0 ? fromIndex : 0);\n\t\t\tif (normalizedFromIndex < 0) return (await materializeValues(iteratorFactories)).indexOf(searchElement, normalizedFromIndex);\n\t\t\tif (normalizedFromIndex === Infinity) return -1;\n\t\t\tlet index = 0;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (index >= normalizedFromIndex && resolvedValue === searchElement) return index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tif (index >= normalizedFromIndex && value === searchElement) return index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn -1;\n\t\t},\n\t\tlastIndexOf: async (searchElement, fromIndex) => {\n\t\t\tconst values = await materializeValues(iteratorFactories);\n\t\t\treturn fromIndex === void 0 ? values.lastIndexOf(searchElement) : values.lastIndexOf(searchElement, fromIndex);\n\t\t},\n\t\tfindLast: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tlet foundValue;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst result = predicate(resolvedValue, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) foundValue = resolvedValue;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) foundValue = value;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn foundValue;\n\t\t},\n\t\tfindLastIndex: async (predicate) => {\n\t\t\tlet index = 0;\n\t\t\tlet foundIndex = -1;\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst result = predicate(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) foundIndex = index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst result = predicate(value, index);\n\t\t\t\tif (isPromiseLike(result) ? await result : result) foundIndex = index;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn foundIndex;\n\t\t},\n\t\tmin: async () => findExtremeBy(iteratorFactories, identity, \"min\"),\n\t\tminBy: async (selector) => findExtremeBy(iteratorFactories, selector, \"min\"),\n\t\tmax: async () => findExtremeBy(iteratorFactories, (value) => value, \"max\"),\n\t\tmaxBy: async (selector) => findExtremeBy(iteratorFactories, selector, \"max\"),\n\t\tgroupBy: async (selector) => {\n\t\t\tlet index = 0;\n\t\t\tconst groupedValues = /* @__PURE__ */ new Map();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tconst selectedKey = selector(resolvedValue, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tconst existingGroup = groupedValues.get(key);\n\t\t\t\tif (existingGroup) existingGroup.push(resolvedValue);\n\t\t\t\telse groupedValues.set(key, [resolvedValue]);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tconst existingGroup = groupedValues.get(key);\n\t\t\t\tif (existingGroup) existingGroup.push(value);\n\t\t\t\telse groupedValues.set(key, [value]);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn groupedValues;\n\t\t},\n\t\tcountBy: async (selector) => {\n\t\t\tlet index = 0;\n\t\t\tconst counts = /* @__PURE__ */ new Map();\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tvar _counts$get;\n\t\t\t\tconst selectedKey = selector(isPromiseLike(value) ? await value : value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tcounts.set(key, ((_counts$get = counts.get(key)) !== null && _counts$get !== void 0 ? _counts$get : 0) + 1);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tvar _counts$get2;\n\t\t\t\tconst selectedKey = selector(value, index);\n\t\t\t\tconst key = isPromiseLike(selectedKey) ? await selectedKey : selectedKey;\n\t\t\t\tcounts.set(key, ((_counts$get2 = counts.get(key)) !== null && _counts$get2 !== void 0 ? _counts$get2 : 0) + 1);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn counts;\n\t\t},\n\t\tjoin: async (separator) => {\n\t\t\tconst normalizedSeparator = separator !== null && separator !== void 0 ? separator : \",\";\n\t\t\tlet isFirst = true;\n\t\t\tlet result = \"\";\n\t\t\tif (syncFactory !== void 0) for (const value of syncFactory()) {\n\t\t\t\tconst resolvedValue = isPromiseLike(value) ? await value : value;\n\t\t\t\tif (!isFirst) result += normalizedSeparator;\n\t\t\t\tresult += resolvedValue == null ? \"\" : String(resolvedValue);\n\t\t\t\tisFirst = false;\n\t\t\t}\n\t\t\telse for await (const value of iterableFactory()) {\n\t\t\t\tif (!isFirst) result += normalizedSeparator;\n\t\t\t\tresult += value == null ? \"\" : String(value);\n\t\t\t\tisFirst = false;\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\ttoArray: async () => materializeValues(iteratorFactories)\n\t};\n};\n/**\n* Creates a chainable async operator pipeline from an iterable of values or promise-like values\n* @param source - Source iterable to resolve\n* @returns A lazy async operator pipeline\n*/\nvar from = (source) => createAsyncOperator(createIteratorFactories(source));\n//#endregion\nexport { createAsyncLocal, createMutex as createAsyncLock, createMutex, createConditional, createConditional as createSignal, createDeferred, createDeferredGenerator, createManuallyConditional, createManuallyConditional as createManuallySignal, createReaderWriterLock, createSemaphore, defer, delay, from, getCurrentLogicalContextId, getLogicalContextValue, onAbort, runOnNewLogicalContext, setLogicalContextValue };\n\n//# sourceMappingURL=index.mjs.map","// gestament - TypeScript based test driver for GTK.\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/gestament\n\nimport {\n nativeCapture,\n nativeCaptureBounds,\n nativeChildAt,\n nativeChildCount,\n nativeClick,\n nativeClearSelection,\n nativeDeselectChildAt,\n nativeIsChildSelected,\n nativeElementInfo,\n nativeImageInfo,\n nativeSelectAllChildren,\n nativeSelectChildAt,\n nativeSelectedChildAt,\n nativeSelectedChildCount,\n nativeSetText,\n nativeSetValue,\n nativeTableCellAt,\n nativeTableColumnCount,\n nativeTableDeselectColumn,\n nativeTableDeselectRow,\n nativeTableIsCellSelected,\n nativeTableIsColumnSelected,\n nativeTableIsRowSelected,\n nativeTableRowCount,\n nativeTableSelectColumn,\n nativeTableSelectRow,\n nativeTableSelectedColumns,\n nativeTableSelectedRows,\n nativeText,\n nativeValueInfo,\n type NativeElementInfo,\n type NativeElementHandle,\n type NativeImageInfo,\n} from './native';\nimport {\n createGtkInvalidArgumentError,\n createGtkOperationFailedError,\n createGtkUnsupportedInterfaceError,\n} from './errors';\nimport type {\n GtkCapture,\n GtkComboBoxItemElement,\n GtkElement,\n GtkElementInfo,\n GtkImageInfo,\n GtkListItemElement,\n GtkMenuItemElement,\n GtkTableCellElement,\n GtkValueInfo,\n GtkWidgetElement,\n GtkWidgetKind,\n} from './types';\n\n/////////////////////////////////////////////////////////////////////////////////////////\n\nconst assertNonNegativeIndex = (name: string, index: number): void => {\n if (!Number.isInteger(index) || index < 0) {\n throw createGtkInvalidArgumentError(\n `${name} must be a non-negative integer.`\n );\n }\n};\n\nconst assertFiniteNumber = (name: string, value: number): void => {\n if (!Number.isFinite(value)) {\n throw createGtkInvalidArgumentError(`${name} must be a finite number.`);\n }\n};\n\nconst normalizeRoleName = (roleName: string): string =>\n roleName.trim().toLowerCase().replace(/[_-]+/g, ' ').replace(/\\s+/g, ' ');\n\nconst hasInterface = (info: NativeElementInfo, name: string): boolean =>\n info.interfaces.some(\n (interfaceName) => interfaceName.toLowerCase() === name.toLowerCase()\n );\n\nconst hasState = (info: NativeElementInfo, name: string): boolean =>\n info.states.some((state) => state.toLowerCase() === name.toLowerCase());\n\nconst elementInfoOverrides = new WeakMap<\n NativeElementHandle,\n Partial<GtkElementInfo>\n>();\n\nconst overrideElementInfo = (\n handle: NativeElementHandle,\n override: Partial<GtkElementInfo>\n): NativeElementHandle => {\n elementInfoOverrides.set(handle, override);\n return handle;\n};\n\nconst nativeInfoKind = (handle: NativeElementHandle): GtkWidgetKind =>\n elementInfoOverrides.get(handle)?.kind ??\n widgetKindFromInfo(nativeElementInfo(handle));\n\nconst widgetKindFromInfo = (info: NativeElementInfo): GtkWidgetKind => {\n const roleName = normalizeRoleName(info.roleName);\n if (hasInterface(info, 'TableCell')) {\n return 'tableCell';\n }\n switch (roleName) {\n case 'frame':\n case 'dialog':\n case 'window':\n return 'window';\n case 'filler':\n case 'panel':\n case 'scroll pane':\n case 'layered pane':\n case 'split pane':\n case 'viewport':\n return 'container';\n case 'button':\n case 'push button':\n case 'push button menu':\n return 'button';\n case 'label':\n case 'static':\n return 'label';\n case 'entry':\n case 'password text':\n case 'search box':\n return 'entry';\n case 'text':\n return hasInterface(info, 'EditableText') ||\n hasState(info, 'editable') ||\n hasState(info, 'singleLine')\n ? 'entry'\n : 'text';\n case 'paragraph':\n return 'text';\n case 'check box':\n return 'checkbox';\n case 'switch':\n return 'switch';\n case 'radio button':\n return 'radio';\n case 'toggle button':\n return hasInterface(info, 'Image') || info.name.length > 0\n ? 'toggleButton'\n : 'switch';\n case 'slider':\n return 'slider';\n case 'spin button':\n return 'spinButton';\n case 'progress bar':\n case 'level bar':\n return 'progressBar';\n case 'combo box':\n return 'comboBox';\n case 'list':\n case 'list box':\n return 'list';\n case 'tree':\n return hasInterface(info, 'Table') ? 'table' : 'list';\n case 'list item':\n case 'tree item':\n return 'listItem';\n case 'table':\n case 'tree table':\n return 'table';\n case 'table cell':\n return 'tableCell';\n case 'image':\n case 'icon':\n return 'image';\n case 'menu':\n case 'menu bar':\n case 'popup menu':\n return 'menu';\n case 'menu item':\n case 'check menu item':\n case 'radio menu item':\n case 'tearoff menu item':\n return 'menuItem';\n default:\n return 'unknown';\n }\n};\n\nconst toGtkElementInfo = (info: NativeElementInfo): GtkElementInfo => ({\n ...info,\n kind: widgetKindFromInfo(info),\n});\n\nconst toGtkElementInfoForHandle = (\n handle: NativeElementHandle\n): GtkElementInfo => {\n const info = toGtkElementInfo(nativeElementInfo(handle));\n const override = elementInfoOverrides.get(handle);\n return override === undefined ? info : { ...info, ...override };\n};\n\ntype GtkElementCommon = Omit<GtkElement, 'kind'>;\n\nconst createCommonElement = (\n handle: NativeElementHandle\n): GtkElementCommon => ({\n info: async (): Promise<GtkElementInfo> => toGtkElementInfoForHandle(handle),\n capture: async (): Promise<GtkCapture> => nativeCapture(handle),\n});\n\nconst expectedKindLabel = (expectedKinds: readonly GtkWidgetKind[]): string =>\n expectedKinds.join(', ');\n\nconst assertExpectedKind = <Child extends GtkWidgetElement>(\n element: GtkWidgetElement,\n expectedKinds: readonly GtkWidgetKind[],\n operation: string\n): Child => {\n if (!expectedKinds.includes(element.kind)) {\n throw createGtkUnsupportedInterfaceError(\n `${operation} returned ${element.kind}, expected ${expectedKindLabel(\n expectedKinds\n )}.`\n );\n }\n return element as Child;\n};\n\nconst createGetChildCountOperation =\n (handle: NativeElementHandle): (() => Promise<number>) =>\n async (): Promise<number> =>\n nativeChildCount(handle);\n\nconst createChildAtOperation =\n <Child extends GtkWidgetElement>(\n handle: NativeElementHandle,\n expectedKinds: readonly GtkWidgetKind[] | undefined\n ): ((index: number) => Promise<Child | undefined>) =>\n async (index: number): Promise<Child | undefined> => {\n assertNonNegativeIndex('index', index);\n const childHandle = nativeChildAt(handle, index);\n if (childHandle === undefined) {\n return undefined;\n }\n\n const child = createGtkElement(childHandle);\n return expectedKinds === undefined\n ? (child as Child)\n : assertExpectedKind<Child>(child, expectedKinds, 'childAt()');\n };\n\nconst createChildContainerOperations = <Child extends GtkWidgetElement>(\n handle: NativeElementHandle,\n expectedKinds: readonly GtkWidgetKind[] | undefined\n): {\n readonly childAt: (index: number) => Promise<Child | undefined>;\n readonly getChildCount: () => Promise<number>;\n} => ({\n childAt: createChildAtOperation<Child>(handle, expectedKinds),\n getChildCount: createGetChildCountOperation(handle),\n});\n\nconst createSelectableChildContainerOperations = <\n Child extends GtkWidgetElement,\n>(\n handle: NativeElementHandle,\n expectedKinds: readonly GtkWidgetKind[]\n): {\n readonly childAt: (index: number) => Promise<Child | undefined>;\n readonly getChildCount: () => Promise<number>;\n readonly getSelectedChildCount: () => Promise<number>;\n readonly selectedChildAt: (\n selectedIndex: number\n ) => Promise<Child | undefined>;\n readonly isChildSelected: (index: number) => Promise<boolean>;\n readonly selectChildAt: (index: number) => Promise<void>;\n readonly deselectChildAt: (index: number) => Promise<void>;\n readonly selectAllChildren: () => Promise<void>;\n readonly clearSelection: () => Promise<void>;\n} => ({\n ...createChildContainerOperations<Child>(handle, expectedKinds),\n getSelectedChildCount: async (): Promise<number> =>\n nativeSelectedChildCount(handle),\n selectedChildAt: async (\n selectedIndex: number\n ): Promise<Child | undefined> => {\n assertNonNegativeIndex('selectedIndex', selectedIndex);\n const childHandle = nativeSelectedChildAt(handle, selectedIndex);\n if (childHandle === undefined) {\n return undefined;\n }\n\n const child = createGtkElement(childHandle);\n return assertExpectedKind<Child>(child, expectedKinds, 'selectedChildAt()');\n },\n isChildSelected: async (index: number): Promise<boolean> => {\n assertNonNegativeIndex('index', index);\n return nativeIsChildSelected(handle, index);\n },\n selectChildAt: async (index: number): Promise<void> => {\n assertNonNegativeIndex('index', index);\n nativeSelectChildAt(handle, index);\n },\n deselectChildAt: async (index: number): Promise<void> => {\n assertNonNegativeIndex('index', index);\n nativeDeselectChildAt(handle, index);\n },\n selectAllChildren: async (): Promise<void> => {\n nativeSelectAllChildren(handle);\n },\n clearSelection: async (): Promise<void> => {\n nativeClearSelection(handle);\n },\n});\n\nconst createOperationFailedForOutOfRangeIndex = (index: number): Error =>\n createGtkOperationFailedError(`Child index is out of range: ${index}`);\n\nconst isUnsupportedInterfaceError = (error: unknown): boolean =>\n (error as { code?: unknown }).code === 'UNSUPPORTED_INTERFACE';\n\nconst visitNativeDescendants = (\n handle: NativeElementHandle,\n visitor: (descendantHandle: NativeElementHandle) => boolean,\n maxNodes: number\n): void => {\n const queue: NativeElementHandle[] = [];\n const childCount = nativeChildCount(handle);\n for (let index = 0; index < childCount; index += 1) {\n const childHandle = nativeChildAt(handle, index);\n if (childHandle !== undefined) {\n queue.push(childHandle);\n }\n }\n\n let visitedNodes = 0;\n while (queue.length > 0 && visitedNodes < maxNodes) {\n const currentHandle = queue.shift()!;\n visitedNodes += 1;\n if (visitor(currentHandle)) {\n return;\n }\n\n const currentChildCount = nativeChildCount(currentHandle);\n for (let index = 0; index < currentChildCount; index += 1) {\n const childHandle = nativeChildAt(currentHandle, index);\n if (childHandle !== undefined) {\n queue.push(childHandle);\n }\n }\n }\n};\n\nconst findFirstDescendantName = (\n handle: NativeElementHandle\n): string | undefined => {\n let foundName: string | undefined;\n visitNativeDescendants(\n handle,\n (descendantHandle) => {\n const name = nativeElementInfo(descendantHandle).name;\n if (name.length === 0) {\n return false;\n }\n\n foundName = name;\n return true;\n },\n 64\n );\n return foundName;\n};\n\nconst directChildKindAt = (\n handle: NativeElementHandle,\n index: number\n): GtkWidgetKind | undefined => {\n const childHandle = nativeChildAt(handle, index);\n return childHandle === undefined ? undefined : nativeInfoKind(childHandle);\n};\n\nconst handleContainsComboItems = (handle: NativeElementHandle): boolean => {\n const childCount = nativeChildCount(handle);\n if (childCount === 0) {\n return false;\n }\n\n const firstChildKind = directChildKindAt(handle, 0);\n return firstChildKind === 'listItem' || firstChildKind === 'menuItem';\n};\n\nconst findComboBoxItemContainerHandle = (\n handle: NativeElementHandle\n): NativeElementHandle | undefined => {\n if (handleContainsComboItems(handle)) {\n return handle;\n }\n\n // GTK4 GtkDropDown exposes the expanded popup list as a nested descendant.\n let foundHandle: NativeElementHandle | undefined;\n visitNativeDescendants(\n handle,\n (descendantHandle) => {\n const kind = nativeInfoKind(descendantHandle);\n if (\n (kind === 'list' || kind === 'menu') &&\n handleContainsComboItems(descendantHandle)\n ) {\n foundHandle = descendantHandle;\n return true;\n }\n\n return false;\n },\n 128\n );\n return foundHandle;\n};\n\nconst resolveComboBoxItemContainerHandle = (\n handle: NativeElementHandle\n): NativeElementHandle => {\n const descendantItemContainer = findComboBoxItemContainerHandle(handle);\n if (descendantItemContainer !== undefined) {\n return descendantItemContainer;\n }\n\n const childCount = nativeChildCount(handle);\n if (childCount !== 1) {\n return handle;\n }\n\n const childHandle = nativeChildAt(handle, 0);\n if (childHandle === undefined) {\n return handle;\n }\n\n const childKind = nativeInfoKind(childHandle);\n return childKind === 'menu' || childKind === 'list' ? childHandle : handle;\n};\n\nconst comboBoxClickTargetHandle = (\n handle: NativeElementHandle\n): NativeElementHandle => {\n const childHandle = nativeChildAt(handle, 0);\n if (childHandle === undefined) {\n return handle;\n }\n\n const childKind = nativeInfoKind(childHandle);\n return childKind === 'button' || childKind === 'toggleButton'\n ? childHandle\n : handle;\n};\n\nconst overrideComboBoxItemInfo = (\n handle: NativeElementHandle\n): NativeElementHandle => {\n const info = nativeElementInfo(handle);\n if (info.name.length > 0) {\n return handle;\n }\n\n const descendantName = findFirstDescendantName(handle);\n return descendantName === undefined\n ? handle\n : overrideElementInfo(handle, { name: descendantName });\n};\n\nconst itemIdentityMatches = (\n candidate: GtkElementInfo,\n selected: GtkElementInfo\n): boolean => {\n if (candidate.accessibleId.length > 0 && selected.accessibleId.length > 0) {\n return candidate.accessibleId === selected.accessibleId;\n }\n\n return (\n candidate.kind === selected.kind &&\n candidate.roleName === selected.roleName &&\n candidate.name === selected.name &&\n candidate.description === selected.description\n );\n};\n\ninterface ComboBoxItemLookup {\n readonly itemContainerHandle: NativeElementHandle;\n readonly itemHandle: NativeElementHandle;\n}\n\nconst comboBoxItemLookupAt = (\n handle: NativeElementHandle,\n index: number\n): ComboBoxItemLookup => {\n const itemContainerHandle = resolveComboBoxItemContainerHandle(handle);\n const itemHandle = nativeChildAt(itemContainerHandle, index);\n if (itemHandle === undefined) {\n throw createOperationFailedForOutOfRangeIndex(index);\n }\n\n const itemKind = nativeInfoKind(itemHandle);\n if (itemKind !== 'listItem' && itemKind !== 'menuItem') {\n throw createGtkUnsupportedInterfaceError(\n `ComboBox childAt() returned ${itemKind}, expected listItem, menuItem.`\n );\n }\n\n return {\n itemContainerHandle,\n itemHandle: overrideComboBoxItemInfo(itemHandle),\n };\n};\n\nconst comboBoxItemHandleAt = (\n handle: NativeElementHandle,\n index: number\n): NativeElementHandle => comboBoxItemLookupAt(handle, index).itemHandle;\n\nconst createComboBoxOperations = (\n handle: NativeElementHandle\n): {\n readonly childAt: (\n index: number\n ) => Promise<GtkComboBoxItemElement | undefined>;\n readonly getChildCount: () => Promise<number>;\n readonly getSelectedChildCount: () => Promise<number>;\n readonly selectedChildAt: (\n selectedIndex: number\n ) => Promise<GtkComboBoxItemElement | undefined>;\n readonly isChildSelected: (index: number) => Promise<boolean>;\n readonly selectChildAt: (index: number) => Promise<void>;\n readonly deselectChildAt: (index: number) => Promise<void>;\n readonly selectAllChildren: () => Promise<void>;\n readonly clearSelection: () => Promise<void>;\n} => ({\n childAt: async (\n index: number\n ): Promise<GtkComboBoxItemElement | undefined> => {\n assertNonNegativeIndex('index', index);\n const itemContainerHandle = resolveComboBoxItemContainerHandle(handle);\n const itemHandle = nativeChildAt(itemContainerHandle, index);\n if (itemHandle === undefined) {\n return undefined;\n }\n\n overrideComboBoxItemInfo(itemHandle);\n return assertExpectedKind<GtkComboBoxItemElement>(\n createGtkElement(itemHandle),\n ['listItem', 'menuItem'],\n 'childAt()'\n );\n },\n getChildCount: async (): Promise<number> =>\n nativeChildCount(resolveComboBoxItemContainerHandle(handle)),\n getSelectedChildCount: async (): Promise<number> =>\n nativeSelectedChildCount(handle),\n selectedChildAt: async (\n selectedIndex: number\n ): Promise<GtkComboBoxItemElement | undefined> => {\n assertNonNegativeIndex('selectedIndex', selectedIndex);\n const childHandle = nativeSelectedChildAt(handle, selectedIndex);\n if (childHandle === undefined) {\n return undefined;\n }\n\n return assertExpectedKind<GtkComboBoxItemElement>(\n createGtkElement(childHandle),\n ['listItem', 'menuItem'],\n 'selectedChildAt()'\n );\n },\n isChildSelected: async (index: number): Promise<boolean> => {\n assertNonNegativeIndex('index', index);\n const itemHandle = comboBoxItemHandleAt(handle, index);\n const itemInfo = toGtkElementInfoForHandle(itemHandle);\n const selectedCount = nativeSelectedChildCount(handle);\n for (\n let selectedIndex = 0;\n selectedIndex < selectedCount;\n selectedIndex += 1\n ) {\n const selectedHandle = nativeSelectedChildAt(handle, selectedIndex);\n if (selectedHandle === undefined) {\n continue;\n }\n\n const selectedInfo = toGtkElementInfo(nativeElementInfo(selectedHandle));\n if (itemIdentityMatches(itemInfo, selectedInfo)) {\n return true;\n }\n }\n\n return false;\n },\n selectChildAt: async (index: number): Promise<void> => {\n assertNonNegativeIndex('index', index);\n const { itemContainerHandle, itemHandle } = comboBoxItemLookupAt(\n handle,\n index\n );\n const expectedName = toGtkElementInfoForHandle(itemHandle).name;\n nativeClick(itemHandle);\n if (\n itemContainerHandle !== handle &&\n expectedName.length > 0 &&\n nativeElementInfo(handle).name !== expectedName\n ) {\n throw createGtkOperationFailedError(\n 'ComboBox child selection did not change the selected item.'\n );\n }\n },\n deselectChildAt: async (index: number): Promise<void> => {\n assertNonNegativeIndex('index', index);\n comboBoxItemHandleAt(handle, index);\n nativeDeselectChildAt(handle, 0);\n },\n selectAllChildren: async (): Promise<void> => {\n nativeSelectAllChildren(handle);\n },\n clearSelection: async (): Promise<void> => {\n const selectedBefore = nativeSelectedChildCount(handle);\n nativeClearSelection(handle);\n if (selectedBefore > 0 && nativeSelectedChildCount(handle) > 0) {\n throw createGtkOperationFailedError(\n 'ComboBox selection could not be cleared.'\n );\n }\n },\n});\n\nconst createSetTextOperation =\n (handle: NativeElementHandle): ((text: string) => Promise<void>) =>\n async (text: string): Promise<void> => {\n nativeSetText(handle, text);\n };\n\nconst createClickOperation =\n (handle: NativeElementHandle): (() => Promise<void>) =>\n async (): Promise<void> => {\n nativeClick(handle);\n };\n\nconst createComboBoxClickOperation =\n (handle: NativeElementHandle): (() => Promise<void>) =>\n async (): Promise<void> => {\n nativeClick(comboBoxClickTargetHandle(handle));\n };\n\nconst createTextOperation =\n (handle: NativeElementHandle): (() => Promise<string>) =>\n async (): Promise<string> =>\n nativeText(handle);\n\nconst createIsCheckedOperation =\n (handle: NativeElementHandle): (() => Promise<boolean>) =>\n async (): Promise<boolean> => {\n const info = nativeElementInfo(handle);\n return hasState(info, 'checked') || hasState(info, 'pressed');\n };\n\nconst createToggleOperation =\n (handle: NativeElementHandle): (() => Promise<void>) =>\n async (): Promise<void> => {\n nativeClick(handle);\n };\n\nconst createValueInfoOperation =\n (handle: NativeElementHandle): (() => Promise<GtkValueInfo>) =>\n async (): Promise<GtkValueInfo> =>\n nativeValueInfo(handle);\n\nconst createImageInfoOperation =\n (handle: NativeElementHandle): (() => Promise<GtkImageInfo>) =>\n async (): Promise<GtkImageInfo> => {\n const info: NativeImageInfo = nativeImageInfo(handle);\n return {\n ...info,\n capture: async (): Promise<GtkCapture> =>\n nativeCaptureBounds(info.bounds),\n };\n };\n\nconst createValueOperation =\n (handle: NativeElementHandle): (() => Promise<number>) =>\n async (): Promise<number> =>\n nativeValueInfo(handle).value;\n\nconst createSetValueOperation =\n (handle: NativeElementHandle): ((value: number) => Promise<void>) =>\n async (value: number): Promise<void> => {\n assertFiniteNumber('value', value);\n nativeSetValue(handle, value);\n };\n\nconst assertUsableValueMetadata = (info: GtkValueInfo): void => {\n if (\n !Number.isFinite(info.value) ||\n !Number.isFinite(info.minimum) ||\n !Number.isFinite(info.maximum) ||\n !Number.isFinite(info.minimumIncrement)\n ) {\n throw createGtkOperationFailedError(\n 'Accessible value metadata does not contain usable numeric values.'\n );\n }\n};\n\nconst valueStep = (info: GtkValueInfo): number => {\n assertUsableValueMetadata(info);\n if (info.minimumIncrement > 0) {\n return info.minimumIncrement;\n }\n\n const range = info.maximum - info.minimum;\n if (!Number.isFinite(range) || range <= 0) {\n throw createGtkOperationFailedError(\n 'Accessible value metadata does not contain a usable increment.'\n );\n }\n return Math.min(1, range);\n};\n\nconst clampedValue = (\n value: number,\n minimum: number,\n maximum: number\n): number => Math.min(Math.max(value, minimum), maximum);\n\nconst createIncrementOperation =\n (handle: NativeElementHandle): (() => Promise<void>) =>\n async (): Promise<void> => {\n const info = nativeValueInfo(handle);\n const step = valueStep(info);\n nativeSetValue(\n handle,\n clampedValue(info.value + step, info.minimum, info.maximum)\n );\n };\n\nconst createDecrementOperation =\n (handle: NativeElementHandle): (() => Promise<void>) =>\n async (): Promise<void> => {\n const info = nativeValueInfo(handle);\n const step = valueStep(info);\n nativeSetValue(\n handle,\n clampedValue(info.value - step, info.minimum, info.maximum)\n );\n };\n\nconst collectDirectTableCellChildren = (\n rowHandle: NativeElementHandle\n): NativeElementHandle[] => {\n const cells: NativeElementHandle[] = [];\n const childCount = nativeChildCount(rowHandle);\n for (let index = 0; index < childCount; index += 1) {\n const childHandle = nativeChildAt(rowHandle, index);\n if (\n childHandle !== undefined &&\n nativeInfoKind(childHandle) === 'tableCell'\n ) {\n cells.push(childHandle);\n }\n }\n return cells;\n};\n\nconst collectFallbackTableRows = (\n handle: NativeElementHandle\n): NativeElementHandle[][] => {\n const rows: NativeElementHandle[][] = [];\n // GTK4 GtkColumnView exposes table rows and cells without the AT-SPI Table\n // interface, so table operations reconstruct the logical grid from children.\n visitNativeDescendants(\n handle,\n (descendantHandle) => {\n const roleName = normalizeRoleName(\n nativeElementInfo(descendantHandle).roleName\n );\n if (roleName !== 'table row') {\n return false;\n }\n\n const cells = collectDirectTableCellChildren(descendantHandle);\n if (cells.length > 0) {\n rows.push(\n cells.map((cellHandle) =>\n overrideElementInfo(cellHandle, { kind: 'tableCell' })\n )\n );\n }\n return false;\n },\n 512\n );\n return rows;\n};\n\nconst fallbackTableRowCount = (handle: NativeElementHandle): number =>\n collectFallbackTableRows(handle).length;\n\nconst fallbackTableColumnCount = (handle: NativeElementHandle): number => {\n const rows = collectFallbackTableRows(handle);\n return rows.reduce((max, row) => Math.max(max, row.length), 0);\n};\n\nconst fallbackTableCellAt = (\n handle: NativeElementHandle,\n row: number,\n column: number\n): NativeElementHandle | undefined => {\n const rows = collectFallbackTableRows(handle);\n return rows[row]?.[column];\n};\n\nconst createTableCellAtOperation =\n (\n handle: NativeElementHandle\n ): ((\n row: number,\n column: number\n ) => Promise<GtkTableCellElement | undefined>) =>\n async (\n row: number,\n column: number\n ): Promise<GtkTableCellElement | undefined> => {\n assertNonNegativeIndex('row', row);\n assertNonNegativeIndex('column', column);\n let cellHandle: NativeElementHandle | undefined;\n try {\n cellHandle = nativeTableCellAt(handle, row, column);\n } catch (error) {\n if (!isUnsupportedInterfaceError(error)) {\n throw error;\n }\n\n cellHandle = fallbackTableCellAt(handle, row, column);\n }\n\n if (cellHandle === undefined) {\n return undefined;\n }\n\n overrideElementInfo(cellHandle, { kind: 'tableCell' });\n return assertExpectedKind<GtkTableCellElement>(\n createGtkElement(cellHandle),\n ['tableCell'],\n 'cellAt()'\n );\n };\n\nconst createTableOperations = (\n handle: NativeElementHandle\n): {\n readonly getRowCount: () => Promise<number>;\n readonly getColumnCount: () => Promise<number>;\n readonly cellAt: (\n row: number,\n column: number\n ) => Promise<GtkTableCellElement | undefined>;\n readonly selectedRows: () => Promise<readonly number[]>;\n readonly selectedColumns: () => Promise<readonly number[]>;\n readonly isRowSelected: (row: number) => Promise<boolean>;\n readonly isColumnSelected: (column: number) => Promise<boolean>;\n readonly isCellSelected: (row: number, column: number) => Promise<boolean>;\n readonly selectRow: (row: number) => Promise<void>;\n readonly deselectRow: (row: number) => Promise<void>;\n readonly selectColumn: (column: number) => Promise<void>;\n readonly deselectColumn: (column: number) => Promise<void>;\n} => ({\n getRowCount: async (): Promise<number> => {\n try {\n return nativeTableRowCount(handle);\n } catch (error) {\n if (!isUnsupportedInterfaceError(error)) {\n throw error;\n }\n return fallbackTableRowCount(handle);\n }\n },\n getColumnCount: async (): Promise<number> => {\n try {\n return nativeTableColumnCount(handle);\n } catch (error) {\n if (!isUnsupportedInterfaceError(error)) {\n throw error;\n }\n return fallbackTableColumnCount(handle);\n }\n },\n cellAt: createTableCellAtOperation(handle),\n selectedRows: async (): Promise<readonly number[]> =>\n nativeTableSelectedRows(handle),\n selectedColumns: async (): Promise<readonly number[]> =>\n nativeTableSelectedColumns(handle),\n isRowSelected: async (row: number): Promise<boolean> => {\n assertNonNegativeIndex('row', row);\n return nativeTableIsRowSelected(handle, row);\n },\n isColumnSelected: async (column: number): Promise<boolean> => {\n assertNonNegativeIndex('column', column);\n return nativeTableIsColumnSelected(handle, column);\n },\n isCellSelected: async (row: number, column: number): Promise<boolean> => {\n assertNonNegativeIndex('row', row);\n assertNonNegativeIndex('column', column);\n return nativeTableIsCellSelected(handle, row, column);\n },\n selectRow: async (row: number): Promise<void> => {\n assertNonNegativeIndex('row', row);\n nativeTableSelectRow(handle, row);\n },\n deselectRow: async (row: number): Promise<void> => {\n assertNonNegativeIndex('row', row);\n nativeTableDeselectRow(handle, row);\n },\n selectColumn: async (column: number): Promise<void> => {\n assertNonNegativeIndex('column', column);\n nativeTableSelectColumn(handle, column);\n },\n deselectColumn: async (column: number): Promise<void> => {\n assertNonNegativeIndex('column', column);\n nativeTableDeselectColumn(handle, column);\n },\n});\n\n/** Creates an element bound to an opaque native accessible handle. */\nexport const createGtkElement = (\n handle: NativeElementHandle\n): GtkWidgetElement => {\n const initialInfo = toGtkElementInfoForHandle(handle);\n const common = createCommonElement(handle);\n\n switch (initialInfo.kind) {\n case 'window':\n return {\n ...common,\n kind: 'window',\n ...createChildContainerOperations<GtkWidgetElement>(handle, undefined),\n };\n case 'button':\n return { ...common, kind: 'button', click: createClickOperation(handle) };\n case 'container':\n return {\n ...common,\n kind: 'container',\n ...createChildContainerOperations<GtkWidgetElement>(handle, undefined),\n };\n case 'label':\n return { ...common, kind: 'label', text: createTextOperation(handle) };\n case 'entry':\n return {\n ...common,\n kind: 'entry',\n setText: createSetTextOperation(handle),\n text: createTextOperation(handle),\n };\n case 'text':\n return { ...common, kind: 'text', text: createTextOperation(handle) };\n case 'checkbox':\n return {\n ...common,\n kind: 'checkbox',\n click: createClickOperation(handle),\n isChecked: createIsCheckedOperation(handle),\n toggle: createToggleOperation(handle),\n };\n case 'switch':\n return {\n ...common,\n kind: 'switch',\n click: createClickOperation(handle),\n isChecked: createIsCheckedOperation(handle),\n toggle: createToggleOperation(handle),\n };\n case 'radio':\n return {\n ...common,\n kind: 'radio',\n click: createClickOperation(handle),\n isChecked: createIsCheckedOperation(handle),\n toggle: createToggleOperation(handle),\n };\n case 'toggleButton':\n return {\n ...common,\n kind: 'toggleButton',\n click: createClickOperation(handle),\n isChecked: createIsCheckedOperation(handle),\n toggle: createToggleOperation(handle),\n };\n case 'slider':\n return {\n ...common,\n kind: 'slider',\n value: createValueOperation(handle),\n valueInfo: createValueInfoOperation(handle),\n setValue: createSetValueOperation(handle),\n };\n case 'spinButton':\n return {\n ...common,\n kind: 'spinButton',\n value: createValueOperation(handle),\n valueInfo: createValueInfoOperation(handle),\n setValue: createSetValueOperation(handle),\n increment: createIncrementOperation(handle),\n decrement: createDecrementOperation(handle),\n };\n case 'progressBar':\n return {\n ...common,\n kind: 'progressBar',\n value: createValueOperation(handle),\n valueInfo: createValueInfoOperation(handle),\n };\n case 'comboBox':\n return {\n ...common,\n kind: 'comboBox',\n click: createComboBoxClickOperation(handle),\n ...createComboBoxOperations(handle),\n };\n case 'list':\n return {\n ...common,\n kind: 'list',\n ...createSelectableChildContainerOperations<GtkListItemElement>(\n handle,\n ['listItem']\n ),\n };\n case 'listItem':\n return {\n ...common,\n kind: 'listItem',\n click: createClickOperation(handle),\n };\n case 'table':\n return { ...common, kind: 'table', ...createTableOperations(handle) };\n case 'tableCell':\n return { ...common, kind: 'tableCell' };\n case 'image':\n return {\n ...common,\n kind: 'image',\n imageInfo: createImageInfoOperation(handle),\n };\n case 'menu':\n return {\n ...common,\n kind: 'menu',\n ...createChildContainerOperations<GtkMenuItemElement>(handle, [\n 'menuItem',\n ]),\n };\n case 'menuItem':\n return {\n ...common,\n kind: 'menuItem',\n click: createClickOperation(handle),\n };\n case 'unknown':\n return { ...common, kind: 'unknown' };\n }\n};\n","// gestament - TypeScript based test driver for GTK.\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/gestament\n\nimport {\n createGtkElementNotFoundError,\n createGtkStaleElementError,\n createGtkUnsupportedInterfaceError,\n} from './errors';\nimport { createGtkElement } from './element';\nimport {\n nativeFindAnyById,\n nativeTrayItems,\n type NativeTrayItem,\n} from './native';\nimport type {\n GtkCapture,\n GtkTrayItem,\n GtkTrayItemMetadata,\n GtkTrayItemSelector,\n GtkWidgetElement,\n} from './types';\n\ninterface NativeTrayItemHandle {\n readonly processId: number;\n readonly busName: string;\n readonly objectPath: string;\n}\n\nconst optionalString = (value: string): string | undefined =>\n value.length === 0 ? undefined : value;\n\nconst toMetadata = (item: NativeTrayItem): GtkTrayItemMetadata => {\n const iconName = optionalString(item.iconName);\n const id = optionalString(item.id);\n const status = optionalString(item.status);\n const title = optionalString(item.title);\n\n return {\n backend: 'status-notifier',\n ...(iconName === undefined ? {} : { iconName }),\n ...(id === undefined ? {} : { id }),\n ...(status === undefined ? {} : { status }),\n ...(title === undefined ? {} : { title }),\n };\n};\n\nconst sameTrayItem = (\n first: NativeTrayItemHandle,\n second: NativeTrayItem\n): boolean =>\n first.busName === second.busName && first.objectPath === second.objectPath;\n\nconst staleTrayItemError = (): Error =>\n createGtkStaleElementError('Tray item is no longer registered.');\n\nconst resolveCurrentInfo = (handle: NativeTrayItemHandle): NativeTrayItem => {\n const item = nativeTrayItems(handle.processId).find((candidate) =>\n sameTrayItem(handle, candidate)\n );\n if (item === undefined) {\n throw staleTrayItemError();\n }\n return item;\n};\n\ntype GtkClickableElement = Extract<\n GtkWidgetElement,\n { readonly click: () => Promise<void> }\n>;\n\nconst isClickableElement = (\n element: GtkWidgetElement\n): element is GtkClickableElement => {\n switch (element.kind) {\n case 'button':\n case 'checkbox':\n case 'switch':\n case 'radio':\n case 'toggleButton':\n case 'comboBox':\n case 'listItem':\n case 'menuItem':\n return true;\n default:\n return false;\n }\n};\n\n/** Returns whether a native tray item matches a public selector. */\nexport const nativeTrayItemMatchesSelector = (\n item: NativeTrayItem,\n selector: GtkTrayItemSelector\n): boolean => {\n if ('id' in selector) {\n return item.id === selector.id;\n }\n if ('title' in selector) {\n return item.title === selector.title;\n }\n if ('busName' in selector) {\n return (\n item.busName === selector.busName &&\n (selector.objectPath === undefined ||\n item.objectPath === selector.objectPath)\n );\n }\n return false;\n};\n\n/** Creates a stable logical tray item handle. */\nexport const createGtkTrayItem = (\n processId: number,\n item: NativeTrayItem\n): GtkTrayItem => {\n const handle: NativeTrayItemHandle = {\n busName: item.busName,\n objectPath: item.objectPath,\n processId,\n };\n\n const trayItem: GtkTrayItem = {\n metadata: async (): Promise<GtkTrayItemMetadata> =>\n toMetadata(resolveCurrentInfo(handle)),\n element: async (): Promise<GtkWidgetElement | undefined> => {\n const current = resolveCurrentInfo(handle);\n const elementHandle = nativeFindAnyById(current.accessibleId);\n return elementHandle === undefined\n ? undefined\n : createGtkElement(elementHandle);\n },\n capture: async (): Promise<GtkCapture> => {\n const element = await trayItem.element();\n if (element === undefined) {\n throw createGtkElementNotFoundError(\n 'Tray item is registered but not visible.'\n );\n }\n return element.capture();\n },\n click: async (): Promise<void> => {\n const element = await trayItem.element();\n if (element === undefined) {\n throw createGtkElementNotFoundError(\n 'Tray item is registered but not visible.'\n );\n }\n if (!isClickableElement(element)) {\n throw createGtkUnsupportedInterfaceError(\n `Tray item element does not support click: ${element.kind}.`\n );\n }\n await element.click();\n },\n openMenu: async (): Promise<GtkWidgetElement | undefined> => {\n resolveCurrentInfo(handle);\n return undefined;\n },\n };\n\n return trayItem;\n};\n","// gestament - TypeScript based test driver for GTK.\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/gestament\n\nimport { spawn, type ChildProcessWithoutNullStreams } from 'node:child_process';\nimport { delay } from 'async-primitives';\n\nimport {\n createGtkAppExitedError,\n createGtkElementNotFoundError,\n createGtkInvalidArgumentError,\n createGtkOperationFailedError,\n normalizeNativeError,\n} from './errors';\nimport { createGtkElement } from './element';\nimport {\n nativeFindById,\n nativeCaptureScreen,\n nativeProcessAtspiReadiness,\n nativeTrayItems,\n nativeWindowAt,\n nativeWindowCount,\n type NativeAtspiReadiness,\n} from './native';\nimport { createGtkTrayItem, nativeTrayItemMatchesSelector } from './tray';\nimport type {\n GtkApp,\n GtkAppEnvironment,\n GtkAppLauncher,\n GtkAppLauncherOptions,\n GtkCapture,\n GtkTrayItem,\n GtkTrayItemSelector,\n GtkWidgetElement,\n LaunchGtkAppOptions,\n} from './types';\n\n/////////////////////////////////////////////////////////////////////////////////////////\n\nconst appendOutput = (lines: string[], chunk: Buffer): void => {\n lines.push(chunk.toString('utf8'));\n if (lines.length > 40) {\n lines.splice(0, lines.length - 40);\n }\n};\n\ninterface ProcessState {\n readonly process: ChildProcessWithoutNullStreams;\n readonly stderr: string[];\n readonly stdout: string[];\n atspiReadiness: NativeAtspiReadiness;\n atspiReady: boolean;\n exitCode: number | null;\n exitSignal: NodeJS.Signals | null;\n}\n\ninterface ParsedElementPath {\n readonly id: string;\n readonly childIndexes: readonly number[];\n}\n\ninterface GtkPathChildContainer {\n readonly childAt: (index: number) => Promise<GtkWidgetElement | undefined>;\n}\n\nconst formatProcessOutput = (state: ProcessState): string => {\n const stdout = state.stdout.join('').trim();\n const stderr = state.stderr.join('').trim();\n\n if (stdout.length === 0 && stderr.length === 0) {\n return '';\n }\n\n return `\\nstdout:\\n${stdout}\\nstderr:\\n${stderr}`;\n};\n\nconst assertProcessRunning = (state: ProcessState, command: string): number => {\n if (state.exitCode !== null || state.exitSignal !== null) {\n throw createGtkAppExitedError(\n `GTK application exited before the operation completed: ${command} ` +\n `(code=${String(state.exitCode)}, signal=${String(state.exitSignal)})` +\n formatProcessOutput(state)\n );\n }\n\n const processId = state.process.pid;\n if (processId === undefined) {\n throw createGtkAppExitedError(\n `GTK application did not expose a process id: ${command}`\n );\n }\n\n return processId;\n};\n\nconst assertNonNegativeIndex = (name: string, index: number): void => {\n if (!Number.isInteger(index) || index < 0) {\n throw createGtkInvalidArgumentError(\n `${name} must be a non-negative integer.`\n );\n }\n};\n\nconst parseElementPath = (path: string): ParsedElementPath => {\n const segments = path.split(/[.:;,]/u);\n const id = segments[0];\n if (id === undefined || id.length === 0) {\n throw createGtkInvalidArgumentError(\n 'path must start with an accessible id.'\n );\n }\n\n const childIndexes: number[] = [];\n for (let index = 1; index < segments.length; index += 1) {\n const segment = segments[index];\n if (segment === undefined || !/^\\d+$/u.test(segment)) {\n throw createGtkInvalidArgumentError(\n 'path child indexes must be non-negative decimal integers.'\n );\n }\n\n const childIndex = Number(segment);\n if (!Number.isSafeInteger(childIndex)) {\n throw createGtkInvalidArgumentError(\n 'path child indexes must be safe non-negative integers.'\n );\n }\n\n childIndexes.push(childIndex);\n }\n\n return { id, childIndexes };\n};\n\nconst isPathChildContainer = (\n element: GtkWidgetElement\n): element is GtkWidgetElement & GtkPathChildContainer => 'childAt' in element;\n\nconst waitForAtspiReady = async (\n state: ProcessState,\n command: string,\n timeoutMs: number,\n startedAt: number\n): Promise<number> => {\n if (state.atspiReady) {\n return assertProcessRunning(state, command);\n }\n\n while (Date.now() - startedAt <= timeoutMs) {\n const processId = assertProcessRunning(state, command);\n state.atspiReadiness = nativeProcessAtspiReadiness(processId);\n if (state.atspiReadiness === 'ready') {\n state.atspiReady = true;\n return processId;\n }\n\n await delay(50);\n }\n\n assertProcessRunning(state, command);\n throw createGtkOperationFailedError(\n `AT-SPI did not become ready for GTK application: ${command} ` +\n `(last readiness: ${state.atspiReadiness})` +\n formatProcessOutput(state)\n );\n};\n\n/**\n * Creates the child process environment used for gestament GTK automation.\n *\n * @param baseEnv Base environment, usually process.env.\n * @param overrides Optional environment overrides supplied by the caller.\n * @returns Environment object passed to child_process.spawn.\n * @remarks\n * gestament defaults to X11 and in-memory GSettings for stable visual tests.\n * NO_AT_BRIDGE is always removed because it disables AT-SPI automation.\n */\nexport const createGtkAppEnvironment = (\n baseEnv: GtkAppEnvironment,\n overrides: GtkAppEnvironment | undefined\n): NodeJS.ProcessEnv => {\n const env: NodeJS.ProcessEnv = {\n ...baseEnv,\n GDK_BACKEND: baseEnv.GDK_BACKEND ?? 'x11',\n GSETTINGS_BACKEND: baseEnv.GSETTINGS_BACKEND ?? 'memory',\n GTK_THEME: baseEnv.GTK_THEME ?? 'Adwaita',\n ...overrides,\n };\n delete env.NO_AT_BRIDGE;\n return env;\n};\n\n/////////////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Launches a GTK application and returns an AT-SPI automation handle.\n * @param appPath - Target GTK application path.\n * @param args - Target GTK application arguments.\n * @param options - Options.\n * @returns GtkApp instanced.\n */\nexport const launchGtkApp = (\n appPath: string,\n args?: readonly string[],\n options?: LaunchGtkAppOptions\n): Promise<GtkApp> => {\n const _args = args ?? [];\n const _timeoutMs = options?.timeoutMs ?? 10_000;\n\n const child = spawn(appPath, [..._args], {\n env: createGtkAppEnvironment(process.env, options?.env),\n stdio: 'pipe',\n });\n\n const state: ProcessState = {\n atspiReadiness: 'missing-bus-name',\n atspiReady: false,\n exitCode: null,\n exitSignal: null,\n process: child,\n stderr: [],\n stdout: [],\n };\n\n child.stdout.on('data', (chunk: Buffer) => {\n appendOutput(state.stdout, chunk);\n });\n child.stderr.on('data', (chunk: Buffer) => {\n appendOutput(state.stderr, chunk);\n });\n child.on('exit', (code, signal) => {\n state.exitCode = code;\n state.exitSignal = signal;\n });\n\n const release = async (): Promise<void> => {\n if (state.exitCode !== null || state.exitSignal !== null) {\n return;\n }\n\n child.kill('SIGTERM');\n\n const startedAt = Date.now();\n while (state.exitCode === null && state.exitSignal === null) {\n if (Date.now() - startedAt > 2_000) {\n child.kill('SIGKILL');\n break;\n }\n await delay(25);\n }\n };\n\n const findById = async (\n id: string\n ): Promise<GtkWidgetElement | undefined> => {\n const startedAt = Date.now();\n await waitForAtspiReady(state, appPath, _timeoutMs, startedAt);\n\n while (Date.now() - startedAt <= _timeoutMs) {\n const processId = assertProcessRunning(state, appPath);\n\n try {\n const handle = nativeFindById(processId, id);\n if (handle !== undefined) {\n return createGtkElement(handle);\n }\n } catch (error) {\n throw normalizeNativeError(error);\n }\n\n await delay(50);\n }\n\n assertProcessRunning(state, appPath);\n return undefined;\n };\n\n const getById = async (id: string): Promise<GtkWidgetElement> => {\n const element = await findById(id);\n if (element === undefined) {\n throw createGtkElementNotFoundError(`Accessible id was not found: ${id}`);\n }\n\n return element;\n };\n\n const findByPath = async (\n path: string\n ): Promise<GtkWidgetElement | undefined> => {\n const parsedPath = parseElementPath(path);\n const startedAt = Date.now();\n await waitForAtspiReady(state, appPath, _timeoutMs, startedAt);\n\n while (Date.now() - startedAt <= _timeoutMs) {\n const processId = assertProcessRunning(state, appPath);\n\n try {\n const handle = nativeFindById(processId, parsedPath.id);\n if (handle !== undefined) {\n let element = createGtkElement(handle);\n let resolved = true;\n\n for (const childIndex of parsedPath.childIndexes) {\n if (!isPathChildContainer(element)) {\n resolved = false;\n break;\n }\n\n const child = await element.childAt(childIndex);\n if (child === undefined) {\n resolved = false;\n break;\n }\n\n element = child;\n }\n\n if (resolved) {\n return element;\n }\n }\n } catch (error) {\n throw normalizeNativeError(error);\n }\n\n await delay(50);\n }\n\n assertProcessRunning(state, appPath);\n return undefined;\n };\n\n const getByPath = async (path: string): Promise<GtkWidgetElement> => {\n const element = await findByPath(path);\n if (element === undefined) {\n throw createGtkElementNotFoundError(\n `Element path was not found: ${path}`\n );\n }\n\n return element;\n };\n\n const findTrayItem = async (\n selector: GtkTrayItemSelector\n ): Promise<GtkTrayItem | undefined> => {\n const startedAt = Date.now();\n\n while (Date.now() - startedAt <= _timeoutMs) {\n const processId = assertProcessRunning(state, appPath);\n\n try {\n const item = nativeTrayItems(processId).find((candidate) =>\n nativeTrayItemMatchesSelector(candidate, selector)\n );\n if (item !== undefined) {\n return createGtkTrayItem(processId, item);\n }\n } catch (error) {\n const normalizedError = normalizeNativeError(error);\n if (\n normalizedError.code === 'OPERATION_FAILED' &&\n normalizedError.message.includes('Timeout was reached')\n ) {\n await delay(50);\n continue;\n }\n throw normalizedError;\n }\n\n await delay(50);\n }\n\n assertProcessRunning(state, appPath);\n return undefined;\n };\n\n const getTrayItem = async (\n selector: GtkTrayItemSelector\n ): Promise<GtkTrayItem> => {\n const trayItem = await findTrayItem(selector);\n if (trayItem === undefined) {\n throw createGtkElementNotFoundError(\n `StatusNotifier tray item was not found: ${JSON.stringify(selector)}`\n );\n }\n\n return trayItem;\n };\n\n const app: GtkApp = {\n capture: async (): Promise<GtkCapture> => {\n assertProcessRunning(state, appPath);\n\n try {\n return nativeCaptureScreen();\n } catch (error) {\n throw normalizeNativeError(error);\n }\n },\n findById,\n findByPath,\n getById,\n getByPath,\n windowAt: async (index: number): Promise<GtkWidgetElement | undefined> => {\n assertNonNegativeIndex('index', index);\n const processId = await waitForAtspiReady(\n state,\n appPath,\n _timeoutMs,\n Date.now()\n );\n\n try {\n const handle = nativeWindowAt(processId, index);\n return handle === undefined ? undefined : createGtkElement(handle);\n } catch (error) {\n throw normalizeNativeError(error);\n }\n },\n getWindowCount: async (): Promise<number> => {\n const processId = await waitForAtspiReady(\n state,\n appPath,\n _timeoutMs,\n Date.now()\n );\n\n try {\n return nativeWindowCount(processId);\n } catch (error) {\n throw normalizeNativeError(error);\n }\n },\n findTrayItem,\n getTrayItem,\n trayItemAt: async (index: number): Promise<GtkTrayItem | undefined> => {\n assertNonNegativeIndex('index', index);\n const processId = assertProcessRunning(state, appPath);\n\n try {\n const item = nativeTrayItems(processId)[index];\n return item === undefined\n ? undefined\n : createGtkTrayItem(processId, item);\n } catch (error) {\n throw normalizeNativeError(error);\n }\n },\n getTrayItemCount: async (): Promise<number> => {\n const processId = assertProcessRunning(state, appPath);\n\n try {\n return nativeTrayItems(processId).length;\n } catch (error) {\n throw normalizeNativeError(error);\n }\n },\n release,\n [Symbol.asyncDispose]: release,\n };\n\n child.on('error', (error) => {\n appendOutput(state.stderr, Buffer.from(error.message));\n });\n\n return Promise.resolve(app);\n};\n\n/**\n * Creates a reusable GTK application launcher.\n * @param options - Options.\n * @returns GtkAppLauncher instance.\n */\nexport const createGtkAppLauncher = (\n options: GtkAppLauncherOptions\n): GtkAppLauncher => {\n const launchedApps: GtkApp[] = [];\n\n const launch = async (args?: readonly string[]): Promise<GtkApp> => {\n const launchOptions: LaunchGtkAppOptions = {\n env: options.env,\n timeoutMs: options.timeoutMs,\n };\n\n const app = await launchGtkApp(\n options.appPath,\n [...(options.args ?? []), ...(args ?? [])],\n launchOptions\n );\n launchedApps.push(app);\n return app;\n };\n\n const release = async (): Promise<void> => {\n const apps = launchedApps.splice(0);\n await Promise.all(apps.map((app) => app.release()));\n };\n\n return {\n launch,\n release,\n [Symbol.asyncDispose]: release,\n };\n};\n"],"names":["assertNonNegativeIndex","createGtkInvalidArgumentError","nativeElementInfo","nativeCapture","createGtkUnsupportedInterfaceError","nativeChildCount","nativeChildAt","nativeSelectedChildCount","nativeSelectedChildAt","nativeIsChildSelected","nativeSelectChildAt","nativeDeselectChildAt","nativeSelectAllChildren","nativeClearSelection","createGtkOperationFailedError","nativeClick","nativeSetText","nativeText","nativeValueInfo","nativeImageInfo","nativeCaptureBounds","nativeSetValue","nativeTableCellAt","nativeTableRowCount","nativeTableColumnCount","nativeTableSelectedRows","nativeTableSelectedColumns","nativeTableIsRowSelected","nativeTableIsColumnSelected","nativeTableIsCellSelected","nativeTableSelectRow","nativeTableDeselectRow","nativeTableSelectColumn","nativeTableDeselectColumn","createGtkStaleElementError","nativeTrayItems","nativeFindAnyById","createGtkElementNotFoundError","createGtkAppExitedError","nativeProcessAtspiReadiness","spawn","nativeFindById","normalizeNativeError","child","nativeCaptureScreen","nativeWindowAt","nativeWindowCount"],"mappings":";;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEA,IAAI,QAAQ,CAAC,MAAM,WAAW;AAatB,SAAO,IAAI,QAAQ,CAAC,YAAY;AACtC,eAAW,SAAS,IAAI;AAAA,EACzB,CAAC;AACF;AC5BA,MAAMA,2BAAyB,CAAC,MAAc,UAAwB;AACpE,MAAI,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,GAAG;AACzC,UAAMC,OAAAA;AAAAA,MACJ,GAAG,IAAI;AAAA,IAAA;AAAA,EAEX;AACF;AAEA,MAAM,qBAAqB,CAAC,MAAc,UAAwB;AAChE,MAAI,CAAC,OAAO,SAAS,KAAK,GAAG;AAC3B,UAAMA,qCAA8B,GAAG,IAAI,2BAA2B;AAAA,EACxE;AACF;AAEA,MAAM,oBAAoB,CAAC,aACzB,SAAS,OAAO,YAAA,EAAc,QAAQ,UAAU,GAAG,EAAE,QAAQ,QAAQ,GAAG;AAE1E,MAAM,eAAe,CAAC,MAAyB,SAC7C,KAAK,WAAW;AAAA,EACd,CAAC,kBAAkB,cA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CAAC;AAClC,UAAM,QAAQ,IAAI,KAAK,IAAI,CAAC,QAAQ,IAAI,QAAA,CAAS,CAAC;AAAA,EACpD;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,CAAC,OAAO,YAAY,GAAG;AAAA,EAAA;AAE3B;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* name: gestament
|
|
3
|
-
* version: 0.
|
|
3
|
+
* version: 0.3.0
|
|
4
4
|
* description: TypeScript based test driver for GTK
|
|
5
5
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
6
|
* license: MIT
|
|
7
7
|
* repository.url: https://github.com/kekyo/gestament.git
|
|
8
|
-
* git.commit.hash:
|
|
8
|
+
* git.commit.hash: c15fe3b28fb1c2fb73504c57773b1ee751cbf8c4
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export * from './types.js';
|