import {
  a as n,
  c as _
} from "./chunk-IO47FP3U.js";

// ../node_modules/highlight.js/lib/languages/xml.js
var T = _((A, d) => {
  function u(e) {
    return e ? typeof e == "string" ? e : e.source : null;
  }
  n(u, "source");
  function m(e) {
    return a("(?=", e, ")");
  }
  n(m, "lookahead");
  function b(e) {
    return a("(", e, ")?");
  }
  n(b, "optional");
  function a(...e) {
    return e.map((t) => u(t)).join("");
  }
  n(a, "concat");
  function N(...e) {
    return "(" + e.map((t) => u(t)).join("|") + ")";
  }
  n(N, "either");
  function E(e) {
    let s = a(/[A-Z_]/, b(/[A-Z0-9_.-]*:/), /[A-Z0-9_.-]*/), t = /[A-Za-z0-9._:-]+/, i = {
      className: "symbol",
      begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
    }, c = {
      begin: /\s/,
      contains: [
        {
          className: "meta-keyword",
          begin: /#?[a-z_][a-z1-9_-]+/,
          illegal: /\n/
        }
      ]
    }, o = e.inherit(c, {
      begin: /\(/,
      end: /\)/
    }), l = e.inherit(e.APOS_STRING_MODE, {
      className: "meta-string"
    }), g = e.inherit(e.QUOTE_STRING_MODE, {
      className: "meta-string"
    }), r = {
      endsWithParent: !0,
      illegal: /</,
      relevance: 0,
      contains: [
        {
          className: "attr",
          begin: t,
          relevance: 0
        },
        {
          begin: /=\s*/,
          relevance: 0,
          contains: [
            {
              className: "string",
              endsParent: !0,
              variants: [
                {
                  begin: /"/,
                  end: /"/,
                  contains: [i]
                },
                {
                  begin: /'/,
                  end: /'/,
                  contains: [i]
                },
                {
                  begin: /[^\s"'=<>`]+/
                }
              ]
            }
          ]
        }
      ]
    };
    return {
      name: "HTML, XML",
      aliases: [
        "html",
        "xhtml",
        "rss",
        "atom",
        "xjb",
        "xsd",
        "xsl",
        "plist",
        "wsf",
        "svg"
      ],
      case_insensitive: !0,
      contains: [
        {
          className: "meta",
          begin: /<![a-z]/,
          end: />/,
          relevance: 10,
          contains: [
            c,
            g,
            l,
            o,
            {
              begin: /\[/,
              end: /\]/,
              contains: [
                {
                  className: "meta",
                  begin: /<![a-z]/,
                  end: />/,
                  contains: [
                    c,
                    o,
                    g,
                    l
                  ]
                }
              ]
            }
          ]
        },
        e.COMMENT(
          /<!--/,
          /-->/,
          {
            relevance: 10
          }
        ),
        {
          begin: /<!\[CDATA\[/,
          end: /\]\]>/,
          relevance: 10
        },
        i,
        {
          className: "meta",
          begin: /<\?xml/,
          end: /\?>/,
          relevance: 10
        },
        {
          className: "tag",
          /*
          The lookahead pattern (?=...) ensures that 'begin' only matches
          '<style' as a single word, followed by a whitespace or an
          ending braket. The '$' is needed for the lexeme to be recognized
          by hljs.subMode() that tests lexemes outside the stream.
          */
          begin: /<style(?=\s|>)/,
          end: />/,
          keywords: {
            name: "style"
          },
          contains: [r],
          starts: {
            end: /<\/style>/,
            returnEnd: !0,
            subLanguage: [
              "css",
              "xml"
            ]
          }
        },
        {
          className: "tag",
          // See the comment in the <style tag about the lookahead pattern
          begin: /<script(?=\s|>)/,
          end: />/,
          keywords: {
            name: "script"
          },
          contains: [r],
          starts: {
            end: /<\/script>/,
            returnEnd: !0,
            subLanguage: [
              "javascript",
              "handlebars",
              "xml"
            ]
          }
        },
        // we need this for now for jSX
        {
          className: "tag",
          begin: /<>|<\/>/
        },
        // open tag
        {
          className: "tag",
          begin: a(
            /</,
            m(a(
              s,
              // <tag/>
              // <tag>
              // <tag ...
              N(/\/>/, />/, /\s/)
            ))
          ),
          end: /\/?>/,
          contains: [
            {
              className: "name",
              begin: s,
              relevance: 0,
              starts: r
            }
          ]
        },
        // close tag
        {
          className: "tag",
          begin: a(
            /<\//,
            m(a(
              s,
              />/
            ))
          ),
          contains: [
            {
              className: "name",
              begin: s,
              relevance: 0
            },
            {
              begin: />/,
              relevance: 0,
              endsParent: !0
            }
          ]
        }
      ]
    };
  }
  n(E, "xml");
  d.exports = E;
});

export {
  T as a
};
