import { u as xe, b as $e } from "./chunk-5HRBRIJM-BjQ8go1b-CJmT3AYe.js";
import { _ as i, aj as De, ak as ve, a5 as Ce, a6 as Le, a8 as Ae, a7 as Ie, l as k, g as v, an as we, ao as Re, ag as M, aq as Ne, bj as Oe } from "./index-CMZig9xg.js";
var It = function() {
  var t = /* @__PURE__ */ i(function(L, a, n, y) {
    for (n = n || {}, y = L.length; y--; n[L[y]] = a) ;
    return n;
  }, "o"), e = [1, 2], l = [1, 3], o = [1, 4], r = [2, 4], h = [1, 9], p = [1, 11], g = [1, 16], u = [1, 17], m = [1, 18], _ = [1, 19], A = [1, 32], H = [1, 20], P = [1, 21], I = [1, 22], d = [1, 23], C = [1, 24], w = [1, 26], Y = [1, 27], G = [1, 28], N = [1, 29], O = [1, 30], it = [1, 31], rt = [1, 34], at = [1, 35], nt = [1, 36], ot = [1, 37], q = [1, 33], f = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], lt = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], Gt = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], Et = {
    trace: /* @__PURE__ */ i(function() {
    }, "trace"),
    yy: {},
    symbols_: { error: 2, start: 3, SPACE: 4, NL: 5, SD: 6, document: 7, line: 8, statement: 9, classDefStatement: 10, styleStatement: 11, cssClassStatement: 12, idStatement: 13, DESCR: 14, "-->": 15, HIDE_EMPTY: 16, scale: 17, WIDTH: 18, COMPOSIT_STATE: 19, STRUCT_START: 20, STRUCT_STOP: 21, STATE_DESCR: 22, AS: 23, ID: 24, FORK: 25, JOIN: 26, CHOICE: 27, CONCURRENT: 28, note: 29, notePosition: 30, NOTE_TEXT: 31, direction: 32, acc_title: 33, acc_title_value: 34, acc_descr: 35, acc_descr_value: 36, acc_descr_multiline_value: 37, classDef: 38, CLASSDEF_ID: 39, CLASSDEF_STYLEOPTS: 40, DEFAULT: 41, style: 42, STYLE_IDS: 43, STYLEDEF_STYLEOPTS: 44, class: 45, CLASSENTITY_IDS: 46, STYLECLASS: 47, direction_tb: 48, direction_bt: 49, direction_rl: 50, direction_lr: 51, eol: 52, ";": 53, EDGE_STATE: 54, STYLE_SEPARATOR: 55, left_of: 56, right_of: 57, $accept: 0, $end: 1 },
    terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "classDef", 39: "CLASSDEF_ID", 40: "CLASSDEF_STYLEOPTS", 41: "DEFAULT", 42: "style", 43: "STYLE_IDS", 44: "STYLEDEF_STYLEOPTS", 45: "class", 46: "CLASSENTITY_IDS", 47: "STYLECLASS", 48: "direction_tb", 49: "direction_bt", 50: "direction_rl", 51: "direction_lr", 53: ";", 54: "EDGE_STATE", 55: "STYLE_SEPARATOR", 56: "left_of", 57: "right_of" },
    productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [10, 3], [10, 3], [11, 3], [12, 3], [32, 1], [32, 1], [32, 1], [32, 1], [52, 1], [52, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1]],
    performAction: /* @__PURE__ */ i(function(L, a, n, y, S, s, T) {
      var c = s.length - 1;
      switch (S) {
        case 3:
          return y.setRootDoc(s[c]), s[c];
        case 4:
          this.$ = [];
          break;
        case 5:
          s[c] != "nl" && (s[c - 1].push(s[c]), this.$ = s[c - 1]);
          break;
        case 6:
        case 7:
          this.$ = s[c];
          break;
        case 8:
          this.$ = "nl";
          break;
        case 12:
          this.$ = s[c];
          break;
        case 13:
          const X = s[c - 1];
          X.description = y.trimColon(s[c]), this.$ = X;
          break;
        case 14:
          this.$ = { stmt: "relation", state1: s[c - 2], state2: s[c] };
          break;
        case 15:
          const xt = y.trimColon(s[c]);
          this.$ = { stmt: "relation", state1: s[c - 3], state2: s[c - 1], description: xt };
          break;
        case 19:
          this.$ = { stmt: "state", id: s[c - 3], type: "default", description: "", doc: s[c - 1] };
          break;
        case 20:
          var z = s[c], J = s[c - 2].trim();
          if (s[c].match(":")) {
            var ht = s[c].split(":");
            z = ht[0], J = [J, ht[1]];
          }
          this.$ = { stmt: "state", id: z, type: "default", description: J };
          break;
        case 21:
          this.$ = { stmt: "state", id: s[c - 3], type: "default", description: s[c - 5], doc: s[c - 1] };
          break;
        case 22:
          this.$ = { stmt: "state", id: s[c], type: "fork" };
          break;
        case 23:
          this.$ = { stmt: "state", id: s[c], type: "join" };
          break;
        case 24:
          this.$ = { stmt: "state", id: s[c], type: "choice" };
          break;
        case 25:
          this.$ = { stmt: "state", id: y.getDividerId(), type: "divider" };
          break;
        case 26:
          this.$ = { stmt: "state", id: s[c - 1].trim(), note: { position: s[c - 2].trim(), text: s[c].trim() } };
          break;
        case 29:
          this.$ = s[c].trim(), y.setAccTitle(this.$);
          break;
        case 30:
        case 31:
          this.$ = s[c].trim(), y.setAccDescription(this.$);
          break;
        case 32:
        case 33:
          this.$ = { stmt: "classDef", id: s[c - 1].trim(), classes: s[c].trim() };
          break;
        case 34:
          this.$ = { stmt: "style", id: s[c - 1].trim(), styleClass: s[c].trim() };
          break;
        case 35:
          this.$ = { stmt: "applyClass", id: s[c - 1].trim(), styleClass: s[c].trim() };
          break;
        case 36:
          y.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" };
          break;
        case 37:
          y.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" };
          break;
        case 38:
          y.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" };
          break;
        case 39:
          y.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" };
          break;
        case 42:
        case 43:
          this.$ = { stmt: "state", id: s[c].trim(), type: "default", description: "" };
          break;
        case 44:
          this.$ = { stmt: "state", id: s[c - 2].trim(), classes: [s[c].trim()], type: "default", description: "" };
          break;
        case 45:
          this.$ = { stmt: "state", id: s[c - 2].trim(), classes: [s[c].trim()], type: "default", description: "" };
          break;
      }
    }, "anonymous"),
    table: [{ 3: 1, 4: e, 5: l, 6: o }, { 1: [3] }, { 3: 5, 4: e, 5: l, 6: o }, { 3: 6, 4: e, 5: l, 6: o }, t([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: h, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: g, 17: u, 19: m, 22: _, 24: A, 25: H, 26: P, 27: I, 28: d, 29: C, 32: 25, 33: w, 35: Y, 37: G, 38: N, 42: O, 45: it, 48: rt, 49: at, 50: nt, 51: ot, 54: q }, t(f, [2, 5]), { 9: 38, 10: 12, 11: 13, 12: 14, 13: 15, 16: g, 17: u, 19: m, 22: _, 24: A, 25: H, 26: P, 27: I, 28: d, 29: C, 32: 25, 33: w, 35: Y, 37: G, 38: N, 42: O, 45: it, 48: rt, 49: at, 50: nt, 51: ot, 54: q }, t(f, [2, 7]), t(f, [2, 8]), t(f, [2, 9]), t(f, [2, 10]), t(f, [2, 11]), t(f, [2, 12], { 14: [1, 39], 15: [1, 40] }), t(f, [2, 16]), { 18: [1, 41] }, t(f, [2, 18], { 20: [1, 42] }), { 23: [1, 43] }, t(f, [2, 22]), t(f, [2, 23]), t(f, [2, 24]), t(f, [2, 25]), { 30: 44, 31: [1, 45], 56: [1, 46], 57: [1, 47] }, t(f, [2, 28]), { 34: [1, 48] }, { 36: [1, 49] }, t(f, [2, 31]), { 39: [1, 50], 41: [1, 51] }, { 43: [1, 52] }, { 46: [1, 53] }, t(lt, [2, 42], { 55: [1, 54] }), t(lt, [2, 43], { 55: [1, 55] }), t(f, [2, 36]), t(f, [2, 37]), t(f, [2, 38]), t(f, [2, 39]), t(f, [2, 6]), t(f, [2, 13]), { 13: 56, 24: A, 54: q }, t(f, [2, 17]), t(Gt, r, { 7: 57 }), { 24: [1, 58] }, { 24: [1, 59] }, { 23: [1, 60] }, { 24: [2, 46] }, { 24: [2, 47] }, t(f, [2, 29]), t(f, [2, 30]), { 40: [1, 61] }, { 40: [1, 62] }, { 44: [1, 63] }, { 47: [1, 64] }, { 24: [1, 65] }, { 24: [1, 66] }, t(f, [2, 14], { 14: [1, 67] }), { 4: h, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: g, 17: u, 19: m, 21: [1, 68], 22: _, 24: A, 25: H, 26: P, 27: I, 28: d, 29: C, 32: 25, 33: w, 35: Y, 37: G, 38: N, 42: O, 45: it, 48: rt, 49: at, 50: nt, 51: ot, 54: q }, t(f, [2, 20], { 20: [1, 69] }), { 31: [1, 70] }, { 24: [1, 71] }, t(f, [2, 32]), t(f, [2, 33]), t(f, [2, 34]), t(f, [2, 35]), t(lt, [2, 44]), t(lt, [2, 45]), t(f, [2, 15]), t(f, [2, 19]), t(Gt, r, { 7: 72 }), t(f, [2, 26]), t(f, [2, 27]), { 4: h, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: g, 17: u, 19: m, 21: [1, 73], 22: _, 24: A, 25: H, 26: P, 27: I, 28: d, 29: C, 32: 25, 33: w, 35: Y, 37: G, 38: N, 42: O, 45: it, 48: rt, 49: at, 50: nt, 51: ot, 54: q }, t(f, [2, 21])],
    defaultActions: { 5: [2, 1], 6: [2, 2], 46: [2, 46], 47: [2, 47] },
    parseError: /* @__PURE__ */ i(function(L, a) {
      if (a.recoverable)
        this.trace(L);
      else {
        var n = new Error(L);
        throw n.hash = a, n;
      }
    }, "parseError"),
    parse: /* @__PURE__ */ i(function(L) {
      var a = this, n = [0], y = [], S = [null], s = [], T = this.table, c = "", z = 0, J = 0, ht = 2, X = 1, xt = s.slice.call(arguments, 1), b = Object.create(this.lexer), j = { yy: {} };
      for (var $t in this.yy)
        Object.prototype.hasOwnProperty.call(this.yy, $t) && (j.yy[$t] = this.yy[$t]);
      b.setInput(L, j.yy), j.yy.lexer = b, j.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
      var Dt = b.yylloc;
      s.push(Dt);
      var Te = b.options && b.options.ranges;
      typeof j.yy.parseError == "function" ? this.parseError = j.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
      function Ee($) {
        n.length = n.length - 2 * $, S.length = S.length - $, s.length = s.length - $;
      }
      i(Ee, "popStack");
      function zt() {
        var $;
        return $ = y.pop() || b.lex() || X, typeof $ != "number" && ($ instanceof Array && (y = $, $ = y.pop()), $ = a.symbols_[$] || $), $;
      }
      i(zt, "lex");
      for (var E, U, D, vt, W = {}, ut, R, jt, dt; ; ) {
        if (U = n[n.length - 1], this.defaultActions[U] ? D = this.defaultActions[U] : ((E === null || typeof E > "u") && (E = zt()), D = T[U] && T[U][E]), typeof D > "u" || !D.length || !D[0]) {
          var Ct = "";
          dt = [];
          for (ut in T[U])
            this.terminals_[ut] && ut > ht && dt.push("'" + this.terminals_[ut] + "'");
          b.showPosition ? Ct = "Parse error on line " + (z + 1) + `:
` + b.showPosition() + `
Expecting ` + dt.join(", ") + ", got '" + (this.terminals_[E] || E) + "'" : Ct = "Parse error on line " + (z + 1) + ": Unexpected " + (E == X ? "end of input" : "'" + (this.terminals_[E] || E) + "'"), this.parseError(Ct, {
            text: b.match,
            token: this.terminals_[E] || E,
            line: b.yylineno,
            loc: Dt,
            expected: dt
          });
        }
        if (D[0] instanceof Array && D.length > 1)
          throw new Error("Parse Error: multiple actions possible at state: " + U + ", token: " + E);
        switch (D[0]) {
          case 1:
            n.push(E), S.push(b.yytext), s.push(b.yylloc), n.push(D[1]), E = null, J = b.yyleng, c = b.yytext, z = b.yylineno, Dt = b.yylloc;
            break;
          case 2:
            if (R = this.productions_[D[1]][1], W.$ = S[S.length - R], W._$ = {
              first_line: s[s.length - (R || 1)].first_line,
              last_line: s[s.length - 1].last_line,
              first_column: s[s.length - (R || 1)].first_column,
              last_column: s[s.length - 1].last_column
            }, Te && (W._$.range = [
              s[s.length - (R || 1)].range[0],
              s[s.length - 1].range[1]
            ]), vt = this.performAction.apply(W, [
              c,
              J,
              z,
              j.yy,
              D[1],
              S,
              s
            ].concat(xt)), typeof vt < "u")
              return vt;
            R && (n = n.slice(0, -1 * R * 2), S = S.slice(0, -1 * R), s = s.slice(0, -1 * R)), n.push(this.productions_[D[1]][0]), S.push(W.$), s.push(W._$), jt = T[n[n.length - 2]][n[n.length - 1]], n.push(jt);
            break;
          case 3:
            return !0;
        }
      }
      return !0;
    }, "parse")
  }, ke = /* @__PURE__ */ function() {
    var L = {
      EOF: 1,
      parseError: /* @__PURE__ */ i(function(a, n) {
        if (this.yy.parser)
          this.yy.parser.parseError(a, n);
        else
          throw new Error(a);
      }, "parseError"),
      // resets the lexer, sets new input
      setInput: /* @__PURE__ */ i(function(a, n) {
        return this.yy = n || this.yy || {}, this._input = a, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
          first_line: 1,
          first_column: 0,
          last_line: 1,
          last_column: 0
        }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
      }, "setInput"),
      // consumes and returns one char from the input
      input: /* @__PURE__ */ i(function() {
        var a = this._input[0];
        this.yytext += a, this.yyleng++, this.offset++, this.match += a, this.matched += a;
        var n = a.match(/(?:\r\n?|\n).*/g);
        return n ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), a;
      }, "input"),
      // unshifts one char (or a string) into the input
      unput: /* @__PURE__ */ i(function(a) {
        var n = a.length, y = a.split(/(?:\r\n?|\n)/g);
        this._input = a + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - n), this.offset -= n;
        var S = this.match.split(/(?:\r\n?|\n)/g);
        this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), y.length - 1 && (this.yylineno -= y.length - 1);
        var s = this.yylloc.range;
        return this.yylloc = {
          first_line: this.yylloc.first_line,
          last_line: this.yylineno + 1,
          first_column: this.yylloc.first_column,
          last_column: y ? (y.length === S.length ? this.yylloc.first_column : 0) + S[S.length - y.length].length - y[0].length : this.yylloc.first_column - n
        }, this.options.ranges && (this.yylloc.range = [s[0], s[0] + this.yyleng - n]), this.yyleng = this.yytext.length, this;
      }, "unput"),
      // When called from action, caches matched text and appends it on next action
      more: /* @__PURE__ */ i(function() {
        return this._more = !0, this;
      }, "more"),
      // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
      reject: /* @__PURE__ */ i(function() {
        if (this.options.backtrack_lexer)
          this._backtrack = !0;
        else
          return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
` + this.showPosition(), {
            text: "",
            token: null,
            line: this.yylineno
          });
        return this;
      }, "reject"),
      // retain first n characters of the match
      less: /* @__PURE__ */ i(function(a) {
        this.unput(this.match.slice(a));
      }, "less"),
      // displays already matched input, i.e. for error messages
      pastInput: /* @__PURE__ */ i(function() {
        var a = this.matched.substr(0, this.matched.length - this.match.length);
        return (a.length > 20 ? "..." : "") + a.substr(-20).replace(/\n/g, "");
      }, "pastInput"),
      // displays upcoming input, i.e. for error messages
      upcomingInput: /* @__PURE__ */ i(function() {
        var a = this.match;
        return a.length < 20 && (a += this._input.substr(0, 20 - a.length)), (a.substr(0, 20) + (a.length > 20 ? "..." : "")).replace(/\n/g, "");
      }, "upcomingInput"),
      // displays the character position where the lexing error occurred, i.e. for error messages
      showPosition: /* @__PURE__ */ i(function() {
        var a = this.pastInput(), n = new Array(a.length + 1).join("-");
        return a + this.upcomingInput() + `
` + n + "^";
      }, "showPosition"),
      // test the lexed token: return FALSE when not a match, otherwise return token
      test_match: /* @__PURE__ */ i(function(a, n) {
        var y, S, s;
        if (this.options.backtrack_lexer && (s = {
          yylineno: this.yylineno,
          yylloc: {
            first_line: this.yylloc.first_line,
            last_line: this.last_line,
            first_column: this.yylloc.first_column,
            last_column: this.yylloc.last_column
          },
          yytext: this.yytext,
          match: this.match,
          matches: this.matches,
          matched: this.matched,
          yyleng: this.yyleng,
          offset: this.offset,
          _more: this._more,
          _input: this._input,
          yy: this.yy,
          conditionStack: this.conditionStack.slice(0),
          done: this.done
        }, this.options.ranges && (s.yylloc.range = this.yylloc.range.slice(0))), S = a[0].match(/(?:\r\n?|\n).*/g), S && (this.yylineno += S.length), this.yylloc = {
          first_line: this.yylloc.last_line,
          last_line: this.yylineno + 1,
          first_column: this.yylloc.last_column,
          last_column: S ? S[S.length - 1].length - S[S.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + a[0].length
        }, this.yytext += a[0], this.match += a[0], this.matches = a, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(a[0].length), this.matched += a[0], y = this.performAction.call(this, this.yy, this, n, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), y)
          return y;
        if (this._backtrack) {
          for (var T in s)
            this[T] = s[T];
          return !1;
        }
        return !1;
      }, "test_match"),
      // return next match in input
      next: /* @__PURE__ */ i(function() {
        if (this.done)
          return this.EOF;
        this._input || (this.done = !0);
        var a, n, y, S;
        this._more || (this.yytext = "", this.match = "");
        for (var s = this._currentRules(), T = 0; T < s.length; T++)
          if (y = this._input.match(this.rules[s[T]]), y && (!n || y[0].length > n[0].length)) {
            if (n = y, S = T, this.options.backtrack_lexer) {
              if (a = this.test_match(y, s[T]), a !== !1)
                return a;
              if (this._backtrack) {
                n = !1;
                continue;
              } else
                return !1;
            } else if (!this.options.flex)
              break;
          }
        return n ? (a = this.test_match(n, s[S]), a !== !1 ? a : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), {
          text: "",
          token: null,
          line: this.yylineno
        });
      }, "next"),
      // return next match that has a token
      lex: /* @__PURE__ */ i(function() {
        var a = this.next();
        return a || this.lex();
      }, "lex"),
      // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
      begin: /* @__PURE__ */ i(function(a) {
        this.conditionStack.push(a);
      }, "begin"),
      // pop the previously active lexer condition state off the condition stack
      popState: /* @__PURE__ */ i(function() {
        var a = this.conditionStack.length - 1;
        return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
      }, "popState"),
      // produce the lexer rule set which is active for the currently active lexer condition state
      _currentRules: /* @__PURE__ */ i(function() {
        return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
      }, "_currentRules"),
      // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
      topState: /* @__PURE__ */ i(function(a) {
        return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
      }, "topState"),
      // alias for begin(condition)
      pushState: /* @__PURE__ */ i(function(a) {
        this.begin(a);
      }, "pushState"),
      // return the number of states currently on the stack
      stateStackSize: /* @__PURE__ */ i(function() {
        return this.conditionStack.length;
      }, "stateStackSize"),
      options: { "case-insensitive": !0 },
      performAction: /* @__PURE__ */ i(function(a, n, y, S) {
        switch (y) {
          case 0:
            return 41;
          case 1:
            return 48;
          case 2:
            return 49;
          case 3:
            return 50;
          case 4:
            return 51;
          case 5:
            break;
          case 6:
            break;
          case 7:
            return 5;
          case 8:
            break;
          case 9:
            break;
          case 10:
            break;
          case 11:
            break;
          case 12:
            return this.pushState("SCALE"), 17;
          case 13:
            return 18;
          case 14:
            this.popState();
            break;
          case 15:
            return this.begin("acc_title"), 33;
          case 16:
            return this.popState(), "acc_title_value";
          case 17:
            return this.begin("acc_descr"), 35;
          case 18:
            return this.popState(), "acc_descr_value";
          case 19:
            this.begin("acc_descr_multiline");
            break;
          case 20:
            this.popState();
            break;
          case 21:
            return "acc_descr_multiline_value";
          case 22:
            return this.pushState("CLASSDEF"), 38;
          case 23:
            return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
          case 24:
            return this.popState(), this.pushState("CLASSDEFID"), 39;
          case 25:
            return this.popState(), 40;
          case 26:
            return this.pushState("CLASS"), 45;
          case 27:
            return this.popState(), this.pushState("CLASS_STYLE"), 46;
          case 28:
            return this.popState(), 47;
          case 29:
            return this.pushState("STYLE"), 42;
          case 30:
            return this.popState(), this.pushState("STYLEDEF_STYLES"), 43;
          case 31:
            return this.popState(), 44;
          case 32:
            return this.pushState("SCALE"), 17;
          case 33:
            return 18;
          case 34:
            this.popState();
            break;
          case 35:
            this.pushState("STATE");
            break;
          case 36:
            return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25;
          case 37:
            return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26;
          case 38:
            return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27;
          case 39:
            return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25;
          case 40:
            return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26;
          case 41:
            return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27;
          case 42:
            return 48;
          case 43:
            return 49;
          case 44:
            return 50;
          case 45:
            return 51;
          case 46:
            this.pushState("STATE_STRING");
            break;
          case 47:
            return this.pushState("STATE_ID"), "AS";
          case 48:
            return this.popState(), "ID";
          case 49:
            this.popState();
            break;
          case 50:
            return "STATE_DESCR";
          case 51:
            return 19;
          case 52:
            this.popState();
            break;
          case 53:
            return this.popState(), this.pushState("struct"), 20;
          case 54:
            break;
          case 55:
            return this.popState(), 21;
          case 56:
            break;
          case 57:
            return this.begin("NOTE"), 29;
          case 58:
            return this.popState(), this.pushState("NOTE_ID"), 56;
          case 59:
            return this.popState(), this.pushState("NOTE_ID"), 57;
          case 60:
            this.popState(), this.pushState("FLOATING_NOTE");
            break;
          case 61:
            return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
          case 62:
            break;
          case 63:
            return "NOTE_TEXT";
          case 64:
            return this.popState(), "ID";
          case 65:
            return this.popState(), this.pushState("NOTE_TEXT"), 24;
          case 66:
            return this.popState(), n.yytext = n.yytext.substr(2).trim(), 31;
          case 67:
            return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 31;
          case 68:
            return 6;
          case 69:
            return 6;
          case 70:
            return 16;
          case 71:
            return 54;
          case 72:
            return 24;
          case 73:
            return n.yytext = n.yytext.trim(), 14;
          case 74:
            return 15;
          case 75:
            return 28;
          case 76:
            return 55;
          case 77:
            return 5;
          case 78:
            return "INVALID";
        }
      }, "anonymous"),
      rules: [/^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:classDef\s+)/i, /^(?:DEFAULT\s+)/i, /^(?:\w+\s+)/i, /^(?:[^\n]*)/i, /^(?:class\s+)/i, /^(?:(\w+)+((,\s*\w+)*))/i, /^(?:[^\n]*)/i, /^(?:style\s+)/i, /^(?:[\w,]+\s+)/i, /^(?:[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:state\s+)/i, /^(?:.*<<fork>>)/i, /^(?:.*<<join>>)/i, /^(?:.*<<choice>>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i],
      conditions: { LINE: { rules: [9, 10], inclusive: !1 }, struct: { rules: [9, 10, 22, 26, 29, 35, 42, 43, 44, 45, 54, 55, 56, 57, 71, 72, 73, 74, 75], inclusive: !1 }, FLOATING_NOTE_ID: { rules: [64], inclusive: !1 }, FLOATING_NOTE: { rules: [61, 62, 63], inclusive: !1 }, NOTE_TEXT: { rules: [66, 67], inclusive: !1 }, NOTE_ID: { rules: [65], inclusive: !1 }, NOTE: { rules: [58, 59, 60], inclusive: !1 }, STYLEDEF_STYLEOPTS: { rules: [], inclusive: !1 }, STYLEDEF_STYLES: { rules: [31], inclusive: !1 }, STYLE_IDS: { rules: [], inclusive: !1 }, STYLE: { rules: [30], inclusive: !1 }, CLASS_STYLE: { rules: [28], inclusive: !1 }, CLASS: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [25], inclusive: !1 }, CLASSDEF: { rules: [23, 24], inclusive: !1 }, acc_descr_multiline: { rules: [20, 21], inclusive: !1 }, acc_descr: { rules: [18], inclusive: !1 }, acc_title: { rules: [16], inclusive: !1 }, SCALE: { rules: [13, 14, 33, 34], inclusive: !1 }, ALIAS: { rules: [], inclusive: !1 }, STATE_ID: { rules: [48], inclusive: !1 }, STATE_STRING: { rules: [49, 50], inclusive: !1 }, FORK_STATE: { rules: [], inclusive: !1 }, STATE: { rules: [9, 10, 36, 37, 38, 39, 40, 41, 46, 47, 51, 52, 53], inclusive: !1 }, ID: { rules: [9, 10], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 15, 17, 19, 22, 26, 29, 32, 35, 53, 57, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78], inclusive: !0 } }
    };
    return L;
  }();
  Et.lexer = ke;
  function ct() {
    this.yy = {};
  }
  return i(ct, "Parser"), ct.prototype = Et, Et.Parser = ct, new ct();
}();
It.parser = It;
var vs = It, Be = "LR", qt = "TB", St = "state", Rt = "relation", Fe = "classDef", Pe = "style", Ye = "applyClass", et = "default", Xt = "divider", Qt = "fill:none", Zt = "fill: #333", te = "c", ee = "text", se = "normal", Lt = "rect", At = "rectWithTitle", Ge = "stateStart", ze = "stateEnd", Ut = "divider", Mt = "roundedWithTitle", je = "note", Ue = "noteGroup", st = "statediagram", Me = "state", Ve = `${st}-${Me}`, ie = "transition", He = "note", Je = "note-edge", We = `${ie} ${Je}`, Ke = `${st}-${He}`, qe = "cluster", Xe = `${st}-${qe}`, Qe = "cluster-alt", Ze = `${st}-${Qe}`, re = "parent", ae = "note", ts = "state", Nt = "----", es = `${Nt}${ae}`, Vt = `${Nt}${re}`, ne = /* @__PURE__ */ i((t, e = qt) => {
  if (!t.doc)
    return e;
  let l = e;
  for (const o of t.doc)
    o.stmt === "dir" && (l = o.value);
  return l;
}, "getDir"), ss = /* @__PURE__ */ i(function(t, e) {
  return e.db.extract(e.db.getRootDocV2()), e.db.getClasses();
}, "getClasses"), is = /* @__PURE__ */ i(async function(t, e, l, o) {
  k.info("REF0:"), k.info("Drawing state diagram (v2)", e);
  const { securityLevel: r, state: h, layout: p } = v();
  o.db.extract(o.db.getRootDocV2());
  const g = o.db.getData(), u = xe(e, r);
  g.type = o.type, g.layoutAlgorithm = p, g.nodeSpacing = (h == null ? void 0 : h.nodeSpacing) || 50, g.rankSpacing = (h == null ? void 0 : h.rankSpacing) || 50, g.markers = ["barb"], g.diagramId = e, await we(g, u), Re.insertTitle(
    u,
    "statediagramTitleText",
    (h == null ? void 0 : h.titleTopMargin) ?? 25,
    o.db.getDiagramTitle()
  ), $e(u, 8, st, (h == null ? void 0 : h.useMaxWidth) ?? !0);
}, "draw"), Cs = {
  getClasses: ss,
  draw: is,
  getDir: ne
}, yt = /* @__PURE__ */ new Map(), B = 0;
function ft(t = "", e = 0, l = "", o = Nt) {
  const r = l !== null && l.length > 0 ? `${o}${l}` : "";
  return `${ts}-${t}${r}-${e}`;
}
i(ft, "stateDomId");
var rs = /* @__PURE__ */ i((t, e, l, o, r, h, p, g) => {
  k.trace("items", e), e.forEach((u) => {
    switch (u.stmt) {
      case St:
        Z(t, u, l, o, r, h, p, g);
        break;
      case et:
        Z(t, u, l, o, r, h, p, g);
        break;
      case Rt:
        {
          Z(
            t,
            u.state1,
            l,
            o,
            r,
            h,
            p,
            g
          ), Z(
            t,
            u.state2,
            l,
            o,
            r,
            h,
            p,
            g
          );
          const m = {
            id: "edge" + B,
            start: u.state1.id,
            end: u.state2.id,
            arrowhead: "normal",
            arrowTypeEnd: "arrow_barb",
            style: Qt,
            labelStyle: "",
            label: M.sanitizeText(u.description, v()),
            arrowheadStyle: Zt,
            labelpos: te,
            labelType: ee,
            thickness: se,
            classes: ie,
            look: p
          };
          r.push(m), B++;
        }
        break;
    }
  });
}, "setupDoc"), Ht = /* @__PURE__ */ i((t, e = qt) => {
  let l = e;
  if (t.doc)
    for (const o of t.doc)
      o.stmt === "dir" && (l = o.value);
  return l;
}, "getDir");
function Q(t, e, l) {
  if (!e.id || e.id === "</join></fork>" || e.id === "</choice>")
    return;
  e.cssClasses && (Array.isArray(e.cssCompiledStyles) || (e.cssCompiledStyles = []), e.cssClasses.split(" ").forEach((r) => {
    if (l.get(r)) {
      const h = l.get(r);
      e.cssCompiledStyles = [...e.cssCompiledStyles, ...h.styles];
    }
  }));
  const o = t.find((r) => r.id === e.id);
  o ? Object.assign(o, e) : t.push(e);
}
i(Q, "insertOrUpdateNode");
function oe(t) {
  var e;
  return ((e = t == null ? void 0 : t.classes) == null ? void 0 : e.join(" ")) ?? "";
}
i(oe, "getClassesFromDbInfo");
function le(t) {
  return (t == null ? void 0 : t.styles) ?? [];
}
i(le, "getStylesFromDbInfo");
var Z = /* @__PURE__ */ i((t, e, l, o, r, h, p, g) => {
  var u, m;
  const _ = e.id, A = l.get(_), H = oe(A), P = le(A);
  if (k.info("dataFetcher parsedItem", e, A, P), _ !== "root") {
    let I = Lt;
    e.start === !0 ? I = Ge : e.start === !1 && (I = ze), e.type !== et && (I = e.type), yt.get(_) || yt.set(_, {
      id: _,
      shape: I,
      description: M.sanitizeText(_, v()),
      cssClasses: `${H} ${Ve}`,
      cssStyles: P
    });
    const d = yt.get(_);
    e.description && (Array.isArray(d.description) ? (d.shape = At, d.description.push(e.description)) : ((u = d.description) == null ? void 0 : u.length) > 0 ? (d.shape = At, d.description === _ ? d.description = [e.description] : d.description = [d.description, e.description]) : (d.shape = Lt, d.description = e.description), d.description = M.sanitizeTextOrArray(d.description, v())), ((m = d.description) == null ? void 0 : m.length) === 1 && d.shape === At && (d.type === "group" ? d.shape = Mt : d.shape = Lt), !d.type && e.doc && (k.info("Setting cluster for XCX", _, Ht(e)), d.type = "group", d.isGroup = !0, d.dir = Ht(e), d.shape = e.type === Xt ? Ut : Mt, d.cssClasses = `${d.cssClasses} ${Xe} ${h ? Ze : ""}`);
    const C = {
      labelStyle: "",
      shape: d.shape,
      label: d.description,
      cssClasses: d.cssClasses,
      cssCompiledStyles: [],
      cssStyles: d.cssStyles,
      id: _,
      dir: d.dir,
      domId: ft(_, B),
      type: d.type,
      isGroup: d.type === "group",
      padding: 8,
      rx: 10,
      ry: 10,
      look: p
    };
    if (C.shape === Ut && (C.label = ""), t && t.id !== "root" && (k.trace("Setting node ", _, " to be child of its parent ", t.id), C.parentId = t.id), C.centerLabel = !0, e.note) {
      const w = {
        labelStyle: "",
        shape: je,
        label: e.note.text,
        cssClasses: Ke,
        // useHtmlLabels: false,
        cssStyles: [],
        cssCompilesStyles: [],
        id: _ + es + "-" + B,
        domId: ft(_, B, ae),
        type: d.type,
        isGroup: d.type === "group",
        padding: v().flowchart.padding,
        look: p,
        position: e.note.position
      }, Y = _ + Vt, G = {
        labelStyle: "",
        shape: Ue,
        label: e.note.text,
        cssClasses: d.cssClasses,
        cssStyles: [],
        id: _ + Vt,
        domId: ft(_, B, re),
        type: "group",
        isGroup: !0,
        padding: 16,
        //getConfig().flowchart.padding
        look: p,
        position: e.note.position
      };
      B++, G.id = Y, w.parentId = Y, Q(o, G, g), Q(o, w, g), Q(o, C, g);
      let N = _, O = w.id;
      e.note.position === "left of" && (N = w.id, O = _), r.push({
        id: N + "-" + O,
        start: N,
        end: O,
        arrowhead: "none",
        arrowTypeEnd: "",
        style: Qt,
        labelStyle: "",
        classes: We,
        arrowheadStyle: Zt,
        labelpos: te,
        labelType: ee,
        thickness: se,
        look: p
      });
    } else
      Q(o, C, g);
  }
  e.doc && (k.trace("Adding nodes children "), rs(e, e.doc, l, o, r, !h, p, g));
}, "dataFetcher"), as = /* @__PURE__ */ i(() => {
  yt.clear(), B = 0;
}, "reset"), Ot = "[*]", ce = "start", he = Ot, ue = "end", Jt = "color", Wt = "fill", ns = "bgFill", os = ",";
function Bt() {
  return /* @__PURE__ */ new Map();
}
i(Bt, "newClassesList");
var mt = [], Ft = [], de = Be, _t = [], K = Bt(), pe = /* @__PURE__ */ i(() => ({
  /** @type {{ id1: string, id2: string, relationTitle: string }[]} */
  relations: [],
  states: /* @__PURE__ */ new Map(),
  documents: {}
}), "newDoc"), bt = {
  root: pe()
}, x = bt.root, tt = 0, Kt = 0, ls = {
  LINE: 0,
  DOTTED_LINE: 1
}, cs = {
  AGGREGATION: 0,
  EXTENSION: 1,
  COMPOSITION: 2,
  DEPENDENCY: 3
}, pt = /* @__PURE__ */ i((t) => JSON.parse(JSON.stringify(t)), "clone"), hs = /* @__PURE__ */ i((t) => {
  k.info("Setting root doc", t), _t = t;
}, "setRootDoc"), us = /* @__PURE__ */ i(() => _t, "getRootDoc"), gt = /* @__PURE__ */ i((t, e, l) => {
  if (e.stmt === Rt)
    gt(t, e.state1, !0), gt(t, e.state2, !1);
  else if (e.stmt === St && (e.id === "[*]" ? (e.id = l ? t.id + "_start" : t.id + "_end", e.start = l) : e.id = e.id.trim()), e.doc) {
    const o = [];
    let r = [], h;
    for (h = 0; h < e.doc.length; h++)
      if (e.doc[h].type === Xt) {
        const p = pt(e.doc[h]);
        p.doc = pt(r), o.push(p), r = [];
      } else
        r.push(e.doc[h]);
    if (o.length > 0 && r.length > 0) {
      const p = {
        stmt: St,
        id: Oe(),
        type: "divider",
        doc: pt(r)
      };
      o.push(pt(p)), e.doc = o;
    }
    e.doc.forEach((p) => gt(e, p, !0));
  }
}, "docTranslator"), Pt = /* @__PURE__ */ i(() => (gt({ id: "root" }, { id: "root", doc: _t }, !0), { id: "root", doc: _t }), "getRootDocV2"), ds = /* @__PURE__ */ i((t) => {
  let e;
  t.doc ? e = t.doc : e = t, k.info(e), ye(!0), k.info("Extract initial document:", e), e.forEach((r) => {
    switch (k.warn("Statement", r.stmt), r.stmt) {
      case St:
        F(
          r.id.trim(),
          r.type,
          r.doc,
          r.description,
          r.note,
          r.classes,
          r.styles,
          r.textStyles
        );
        break;
      case Rt:
        _e(r.state1, r.state2, r.description);
        break;
      case Fe:
        be(r.id.trim(), r.classes);
        break;
      case Pe:
        {
          const h = r.id.trim().split(","), p = r.styleClass.split(",");
          h.forEach((g) => {
            let u = V(g);
            if (u === void 0) {
              const m = g.trim();
              F(m), u = V(m);
            }
            u.styles = p.map((m) => {
              var _;
              return (_ = m.replace(/;/g, "")) == null ? void 0 : _.trim();
            });
          });
        }
        break;
      case Ye:
        Yt(r.id.trim(), r.styleClass);
        break;
    }
  });
  const l = fe(), o = v().look;
  as(), Z(void 0, Pt(), l, mt, Ft, !0, o, K), mt.forEach((r) => {
    if (Array.isArray(r.label)) {
      if (r.description = r.label.slice(1), r.isGroup && r.description.length > 0)
        throw new Error(
          "Group nodes can only have label. Remove the additional description for node [" + r.id + "]"
        );
      r.label = r.label[0];
    }
  });
}, "extract"), F = /* @__PURE__ */ i(function(t, e = et, l = null, o = null, r = null, h = null, p = null, g = null) {
  const u = t == null ? void 0 : t.trim();
  if (x.states.has(u) ? (x.states.get(u).doc || (x.states.get(u).doc = l), x.states.get(u).type || (x.states.get(u).type = e)) : (k.info("Adding state ", u, o), x.states.set(u, {
    id: u,
    descriptions: [],
    type: e,
    doc: l,
    note: r,
    classes: [],
    styles: [],
    textStyles: []
  })), o && (k.info("Setting state description", u, o), typeof o == "string" && wt(u, o.trim()), typeof o == "object" && o.forEach((m) => wt(u, m.trim()))), r) {
    const m = x.states.get(u);
    m.note = r, m.note.text = M.sanitizeText(m.note.text, v());
  }
  h && (k.info("Setting state classes", u, h), (typeof h == "string" ? [h] : h).forEach((m) => Yt(u, m.trim()))), p && (k.info("Setting state styles", u, p), (typeof p == "string" ? [p] : p).forEach((m) => ms(u, m.trim()))), g && (k.info("Setting state styles", u, p), (typeof g == "string" ? [g] : g).forEach((m) => _s(u, m.trim())));
}, "addState"), ye = /* @__PURE__ */ i(function(t) {
  mt = [], Ft = [], bt = {
    root: pe()
  }, x = bt.root, tt = 0, K = Bt(), t || Ne();
}, "clear"), V = /* @__PURE__ */ i(function(t) {
  return x.states.get(t);
}, "getState"), fe = /* @__PURE__ */ i(function() {
  return x.states;
}, "getStates"), ps = /* @__PURE__ */ i(function() {
  k.info("Documents = ", bt);
}, "logDocuments"), ys = /* @__PURE__ */ i(function() {
  return x.relations;
}, "getRelations");
function kt(t = "") {
  let e = t;
  return t === Ot && (tt++, e = `${ce}${tt}`), e;
}
i(kt, "startIdIfNeeded");
function Tt(t = "", e = et) {
  return t === Ot ? ce : e;
}
i(Tt, "startTypeIfNeeded");
function ge(t = "") {
  let e = t;
  return t === he && (tt++, e = `${ue}${tt}`), e;
}
i(ge, "endIdIfNeeded");
function Se(t = "", e = et) {
  return t === he ? ue : e;
}
i(Se, "endTypeIfNeeded");
function me(t, e, l) {
  let o = kt(t.id.trim()), r = Tt(t.id.trim(), t.type), h = kt(e.id.trim()), p = Tt(e.id.trim(), e.type);
  F(
    o,
    r,
    t.doc,
    t.description,
    t.note,
    t.classes,
    t.styles,
    t.textStyles
  ), F(
    h,
    p,
    e.doc,
    e.description,
    e.note,
    e.classes,
    e.styles,
    e.textStyles
  ), x.relations.push({
    id1: o,
    id2: h,
    relationTitle: M.sanitizeText(l, v())
  });
}
i(me, "addRelationObjs");
var _e = /* @__PURE__ */ i(function(t, e, l) {
  if (typeof t == "object")
    me(t, e, l);
  else {
    const o = kt(t.trim()), r = Tt(t), h = ge(e.trim()), p = Se(e);
    F(o, r), F(h, p), x.relations.push({
      id1: o,
      id2: h,
      title: M.sanitizeText(l, v())
    });
  }
}, "addRelation"), wt = /* @__PURE__ */ i(function(t, e) {
  const l = x.states.get(t), o = e.startsWith(":") ? e.replace(":", "").trim() : e;
  l.descriptions.push(M.sanitizeText(o, v()));
}, "addDescription"), fs = /* @__PURE__ */ i(function(t) {
  return t.substring(0, 1) === ":" ? t.substr(2).trim() : t.trim();
}, "cleanupLabel"), gs = /* @__PURE__ */ i(() => (Kt++, "divider-id-" + Kt), "getDividerId"), be = /* @__PURE__ */ i(function(t, e = "") {
  K.has(t) || K.set(t, { id: t, styles: [], textStyles: [] });
  const l = K.get(t);
  e != null && e.split(os).forEach((o) => {
    const r = o.replace(/([^;]*);/, "$1").trim();
    if (RegExp(Jt).exec(o)) {
      const h = r.replace(Wt, ns).replace(Jt, Wt);
      l.textStyles.push(h);
    }
    l.styles.push(r);
  });
}, "addStyleClass"), Ss = /* @__PURE__ */ i(function() {
  return K;
}, "getClasses"), Yt = /* @__PURE__ */ i(function(t, e) {
  t.split(",").forEach(function(l) {
    let o = V(l);
    if (o === void 0) {
      const r = l.trim();
      F(r), o = V(r);
    }
    o.classes.push(e);
  });
}, "setCssClass"), ms = /* @__PURE__ */ i(function(t, e) {
  const l = V(t);
  l !== void 0 && l.styles.push(e);
}, "setStyle"), _s = /* @__PURE__ */ i(function(t, e) {
  const l = V(t);
  l !== void 0 && l.textStyles.push(e);
}, "setTextStyle"), bs = /* @__PURE__ */ i(() => de, "getDirection"), ks = /* @__PURE__ */ i((t) => {
  de = t;
}, "setDirection"), Ts = /* @__PURE__ */ i((t) => t && t[0] === ":" ? t.substr(1).trim() : t.trim(), "trimColon"), Es = /* @__PURE__ */ i(() => {
  const t = v();
  return { nodes: mt, edges: Ft, other: {}, config: t, direction: ne(Pt()) };
}, "getData"), Ls = {
  getConfig: /* @__PURE__ */ i(() => v().state, "getConfig"),
  getData: Es,
  addState: F,
  clear: ye,
  getState: V,
  getStates: fe,
  getRelations: ys,
  getClasses: Ss,
  getDirection: bs,
  addRelation: _e,
  getDividerId: gs,
  setDirection: ks,
  cleanupLabel: fs,
  lineType: ls,
  relationType: cs,
  logDocuments: ps,
  getRootDoc: us,
  setRootDoc: hs,
  getRootDocV2: Pt,
  extract: ds,
  trimColon: Ts,
  getAccTitle: Ie,
  setAccTitle: Ae,
  getAccDescription: Le,
  setAccDescription: Ce,
  addStyleClass: be,
  setCssClass: Yt,
  addDescription: wt,
  setDiagramTitle: ve,
  getDiagramTitle: De
}, xs = /* @__PURE__ */ i((t) => `
defs #statediagram-barbEnd {
    fill: ${t.transitionColor};
    stroke: ${t.transitionColor};
  }
g.stateGroup text {
  fill: ${t.nodeBorder};
  stroke: none;
  font-size: 10px;
}
g.stateGroup text {
  fill: ${t.textColor};
  stroke: none;
  font-size: 10px;

}
g.stateGroup .state-title {
  font-weight: bolder;
  fill: ${t.stateLabelColor};
}

g.stateGroup rect {
  fill: ${t.mainBkg};
  stroke: ${t.nodeBorder};
}

g.stateGroup line {
  stroke: ${t.lineColor};
  stroke-width: 1;
}

.transition {
  stroke: ${t.transitionColor};
  stroke-width: 1;
  fill: none;
}

.stateGroup .composit {
  fill: ${t.background};
  border-bottom: 1px
}

.stateGroup .alt-composit {
  fill: #e0e0e0;
  border-bottom: 1px
}

.state-note {
  stroke: ${t.noteBorderColor};
  fill: ${t.noteBkgColor};

  text {
    fill: ${t.noteTextColor};
    stroke: none;
    font-size: 10px;
  }
}

.stateLabel .box {
  stroke: none;
  stroke-width: 0;
  fill: ${t.mainBkg};
  opacity: 0.5;
}

.edgeLabel .label rect {
  fill: ${t.labelBackgroundColor};
  opacity: 0.5;
}
.edgeLabel {
  background-color: ${t.edgeLabelBackground};
  p {
    background-color: ${t.edgeLabelBackground};
  }
  rect {
    opacity: 0.5;
    background-color: ${t.edgeLabelBackground};
    fill: ${t.edgeLabelBackground};
  }
  text-align: center;
}
.edgeLabel .label text {
  fill: ${t.transitionLabelColor || t.tertiaryTextColor};
}
.label div .edgeLabel {
  color: ${t.transitionLabelColor || t.tertiaryTextColor};
}

.stateLabel text {
  fill: ${t.stateLabelColor};
  font-size: 10px;
  font-weight: bold;
}

.node circle.state-start {
  fill: ${t.specialStateColor};
  stroke: ${t.specialStateColor};
}

.node .fork-join {
  fill: ${t.specialStateColor};
  stroke: ${t.specialStateColor};
}

.node circle.state-end {
  fill: ${t.innerEndBackground};
  stroke: ${t.background};
  stroke-width: 1.5
}
.end-state-inner {
  fill: ${t.compositeBackground || t.background};
  // stroke: ${t.background};
  stroke-width: 1.5
}

.node rect {
  fill: ${t.stateBkg || t.mainBkg};
  stroke: ${t.stateBorder || t.nodeBorder};
  stroke-width: 1px;
}
.node polygon {
  fill: ${t.mainBkg};
  stroke: ${t.stateBorder || t.nodeBorder};;
  stroke-width: 1px;
}
#statediagram-barbEnd {
  fill: ${t.lineColor};
}

