"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_primordials_map_set = require('../primordials/map-set.js');

//#region src/dlx/_internal.ts
/**
* @file Shared internals for the `dlx/*` module — the bounded LRU cache used by
*   `resolveBinaryPath` on Windows. Webpack-safe lazy `node:fs` / `node:path` /
*   `node:crypto` loaders live in the canonical
*   `@socketsecurity/lib/node/{fs,path,crypto}` helpers — import `getNodeFs` /
*   `getNodePath` / `getNodeCrypto` directly from there.
*/
const BINARY_PATH_CACHE_MAX_SIZE = 200;
const binaryPathCache = new require_primordials_map_set.MapCtor();
function binaryPathCacheSet(key, value) {
	if (binaryPathCache.has(key)) binaryPathCache.delete(key);
	else if (binaryPathCache.size >= 200) {
		const oldest = binaryPathCache.keys().next().value;
		if (oldest !== void 0) binaryPathCache.delete(oldest);
	}
	binaryPathCache.set(key, value);
}

//#endregion
exports.BINARY_PATH_CACHE_MAX_SIZE = BINARY_PATH_CACHE_MAX_SIZE;
exports.binaryPathCache = binaryPathCache;
exports.binaryPathCacheSet = binaryPathCacheSet;