"use strict";
/* Socket Lib - Built with esbuild */
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var symbols_exports = {};
__export(symbols_exports, {
  LOG_SYMBOLS: () => LOG_SYMBOLS,
  getConsoleSymbols: () => getConsoleSymbols,
  getKGroupIndentationWidthSymbol: () => getKGroupIndentationWidthSymbol,
  incLogCallCountSymbol: () => incLogCallCountSymbol,
  lastWasBlankSymbol: () => lastWasBlankSymbol
});
module.exports = __toCommonJS(symbols_exports);
var import_is_unicode_supported = __toESM(require("../external/@socketregistry/is-unicode-supported"));
var import_globals = require("../primordials/globals");
var import_object = require("../primordials/object");
var import_reflect = require("../primordials/reflect");
var import_context = require("../themes/context");
var import_colors = require("./colors");
var import_internal = require("./_internal");
let _consoleSymbols;
let _kGroupIndentationWidthSymbol;
function getConsoleSymbols() {
  if (_consoleSymbols === void 0) {
    _consoleSymbols = (0, import_object.ObjectGetOwnPropertySymbols)(import_internal.globalConsole);
  }
  return _consoleSymbols;
}
function getKGroupIndentationWidthSymbol() {
  if (_kGroupIndentationWidthSymbol === void 0) {
    _kGroupIndentationWidthSymbol = getConsoleSymbols().find((s) => s.label === "kGroupIndentWidth") ?? Symbol("kGroupIndentWidth");
  }
  return _kGroupIndentationWidthSymbol;
}
const incLogCallCountSymbol = Symbol.for("logger.logCallCount++");
const lastWasBlankSymbol = Symbol.for("logger.lastWasBlank");
const LOG_SYMBOLS = /* @__PURE__ */ (() => {
  const target = {
    __proto__: null
  };
  let initialized = false;
  const handler = {
    __proto__: null
  };
  const updateSymbols = () => {
    const supported = (0, import_is_unicode_supported.default)();
    const colors = (0, import_colors.getYoctocolors)();
    const theme = (0, import_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;
    target["fail"] = (0, import_colors.applyColor)(supported ? "\u2716" : "\xD7", errorColor, colors);
    target["info"] = (0, import_colors.applyColor)(supported ? "\u2139" : "i", infoColor, colors);
    target["progress"] = (0, import_colors.applyColor)(supported ? "\u2234" : ":.", stepColor, colors);
    target["reason"] = colors.dim(
      (0, import_colors.applyColor)(supported ? "\u2234" : ":.", warningColor, colors)
    );
    target["skip"] = (0, import_colors.applyColor)(supported ? "\u21BB" : "@", stepColor, colors);
    target["step"] = (0, import_colors.applyColor)(supported ? "\u2192" : ">", stepColor, colors);
    target["success"] = (0, import_colors.applyColor)(supported ? "\u2714" : "\u221A", successColor, colors);
    target["warn"] = (0, import_colors.applyColor)(supported ? "\u26A0" : "\u203C", warningColor, colors);
  };
  const init = () => {
    if (initialized) {
      return;
    }
    updateSymbols();
    initialized = true;
    for (const trapName in handler) {
      delete handler[trapName];
    }
  };
  const reset = () => {
    if (!initialized) {
      return;
    }
    updateSymbols();
  };
  for (const trapName of (0, import_reflect.ReflectOwnKeys)(Reflect)) {
    const fn = Reflect[trapName];
    if (typeof fn === "function") {
      ;
      handler[trapName] = (...args) => {
        init();
        return fn(...args);
      };
    }
  }
  (0, import_context.onThemeChange)(() => {
    reset();
  });
  return new import_globals.ProxyCtor(target, handler);
})();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  LOG_SYMBOLS,
  getConsoleSymbols,
  getKGroupIndentationWidthSymbol,
  incLogCallCountSymbol,
  lastWasBlankSymbol
});
