import { __require as c } from "./markup-templating.mjs";
var i, l;
function d() {
  if (l)
    return i;
  l = 1;
  var p = c();
  i = n, n.displayName = "ftl", n.aliases = [];
  function n(o) {
    o.register(p), function(t) {
      for (var e = /[^<()"']|\((?:<expr>)*\)|<(?!#--)|<#--(?:[^-]|-(?!->))*-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/.source, u = 0; u < 2; u++)
        e = e.replace(/<expr>/g, function() {
          return e;
        });
      e = e.replace(/<expr>/g, /[^\s\S]/.source);
      var r = {
        comment: /<#--[\s\S]*?-->/,
        string: [{
          // raw string
          pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/,
          greedy: !0
        }, {
          pattern: RegExp(/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:<expr>))*\})*\1/.source.replace(/<expr>/g, function() {
            return e;
          })),
          greedy: !0,
          inside: {
            interpolation: {
              pattern: RegExp(/((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:<expr>))*\}/.source.replace(/<expr>/g, function() {
                return e;
              })),
              lookbehind: !0,
              inside: {
                "interpolation-punctuation": {
                  pattern: /^\$\{|\}$/,
                  alias: "punctuation"
                },
                rest: null
              }
            }
          }
        }],
        keyword: /\b(?:as)\b/,
        boolean: /\b(?:false|true)\b/,
        "builtin-function": {
          pattern: /((?:^|[^?])\?\s*)\w+/,
          lookbehind: !0,
          alias: "function"
        },
        function: /\b\w+(?=\s*\()/,
        number: /\b\d+(?:\.\d+)?\b/,
        operator: /\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,
        punctuation: /[,;.:()[\]{}]/
      };
      r.string[1].inside.interpolation.inside.rest = r, t.languages.ftl = {
        "ftl-comment": {
          // the pattern is shortened to be more efficient
          pattern: /^<#--[\s\S]*/,
          alias: "comment"
        },
        "ftl-directive": {
          pattern: /^<[\s\S]+>$/,
          inside: {
            directive: {
              pattern: /(^<\/?)[#@][a-z]\w*/i,
              lookbehind: !0,
              alias: "keyword"
            },
            punctuation: /^<\/?|\/?>$/,
            content: {
              pattern: /\s*\S[\s\S]*/,
              alias: "ftl",
              inside: r
            }
          }
        },
        "ftl-interpolation": {
          pattern: /^\$\{[\s\S]*\}$/,
          inside: {
            punctuation: /^\$\{|\}$/,
            content: {
              pattern: /\s*\S[\s\S]*/,
              alias: "ftl",
              inside: r
            }
          }
        }
      }, t.hooks.add("before-tokenize", function(a) {
        var s = RegExp(/<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:<expr>)*?>|\$\{(?:<expr>)*?\}/.source.replace(/<expr>/g, function() {
          return e;
        }), "gi");
        t.languages["markup-templating"].buildPlaceholders(a, "ftl", s);
      }), t.hooks.add("after-tokenize", function(a) {
        t.languages["markup-templating"].tokenizePlaceholders(a, "ftl");
      });
    }(o);
  }
  return i;
}
export {
  d as __require
};
