module.exports = function (e) {
  var n = "[A-Za-z$_][0-9A-Za-z$_]*",
    a = {
      keyword:
        "in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",
      literal: "true false null undefined NaN Infinity",
      built_in:
        "eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise",
    },
    r = {
      className: "number",
      variants: [
        { begin: "\\b(0[bB][01]+)" },
        { begin: "\\b(0[oO][0-7]+)" },
        { begin: e.C_NUMBER_RE },
      ],
      relevance: 0,
    },
    s = {
      className: "subst",
      begin: "\\$\\{",
      end: "\\}",
      keywords: a,
      contains: [],
    },
    i = {
      className: "string",
      begin: "`",
      end: "`",
      contains: [e.BACKSLASH_ESCAPE, s],
    };
  s.contains = [e.APOS_STRING_MODE, e.QUOTE_STRING_MODE, i, r, e.REGEXP_MODE];
  var t = s.contains.concat([e.C_BLOCK_COMMENT_MODE, e.C_LINE_COMMENT_MODE]);
  return {
    aliases: ["js", "jsx"],
    keywords: a,
    contains: [
      {
        className: "meta",
        relevance: 10,
        begin: /^\s*['"]use (strict|asm)['"]/,
      },
      { className: "meta", begin: /^#!/, end: /$/ },
      e.APOS_STRING_MODE,
      e.QUOTE_STRING_MODE,
      i,
      e.C_LINE_COMMENT_MODE,
      e.C_BLOCK_COMMENT_MODE,
      r,
      {
        begin: /[{,]\s*/,
        relevance: 0,
        contains: [
          {
            begin: n + "\\s*:",
            returnBegin: !0,
            relevance: 0,
            contains: [{ className: "attr", begin: n, relevance: 0 }],
          },
        ],
      },
      {
        begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
        keywords: "return throw case",
        contains: [
          e.C_LINE_COMMENT_MODE,
          e.C_BLOCK_COMMENT_MODE,
          e.REGEXP_MODE,
          {
            className: "function",
            begin: "(\\(.*?\\)|" + n + ")\\s*=>",
            returnBegin: !0,
            end: "\\s*=>",
            contains: [
              {
                className: "params",
                variants: [
                  { begin: n },
                  { begin: /\(\s*\)/ },
                  {
                    begin: /\(/,
                    end: /\)/,
                    excludeBegin: !0,
                    excludeEnd: !0,
                    keywords: a,
                    contains: t,
                  },
                ],
              },
            ],
          },
          {
            begin: /</,
            end: /(\/\w+|\w+\/)>/,
            subLanguage: "xml",
            contains: [
              { begin: /<\w+\s*\/>/, skip: !0 },
              {
                begin: /<\w+/,
                end: /(\/\w+|\w+\/)>/,
                skip: !0,
                contains: [{ begin: /<\w+\s*\/>/, skip: !0 }, "self"],
              },
            ],
          },
        ],
        relevance: 0,
      },
      {
        className: "function",
        beginKeywords: "function",
        end: /\{/,
        excludeEnd: !0,
        contains: [
          e.inherit(e.TITLE_MODE, { begin: n }),
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            excludeBegin: !0,
            excludeEnd: !0,
            contains: t,
          },
        ],
        illegal: /\[|%/,
      },
      { begin: /\$[(.]/ },
      e.METHOD_GUARD,
      {
        className: "class",
        beginKeywords: "class",
        end: /[{;=]/,
        excludeEnd: !0,
        illegal: /[:"\[\]]/,
        contains: [{ beginKeywords: "extends" }, e.UNDERSCORE_TITLE_MODE],
      },
      { beginKeywords: "constructor", end: /\{/, excludeEnd: !0 },
    ],
    illegal: /#(?!!)/,
  };
};
