import x from "./csharp.es.js";
import A from "./markup.es.js";
d.displayName = "cshtml";
d.aliases = ["razor"];
function d(c) {
  c.register(x), c.register(A), (function(e) {
    var h = /\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\//.source, m = /@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source + "|" + /'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source;
    function a(o, y) {
      for (var p = 0; p < y; p++)
        o = o.replace(/<self>/g, function() {
          return "(?:" + o + ")";
        });
      return o.replace(/<self>/g, "[^\\s\\S]").replace(/<str>/g, "(?:" + m + ")").replace(/<comment>/g, "(?:" + h + ")");
    }
    var r = a(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source, 2), f = a(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source, 1), s = a(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source, 2), v = a(/<(?:[^<>'"@/]|<comment>|<self>)*>/.source, 1), l = /@/.source + /(?:await\b\s*)?/.source + "(?:" + /(?!await\b)\w+\b/.source + "|" + r + ")(?:" + /[?!]?\.\w+\b/.source + "|(?:" + v + ")?" + r + "|" + f + ")*" + /(?![?!\.(\[]|<(?!\/))/.source, w = /@(?![\w()])/.source + "|" + l, g = "(?:" + /"[^"@]*"|'[^'@]*'|[^\s'"@>=]+(?=[\s>])/.source + `|["'][^"'@]*(?:(?:` + w + `)[^"'@]*)+["'])`, u = /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*<tagAttrValue>|(?=[\s/>])))+)?/.source.replace(
      /<tagAttrValue>/,
      g
    ), t = /(?!\d)[^\s>\/=$<%]+/.source + u + /\s*\/?>/.source, b = /\B@?/.source + "(?:" + /<([a-zA-Z][\w:]*)/.source + u + /\s*>/.source + "(?:" + (/[^<]/.source + "|" + // all tags that are not the start tag
    // eslint-disable-next-line regexp/strict
    /<\/?(?!\1\b)/.source + t + "|" + // nested start tag
    a(
      // eslint-disable-next-line regexp/strict
      /<\1/.source + u + /\s*>/.source + "(?:" + (/[^<]/.source + "|" + // all tags that are not the start tag
      // eslint-disable-next-line regexp/strict
      /<\/?(?!\1\b)/.source + t + "|<self>") + ")*" + // eslint-disable-next-line regexp/strict
      /<\/\1\s*>/.source,
      2
    )) + ")*" + // eslint-disable-next-line regexp/strict
    /<\/\1\s*>/.source + "|" + /</.source + t + ")";
    e.languages.cshtml = e.languages.extend("markup", {});
    var k = e.languages.insertBefore(
      "csharp",
      "string",
      {
        html: {
          pattern: RegExp(b),
          greedy: !0,
          inside: e.languages.cshtml
        }
      },
      {
        csharp: e.languages.extend("csharp", {})
      }
    ), n = {
      pattern: /\S[\s\S]*/,
      alias: "language-csharp",
      inside: k
    }, i = {
      pattern: RegExp(/(^|[^@])/.source + l),
      lookbehind: !0,
      greedy: !0,
      alias: "variable",
      inside: {
        keyword: /^@/,
        csharp: n
      }
    };
    e.languages.cshtml.tag.pattern = RegExp(/<\/?/.source + t), e.languages.cshtml.tag.inside["attr-value"].pattern = RegExp(
      /=\s*/.source + g
    ), e.languages.insertBefore(
      "inside",
      "punctuation",
      {
        value: i
      },
      e.languages.cshtml.tag.inside["attr-value"]
    ), e.languages.insertBefore("cshtml", "prolog", {
      "razor-comment": {
        pattern: /@\*[\s\S]*?\*@/,
        greedy: !0,
        alias: "comment"
      },
      block: {
        pattern: RegExp(
          /(^|[^@])@/.source + "(?:" + [
            // @{ ... }
            s,
            // @code{ ... }
            /(?:code|functions)\s*/.source + s,
            // @for (...) { ... }
            /(?:for|foreach|lock|switch|using|while)\s*/.source + r + /\s*/.source + s,
            // @do { ... } while (...);
            /do\s*/.source + s + /\s*while\s*/.source + r + /(?:\s*;)?/.source,
            // @try { ... } catch (...) { ... } finally { ... }
            /try\s*/.source + s + /\s*catch\s*/.source + r + /\s*/.source + s + /\s*finally\s*/.source + s,
            // @if (...) {...} else if (...) {...} else {...}
            /if\s*/.source + r + /\s*/.source + s + "(?:" + /\s*else/.source + "(?:" + /\s+if\s*/.source + r + ")?" + /\s*/.source + s + ")*",
            // @helper Ident(params) { ... }
            /helper\s+\w+\s*/.source + r + /\s*/.source + s
          ].join("|") + ")"
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          keyword: /^@\w*/,
          csharp: n
        }
      },
      directive: {
        pattern: /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m,
        lookbehind: !0,
        greedy: !0,
        inside: {
          keyword: /^@\w+/,
          csharp: n
        }
      },
      value: i,
      "delegate-operator": {
        pattern: /(^|[^@])@(?=<)/,
        lookbehind: !0,
        alias: "operator"
      }
    }), e.languages.razor = e.languages.cshtml;
  })(c);
}
export {
  d as default
};
//# sourceMappingURL=cshtml.es.js.map