.statediagram-cluster rect {
  fill: ${t.compositeTitleBackground};
  stroke: ${t.stateBorder || t.nodeBorder};
  stroke-width: 1px;
}

.cluster-label, .nodeLabel {
  color: ${t.stateLabelColor};
  // line-height: 1;
}

.statediagram-cluster rect.outer {
  rx: 5px;
  ry: 5px;
}
.statediagram-state .divider {
  stroke: ${t.stateBorder || t.nodeBorder};
}

.statediagram-state .title-state {
  rx: 5px;
  ry: 5px;
}
.statediagram-cluster.statediagram-cluster .inner {
  fill: ${t.compositeBackground || t.background};
}
.statediagram-cluster.statediagram-cluster-alt .inner {
  fill: ${t.altBackground ? t.altBackground : "#efefef"};
}

.statediagram-cluster .inner {
  rx:0;
  ry:0;
}

.statediagram-state rect.basic {
  rx: 5px;
  ry: 5px;
}
.statediagram-state rect.divider {
  stroke-dasharray: 10,10;
  fill: ${t.altBackground ? t.altBackground : "#efefef"};
}

.note-edge {
  stroke-dasharray: 5;
}

.statediagram-note rect {
  fill: ${t.noteBkgColor};
  stroke: ${t.noteBorderColor};
  stroke-width: 1px;
  rx: 0;
  ry: 0;
}
.statediagram-note rect {
  fill: ${t.noteBkgColor};
  stroke: ${t.noteBorderColor};
  stroke-width: 1px;
  rx: 0;
  ry: 0;
}

.statediagram-note text {
  fill: ${t.noteTextColor};
}

.statediagram-note .nodeLabel {
  color: ${t.noteTextColor};
}
.statediagram .edgeLabel {
  color: red; // ${t.noteTextColor};
}

#dependencyStart, #dependencyEnd {
  fill: ${t.lineColor};
  stroke: ${t.lineColor};
  stroke-width: 1;
}

.statediagramTitleText {
  text-anchor: middle;
  font-size: 18px;
  fill: ${t.textColor};
}
`, "getStyles"), As = xs;
export {
  vs as A,
  As as I,
  Cs as L,
  Ls as R
};
