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

// ../node_modules/highlight.js/lib/languages/bash.js
var E = m((_, o) => {
  function g(e) {
    return e ? typeof e == "string" ? e : e.source : null;
  }
  t(g, "source");
  function h(...e) {
    return e.map((s) => g(s)).join("");
  }
  t(h, "concat");
  function f(e) {
    let n = {}, s = {
      begin: /\$\{/,
      end: /\}/,
      contains: [
        "self",
        {
          begin: /:-/,
          contains: [n]
        }
        // default values
      ]
    };
    Object.assign(n, {
      className: "variable",
      variants: [
        { begin: h(
          /\$[\w\d#@][\w\d_]*/,
          // negative look-ahead tries to avoid matching patterns that are not
          // Perl at all like $ident$, @ident@, etc.
          "(?![\\w\\d])(?![$])"
        ) },
        s
      ]
    });
    let a = {
      className: "subst",
      begin: /\$\(/,
      end: /\)/,
      contains: [e.BACKSLASH_ESCAPE]
    }, c = {
      begin: /<<-?\s*(?=\w+)/,
      starts: {
        contains: [
          e.END_SAME_AS_BEGIN({
            begin: /(\w+)/,
            end: /(\w+)/,
            className: "string"
          })
        ]
      }
    }, i = {
      className: "string",
      begin: /"/,
      end: /"/,
      contains: [
        e.BACKSLASH_ESCAPE,
        n,
        a
      ]
    };
    a.contains.push(i);
    let r = {
      className: "",
      begin: /\\"/
    }, l = {
      className: "string",
      begin: /'/,
      end: /'/
    }, p = {
      begin: /\$\(\(/,
      end: /\)\)/,
      contains: [
        { begin: /\d+#[0-9a-f]+/, className: "number" },
        e.NUMBER_MODE,
        n
      ]
    }, u = [
      "fish",
      "bash",
      "zsh",
      "sh",
      "csh",
      "ksh",
      "tcsh",
      "dash",
      "scsh"
    ], d = e.SHEBANG({
      binary: `(${u.join("|")})`,
      relevance: 10
    }), b = {
      className: "function",
      begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
      returnBegin: !0,
      contains: [e.inherit(e.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
      relevance: 0
    };
    return {
      name: "Bash",
      aliases: ["sh", "zsh"],
      keywords: {
        $pattern: /\b[a-z._-]+\b/,
        keyword: "if then else elif fi for while in do done case esac function",
        literal: "true false",
        built_in: (
          // Shell built-ins
          // http://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
          "break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"
        )
      },
      contains: [
        d,
        // to catch known shells and boost relevancy
        e.SHEBANG(),
        // to catch unknown shells but still highlight the shebang
        b,
        p,
        e.HASH_COMMENT_MODE,
        c,
        i,
        r,
        l,
        n
      ]
    };
  }
  t(f, "bash");
  o.exports = f;
});

export {
  E as a
};
