import { q as ee, u as Pt } from "./vendor/recharts.js";
import { n as r, r as Tt } from "./chunk-AGHRB4JF.js";
import { B as Se, C as ie, E as _e, L as Ae, V as ke, W as Fe, _ as Pe, a as ve, b as Lt, c as Ce, d as D, v as Le } from "./chunk-ICPOFSXX.js";
var vt = (function() {
  var t = /* @__PURE__ */ r(function(s, c, b, u) {
    for (b = b || {}, u = s.length; u--; b[s[u]] = c) ;
    return b;
  }, "o"), o = [1, 3], T = [1, 4], f = [1, 5], l = [1, 6], d = [1, 7], S = [
    1,
    4,
    5,
    10,
    12,
    13,
    14,
    18,
    25,
    35,
    37,
    39,
    41,
    42,
    48,
    50,
    51,
    52,
    53,
    54,
    55,
    56,
    57,
    60,
    61,
    63,
    64,
    65,
    66,
    67
  ], h = [
    1,
    4,
    5,
    10,
    12,
    13,
    14,
    18,
    25,
    28,
    35,
    37,
    39,
    41,
    42,
    48,
    50,
    51,
    52,
    53,
    54,
    55,
    56,
    57,
    60,
    61,
    63,
    64,
    65,
    66,
    67
  ], n = [
    55,
    56,
    57
  ], V = [2, 36], m = [1, 37], q = [1, 36], p = [1, 38], y = [1, 35], g = [1, 43], _ = [1, 41], ht = [1, 14], ct = [1, 23], dt = [1, 18], ut = [1, 19], rt = [1, 20], lt = [1, 21], e = [1, 22], Et = [1, 24], Dt = [1, 25], zt = [1, 26], Vt = [1, 27], It = [1, 28], wt = [1, 29], U = [1, 32], Q = [1, 33], k = [1, 34], F = [1, 39], P = [1, 40], v = [1, 42], C = [1, 44], H = [1, 62], X = [1, 61], L = [
    4,
    5,
    8,
    10,
    12,
    13,
    14,
    18,
    44,
    47,
    49,
    55,
    56,
    57,
    63,
    64,
    65,
    66,
    67
  ], Bt = [1, 65], Rt = [1, 66], Nt = [1, 67], Wt = [1, 68], Ut = [1, 69], Qt = [1, 70], Ot = [1, 71], Ht = [1, 72], Xt = [1, 73], Mt = [1, 74], Yt = [1, 75], jt = [1, 76], B = [
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    18
  ], G = [1, 90], K = [1, 91], Z = [1, 92], J = [1, 99], $ = [1, 93], tt = [1, 96], et = [1, 94], it = [1, 95], at = [1, 97], nt = [1, 98], qt = [1, 102], Gt = [
    10,
    55,
    56,
    57
  ], R = [
    4,
    5,
    6,
    8,
    10,
    11,
    13,
    17,
    18,
    19,
    20,
    55,
    56,
    57
  ], bt = {
    trace: /* @__PURE__ */ r(function() {
    }, "trace"),
    yy: {},
    symbols_: {
      error: 2,
      idStringToken: 3,
      ALPHA: 4,
      NUM: 5,
      NODE_STRING: 6,
      DOWN: 7,
      MINUS: 8,
      DEFAULT: 9,
      COMMA: 10,
      COLON: 11,
      AMP: 12,
      BRKT: 13,
      MULT: 14,
      UNICODE_TEXT: 15,
      styleComponent: 16,
      UNIT: 17,
      SPACE: 18,
      STYLE: 19,
      PCT: 20,
      idString: 21,
      style: 22,
      stylesOpt: 23,
      classDefStatement: 24,
      CLASSDEF: 25,
      start: 26,
      eol: 27,
      QUADRANT: 28,
      document: 29,
      line: 30,
      statement: 31,
      axisDetails: 32,
      quadrantDetails: 33,
      points: 34,
      title: 35,
      title_value: 36,
      acc_title: 37,
      acc_title_value: 38,
      acc_descr: 39,
      acc_descr_value: 40,
      acc_descr_multiline_value: 41,
      section: 42,
      text: 43,
      point_start: 44,
      point_x: 45,
      point_y: 46,
      class_name: 47,
      "X-AXIS": 48,
      "AXIS-TEXT-DELIMITER": 49,
      "Y-AXIS": 50,
      QUADRANT_1: 51,
      QUADRANT_2: 52,
      QUADRANT_3: 53,
      QUADRANT_4: 54,
      NEWLINE: 55,
      SEMI: 56,
      EOF: 57,
      alphaNumToken: 58,
      textNoTagsToken: 59,
      STR: 60,
      MD_STR: 61,
      alphaNum: 62,
      PUNCTUATION: 63,
      PLUS: 64,
      EQUALS: 65,
      DOT: 66,
      UNDERSCORE: 67,
      $accept: 0,
      $end: 1
    },
    terminals_: {
      2: "error",
      4: "ALPHA",
      5: "NUM",
      6: "NODE_STRING",
      7: "DOWN",
      8: "MINUS",
      9: "DEFAULT",
      10: "COMMA",
      11: "COLON",
      12: "AMP",
      13: "BRKT",
      14: "MULT",
      15: "UNICODE_TEXT",
      17: "UNIT",
      18: "SPACE",
      19: "STYLE",
      20: "PCT",
      25: "CLASSDEF",
      28: "QUADRANT",
      35: "title",
      36: "title_value",
      37: "acc_title",
      38: "acc_title_value",
      39: "acc_descr",
      40: "acc_descr_value",
      41: "acc_descr_multiline_value",
      42: "section",
      44: "point_start",
      45: "point_x",
      46: "point_y",
      47: "class_name",
      48: "X-AXIS",
      49: "AXIS-TEXT-DELIMITER",
      50: "Y-AXIS",
      51: "QUADRANT_1",
      52: "QUADRANT_2",
      53: "QUADRANT_3",
      54: "QUADRANT_4",
      55: "NEWLINE",
      56: "SEMI",
      57: "EOF",
      60: "STR",
      61: "MD_STR",
      63: "PUNCTUATION",
      64: "PLUS",
      65: "EQUALS",
      66: "DOT",
      67: "UNDERSCORE"
    },
    productions_: [
      0,
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [3, 1],
      [16, 1],
      [16, 1],
      [16, 1],
      [16, 1],
      [16, 1],
      [16, 1],
      [16, 1],
      [16, 1],
      [16, 1],
      [16, 1],
      [21, 1],
      [21, 2],
      [22, 1],
      [22, 2],
      [23, 1],
      [23, 3],
      [24, 5],
      [26, 2],
      [26, 2],
      [26, 2],
      [29, 0],
      [29, 2],
      [30, 2],
      [31, 0],
      [31, 1],
      [31, 2],
      [31, 1],
      [31, 1],
      [31, 1],
      [31, 2],
      [31, 2],
      [31, 2],
      [31, 1],
      [31, 1],
      [34, 4],
      [34, 5],
      [34, 5],
      [34, 6],
      [32, 4],
      [32, 3],
      [32, 2],
      [32, 4],
      [32, 3],
      [32, 2],
      [33, 2],
      [33, 2],
      [33, 2],
      [33, 2],
      [27, 1],
      [27, 1],
      [27, 1],
      [43, 1],
      [43, 2],
      [43, 1],
      [43, 1],
      [62, 1],
      [62, 2],
      [58, 1],
      [58, 1],
      [58, 1],
      [58, 1],
      [58, 1],
      [58, 1],
      [58, 1],
      [58, 1],
      [58, 1],
      [58, 1],
      [58, 1],
      [59, 1],
      [59, 1],
      [59, 1]
    ],
    performAction: /* @__PURE__ */ r(function(c, b, u, x, A, i, ot) {
      var a = i.length - 1;
      switch (A) {
        case 23:
          this.$ = i[a];
          break;
        case 24:
          this.$ = i[a - 1] + "" + i[a];
          break;
        case 26:
          this.$ = i[a - 1] + i[a];
          break;
        case 27:
          this.$ = [i[a].trim()];
          break;
        case 28:
          i[a - 2].push(i[a].trim()), this.$ = i[a - 2];
          break;
        case 29:
          this.$ = i[a - 4], x.addClass(i[a - 2], i[a]);
          break;
        case 37:
          this.$ = [];
          break;
        case 42:
          this.$ = i[a].trim(), x.setDiagramTitle(this.$);
          break;
        case 43:
          this.$ = i[a].trim(), x.setAccTitle(this.$);
          break;
        case 44:
        case 45:
          this.$ = i[a].trim(), x.setAccDescription(this.$);
          break;
        case 46:
          x.addSection(i[a].substr(8)), this.$ = i[a].substr(8);
          break;
        case 47:
          x.addPoint(i[a - 3], "", i[a - 1], i[a], []);
          break;
        case 48:
          x.addPoint(i[a - 4], i[a - 3], i[a - 1], i[a], []);
          break;
        case 49:
          x.addPoint(i[a - 4], "", i[a - 2], i[a - 1], i[a]);
          break;
        case 50:
          x.addPoint(i[a - 5], i[a - 4], i[a - 2], i[a - 1], i[a]);
          break;
        case 51:
          x.setXAxisLeftText(i[a - 2]), x.setXAxisRightText(i[a]);
          break;
        case 52:
          i[a - 1].text += " ⟶ ", x.setXAxisLeftText(i[a - 1]);
          break;
        case 53:
          x.setXAxisLeftText(i[a]);
          break;
        case 54:
          x.setYAxisBottomText(i[a - 2]), x.setYAxisTopText(i[a]);
          break;
        case 55:
          i[a - 1].text += " ⟶ ", x.setYAxisBottomText(i[a - 1]);
          break;
        case 56:
          x.setYAxisBottomText(i[a]);
          break;
        case 57:
          x.setQuadrant1Text(i[a]);
          break;
        case 58:
          x.setQuadrant2Text(i[a]);
          break;
        case 59:
          x.setQuadrant3Text(i[a]);
          break;
        case 60:
          x.setQuadrant4Text(i[a]);
          break;
        case 64:
          this.$ = {
            text: i[a],
            type: "text"
          };
          break;
        case 65:
          this.$ = {
            text: i[a - 1].text + "" + i[a],
            type: i[a - 1].type
          };
          break;
        case 66:
          this.$ = {
            text: i[a],
            type: "text"
          };
          break;
        case 67:
          this.$ = {
            text: i[a],
            type: "markdown"
          };
          break;
        case 68:
          this.$ = i[a];
          break;
        case 69:
          this.$ = i[a - 1] + "" + i[a];
          break;
      }
    }, "anonymous"),
    table: [
      {
        18: o,
        26: 1,
        27: 2,
        28: T,
        55: f,
        56: l,
        57: d
      },
      { 1: [3] },
      {
        18: o,
        26: 8,
        27: 2,
        28: T,
        55: f,
        56: l,
        57: d
      },
      {
        18: o,
        26: 9,
        27: 2,
        28: T,
        55: f,
        56: l,
        57: d
      },
      t(S, [2, 33], { 29: 10 }),
      t(h, [2, 61]),
      t(h, [2, 62]),
      t(h, [2, 63]),
      { 1: [2, 30] },
      { 1: [2, 31] },
      t(n, V, {
        30: 11,
        31: 12,
        24: 13,
        32: 15,
        33: 16,
        34: 17,
        43: 30,
        58: 31,
        1: [2, 32],
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        18: ht,
        25: ct,
        35: dt,
        37: ut,
        39: rt,
        41: lt,
        42: e,
        48: Et,
        50: Dt,
        51: zt,
        52: Vt,
        53: It,
        54: wt,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(S, [2, 34]),
      {
        27: 45,
        55: f,
        56: l,
        57: d
      },
      t(n, [2, 37]),
      t(n, V, {
        24: 13,
        32: 15,
        33: 16,
        34: 17,
        43: 30,
        58: 31,
        31: 46,
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        18: ht,
        25: ct,
        35: dt,
        37: ut,
        39: rt,
        41: lt,
        42: e,
        48: Et,
        50: Dt,
        51: zt,
        52: Vt,
        53: It,
        54: wt,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 39]),
      t(n, [2, 40]),
      t(n, [2, 41]),
      { 36: [1, 47] },
      { 38: [1, 48] },
      { 40: [1, 49] },
      t(n, [2, 45]),
      t(n, [2, 46]),
      { 18: [1, 50] },
      {
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        43: 51,
        58: 31,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      },
      {
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        43: 52,
        58: 31,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      },
      {
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        43: 53,
        58: 31,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      },
      {
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        43: 54,
        58: 31,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      },
      {
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        43: 55,
        58: 31,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      },
      {
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        43: 56,
        58: 31,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      },
      {
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        44: [1, 57],
        47: [1, 58],
        58: 60,
        59: 59,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      },
      t(L, [2, 64]),
      t(L, [2, 66]),
      t(L, [2, 67]),
      t(L, [2, 70]),
      t(L, [2, 71]),
      t(L, [2, 72]),
      t(L, [2, 73]),
      t(L, [2, 74]),
      t(L, [2, 75]),
      t(L, [2, 76]),
      t(L, [2, 77]),
      t(L, [2, 78]),
      t(L, [2, 79]),
      t(L, [2, 80]),
      t(S, [2, 35]),
      t(n, [2, 38]),
      t(n, [2, 42]),
      t(n, [2, 43]),
      t(n, [2, 44]),
      {
        3: 64,
        4: Bt,
        5: Rt,
        6: Nt,
        7: Wt,
        8: Ut,
        9: Qt,
        10: Ot,
        11: Ht,
        12: Xt,
        13: Mt,
        14: Yt,
        15: jt,
        21: 63
      },
      t(n, [2, 53], {
        59: 59,
        58: 60,
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        49: [1, 77],
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 56], {
        59: 59,
        58: 60,
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        49: [1, 78],
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 57], {
        59: 59,
        58: 60,
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 58], {
        59: 59,
        58: 60,
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 59], {
        59: 59,
        58: 60,
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 60], {
        59: 59,
        58: 60,
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      { 45: [1, 79] },
      { 44: [1, 80] },
      t(L, [2, 65]),
      t(L, [2, 81]),
      t(L, [2, 82]),
      t(L, [2, 83]),
      {
        3: 82,
        4: Bt,
        5: Rt,
        6: Nt,
        7: Wt,
        8: Ut,
        9: Qt,
        10: Ot,
        11: Ht,
        12: Xt,
        13: Mt,
        14: Yt,
        15: jt,
        18: [1, 81]
      },
      t(B, [2, 23]),
      t(B, [2, 1]),
      t(B, [2, 2]),
      t(B, [2, 3]),
      t(B, [2, 4]),
      t(B, [2, 5]),
      t(B, [2, 6]),
      t(B, [2, 7]),
      t(B, [2, 8]),
      t(B, [2, 9]),
      t(B, [2, 10]),
      t(B, [2, 11]),
      t(B, [2, 12]),
      t(n, [2, 52], {
        58: 31,
        43: 83,
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 55], {
        58: 31,
        43: 84,
        4: m,
        5: q,
        10: p,
        12: y,
        13: g,
        14: _,
        60: U,
        61: Q,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      { 46: [1, 85] },
      { 45: [1, 86] },
      {
        4: G,
        5: K,
        6: Z,
        8: J,
        11: $,
        13: tt,
        16: 89,
        17: et,
        18: it,
        19: at,
        20: nt,
        22: 88,
        23: 87
      },
      t(B, [2, 24]),
      t(n, [2, 51], {
        59: 59,
        58: 60,
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 54], {
        59: 59,
        58: 60,
        4: m,
        5: q,
        8: H,
        10: p,
        12: y,
        13: g,
        14: _,
        18: X,
        63: k,
        64: F,
        65: P,
        66: v,
        67: C
      }),
      t(n, [2, 47], {
        22: 88,
        16: 89,
        23: 100,
        4: G,
        5: K,
        6: Z,
        8: J,
        11: $,
        13: tt,
        17: et,
        18: it,
        19: at,
        20: nt
      }),
      { 46: [1, 101] },
      t(n, [2, 29], { 10: qt }),
      t(Gt, [2, 27], {
        16: 103,
        4: G,
        5: K,
        6: Z,
        8: J,
        11: $,
        13: tt,
        17: et,
        18: it,
        19: at,
        20: nt
      }),
      t(R, [2, 25]),
      t(R, [2, 13]),
      t(R, [2, 14]),
      t(R, [2, 15]),
      t(R, [2, 16]),
      t(R, [2, 17]),
      t(R, [2, 18]),
      t(R, [2, 19]),
      t(R, [2, 20]),
      t(R, [2, 21]),
      t(R, [2, 22]),
      t(n, [2, 49], { 10: qt }),
      t(n, [2, 48], {
        22: 88,
        16: 89,
        23: 104,
        4: G,
        5: K,
        6: Z,
        8: J,
        11: $,
        13: tt,
        17: et,
        18: it,
        19: at,
        20: nt
      }),
      {
        4: G,
        5: K,
        6: Z,
        8: J,
        11: $,
        13: tt,
        16: 89,
        17: et,
        18: it,
        19: at,
        20: nt,
        22: 105
      },
      t(R, [2, 26]),
      t(n, [2, 50], { 10: qt }),
      t(Gt, [2, 28], {
        16: 103,
        4: G,
        5: K,
        6: Z,
        8: J,
        11: $,
        13: tt,
        17: et,
        18: it,
        19: at,
        20: nt
      })
    ],
    defaultActions: {
      8: [2, 30],
      9: [2, 31]
    },
    parseError: /* @__PURE__ */ r(function(c, b) {
      if (b.recoverable) this.trace(c);
      else {
        var u = new Error(c);
        throw u.hash = b, u;
      }
    }, "parseError"),
    parse: /* @__PURE__ */ r(function(c) {
      var b = this, u = [0], x = [], A = [null], i = [], ot = this.table, a = "", ft = 0, Kt = 0, Zt = 0, Te = 2, Jt = 1, me = i.slice.call(arguments, 1), E = Object.create(this.lexer), Y = { yy: {} };
      for (var St in this.yy) Object.prototype.hasOwnProperty.call(this.yy, St) && (Y.yy[St] = this.yy[St]);
      E.setInput(c, Y.yy), Y.yy.lexer = E, Y.yy.parser = this, typeof E.yylloc > "u" && (E.yylloc = {});
      var _t = E.yylloc;
      i.push(_t);
      var qe = E.options && E.options.ranges;
      typeof Y.yy.parseError == "function" ? this.parseError = Y.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
      function be(W) {
        u.length = u.length - 2 * W, A.length = A.length - W, i.length = i.length - W;
      }
      r(be, "popStack");
      function $t() {
        var W = x.pop() || E.lex() || Jt;
        return typeof W != "number" && (W instanceof Array && (x = W, W = x.pop()), W = b.symbols_[W] || W), W;
      }
      r($t, "lex");
      for (var I, At, j, N, kt, st = {}, gt, M, te, pt; ; ) {
        if (j = u[u.length - 1], this.defaultActions[j] ? N = this.defaultActions[j] : ((I === null || typeof I > "u") && (I = $t()), N = ot[j] && ot[j][I]), typeof N > "u" || !N.length || !N[0]) {
          var Ft = "";
          pt = [];
          for (gt in ot[j]) this.terminals_[gt] && gt > Te && pt.push("'" + this.terminals_[gt] + "'");
          E.showPosition ? Ft = "Parse error on line " + (ft + 1) + `:
` + E.showPosition() + `
Expecting ` + pt.join(", ") + ", got '" + (this.terminals_[I] || I) + "'" : Ft = "Parse error on line " + (ft + 1) + ": Unexpected " + (I == Jt ? "end of input" : "'" + (this.terminals_[I] || I) + "'"), this.parseError(Ft, {
            text: E.match,
            token: this.terminals_[I] || I,
            line: E.yylineno,
            loc: _t,
            expected: pt
          });
        }
        if (N[0] instanceof Array && N.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + j + ", token: " + I);
        switch (N[0]) {
          case 1:
            u.push(I), A.push(E.yytext), i.push(E.yylloc), u.push(N[1]), I = null, At ? (I = At, At = null) : (Kt = E.yyleng, a = E.yytext, ft = E.yylineno, _t = E.yylloc, Zt > 0 && Zt--);
            break;
          case 2:
            if (M = this.productions_[N[1]][1], st.$ = A[A.length - M], st._$ = {
              first_line: i[i.length - (M || 1)].first_line,
              last_line: i[i.length - 1].last_line,
              first_column: i[i.length - (M || 1)].first_column,
              last_column: i[i.length - 1].last_column
            }, qe && (st._$.range = [i[i.length - (M || 1)].range[0], i[i.length - 1].range[1]]), kt = this.performAction.apply(st, [
              a,
              Kt,
              ft,
              Y.yy,
              N[1],
              A,
              i
            ].concat(me)), typeof kt < "u") return kt;
            M && (u = u.slice(0, -1 * M * 2), A = A.slice(0, -1 * M), i = i.slice(0, -1 * M)), u.push(this.productions_[N[1]][0]), A.push(st.$), i.push(st._$), te = ot[u[u.length - 2]][u[u.length - 1]], u.push(te);
            break;
          case 3:
            return !0;
        }
      }
      return !0;
    }, "parse")
  };
  bt.lexer = /* @__PURE__ */ (function() {
    return {
      EOF: 1,
      parseError: /* @__PURE__ */ r(function(c, b) {
        if (this.yy.parser) this.yy.parser.parseError(c, b);
        else throw new Error(c);
      }, "parseError"),
      setInput: /* @__PURE__ */ r(function(s, c) {
        return this.yy = c || this.yy || {}, this._input = s, 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"),
      input: /* @__PURE__ */ r(function() {
        var s = this._input[0];
        return this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s, s.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
      }, "input"),
      unput: /* @__PURE__ */ r(function(s) {
        var c = s.length, b = s.split(/(?:\r\n?|\n)/g);
        this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - c), this.offset -= c;
        var u = 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), b.length - 1 && (this.yylineno -= b.length - 1);
        var x = 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: b ? (b.length === u.length ? this.yylloc.first_column : 0) + u[u.length - b.length].length - b[0].length : this.yylloc.first_column - c
        }, this.options.ranges && (this.yylloc.range = [x[0], x[0] + this.yyleng - c]), this.yyleng = this.yytext.length, this;
      }, "unput"),
      more: /* @__PURE__ */ r(function() {
        return this._more = !0, this;
      }, "more"),
      reject: /* @__PURE__ */ r(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"),
      less: /* @__PURE__ */ r(function(s) {
        this.unput(this.match.slice(s));
      }, "less"),
      pastInput: /* @__PURE__ */ r(function() {
        var s = this.matched.substr(0, this.matched.length - this.match.length);
        return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
      }, "pastInput"),
      upcomingInput: /* @__PURE__ */ r(function() {
        var s = this.match;
        return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
      }, "upcomingInput"),
      showPosition: /* @__PURE__ */ r(function() {
        var s = this.pastInput(), c = new Array(s.length + 1).join("-");
        return s + this.upcomingInput() + `
` + c + "^";
      }, "showPosition"),
      test_match: /* @__PURE__ */ r(function(s, c) {
        var b, u, x;
        if (this.options.backtrack_lexer && (x = {
          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 && (x.yylloc.range = this.yylloc.range.slice(0))), u = s[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.length), this.yylloc = {
          first_line: this.yylloc.last_line,
          last_line: this.yylineno + 1,
          first_column: this.yylloc.last_column,
          last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
        }, this.yytext += s[0], this.match += s[0], this.matches = s, 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(s[0].length), this.matched += s[0], b = this.performAction.call(this, this.yy, this, c, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), b) return b;
        if (this._backtrack) {
          for (var A in x) this[A] = x[A];
          return !1;
        }
        return !1;
      }, "test_match"),
      next: /* @__PURE__ */ r(function() {
        if (this.done) return this.EOF;
        this._input || (this.done = !0);
        var s, c, b, u;
        this._more || (this.yytext = "", this.match = "");
        for (var x = this._currentRules(), A = 0; A < x.length; A++)
          if (b = this._input.match(this.rules[x[A]]), b && (!c || b[0].length > c[0].length)) {
            if (c = b, u = A, this.options.backtrack_lexer) {
              if (s = this.test_match(b, x[A]), s !== !1) return s;
              if (this._backtrack) {
                c = !1;
                continue;
              } else return !1;
            } else if (!this.options.flex) break;
          }
        return c ? (s = this.test_match(c, x[u]), s !== !1 ? s : !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"),
      lex: /* @__PURE__ */ r(function() {
        var c = this.next();
        return c || this.lex();
      }, "lex"),
      begin: /* @__PURE__ */ r(function(c) {
        this.conditionStack.push(c);
      }, "begin"),
      popState: /* @__PURE__ */ r(function() {
        return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
      }, "popState"),
      _currentRules: /* @__PURE__ */ r(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"),
      topState: /* @__PURE__ */ r(function(c) {
        return c = this.conditionStack.length - 1 - Math.abs(c || 0), c >= 0 ? this.conditionStack[c] : "INITIAL";
      }, "topState"),
      pushState: /* @__PURE__ */ r(function(c) {
        this.begin(c);
      }, "pushState"),
      stateStackSize: /* @__PURE__ */ r(function() {
        return this.conditionStack.length;
      }, "stateStackSize"),
      options: { "case-insensitive": !0 },
      performAction: /* @__PURE__ */ r(function(c, b, u, x) {
        switch (u) {
          case 0:
            break;
          case 1:
            break;
          case 2:
            return 55;
          case 3:
            break;
          case 4:
            return this.begin("title"), 35;
          case 5:
            return this.popState(), "title_value";
          case 6:
            return this.begin("acc_title"), 37;
          case 7:
            return this.popState(), "acc_title_value";
          case 8:
            return this.begin("acc_descr"), 39;
          case 9:
            return this.popState(), "acc_descr_value";
          case 10:
            this.begin("acc_descr_multiline");
            break;
          case 11:
            this.popState();
            break;
          case 12:
            return "acc_descr_multiline_value";
          case 13:
            return 48;
          case 14:
            return 50;
          case 15:
            return 49;
          case 16:
            return 51;
          case 17:
            return 52;
          case 18:
            return 53;
          case 19:
            return 54;
          case 20:
            return 25;
          case 21:
            this.begin("md_string");
            break;
          case 22:
            return "MD_STR";
          case 23:
            this.popState();
            break;
          case 24:
            this.begin("string");
            break;
          case 25:
            this.popState();
            break;
          case 26:
            return "STR";
          case 27:
            this.begin("class_name");
            break;
          case 28:
            return this.popState(), 47;
          case 29:
            return this.begin("point_start"), 44;
          case 30:
            return this.begin("point_x"), 45;
          case 31:
            this.popState();
            break;
          case 32:
            this.popState(), this.begin("point_y");
            break;
          case 33:
            return this.popState(), 46;
          case 34:
            return 28;
          case 35:
            return 4;
          case 36:
            return 11;
          case 37:
            return 64;
          case 38:
            return 10;
          case 39:
            return 65;
          case 40:
            return 65;
          case 41:
            return 14;
          case 42:
            return 13;
          case 43:
            return 67;
          case 44:
            return 66;
          case 45:
            return 12;
          case 46:
            return 8;
          case 47:
            return 5;
          case 48:
            return 18;
          case 49:
            return 56;
          case 50:
            return 63;
          case 51:
            return 57;
        }
      }, "anonymous"),
      rules: [
        /^(?:%%(?!\{)[^\n]*)/i,
        /^(?:[^\}]%%[^\n]*)/i,
        /^(?:[\n\r]+)/i,
        /^(?:%%[^\n]*)/i,
        /^(?:title\b)/i,
        /^(?:(?!\n||)*[^\n]*)/i,
        /^(?:accTitle\s*:\s*)/i,
        /^(?:(?!\n||)*[^\n]*)/i,
        /^(?:accDescr\s*:\s*)/i,
        /^(?:(?!\n||)*[^\n]*)/i,
        /^(?:accDescr\s*\{\s*)/i,
        /^(?:[\}])/i,
        /^(?:[^\}]*)/i,
        /^(?: *x-axis *)/i,
        /^(?: *y-axis *)/i,
        /^(?: *--+> *)/i,
        /^(?: *quadrant-1 *)/i,
        /^(?: *quadrant-2 *)/i,
        /^(?: *quadrant-3 *)/i,
        /^(?: *quadrant-4 *)/i,
        /^(?:classDef\b)/i,
        /^(?:["][`])/i,
        /^(?:[^`"]+)/i,
        /^(?:[`]["])/i,
        /^(?:["])/i,
        /^(?:["])/i,
        /^(?:[^"]*)/i,
        /^(?::::)/i,
        /^(?:^\w+)/i,
        /^(?:\s*:\s*\[\s*)/i,
        /^(?:(1)|(0(.\d+)?))/i,
        /^(?:\s*\] *)/i,
        /^(?:\s*,\s*)/i,
        /^(?:(1)|(0(.\d+)?))/i,
        /^(?: *quadrantChart *)/i,
        /^(?:[A-Za-z]+)/i,
        /^(?::)/i,
        /^(?:\+)/i,
        /^(?:,)/i,
        /^(?:=)/i,
        /^(?:=)/i,
        /^(?:\*)/i,
        /^(?:#)/i,
        /^(?:[\_])/i,
        /^(?:\.)/i,
        /^(?:&)/i,
        /^(?:-)/i,
        /^(?:[0-9]+)/i,
        /^(?:\s)/i,
        /^(?:;)/i,
        /^(?:[!"#$%&'*+,-.`?\\_/])/i,
        /^(?:$)/i
      ],
      conditions: {
        class_name: {
          rules: [28],
          inclusive: !1
        },
        point_y: {
          rules: [33],
          inclusive: !1
        },
        point_x: {
          rules: [32],
          inclusive: !1
        },
        point_start: {
          rules: [30, 31],
          inclusive: !1
        },
        acc_descr_multiline: {
          rules: [11, 12],
          inclusive: !1
        },
        acc_descr: {
          rules: [9],
          inclusive: !1
        },
        acc_title: {
          rules: [7],
          inclusive: !1
        },
        title: {
          rules: [5],
          inclusive: !1
        },
        md_string: {
          rules: [22, 23],
          inclusive: !1
        },
        string: {
          rules: [25, 26],
          inclusive: !1
        },
        INITIAL: {
          rules: [
            0,
            1,
            2,
            3,
            4,
            6,
            8,
            10,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            24,
            27,
            29,
            34,
            35,
            36,
            37,
            38,
            39,
            40,
            41,
            42,
            43,
            44,
            45,
            46,
            47,
            48,
            49,
            50,
            51
          ],
          inclusive: !0
        }
      }
    };
  })();
  function xt() {
    this.yy = {};
  }
  return r(xt, "Parser"), xt.prototype = bt, bt.Parser = xt, new xt();
})();
vt.parser = vt;
var Ee = vt, w = _e(), De = class {
  constructor() {
    this.classes = /* @__PURE__ */ new Map(), this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData();
  }
  static {
    r(this, "QuadrantBuilder");
  }
  getDefaultData() {
    return {
      titleText: "",
      quadrant1Text: "",
      quadrant2Text: "",
      quadrant3Text: "",
      quadrant4Text: "",
      xAxisLeftText: "",
      xAxisRightText: "",
      yAxisBottomText: "",
      yAxisTopText: "",
      points: []
    };
  }
  getDefaultConfig() {
    return {
      showXAxis: !0,
      showYAxis: !0,
      showTitle: !0,
      chartHeight: D.quadrantChart?.chartWidth || 500,
      chartWidth: D.quadrantChart?.chartHeight || 500,
      titlePadding: D.quadrantChart?.titlePadding || 10,
      titleFontSize: D.quadrantChart?.titleFontSize || 20,
      quadrantPadding: D.quadrantChart?.quadrantPadding || 5,
      xAxisLabelPadding: D.quadrantChart?.xAxisLabelPadding || 5,
      yAxisLabelPadding: D.quadrantChart?.yAxisLabelPadding || 5,
      xAxisLabelFontSize: D.quadrantChart?.xAxisLabelFontSize || 16,
      yAxisLabelFontSize: D.quadrantChart?.yAxisLabelFontSize || 16,
      quadrantLabelFontSize: D.quadrantChart?.quadrantLabelFontSize || 16,
      quadrantTextTopPadding: D.quadrantChart?.quadrantTextTopPadding || 5,
      pointTextPadding: D.quadrantChart?.pointTextPadding || 5,
      pointLabelFontSize: D.quadrantChart?.pointLabelFontSize || 12,
      pointRadius: D.quadrantChart?.pointRadius || 5,
      xAxisPosition: D.quadrantChart?.xAxisPosition || "top",
      yAxisPosition: D.quadrantChart?.yAxisPosition || "left",
      quadrantInternalBorderStrokeWidth: D.quadrantChart?.quadrantInternalBorderStrokeWidth || 1,
      quadrantExternalBorderStrokeWidth: D.quadrantChart?.quadrantExternalBorderStrokeWidth || 2
    };
  }
  getDefaultThemeConfig() {
    return {
      quadrant1Fill: w.quadrant1Fill,
      quadrant2Fill: w.quadrant2Fill,
      quadrant3Fill: w.quadrant3Fill,
      quadrant4Fill: w.quadrant4Fill,
      quadrant1TextFill: w.quadrant1TextFill,
      quadrant2TextFill: w.quadrant2TextFill,
      quadrant3TextFill: w.quadrant3TextFill,
      quadrant4TextFill: w.quadrant4TextFill,
      quadrantPointFill: w.quadrantPointFill,
      quadrantPointTextFill: w.quadrantPointTextFill,
      quadrantXAxisTextFill: w.quadrantXAxisTextFill,
      quadrantYAxisTextFill: w.quadrantYAxisTextFill,
      quadrantTitleFill: w.quadrantTitleFill,
      quadrantInternalBorderStrokeFill: w.quadrantInternalBorderStrokeFill,
      quadrantExternalBorderStrokeFill: w.quadrantExternalBorderStrokeFill
    };
  }
  clear() {
    this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData(), this.classes = /* @__PURE__ */ new Map(), Tt.info("clear called");
  }
  setData(t) {
    this.data = {
      ...this.data,
      ...t
    };
  }
  addPoints(t) {
    this.data.points = [...t, ...this.data.points];
  }
  addClass(t, o) {
    this.classes.set(t, o);
  }
  setConfig(t) {
    Tt.trace("setConfig called with: ", t), this.config = {
      ...this.config,
      ...t
    };
  }
  setThemeConfig(t) {
    Tt.trace("setThemeConfig called with: ", t), this.themeConfig = {
      ...this.themeConfig,
      ...t
    };
  }
  calculateSpace(t, o, T, f) {
    const l = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize, d = {
      top: t === "top" && o ? l : 0,
      bottom: t === "bottom" && o ? l : 0
    }, S = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize, h = {
      left: this.config.yAxisPosition === "left" && T ? S : 0,
      right: this.config.yAxisPosition === "right" && T ? S : 0
    }, n = this.config.titleFontSize + this.config.titlePadding * 2, V = { top: f ? n : 0 }, m = this.config.quadrantPadding + h.left, q = this.config.quadrantPadding + d.top + V.top, p = this.config.chartWidth - this.config.quadrantPadding * 2 - h.left - h.right, y = this.config.chartHeight - this.config.quadrantPadding * 2 - d.top - d.bottom - V.top;
    return {
      xAxisSpace: d,
      yAxisSpace: h,
      titleSpace: V,
      quadrantSpace: {
        quadrantLeft: m,
        quadrantTop: q,
        quadrantWidth: p,
        quadrantHalfWidth: p / 2,
        quadrantHeight: y,
        quadrantHalfHeight: y / 2
      }
    };
  }
  getAxisLabels(t, o, T, f) {
    const { quadrantSpace: l, titleSpace: d } = f, { quadrantHalfHeight: S, quadrantHeight: h, quadrantLeft: n, quadrantHalfWidth: V, quadrantTop: m, quadrantWidth: q } = l, p = !!this.data.xAxisRightText, y = !!this.data.yAxisTopText, g = [];
    return this.data.xAxisLeftText && o && g.push({
      text: this.data.xAxisLeftText,
      fill: this.themeConfig.quadrantXAxisTextFill,
      x: n + (p ? V / 2 : 0),
      y: t === "top" ? this.config.xAxisLabelPadding + d.top : this.config.xAxisLabelPadding + m + h + this.config.quadrantPadding,
      fontSize: this.config.xAxisLabelFontSize,
      verticalPos: p ? "center" : "left",
      horizontalPos: "top",
      rotation: 0
    }), this.data.xAxisRightText && o && g.push({
      text: this.data.xAxisRightText,
      fill: this.themeConfig.quadrantXAxisTextFill,
      x: n + V + (p ? V / 2 : 0),
      y: t === "top" ? this.config.xAxisLabelPadding + d.top : this.config.xAxisLabelPadding + m + h + this.config.quadrantPadding,
      fontSize: this.config.xAxisLabelFontSize,
      verticalPos: p ? "center" : "left",
      horizontalPos: "top",
      rotation: 0
    }), this.data.yAxisBottomText && T && g.push({
      text: this.data.yAxisBottomText,
      fill: this.themeConfig.quadrantYAxisTextFill,
      x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + n + q + this.config.quadrantPadding,
      y: m + h - (y ? S / 2 : 0),
      fontSize: this.config.yAxisLabelFontSize,
      verticalPos: y ? "center" : "left",
      horizontalPos: "top",
      rotation: -90
    }), this.data.yAxisTopText && T && g.push({
      text: this.data.yAxisTopText,
      fill: this.themeConfig.quadrantYAxisTextFill,
      x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + n + q + this.config.quadrantPadding,
      y: m + S - (y ? S / 2 : 0),
      fontSize: this.config.yAxisLabelFontSize,
      verticalPos: y ? "center" : "left",
      horizontalPos: "top",
      rotation: -90
    }), g;
  }
  getQuadrants(t) {
    const { quadrantSpace: o } = t, { quadrantHalfHeight: T, quadrantLeft: f, quadrantHalfWidth: l, quadrantTop: d } = o, S = [
      {
        text: {
          text: this.data.quadrant1Text,
          fill: this.themeConfig.quadrant1TextFill,
          x: 0,
          y: 0,
          fontSize: this.config.quadrantLabelFontSize,
          verticalPos: "center",
          horizontalPos: "middle",
          rotation: 0
        },
        x: f + l,
        y: d,
        width: l,
        height: T,
        fill: this.themeConfig.quadrant1Fill
      },
      {
        text: {
          text: this.data.quadrant2Text,
          fill: this.themeConfig.quadrant2TextFill,
          x: 0,
          y: 0,
          fontSize: this.config.quadrantLabelFontSize,
          verticalPos: "center",
          horizontalPos: "middle",
          rotation: 0
        },
        x: f,
        y: d,
        width: l,
        height: T,
        fill: this.themeConfig.quadrant2Fill
      },
      {
        text: {
          text: this.data.quadrant3Text,
          fill: this.themeConfig.quadrant3TextFill,
          x: 0,
          y: 0,
          fontSize: this.config.quadrantLabelFontSize,
          verticalPos: "center",
          horizontalPos: "middle",
          rotation: 0
        },
        x: f,
        y: d + T,
        width: l,
        height: T,
        fill: this.themeConfig.quadrant3Fill
      },
      {
        text: {
          text: this.data.quadrant4Text,
          fill: this.themeConfig.quadrant4TextFill,
          x: 0,
          y: 0,
          fontSize: this.config.quadrantLabelFontSize,
          verticalPos: "center",
          horizontalPos: "middle",
          rotation: 0
        },
        x: f + l,
        y: d + T,
        width: l,
        height: T,
        fill: this.themeConfig.quadrant4Fill
      }
    ];
    for (const h of S)
      h.text.x = h.x + h.width / 2, this.data.points.length === 0 ? (h.text.y = h.y + h.height / 2, h.text.horizontalPos = "middle") : (h.text.y = h.y + this.config.quadrantTextTopPadding, h.text.horizontalPos = "top");
    return S;
  }
  getQuadrantPoints(t) {
    const { quadrantSpace: o } = t, { quadrantHeight: T, quadrantLeft: f, quadrantTop: l, quadrantWidth: d } = o, S = ee().domain([0, 1]).range([f, d + f]), h = ee().domain([0, 1]).range([T + l, l]);
    return this.data.points.map((n) => {
      const V = this.classes.get(n.className);
      return V && (n = {
        ...V,
        ...n
      }), {
        x: S(n.x),
        y: h(n.y),
        fill: n.color ?? this.themeConfig.quadrantPointFill,
        radius: n.radius ?? this.config.pointRadius,
        text: {
          text: n.text,
          fill: this.themeConfig.quadrantPointTextFill,
          x: S(n.x),
          y: h(n.y) + this.config.pointTextPadding,
          verticalPos: "center",
          horizontalPos: "top",
          fontSize: this.config.pointLabelFontSize,
          rotation: 0
        },
        strokeColor: n.strokeColor ?? this.themeConfig.quadrantPointFill,
        strokeWidth: n.strokeWidth ?? "0px"
      };
    });
  }
  getBorders(t) {
    const o = this.config.quadrantExternalBorderStrokeWidth / 2, { quadrantSpace: T } = t, { quadrantHalfHeight: f, quadrantHeight: l, quadrantLeft: d, quadrantHalfWidth: S, quadrantTop: h, quadrantWidth: n } = T;
    return [
      {
        strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
        strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
        x1: d - o,
        y1: h,
        x2: d + n + o,
        y2: h
      },
      {
        strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
        strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
        x1: d + n,
        y1: h + o,
        x2: d + n,
        y2: h + l - o
      },
      {
        strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
        strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
        x1: d - o,
        y1: h + l,
        x2: d + n + o,
        y2: h + l
      },
      {
        strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
        strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
        x1: d,
        y1: h + o,
        x2: d,
        y2: h + l - o
      },
      {
        strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
        strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
        x1: d + S,
        y1: h + o,
        x2: d + S,
        y2: h + l - o
      },
      {
        strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
        strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
        x1: d + o,
        y1: h + f,
        x2: d + n - o,
        y2: h + f
      }
    ];
  }
  getTitle(t) {
    if (t) return {
      text: this.data.titleText,
      fill: this.themeConfig.quadrantTitleFill,
      fontSize: this.config.titleFontSize,
      horizontalPos: "top",
      verticalPos: "center",
      rotation: 0,
      y: this.config.titlePadding,
      x: this.config.chartWidth / 2
    };
  }
  build() {
    const t = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText), o = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText), T = this.config.showTitle && !!this.data.titleText, f = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition, l = this.calculateSpace(f, t, o, T);
    return {
      points: this.getQuadrantPoints(l),
      quadrants: this.getQuadrants(l),
      axisLabels: this.getAxisLabels(f, t, o, l),
      borderLines: this.getBorders(l),
      title: this.getTitle(T)
    };
  }
}, yt = class extends Error {
  static {
    r(this, "InvalidStyleError");
  }
  constructor(t, o, T) {
    super(`value for ${t} ${o} is invalid, please use a valid ${T}`), this.name = "InvalidStyleError";
  }
};
function Ct(t) {
  return !/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t);
}
r(Ct, "validateHexCode");
function ae(t) {
  return !/^\d+$/.test(t);
}
r(ae, "validateNumber");
function ne(t) {
  return !/^\d+px$/.test(t);
}
r(ne, "validateSizeInPixels");
var ze = Lt();
function O(t) {
  return Ae(t.trim(), ze);
}
r(O, "textSanitizer");
var z = new De();
function se(t) {
  z.setData({ quadrant1Text: O(t.text) });
}
r(se, "setQuadrant1Text");
function re(t) {
  z.setData({ quadrant2Text: O(t.text) });
}
r(re, "setQuadrant2Text");
function le(t) {
  z.setData({ quadrant3Text: O(t.text) });
}
r(le, "setQuadrant3Text");
function oe(t) {
  z.setData({ quadrant4Text: O(t.text) });
}
r(oe, "setQuadrant4Text");
function he(t) {
  z.setData({ xAxisLeftText: O(t.text) });
}
r(he, "setXAxisLeftText");
function ce(t) {
  z.setData({ xAxisRightText: O(t.text) });
}
r(ce, "setXAxisRightText");
function de(t) {
  z.setData({ yAxisTopText: O(t.text) });
}
r(de, "setYAxisTopText");
function ue(t) {
  z.setData({ yAxisBottomText: O(t.text) });
}
r(ue, "setYAxisBottomText");
function mt(t) {
  const o = {};
  for (const T of t) {
    const [f, l] = T.trim().split(/\s*:\s*/);
    if (f === "radius") {
      if (ae(l)) throw new yt(f, l, "number");
      o.radius = parseInt(l);
    } else if (f === "color") {
      if (Ct(l)) throw new yt(f, l, "hex code");
      o.color = l;
    } else if (f === "stroke-color") {
      if (Ct(l)) throw new yt(f, l, "hex code");
      o.strokeColor = l;
    } else if (f === "stroke-width") {
      if (ne(l)) throw new yt(f, l, "number of pixels (eg. 10px)");
      o.strokeWidth = l;
    } else throw new Error(`style named ${f} is not supported.`);
  }
  return o;
}
r(mt, "parseStyles");
function xe(t, o, T, f, l) {
  const d = mt(l);
  z.addPoints([{
    x: T,
    y: f,
    text: O(t.text),
    className: o,
    ...d
  }]);
}
r(xe, "addPoint");
function fe(t, o) {
  z.addClass(t, mt(o));
}
r(fe, "addClass");
function ge(t) {
  z.setConfig({ chartWidth: t });
}
r(ge, "setWidth");
function pe(t) {
  z.setConfig({ chartHeight: t });
}
r(pe, "setHeight");
function ye() {
  const { themeVariables: t, quadrantChart: o } = Lt();
  return o && z.setConfig(o), z.setThemeConfig({
    quadrant1Fill: t.quadrant1Fill,
    quadrant2Fill: t.quadrant2Fill,
    quadrant3Fill: t.quadrant3Fill,
    quadrant4Fill: t.quadrant4Fill,
    quadrant1TextFill: t.quadrant1TextFill,
    quadrant2TextFill: t.quadrant2TextFill,
    quadrant3TextFill: t.quadrant3TextFill,
    quadrant4TextFill: t.quadrant4TextFill,
    quadrantPointFill: t.quadrantPointFill,
    quadrantPointTextFill: t.quadrantPointTextFill,
    quadrantXAxisTextFill: t.quadrantXAxisTextFill,
    quadrantYAxisTextFill: t.quadrantYAxisTextFill,
    quadrantExternalBorderStrokeFill: t.quadrantExternalBorderStrokeFill,
    quadrantInternalBorderStrokeFill: t.quadrantInternalBorderStrokeFill,
    quadrantTitleFill: t.quadrantTitleFill
  }), z.setData({ titleText: ie() }), z.build();
}
r(ye, "getQuadrantData");
var Ve = {
  setWidth: ge,
  setHeight: pe,
  setQuadrant1Text: se,
  setQuadrant2Text: re,
  setQuadrant3Text: le,
  setQuadrant4Text: oe,
  setXAxisLeftText: he,
  setXAxisRightText: ce,
  setYAxisTopText: de,
  setYAxisBottomText: ue,
  parseStyles: mt,
  addPoint: xe,
  addClass: fe,
  getQuadrantData: ye,
  clear: /* @__PURE__ */ r(function() {
    z.clear(), ve();
  }, "clear"),
  setAccTitle: ke,
  getAccTitle: Le,
  setDiagramTitle: Fe,
  getDiagramTitle: ie,
  getAccDescription: Pe,
  setAccDescription: Se
}, Re = {
  parser: Ee,
  db: Ve,
  renderer: { draw: /* @__PURE__ */ r((t, o, T, f) => {
    function l(e) {
      return e === "top" ? "hanging" : "middle";
    }
    r(l, "getDominantBaseLine");
    function d(e) {
      return e === "left" ? "start" : "middle";
    }
    r(d, "getTextAnchor");
    function S(e) {
      return `translate(${e.x}, ${e.y}) rotate(${e.rotation || 0})`;
    }
    r(S, "getTransformation");
    const h = Lt();
    Tt.debug(`Rendering quadrant chart
` + t);
    const n = h.securityLevel;
    let V;
    n === "sandbox" && (V = Pt("#i" + o));
    const m = (n === "sandbox" ? Pt(V.nodes()[0].contentDocument.body) : Pt("body")).select(`[id="${o}"]`), q = m.append("g").attr("class", "main"), p = h.quadrantChart?.chartWidth ?? 500, y = h.quadrantChart?.chartHeight ?? 500;
    Ce(m, y, p, h.quadrantChart?.useMaxWidth ?? !0), m.attr("viewBox", "0 0 " + p + " " + y), f.db.setHeight(y), f.db.setWidth(p);
    const g = f.db.getQuadrantData(), _ = q.append("g").attr("class", "quadrants"), ht = q.append("g").attr("class", "border"), ct = q.append("g").attr("class", "data-points"), dt = q.append("g").attr("class", "labels"), ut = q.append("g").attr("class", "title");
    g.title && ut.append("text").attr("x", 0).attr("y", 0).attr("fill", g.title.fill).attr("font-size", g.title.fontSize).attr("dominant-baseline", l(g.title.horizontalPos)).attr("text-anchor", d(g.title.verticalPos)).attr("transform", S(g.title)).text(g.title.text), g.borderLines && ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1", (e) => e.x1).attr("y1", (e) => e.y1).attr("x2", (e) => e.x2).attr("y2", (e) => e.y2).style("stroke", (e) => e.strokeFill).style("stroke-width", (e) => e.strokeWidth);
    const rt = _.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class", "quadrant");
    rt.append("rect").attr("x", (e) => e.x).attr("y", (e) => e.y).attr("width", (e) => e.width).attr("height", (e) => e.height).attr("fill", (e) => e.fill), rt.append("text").attr("x", 0).attr("y", 0).attr("fill", (e) => e.text.fill).attr("font-size", (e) => e.text.fontSize).attr("dominant-baseline", (e) => l(e.text.horizontalPos)).attr("text-anchor", (e) => d(e.text.verticalPos)).attr("transform", (e) => S(e.text)).text((e) => e.text.text), dt.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class", "label").append("text").attr("x", 0).attr("y", 0).text((e) => e.text).attr("fill", (e) => e.fill).attr("font-size", (e) => e.fontSize).attr("dominant-baseline", (e) => l(e.horizontalPos)).attr("text-anchor", (e) => d(e.verticalPos)).attr("transform", (e) => S(e));
    const lt = ct.selectAll("g.data-point").data(g.points).enter().append("g").attr("class", "data-point");
    lt.append("circle").attr("cx", (e) => e.x).attr("cy", (e) => e.y).attr("r", (e) => e.radius).attr("fill", (e) => e.fill).attr("stroke", (e) => e.strokeColor).attr("stroke-width", (e) => e.strokeWidth), lt.append("text").attr("x", 0).attr("y", 0).text((e) => e.text.text).attr("fill", (e) => e.text.fill).attr("font-size", (e) => e.text.fontSize).attr("dominant-baseline", (e) => l(e.text.horizontalPos)).attr("text-anchor", (e) => d(e.text.verticalPos)).attr("transform", (e) => S(e.text));
  }, "draw") },
  styles: /* @__PURE__ */ r(() => "", "styles")
};
export {
  Re as diagram
};

//# sourceMappingURL=quadrantDiagram-34T5L4WZ.js.map