import { getLineFunctionsWithOffset as lt, markerOffsets2 as F, markerOffsets as z } from "./chunk-HN2XXSSU.js";
import { createLabel_default as q } from "./chunk-JZLCHNYA.js";
import { getSubGraphTitleMargins as ct } from "./chunk-CVBHYZKI.js";
import { styles2String as pt, isLabelStyle as dt } from "./chunk-ATLVNIR6.js";
import { createText as ft } from "./chunk-JA3XYJ7Z.js";
import { utils_default as S } from "./chunk-S3R3BYOJ.js";
import { getConfig2 as E, evaluate as ht } from "./chunk-ABZYJK2D.js";
import { __name as h, log as m } from "./chunk-AGHRB4JF.js";
import "../../../../../../d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js";
import "../../../../../../d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js";
import mt from "../../../../../../roughjs@4.6.6/node_modules/roughjs/bundled/rough.esm.js";
import yt from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/line.js";
import at from "../../../../../../d3-selection@3.0.0/node_modules/d3-selection/src/select.js";
import j from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/curve/basis.js";
import G from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js";
import kt, { stepBefore as xt, stepAfter as ut } from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/curve/step.js";
import bt from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/curve/natural.js";
import { monotoneY as gt, monotoneX as Lt } from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/curve/monotone.js";
import Mt from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/curve/catmullRom.js";
import { bumpY as wt, bumpX as _t } from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/curve/bump.js";
import vt from "../../../../../../d3-shape@3.2.0/node_modules/d3-shape/src/curve/cardinal.js";
var $t = /* @__PURE__ */ h((r, t, a, s, i, n) => {
  t.arrowTypeStart && K(r, "start", t.arrowTypeStart, a, s, i, n), t.arrowTypeEnd && K(r, "end", t.arrowTypeEnd, a, s, i, n);
}, "addEdgeMarkers"), St = {
  arrow_cross: { type: "cross", fill: !1 },
  arrow_point: { type: "point", fill: !0 },
  arrow_barb: { type: "barb", fill: !0 },
  arrow_circle: { type: "circle", fill: !1 },
  aggregation: { type: "aggregation", fill: !1 },
  extension: { type: "extension", fill: !1 },
  composition: { type: "composition", fill: !0 },
  dependency: { type: "dependency", fill: !0 },
  lollipop: { type: "lollipop", fill: !1 },
  only_one: { type: "onlyOne", fill: !1 },
  zero_or_one: { type: "zeroOrOne", fill: !1 },
  one_or_more: { type: "oneOrMore", fill: !1 },
  zero_or_more: { type: "zeroOrMore", fill: !1 },
  requirement_arrow: { type: "requirement_arrow", fill: !1 },
  requirement_contains: { type: "requirement_contains", fill: !1 }
}, K = /* @__PURE__ */ h((r, t, a, s, i, n, e) => {
  var d;
  const o = St[a];
  if (!o) {
    m.warn(`Unknown arrow type: ${a}`);
    return;
  }
  const c = o.type, p = `${i}_${n}-${c}${t === "start" ? "Start" : "End"}`;
  if (e && e.trim() !== "") {
    const f = e.replace(/[^\dA-Za-z]/g, "_"), y = `${p}_${f}`;
    if (!document.getElementById(y)) {
      const M = document.getElementById(p);
      if (M) {
        const g = M.cloneNode(!0);
        g.id = y, g.querySelectorAll("path, circle, line").forEach((_) => {
          _.setAttribute("stroke", e), o.fill && _.setAttribute("fill", e);
        }), (d = M.parentNode) == null || d.appendChild(g);
      }
    }
    r.attr(`marker-${t}`, `url(${s}#${y})`);
  } else
    r.attr(`marker-${t}`, `url(${s}#${p})`);
}, "addEdgeMarker"), I = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), kr = /* @__PURE__ */ h(() => {
  I.clear(), b.clear();
}, "clear"), U = /* @__PURE__ */ h((r) => r ? r.reduce((a, s) => a + ";" + s, "") : "", "getLabelStyles"), xr = /* @__PURE__ */ h(async (r, t) => {
  let a = ht(E().flowchart.htmlLabels);
  const { labelStyles: s } = pt(t);
  t.labelStyle = s;
  const i = await ft(r, t.label, {
    style: t.labelStyle,
    useHtmlLabels: a,
    addSvgBackground: !0,
    isNode: !1
  });
  m.info("abc82", t, t.labelType);
  const n = r.insert("g").attr("class", "edgeLabel"), e = n.insert("g").attr("class", "label").attr("data-id", t.id);
  e.node().appendChild(i);
  let o = i.getBBox();
  if (a) {
    const l = i.children[0], p = at(i);
    o = l.getBoundingClientRect(), p.attr("width", o.width), p.attr("height", o.height);
  }
  e.attr("transform", "translate(" + -o.width / 2 + ", " + -o.height / 2 + ")"), I.set(t.id, n), t.width = o.width, t.height = o.height;
  let c;
  if (t.startLabelLeft) {
    const l = await q(
      t.startLabelLeft,
      U(t.labelStyle)
    ), p = r.insert("g").attr("class", "edgeTerminals"), d = p.insert("g").attr("class", "inner");
    c = d.node().appendChild(l);
    const f = l.getBBox();
    d.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), b.get(t.id) || b.set(t.id, {}), b.get(t.id).startLeft = p, X(c, t.startLabelLeft);
  }
  if (t.startLabelRight) {
    const l = await q(
      t.startLabelRight,
      U(t.labelStyle)
    ), p = r.insert("g").attr("class", "edgeTerminals"), d = p.insert("g").attr("class", "inner");
    c = p.node().appendChild(l), d.node().appendChild(l);
    const f = l.getBBox();
    d.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), b.get(t.id) || b.set(t.id, {}), b.get(t.id).startRight = p, X(c, t.startLabelRight);
  }
  if (t.endLabelLeft) {
    const l = await q(t.endLabelLeft, U(t.labelStyle)), p = r.insert("g").attr("class", "edgeTerminals"), d = p.insert("g").attr("class", "inner");
    c = d.node().appendChild(l);
    const f = l.getBBox();
    d.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), p.node().appendChild(l), b.get(t.id) || b.set(t.id, {}), b.get(t.id).endLeft = p, X(c, t.endLabelLeft);
  }
  if (t.endLabelRight) {
    const l = await q(t.endLabelRight, U(t.labelStyle)), p = r.insert("g").attr("class", "edgeTerminals"), d = p.insert("g").attr("class", "inner");
    c = d.node().appendChild(l);
    const f = l.getBBox();
    d.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), p.node().appendChild(l), b.get(t.id) || b.set(t.id, {}), b.get(t.id).endRight = p, X(c, t.endLabelRight);
  }
  return i;
}, "insertEdgeLabel");
function X(r, t) {
  E().flowchart.htmlLabels && r && (r.style.width = t.length * 9 + "px", r.style.height = "12px");
}
h(X, "setTerminalWidth");
var ur = /* @__PURE__ */ h((r, t) => {
  m.debug("Moving label abc88 ", r.id, r.label, I.get(r.id), t);
  let a = t.updatedPath ? t.updatedPath : t.originalPath;
  const s = E(), { subGraphTitleTotalMargin: i } = ct(s);
  if (r.label) {
    const n = I.get(r.id);
    let e = r.x, o = r.y;
    if (a) {
      const c = S.calcLabelPosition(a);
      m.debug(
        "Moving label " + r.label + " from (",
        e,
        ",",
        o,
        ") to (",
        c.x,
        ",",
        c.y,
        ") abc88"
      ), t.updatedPath && (e = c.x, o = c.y);
    }
    n.attr("transform", `translate(${e}, ${o + i / 2})`);
  }
  if (r.startLabelLeft) {
    const n = b.get(r.id).startLeft;
    let e = r.x, o = r.y;
    if (a) {
      const c = S.calcTerminalLabelPosition(r.arrowTypeStart ? 10 : 0, "start_left", a);
      e = c.x, o = c.y;
    }
    n.attr("transform", `translate(${e}, ${o})`);
  }
  if (r.startLabelRight) {
    const n = b.get(r.id).startRight;
    let e = r.x, o = r.y;
    if (a) {
      const c = S.calcTerminalLabelPosition(
        r.arrowTypeStart ? 10 : 0,
        "start_right",
        a
      );
      e = c.x, o = c.y;
    }
    n.attr("transform", `translate(${e}, ${o})`);
  }
  if (r.endLabelLeft) {
    const n = b.get(r.id).endLeft;
    let e = r.x, o = r.y;
    if (a) {
      const c = S.calcTerminalLabelPosition(r.arrowTypeEnd ? 10 : 0, "end_left", a);
      e = c.x, o = c.y;
    }
    n.attr("transform", `translate(${e}, ${o})`);
  }
  if (r.endLabelRight) {
    const n = b.get(r.id).endRight;
    let e = r.x, o = r.y;
    if (a) {
      const c = S.calcTerminalLabelPosition(r.arrowTypeEnd ? 10 : 0, "end_right", a);
      e = c.x, o = c.y;
    }
    n.attr("transform", `translate(${e}, ${o})`);
  }
}, "positionEdgeLabel"), Et = /* @__PURE__ */ h((r, t) => {
  const a = r.x, s = r.y, i = Math.abs(t.x - a), n = Math.abs(t.y - s), e = r.width / 2, o = r.height / 2;
  return i >= e || n >= o;
}, "outsideNode"), Ot = /* @__PURE__ */ h((r, t, a) => {
  m.debug(`intersection calc abc89:
  outsidePoint: ${JSON.stringify(t)}
  insidePoint : ${JSON.stringify(a)}
  node        : x:${r.x} y:${r.y} w:${r.width} h:${r.height}`);
  const s = r.x, i = r.y, n = Math.abs(s - a.x), e = r.width / 2;
  let o = a.x < t.x ? e - n : e + n;
  const c = r.height / 2, l = Math.abs(t.y - a.y), p = Math.abs(t.x - a.x);
  if (Math.abs(i - t.y) * e > Math.abs(s - t.x) * c) {
    let d = a.y < t.y ? t.y - c - i : i - c - t.y;
    o = p * d / l;
    const f = {
      x: a.x < t.x ? a.x + o : a.x - p + o,
      y: a.y < t.y ? a.y + l - d : a.y - l + d
    };
    return o === 0 && (f.x = t.x, f.y = t.y), p === 0 && (f.x = t.x), l === 0 && (f.y = t.y), m.debug(`abc89 top/bottom calc, Q ${l}, q ${d}, R ${p}, r ${o}`, f), f;
  } else {
    a.x < t.x ? o = t.x - e - s : o = s - e - t.x;
    let d = l * o / p, f = a.x < t.x ? a.x + p - o : a.x - p + o, y = a.y < t.y ? a.y + d : a.y - d;
    return m.debug(`sides calc abc89, Q ${l}, q ${d}, R ${p}, r ${o}`, { _x: f, _y: y }), o === 0 && (f = t.x, y = t.y), p === 0 && (f = t.x), l === 0 && (y = t.y), { x: f, y };
  }
}, "intersection"), tt = /* @__PURE__ */ h((r, t) => {
  m.warn("abc88 cutPathAtIntersect", r, t);
  let a = [], s = r[0], i = !1;
  return r.forEach((n) => {
    if (m.info("abc88 checking point", n, t), !Et(t, n) && !i) {
      const e = Ot(t, s, n);
      m.debug("abc88 inside", n, s, e), m.debug("abc88 intersection", e, t);
      let o = !1;
      a.forEach((c) => {
        o = o || c.x === e.x && c.y === e.y;
      }), a.some((c) => c.x === e.x && c.y === e.y) ? m.warn("abc88 no intersect", e, a) : a.push(e), i = !0;
    } else
      m.warn("abc88 outside", n, s), s = n, i || a.push(n);
  }), m.debug("returning points", a), a;
}, "cutPathAtIntersect");
function et(r) {
  const t = [], a = [];
  for (let s = 1; s < r.length - 1; s++) {
    const i = r[s - 1], n = r[s], e = r[s + 1];
    (i.x === n.x && n.y === e.y && Math.abs(n.x - e.x) > 5 && Math.abs(n.y - i.y) > 5 || i.y === n.y && n.x === e.x && Math.abs(n.x - i.x) > 5 && Math.abs(n.y - e.y) > 5) && (t.push(n), a.push(s));
  }
  return { cornerPoints: t, cornerPointPositions: a };
}
h(et, "extractCornerPoints");
var rt = /* @__PURE__ */ h(function(r, t, a) {
  const s = t.x - r.x, i = t.y - r.y, n = Math.sqrt(s * s + i * i), e = a / n;
  return { x: t.x - e * s, y: t.y - e * i };
}, "findAdjacentPoint"), Tt = /* @__PURE__ */ h(function(r) {
  const { cornerPointPositions: t } = et(r), a = [];
  for (let s = 0; s < r.length; s++)
    if (t.includes(s)) {
      const i = r[s - 1], n = r[s + 1], e = r[s], o = rt(i, e, 5), c = rt(n, e, 5), l = c.x - o.x, p = c.y - o.y;
      a.push(o);
      const d = Math.sqrt(2) * 2;
      let f = { x: e.x, y: e.y };
      if (Math.abs(n.x - i.x) > 10 && Math.abs(n.y - i.y) >= 10) {
        m.debug(
          "Corner point fixing",
          Math.abs(n.x - i.x),
          Math.abs(n.y - i.y)
        );
        const y = 5;
        e.x === o.x ? f = {
          x: l < 0 ? o.x - y + d : o.x + y - d,
          y: p < 0 ? o.y - d : o.y + d
        } : f = {
          x: l < 0 ? o.x - d : o.x + d,
          y: p < 0 ? o.y - y + d : o.y + y - d
        };
      } else
        m.debug(
          "Corner point skipping fixing",
          Math.abs(n.x - i.x),
          Math.abs(n.y - i.y)
        );
      a.push(f, c);
    } else
      a.push(r[s]);
  return a;
}, "fixCorners"), Xt = /* @__PURE__ */ h((r, t, a) => {
  const s = r - t - a, i = 2, n = 2, e = i + n, o = Math.floor(s / e), c = Array(o).fill(`${i} ${n}`).join(" ");
  return `0 ${t} ${c} ${a}`;
}, "generateDashArray"), br = /* @__PURE__ */ h(function(r, t, a, s, i, n, e, o = !1) {
  var J;
  const { handDrawnSeed: c } = E();
  let l = t.points, p = !1;
  const d = i;
  var f = n;
  const y = [];
  for (const u in t.cssCompiledStyles)
    dt(u) || y.push(t.cssCompiledStyles[u]);
  m.debug("UIO intersect check", t.points, f.x, d.x), f.intersect && d.intersect && !o && (l = l.slice(1, t.points.length - 1), l.unshift(d.intersect(l[0])), m.debug(
    "Last point UIO",
    t.start,
    "-->",
    t.end,
    l[l.length - 1],
    f,
    f.intersect(l[l.length - 1])
  ), l.push(f.intersect(l[l.length - 1])));
  const M = btoa(JSON.stringify(l));
  t.toCluster && (m.info("to cluster abc88", a.get(t.toCluster)), l = tt(t.points, a.get(t.toCluster).node), p = !0), t.fromCluster && (m.debug(
    "from cluster abc88",
    a.get(t.fromCluster),
    JSON.stringify(l, null, 2)
  ), l = tt(l.reverse(), a.get(t.fromCluster).node).reverse(), p = !0);
  let g = l.filter((u) => !Number.isNaN(u.y));
  g = Tt(g);
  let k = j;
  switch (k = G, t.curve) {
    case "linear":
      k = G;
      break;
    case "basis":
      k = j;
      break;
    case "cardinal":
      k = vt;
      break;
    case "bumpX":
      k = _t;
      break;
    case "bumpY":
      k = wt;
      break;
    case "catmullRom":
      k = Mt;
      break;
    case "monotoneX":
      k = Lt;
      break;
    case "monotoneY":
      k = gt;
      break;
    case "natural":
      k = bt;
      break;
    case "step":
      k = kt;
      break;
    case "stepAfter":
      k = ut;
      break;
    case "stepBefore":
      k = xt;
      break;
    default:
      k = j;
  }
  const { x: _, y: Y } = lt(t), P = yt().x(_).y(Y).curve(k);
  let L;
  switch (t.thickness) {
    case "normal":
      L = "edge-thickness-normal";
      break;
    case "thick":
      L = "edge-thickness-thick";
      break;
    case "invisible":
      L = "edge-thickness-invisible";
      break;
    default:
      L = "edge-thickness-normal";
  }
  switch (t.pattern) {
    case "solid":
      L += " edge-pattern-solid";
      break;
    case "dotted":
      L += " edge-pattern-dotted";
      break;
    case "dashed":
      L += " edge-pattern-dashed";
      break;
    default:
      L += " edge-pattern-solid";
  }
  let x, v = t.curve === "rounded" ? nt(st(g, t), 5) : P(g);
  const w = Array.isArray(t.style) ? t.style : [t.style];
  let C = w.find((u) => u == null ? void 0 : u.startsWith("stroke:")), W = !1;
  if (t.look === "handDrawn") {
    const u = mt.svg(r);
    Object.assign([], g);
    const H = u.path(v, {
      roughness: 0.3,
      seed: c
    });
    L += " transition", x = at(H).select("path").attr("id", t.id).attr("class", " " + L + (t.classes ? " " + t.classes : "")).attr("style", w ? w.reduce((A, B) => A + ";" + B, "") : "");
    let O = x.attr("d");
    x.attr("d", O), r.node().appendChild(x.node());
  } else {
    const u = y.join(";"), H = w ? w.reduce((R, T) => R + T + ";", "") : "";
    let O = "";
    t.animate && (O = " edge-animation-fast"), t.animation && (O = " edge-animation-" + t.animation);
    const A = (u ? u + ";" + H + ";" : H) + ";" + (w ? w.reduce((R, T) => R + ";" + T, "") : "");
    x = r.append("path").attr("d", v).attr("id", t.id).attr(
      "class",
      " " + L + (t.classes ? " " + t.classes : "") + (O ?? "")
    ).attr("style", A), C = (J = A.match(/stroke:([^;]+)/)) == null ? void 0 : J[1], W = t.animate === !0 || !!t.animation || u.includes("animation");
    const B = x.node(), V = typeof B.getTotalLength == "function" ? B.getTotalLength() : 0, Q = F[t.arrowTypeStart] || 0, Z = F[t.arrowTypeEnd] || 0;
    if (t.look === "neo" && !W) {
      const T = `stroke-dasharray: ${t.pattern === "dotted" || t.pattern === "dashed" ? Xt(V, Q, Z) : `0 ${Q} ${V - Q - Z} ${Z}`}; stroke-dashoffset: 0;`;
      x.attr("style", T + x.attr("style"));
    }
  }
  x.attr("data-edge", !0), x.attr("data-et", "edge"), x.attr("data-id", t.id), x.attr("data-points", M), t.showPoints && g.forEach((u) => {
    r.append("circle").style("stroke", "red").style("fill", "red").attr("r", 1).attr("cx", u.x).attr("cy", u.y);
  });
  let $ = "";
  (E().flowchart.arrowMarkerAbsolute || E().state.arrowMarkerAbsolute) && ($ = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, $ = $.replace(/\(/g, "\\(").replace(/\)/g, "\\)")), m.info("arrowTypeStart", t.arrowTypeStart), m.info("arrowTypeEnd", t.arrowTypeEnd), $t(x, t, $, e, s, C);
  const ot = Math.floor(l.length / 2), it = l[ot];
  S.isLabelCoordinateInPath(it, x.attr("d")) || (p = !0);
  let N = {};
  return p && (N.updatedPath = l), N.originalPath = t.points, N;
}, "insertEdge");
function nt(r, t) {
  if (r.length < 2)
    return "";
  let a = "";
  const s = r.length, i = 1e-5;
  for (let n = 0; n < s; n++) {
    const e = r[n], o = r[n - 1], c = r[n + 1];
    if (n === 0)
      a += `M${e.x},${e.y}`;
    else if (n === s - 1)
      a += `L${e.x},${e.y}`;
    else {
      const l = e.x - o.x, p = e.y - o.y, d = c.x - e.x, f = c.y - e.y, y = Math.hypot(l, p), M = Math.hypot(d, f);
      if (y < i || M < i) {
        a += `L${e.x},${e.y}`;
        continue;
      }
      const g = l / y, k = p / y, _ = d / M, Y = f / M, P = g * _ + k * Y, L = Math.max(-1, Math.min(1, P)), x = Math.acos(L);
      if (x < i || Math.abs(Math.PI - x) < i) {
        a += `L${e.x},${e.y}`;
        continue;
      }
      const v = Math.min(t / Math.sin(x / 2), y / 2, M / 2), w = e.x - g * v, C = e.y - k * v, W = e.x + _ * v, $ = e.y + Y * v;
      a += `L${w},${C}`, a += `Q${e.x},${e.y} ${W},${$}`;
    }
  }
  return a;
}
h(nt, "generateRoundedPath");
function D(r, t) {
  if (!r || !t)
    return { angle: 0, deltaX: 0, deltaY: 0 };
  const a = t.x - r.x, s = t.y - r.y;
  return { angle: Math.atan2(s, a), deltaX: a, deltaY: s };
}
h(D, "calculateDeltaAndAngle");
function st(r, t) {
  const a = r.map((i) => ({ ...i }));
  if (r.length >= 2 && z[t.arrowTypeStart]) {
    const i = z[t.arrowTypeStart], n = r[0], e = r[1], { angle: o } = D(n, e), c = i * Math.cos(o), l = i * Math.sin(o);
    a[0].x = n.x + c, a[0].y = n.y + l;
  }
  const s = r.length;
  if (s >= 2 && z[t.arrowTypeEnd]) {
    const i = z[t.arrowTypeEnd], n = r[s - 1], e = r[s - 2], { angle: o } = D(e, n), c = i * Math.cos(o), l = i * Math.sin(o);
    a[s - 1].x = n.x - c, a[s - 1].y = n.y - l;
  }
  return a;
}
h(st, "applyMarkerOffsetsToPoints");
var Yt = /* @__PURE__ */ h((r, t, a, s) => {
  t.forEach((i) => {
    Dt[i](r, a, s);
  });
}, "insertMarkers"), Ct = /* @__PURE__ */ h((r, t, a) => {
  m.trace("Making markers for ", a), r.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), r.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
}, "extension"), Wt = /* @__PURE__ */ h((r, t, a) => {
  r.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), r.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
}, "composition"), Ht = /* @__PURE__ */ h((r, t, a) => {
  r.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), r.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
}, "aggregation"), At = /* @__PURE__ */ h((r, t, a) => {
  r.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), r.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
}, "dependency"), Bt = /* @__PURE__ */ h((r, t, a) => {
  r.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), r.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
}, "lollipop"), Rt = /* @__PURE__ */ h((r, t, a) => {
  r.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), r.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
}, "point"), zt = /* @__PURE__ */ h((r, t, a) => {
  r.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), r.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
}, "circle"), qt = /* @__PURE__ */ h((r, t, a) => {
  r.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), r.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
}, "cross"), Ut = /* @__PURE__ */ h((r, t, a) => {
  r.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
}, "barb"), It = /* @__PURE__ */ h((r, t, a) => {
  r.append("defs").append("marker").attr("id", a + "_" + t + "-onlyOneStart").attr("class", "marker onlyOne " + t).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18"), r.append("defs").append("marker").attr("id", a + "_" + t + "-onlyOneEnd").attr("class", "marker onlyOne " + t).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
}, "only_one"), Pt = /* @__PURE__ */ h((r, t, a) => {
  const s = r.append("defs").append("marker").attr("id", a + "_" + t + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + t).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
  s.append("circle").attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6), s.append("path").attr("d", "M9,0 L9,18");
  const i = r.append("defs").append("marker").attr("id", a + "_" + t + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + t).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
  i.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6), i.append("path").attr("d", "M21,0 L21,18");
}, "zero_or_one"), Nt = /* @__PURE__ */ h((r, t, a) => {
  r.append("defs").append("marker").attr("id", a + "_" + t + "-oneOrMoreStart").attr("class", "marker oneOrMore " + t).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"), r.append("defs").append("marker").attr("id", a + "_" + t + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + t).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
}, "one_or_more"), Qt = /* @__PURE__ */ h((r, t, a) => {
  const s = r.append("defs").append("marker").attr("id", a + "_" + t + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + t).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
  s.append("circle").attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6), s.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
  const i = r.append("defs").append("marker").attr("id", a + "_" + t + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + t).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
  i.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6), i.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
}, "zero_or_more"), Zt = /* @__PURE__ */ h((r, t, a) => {
  r.append("defs").append("marker").attr("id", a + "_" + t + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("path").attr(
    "d",
    `M0,0
      L20,10
      M20,10
      L0,20`
  );
}, "requirement_arrow"), jt = /* @__PURE__ */ h((r, t, a) => {
  const s = r.append("defs").append("marker").attr("id", a + "_" + t + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
  s.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none"), s.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10), s.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
}, "requirement_contains"), Dt = {
  extension: Ct,
  composition: Wt,
  aggregation: Ht,
  dependency: At,
  lollipop: Bt,
  point: Rt,
  circle: zt,
  cross: qt,
  barb: Ut,
  only_one: It,
  zero_or_one: Pt,
  one_or_more: Nt,
  zero_or_more: Qt,
  requirement_arrow: Zt,
  requirement_contains: jt
}, gr = Yt;
export {
  kr as clear,
  br as insertEdge,
  xr as insertEdgeLabel,
  gr as markers_default,
  ur as positionEdgeLabel
};
