"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../_virtual/_rolldown/runtime.js');
const require_paths_normalize = require('../paths/normalize.js');
let node_process = require("node:process");
node_process = require_runtime.__toESM(node_process);

//#region src/sea/detect.ts
/**
* @file SEA (Single Executable Application) binary detection + path accessor.
*   Two responsibilities (mirror of `src/smol/detect.ts` shape):
*
*   1. `isSeaBinary()` — memoized boolean detector for whether the current process
*      is running as a Node.js Single Executable Application. Probes via Node
*      24+'s `node:sea.isSea()` native API; falls back to `false` on older
*      runtimes.
*   2. `getSeaBinaryPath()` — returns the path of the SEA binary
*      (`process.argv[0]` normalized) when running as SEA, otherwise
*      `undefined`. Defensive across runtimes: returns `false` / `undefined`
*      cleanly on stock Node < 24, browsers, Deno, Bun.
*/
/**
* Cached SEA detection result.
*/
let _isSea;
/**
* Get the current SEA binary path. Only valid when running as a SEA binary.
*
* @example
*   ```typescript
*   const binPath = getSeaBinaryPath()
*   if (binPath) {
*   console.log(`Running as SEA binary: ${binPath}`)
*   }
*   ```
*/
function getSeaBinaryPath() {
	return isSeaBinary() && node_process.default.argv[0] ? /* @__PURE__ */ require_paths_normalize.normalizePath(node_process.default.argv[0]) : void 0;
}
/**
* Detect if the current process is running as a SEA binary. Uses Node.js 24+
* native API with caching for performance.
*
* @example
*   ;```typescript
*   if (isSeaBinary()) {
*     console.log('Running as a Single Executable Application')
*   }
*   ```
*/
function isSeaBinary() {
	if (_isSea === void 0) try {
		_isSea = require("node:sea").isSea();
	} catch {
		_isSea = false;
	}
	return _isSea ?? false;
}

//#endregion
exports.getSeaBinaryPath = getSeaBinaryPath;
exports.isSeaBinary = isSeaBinary;