"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../_virtual/_rolldown/runtime.js');
const require_primordials_object = require('../primordials/object.js');
const require_primordials_reflect = require('../primordials/reflect.js');
const require_themes_context = require('../themes/context.js');
const require_logger__internal = require('./_internal.js');
const require_logger_colors = require('./colors.js');
const require_primordials_globals = require('../primordials/globals.js');
let src_external__socketregistry_is_unicode_supported = require("../external/@socketregistry/is-unicode-supported");
src_external__socketregistry_is_unicode_supported = require_runtime.__toESM(src_external__socketregistry_is_unicode_supported);

//#region src/logger/symbols.ts
/**
* @file Symbol exports + the `LOG_SYMBOLS` proxy. The two `Symbol.for(...)`
*   constants are how the spinner (and tests) reach into a `Logger` instance to
*   bump the call counter and toggle blank-line tracking without exposing
*   private fields. The `LOG_SYMBOLS` proxy is the public colored-symbol
*   palette that lazily initializes on first access (so importing the logger
*   during early Node.js bootstrap doesn't pre-resolve the theme before themes
*   are configured) and re-renders whenever `setTheme()` fires
*   `onThemeChange`.
*/
let _consoleSymbols;
let _kGroupIndentationWidthSymbol;
/**
* Lazily get console symbols on first access.
*
* Deferred to avoid accessing global console during early Node.js bootstrap
* before stdout is ready.
*/
function getConsoleSymbols() {
	/* c8 ignore start */
	if (_consoleSymbols === void 0) _consoleSymbols = require_primordials_object.ObjectGetOwnPropertySymbols(require_logger__internal.globalConsole);
	/* c8 ignore stop */
	return _consoleSymbols;
}
/**
* Lazily get kGroupIndentationWidth symbol on first access.
*/
function getKGroupIndentationWidthSymbol() {
	/* c8 ignore next - Lazy-init second-call branch; module-singleton. */
	if (_kGroupIndentationWidthSymbol === void 0) _kGroupIndentationWidthSymbol = getConsoleSymbols().find((s) => s.label === "kGroupIndentWidth") ?? Symbol("kGroupIndentWidth");
	return _kGroupIndentationWidthSymbol;
}
/**
* Symbol for incrementing the internal log call counter.
*
* This is an internal symbol used to track the number of times logging methods
* have been called on a logger instance.
*/
const incLogCallCountSymbol = Symbol.for("logger.logCallCount++");
/**
* Symbol for tracking whether the last logged line was blank.
*
* This is used internally to prevent multiple consecutive blank lines and to
* determine whether to add spacing before certain messages.
*/
const lastWasBlankSymbol = Symbol.for("logger.lastWasBlank");
/**
* Log symbols for terminal output with colored indicators.
*
* Provides colored Unicode symbols (✖, ℹ, ∴, →, ✔, ⚠) with ASCII fallbacks (×,
* i, :., >, √, ‼) for terminals that don't support Unicode. Symbols are colored
* according to the active theme's color palette (error, info, reason, step,
* success, warning).
*
* The symbols are lazily initialized on first access and automatically update
* when the fallback theme changes (via setTheme()). Note that LOG_SYMBOLS
* reflect the global fallback theme, not async-local theme contexts from
* withTheme().
*
* @example
*   ```typescript
*   import { LOG_SYMBOLS } from '@socketsecurity/lib/logger/symbols'
*
*   console.log(`${LOG_SYMBOLS.fail} Build failed`) // Theme error color ✖
*   console.log(`${LOG_SYMBOLS.info} Starting process`) // Theme info color ℹ
*   console.log(`${LOG_SYMBOLS.progress} Working on task`) // Theme step color ∴
*   console.log(`${LOG_SYMBOLS.step} Processing files`) // Theme step color →
*   console.log(`${LOG_SYMBOLS.success} Build completed`) // Theme success color ✔
*   console.log(`${LOG_SYMBOLS.warn} Deprecated API used`) // Theme warning color ⚠
*   ```
*/
const LOG_SYMBOLS = /*@__PURE__*/ (() => {
	const target = { __proto__: null };
	let initialized = false;
	const handler = { __proto__: null };
	const updateSymbols = () => {
		const supported = (0, src_external__socketregistry_is_unicode_supported.default)();
		const colors = /* @__PURE__ */ require_logger_colors.getYoctocolors();
		const theme = require_themes_context.getTheme();
		const successColor = theme.colors.success;
		const errorColor = theme.colors.error;
		const warningColor = theme.colors.warning;
		const infoColor = theme.colors.info;
		const stepColor = theme.colors.step;
		/* c8 ignore start - ASCII-fallback symbol arms only fire on
		terminals without unicode support; tests run on unicode TTYs. */
		target["fail"] = /* @__PURE__ */ require_logger_colors.applyColor(supported ? "✖" : "×", errorColor, colors);
		target["info"] = /* @__PURE__ */ require_logger_colors.applyColor(supported ? "ℹ" : "i", infoColor, colors);
		target["progress"] = /* @__PURE__ */ require_logger_colors.applyColor(supported ? "∴" : ":.", stepColor, colors);
		target["reason"] = colors.dim(/* @__PURE__ */ require_logger_colors.applyColor(supported ? "∴" : ":.", warningColor, colors));
		target["skip"] = /* @__PURE__ */ require_logger_colors.applyColor(supported ? "↻" : "@", stepColor, colors);
		target["step"] = /* @__PURE__ */ require_logger_colors.applyColor(supported ? "→" : ">", stepColor, colors);
		target["success"] = /* @__PURE__ */ require_logger_colors.applyColor(supported ? "✔" : "√", successColor, colors);
		target["warn"] = /* @__PURE__ */ require_logger_colors.applyColor(supported ? "⚠" : "‼", warningColor, colors);
		/* c8 ignore stop */
	};
	const init = () => {
		/* c8 ignore start */
		if (initialized) return;
		/* c8 ignore stop */
		updateSymbols();
		initialized = true;
		for (const trapName in handler) delete handler[trapName];
	};
	const reset = () => {
		/* c8 ignore start */
		if (!initialized) return;
		/* c8 ignore stop */
		updateSymbols();
	};
	for (const trapName of require_primordials_reflect.ReflectOwnKeys(Reflect)) {
		const fn = Reflect[trapName];
		if (typeof fn === "function") handler[trapName] = (...args) => {
			init();
			return fn(...args);
		};
	}
	/* c8 ignore next 4 - onThemeChange callback fires only when
	setTheme() is called at runtime; tests use the static default
	theme. */
	require_themes_context.onThemeChange(() => {
		reset();
	});
	return new require_primordials_globals.ProxyCtor(target, handler);
})();

//#endregion
exports.LOG_SYMBOLS = LOG_SYMBOLS;
exports.getConsoleSymbols = getConsoleSymbols;
exports.getKGroupIndentationWidthSymbol = getKGroupIndentationWidthSymbol;
exports.incLogCallCountSymbol = incLogCallCountSymbol;
exports.lastWasBlankSymbol = lastWasBlankSymbol;