import { __exports as n } from "../../../../../../../_virtual/index18.js";
import "../../../../../js-tokens@4.0.0/node_modules/js-tokens/index.js";
import "../../../../../@babel_helper-validator-identifier@7.18.6/node_modules/@babel/helper-validator-identifier/lib/index.js";
import "../../../../../chalk@2.4.2/node_modules/chalk/index.js";
import { __exports as b } from "../../../../../../../_virtual/index24.js";
import { __exports as T } from "../../../../../../../_virtual/index25.js";
import { c as x } from "../../../../../../../_virtual/index26.js";
var d;
function E() {
  if (d)
    return n;
  d = 1, Object.defineProperty(n, "__esModule", {
    value: !0
  }), n.default = _, n.getChalk = c, n.shouldHighlight = f;
  var s = b, l = T, u = x.exports;
  const m = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
  function g(r) {
    return {
      keyword: r.cyan,
      capitalized: r.yellow,
      jsxIdentifier: r.yellow,
      punctuator: r.yellow,
      number: r.magenta,
      string: r.green,
      regex: r.magenta,
      comment: r.grey,
      invalid: r.white.bgRed.bold
    };
  }
  const v = /\r\n|[\n\r\u2028\u2029]/, h = /^[()[\]{}]$/;
  let a;
  {
    const r = /^[a-z][\w-]*$/i, o = function(e, t, i) {
      if (e.type === "name") {
        if ((0, l.isKeyword)(e.value) || (0, l.isStrictReservedWord)(e.value, !0) || m.has(e.value))
          return "keyword";
        if (r.test(e.value) && (i[t - 1] === "<" || i.substr(t - 2, 2) == "</"))
          return "jsxIdentifier";
        if (e.value[0] !== e.value[0].toLowerCase())
          return "capitalized";
      }
      return e.type === "punctuator" && h.test(e.value) ? "bracket" : e.type === "invalid" && (e.value === "@" || e.value === "#") ? "punctuator" : e.type;
    };
    a = function* (e) {
      let t;
      for (; t = s.default.exec(e); ) {
        const i = s.matchToToken(t);
        yield {
          type: o(i, t.index, e),
          value: i.value
        };
      }
    };
  }
  function y(r, o) {
    let e = "";
    for (const {
      type: t,
      value: i
    } of a(o)) {
      const p = r[t];
      p ? e += i.split(v).map((w) => p(w)).join(`
`) : e += i;
    }
    return e;
  }
  function f(r) {
    return !!u.supportsColor || r.forceColor;
  }
  function c(r) {
    return r.forceColor ? new u.constructor({
      enabled: !0,
      level: 1
    }) : u;
  }
  function _(r, o = {}) {
    if (r !== "" && f(o)) {
      const e = c(o), t = g(e);
      return y(t, r);
    } else
      return r;
  }
  return n;
}
export {
  E as __require
};
//# sourceMappingURL=index.js.map
