@wzh-/ai-chat-example 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/css/index.css +1 -1
  2. package/dist/js/_baseFor.js +309 -0
  3. package/dist/js/architecture-U656AL7Q.js +3 -4
  4. package/dist/js/architectureDiagram-VXUJARFQ.js +53 -54
  5. package/dist/js/blockDiagram-VD42YOAC.js +449 -449
  6. package/dist/js/c4Diagram-YG6GDRKO.js +87 -87
  7. package/dist/js/chunk-B4BG7PRW.js +160 -160
  8. package/dist/js/chunk-DI55MBZ5.js +98 -98
  9. package/dist/js/chunk-FPAJGGOC.js +1373 -197
  10. package/dist/js/chunk-JA3XYJ7Z.js +36 -36
  11. package/dist/js/chunk-JZLCHNYA.js +1461 -1461
  12. package/dist/js/chunk-N4CR4FBY.js +5 -5
  13. package/dist/js/chunk-QXUST7PY.js +226 -226
  14. package/dist/js/chunk-S3R3BYOJ.js +602 -454
  15. package/dist/js/classDiagram-2ON5EDUG.js +2 -2
  16. package/dist/js/classDiagram-v2-WZHVMYZB.js +2 -2
  17. package/dist/js/clone.js +1 -1
  18. package/dist/js/dagre-6UL2VRFP.js +152 -152
  19. package/dist/js/dagre.js +1034 -933
  20. package/dist/js/diagram-PSM6KHXK.js +58 -59
  21. package/dist/js/diagram-QEK2KX5R.js +53 -54
  22. package/dist/js/diagram-S2PKOQOG.js +24 -25
  23. package/dist/js/erDiagram-Q2GNP2WA.js +96 -96
  24. package/dist/js/flatten.js +34 -0
  25. package/dist/js/flowDiagram-NV44I4VS.js +166 -166
  26. package/dist/js/ganttDiagram-JELNMOA3.js +916 -916
  27. package/dist/js/gitGraph-F6HP7TQM.js +3 -4
  28. package/dist/js/gitGraphDiagram-NY62KEGX.js +373 -374
  29. package/dist/js/graphlib.js +264 -143
  30. package/dist/js/index.js +3280 -3266
  31. package/dist/js/info-NVLQJR56.js +3 -4
  32. package/dist/js/infoDiagram-WHAUD3N6.js +3 -4
  33. package/dist/js/isEmpty.js +18 -18
  34. package/dist/js/kanban-definition-3W4ZIXB7.js +2 -2
  35. package/dist/js/line.js +7 -7
  36. package/dist/js/mermaid.core.js +65 -65
  37. package/dist/js/mindmap-definition-VGOIOE7T.js +2 -2
  38. package/dist/js/packet-BFZMPI3H.js +3 -4
  39. package/dist/js/pie-7BOR55EZ.js +3 -4
  40. package/dist/js/pieDiagram-ADFJNKIX.js +39 -40
  41. package/dist/js/radar-NHE76QYJ.js +3 -4
  42. package/dist/js/reduce.js +451 -0
  43. package/dist/js/requirementDiagram-UZGBJVZJ.js +16 -16
  44. package/dist/js/sequenceDiagram-WL72ISMW.js +731 -731
  45. package/dist/js/stateDiagram-FKZM4ZOC.js +83 -83
  46. package/dist/js/stateDiagram-v2-4FDKWEC3.js +2 -2
  47. package/dist/js/treemap-KMMF4GRG.js +3 -4
  48. package/dist/js/xychartDiagram-PRI3JC2R.js +25 -25
  49. package/package.json +14 -7
@@ -1,12 +1,12 @@
1
1
  import "./marked.esm.js";
2
- import "./isArrayLikeObject.js";
3
- import { c as getEdgeId, g as utils_default } from "./chunk-S3R3BYOJ.js";
2
+ import "./_baseFor.js";
4
3
  import { g as log, h as __name, p as select_default } from "./src.js";
5
4
  import { B as setAccTitle, C as getDiagramTitle, H as setConfig2, U as setDiagramTitle, _ as getAccDescription, a as clear, b as getConfig2, et as rgba_default, s as common_default, u as defaultConfig2, v as getAccTitle, z as setAccDescription } from "./chunk-ABZYJK2D.js";
6
5
  import { t as channel_default } from "./channel.js";
7
6
  import "./path.js";
8
7
  import "./math.js";
9
8
  import "./array.js";
9
+ import { c as getEdgeId, g as utils_default } from "./chunk-S3R3BYOJ.js";
10
10
  import "./line.js";
11
11
  import "./dist.js";
12
12
  import "./chunk-JA3XYJ7Z.js";
@@ -39,36 +39,36 @@ var MERMAID_DOM_ID_PREFIX = "flowchart-", FlowDB = class {
39
39
  let e;
40
40
  e = s.includes("\n") ? s + "\n" : "{\n" + s + "\n}", c = load(e, { schema: JSON_SCHEMA });
41
41
  }
42
- let l = this.edges.find((t) => t.id === e);
43
- if (l) {
42
+ let u = this.edges.find((t) => t.id === e);
43
+ if (u) {
44
44
  let e = c;
45
- e?.animate !== void 0 && (l.animate = e.animate), e?.animation !== void 0 && (l.animation = e.animation), e?.curve !== void 0 && (l.interpolate = e.curve);
45
+ e?.animate !== void 0 && (u.animate = e.animate), e?.animation !== void 0 && (u.animation = e.animation), e?.curve !== void 0 && (u.interpolate = e.curve);
46
46
  return;
47
47
  }
48
- let u, d = this.vertices.get(e);
49
- if (d === void 0 && (d = {
48
+ let d, f = this.vertices.get(e);
49
+ if (f === void 0 && (f = {
50
50
  id: e,
51
51
  labelType: "text",
52
52
  domId: MERMAID_DOM_ID_PREFIX + e + "-" + this.vertexCounter,
53
53
  styles: [],
54
54
  classes: []
55
- }, this.vertices.set(e, d)), this.vertexCounter++, t === void 0 ? d.text === void 0 && (d.text = e) : (this.config = getConfig2(), u = this.sanitizeText(t.text.trim()), d.labelType = t.type, u.startsWith("\"") && u.endsWith("\"") && (u = u.substring(1, u.length - 1)), d.text = u), n !== void 0 && (d.type = n), r?.forEach((e) => {
56
- d.styles.push(e);
55
+ }, this.vertices.set(e, f)), this.vertexCounter++, t === void 0 ? f.text === void 0 && (f.text = e) : (this.config = getConfig2(), d = this.sanitizeText(t.text.trim()), f.labelType = t.type, d.startsWith("\"") && d.endsWith("\"") && (d = d.substring(1, d.length - 1)), f.text = d), n !== void 0 && (f.type = n), r?.forEach((e) => {
56
+ f.styles.push(e);
57
57
  }), i?.forEach((e) => {
58
- d.classes.push(e);
59
- }), a !== void 0 && (d.dir = a), d.props === void 0 ? d.props = o : o !== void 0 && Object.assign(d.props, o), c !== void 0) {
58
+ f.classes.push(e);
59
+ }), a !== void 0 && (f.dir = a), f.props === void 0 ? f.props = o : o !== void 0 && Object.assign(f.props, o), c !== void 0) {
60
60
  if (c.shape) {
61
61
  if (c.shape !== c.shape.toLowerCase() || c.shape.includes("_")) throw Error(`No such shape: ${c.shape}. Shape names should be lowercase.`);
62
62
  if (!isValidShape(c.shape)) throw Error(`No such shape: ${c.shape}.`);
63
- d.type = c?.shape;
63
+ f.type = c?.shape;
64
64
  }
65
- c?.label && (d.text = c?.label), c?.icon && (d.icon = c?.icon, !c.label?.trim() && d.text === e && (d.text = "")), c?.form && (d.form = c?.form), c?.pos && (d.pos = c?.pos), c?.img && (d.img = c?.img, !c.label?.trim() && d.text === e && (d.text = "")), c?.constraint && (d.constraint = c.constraint), c.w && (d.assetWidth = Number(c.w)), c.h && (d.assetHeight = Number(c.h));
65
+ c?.label && (f.text = c?.label), c?.icon && (f.icon = c?.icon, !c.label?.trim() && f.text === e && (f.text = "")), c?.form && (f.form = c?.form), c?.pos && (f.pos = c?.pos), c?.img && (f.img = c?.img, !c.label?.trim() && f.text === e && (f.text = "")), c?.constraint && (f.constraint = c.constraint), c.w && (f.assetWidth = Number(c.w)), c.h && (f.assetHeight = Number(c.h));
66
66
  }
67
67
  }
68
- addSingleLink(t, r, i, a) {
69
- let o = {
68
+ addSingleLink(t, n, r, i) {
69
+ let a = {
70
70
  start: t,
71
- end: r,
71
+ end: n,
72
72
  type: void 0,
73
73
  text: "",
74
74
  labelType: "text",
@@ -76,20 +76,20 @@ var MERMAID_DOM_ID_PREFIX = "flowchart-", FlowDB = class {
76
76
  isUserDefinedId: !1,
77
77
  interpolate: this.edges.defaultInterpolate
78
78
  };
79
- log.info("abc78 Got edge...", o);
80
- let s = i.text;
81
- if (s !== void 0 && (o.text = this.sanitizeText(s.text.trim()), o.text.startsWith("\"") && o.text.endsWith("\"") && (o.text = o.text.substring(1, o.text.length - 1)), o.labelType = s.type), i !== void 0 && (o.type = i.type, o.stroke = i.stroke, o.length = i.length > 10 ? 10 : i.length), a && !this.edges.some((e) => e.id === a)) o.id = a, o.isUserDefinedId = !0;
79
+ log.info("abc78 Got edge...", a);
80
+ let o = r.text;
81
+ if (o !== void 0 && (a.text = this.sanitizeText(o.text.trim()), a.text.startsWith("\"") && a.text.endsWith("\"") && (a.text = a.text.substring(1, a.text.length - 1)), a.labelType = o.type), r !== void 0 && (a.type = r.type, a.stroke = r.stroke, a.length = r.length > 10 ? 10 : r.length), i && !this.edges.some((e) => e.id === i)) a.id = i, a.isUserDefinedId = !0;
82
82
  else {
83
- let t = this.edges.filter((e) => e.start === o.start && e.end === o.end);
84
- t.length === 0 ? o.id = getEdgeId(o.start, o.end, {
83
+ let e = this.edges.filter((e) => e.start === a.start && e.end === a.end);
84
+ e.length === 0 ? a.id = getEdgeId(a.start, a.end, {
85
85
  counter: 0,
86
86
  prefix: "L"
87
- }) : o.id = getEdgeId(o.start, o.end, {
88
- counter: t.length + 1,
87
+ }) : a.id = getEdgeId(a.start, a.end, {
88
+ counter: e.length + 1,
89
89
  prefix: "L"
90
90
  });
91
91
  }
92
- if (this.edges.length < (this.config.maxEdges ?? 500)) log.info("Pushing edge..."), this.edges.push(o);
92
+ if (this.edges.length < (this.config.maxEdges ?? 500)) log.info("Pushing edge..."), this.edges.push(a);
93
93
  else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
94
94
 
95
95
  Initialize mermaid with maxEdges set to a higher number to allow more edges.
@@ -99,12 +99,12 @@ You have to call mermaid.initialize.`);
99
99
  isLinkData(e) {
100
100
  return typeof e == "object" && !!e && "id" in e && typeof e.id == "string";
101
101
  }
102
- addLink(e, t, r) {
102
+ addLink(t, n, r) {
103
103
  let i = this.isLinkData(r) ? r.id.replace("@", "") : void 0;
104
- log.info("addLink", e, t, i);
105
- for (let n of e) for (let a of t) {
106
- let o = n === e[e.length - 1], s = a === t[0];
107
- o && s ? this.addSingleLink(n, a, r, i) : this.addSingleLink(n, a, r, void 0);
104
+ log.info("addLink", t, n, i);
105
+ for (let e of t) for (let a of n) {
106
+ let o = e === t[t.length - 1], s = a === n[0];
107
+ o && s ? this.addSingleLink(e, a, r, i) : this.addSingleLink(e, a, r, void 0);
108
108
  }
109
109
  }
110
110
  updateLinkInterpolate(e, t) {
@@ -154,30 +154,30 @@ You have to call mermaid.initialize.`);
154
154
  for (let n of e.split(",")) this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(n) : n, t);
155
155
  }
156
156
  }
157
- setClickFun(e, n, r) {
158
- let i = this.lookUpDomId(e);
159
- if (getConfig2().securityLevel !== "loose" || n === void 0) return;
160
- let a = [];
161
- if (typeof r == "string") {
162
- a = r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
163
- for (let e = 0; e < a.length; e++) {
164
- let t = a[e].trim();
165
- t.startsWith("\"") && t.endsWith("\"") && (t = t.substr(1, t.length - 2)), a[e] = t;
157
+ setClickFun(e, t, n) {
158
+ let r = this.lookUpDomId(e);
159
+ if (getConfig2().securityLevel !== "loose" || t === void 0) return;
160
+ let i = [];
161
+ if (typeof n == "string") {
162
+ i = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
163
+ for (let e = 0; e < i.length; e++) {
164
+ let t = i[e].trim();
165
+ t.startsWith("\"") && t.endsWith("\"") && (t = t.substr(1, t.length - 2)), i[e] = t;
166
166
  }
167
167
  }
168
- a.length === 0 && a.push(e);
169
- let o = this.vertices.get(e);
170
- o && (o.haveCallback = !0, this.funs.push(() => {
171
- let e = document.querySelector(`[id="${i}"]`);
168
+ i.length === 0 && i.push(e);
169
+ let a = this.vertices.get(e);
170
+ a && (a.haveCallback = !0, this.funs.push(() => {
171
+ let e = document.querySelector(`[id="${r}"]`);
172
172
  e !== null && e.addEventListener("click", () => {
173
- utils_default.runFunc(n, ...a);
173
+ utils_default.runFunc(t, ...i);
174
174
  }, !1);
175
175
  }));
176
176
  }
177
- setLink(e, n, r) {
177
+ setLink(e, t, n) {
178
178
  e.split(",").forEach((e) => {
179
- let i = this.vertices.get(e);
180
- i !== void 0 && (i.link = utils_default.formatUrl(n, this.config), i.linkTarget = r);
179
+ let r = this.vertices.get(e);
180
+ r !== void 0 && (r.link = utils_default.formatUrl(t, this.config), r.linkTarget = n);
181
181
  }), this.setClass(e, "clickable");
182
182
  }
183
183
  getTooltip(e) {
@@ -208,10 +208,10 @@ You have to call mermaid.initialize.`);
208
208
  setupToolTips(e) {
209
209
  let t = select_default(".mermaidTooltip");
210
210
  (t._groups || t)[0][0] === null && (t = select_default("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0)), select_default(e).select("svg").selectAll("g.node").on("mouseover", (e) => {
211
- let n = select_default(e.currentTarget);
212
- if (n.attr("title") === null) return;
213
- let r = e.currentTarget?.getBoundingClientRect();
214
- t.transition().duration(200).style("opacity", ".9"), t.text(n.attr("title")).style("left", window.scrollX + r.left + (r.right - r.left) / 2 + "px").style("top", window.scrollY + r.bottom + "px"), t.html(t.html().replace(/&lt;br\/&gt;/g, "<br/>")), n.classed("hover", !0);
211
+ let r = select_default(e.currentTarget);
212
+ if (r.attr("title") === null) return;
213
+ let i = e.currentTarget?.getBoundingClientRect();
214
+ t.transition().duration(200).style("opacity", ".9"), t.text(r.attr("title")).style("left", window.scrollX + i.left + (i.right - i.left) / 2 + "px").style("top", window.scrollY + i.bottom + "px"), t.html(t.html().replace(/&lt;br\/&gt;/g, "<br/>")), r.classed("hover", !0);
215
215
  }).on("mouseout", (e) => {
216
216
  t.transition().duration(500).style("opacity", 0), select_default(e.currentTarget).classed("hover", !1);
217
217
  });
@@ -225,9 +225,9 @@ You have to call mermaid.initialize.`);
225
225
  defaultStyle() {
226
226
  return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
227
227
  }
228
- addSubGraph(e, t, i) {
229
- let a = e.text.trim(), o = i.text;
230
- e === i && /\s/.exec(i.text) && (a = void 0);
228
+ addSubGraph(n, r, i) {
229
+ let a = n.text.trim(), o = i.text;
230
+ n === i && /\s/.exec(i.text) && (a = void 0);
231
231
  let s = (/* @__PURE__ */ __name((e) => {
232
232
  let t = {
233
233
  boolean: {},
@@ -241,18 +241,18 @@ You have to call mermaid.initialize.`);
241
241
  }),
242
242
  dir: r
243
243
  };
244
- }, "uniq"))(t.flat()), c = s.nodeList, l = s.dir, u = getConfig2().flowchart ?? {};
245
- if (l ??= u.inheritDir ? this.getDirection() ?? getConfig2().direction ?? void 0 : void 0, this.version === "gen-1") for (let e = 0; e < c.length; e++) c[e] = this.lookUpDomId(c[e]);
244
+ }, "uniq"))(r.flat()), c = s.nodeList, u = s.dir, d = getConfig2().flowchart ?? {};
245
+ if (u ??= d.inheritDir ? this.getDirection() ?? getConfig2().direction ?? void 0 : void 0, this.version === "gen-1") for (let e = 0; e < c.length; e++) c[e] = this.lookUpDomId(c[e]);
246
246
  a ??= "subGraph" + this.subCount, o ||= "", o = this.sanitizeText(o), this.subCount += 1;
247
- let d = {
247
+ let f = {
248
248
  id: a,
249
249
  nodes: c,
250
250
  title: o.trim(),
251
251
  classes: [],
252
- dir: l,
252
+ dir: u,
253
253
  labelType: i.type
254
254
  };
255
- return log.info("Adding", d.id, d.nodes, d.dir), d.nodes = this.makeUniq(d, this.subGraphs).nodes, this.subGraphs.push(d), this.subGraphLookup.set(a, d), a;
255
+ return log.info("Adding", f.id, f.nodes, f.dir), f.nodes = this.makeUniq(f, this.subGraphs).nodes, this.subGraphs.push(f), this.subGraphLookup.set(a, f), a;
256
256
  }
257
257
  getPosForId(e) {
258
258
  for (let [t, n] of this.subGraphs.entries()) if (n.id === e) return t;
@@ -456,67 +456,67 @@ You have to call mermaid.initialize.`);
456
456
  return t;
457
457
  }
458
458
  getData() {
459
- let t = getConfig2(), n = [], r = [], i = this.getSubGraphs(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
460
- for (let e = i.length - 1; e >= 0; e--) {
461
- let t = i[e];
462
- t.nodes.length > 0 && o.set(t.id, !0);
463
- for (let e of t.nodes) a.set(e, t.id);
459
+ let e = getConfig2(), t = [], n = [], r = this.getSubGraphs(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
460
+ for (let e = r.length - 1; e >= 0; e--) {
461
+ let t = r[e];
462
+ t.nodes.length > 0 && a.set(t.id, !0);
463
+ for (let e of t.nodes) i.set(e, t.id);
464
464
  }
465
- for (let e = i.length - 1; e >= 0; e--) {
466
- let r = i[e];
467
- n.push({
468
- id: r.id,
469
- label: r.title,
465
+ for (let n = r.length - 1; n >= 0; n--) {
466
+ let a = r[n];
467
+ t.push({
468
+ id: a.id,
469
+ label: a.title,
470
470
  labelStyle: "",
471
- parentId: a.get(r.id),
471
+ parentId: i.get(a.id),
472
472
  padding: 8,
473
- cssCompiledStyles: this.getCompiledStyles(r.classes),
474
- cssClasses: r.classes.join(" "),
473
+ cssCompiledStyles: this.getCompiledStyles(a.classes),
474
+ cssClasses: a.classes.join(" "),
475
475
  shape: "rect",
476
- dir: r.dir,
476
+ dir: a.dir,
477
477
  isGroup: !0,
478
- look: t.look
478
+ look: e.look
479
479
  });
480
480
  }
481
- this.getVertices().forEach((e) => {
482
- this.addNodeFromVertex(e, n, a, o, t, t.look || "classic");
481
+ this.getVertices().forEach((n) => {
482
+ this.addNodeFromVertex(n, t, i, a, e, e.look || "classic");
483
483
  });
484
- let s = this.getEdges();
485
- return s.forEach((n, i) => {
486
- let { arrowTypeStart: a, arrowTypeEnd: o } = this.destructEdgeType(n.type), c = [...s.defaultStyle ?? []];
487
- n.style && c.push(...n.style);
488
- let l = {
489
- id: getEdgeId(n.start, n.end, {
490
- counter: i,
484
+ let o = this.getEdges();
485
+ return o.forEach((t, r) => {
486
+ let { arrowTypeStart: i, arrowTypeEnd: a } = this.destructEdgeType(t.type), s = [...o.defaultStyle ?? []];
487
+ t.style && s.push(...t.style);
488
+ let c = {
489
+ id: getEdgeId(t.start, t.end, {
490
+ counter: r,
491
491
  prefix: "L"
492
- }, n.id),
493
- isUserDefinedId: n.isUserDefinedId,
494
- start: n.start,
495
- end: n.end,
496
- type: n.type ?? "normal",
497
- label: n.text,
492
+ }, t.id),
493
+ isUserDefinedId: t.isUserDefinedId,
494
+ start: t.start,
495
+ end: t.end,
496
+ type: t.type ?? "normal",
497
+ label: t.text,
498
498
  labelpos: "c",
499
- thickness: n.stroke,
500
- minlen: n.length,
501
- classes: n?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
502
- arrowTypeStart: n?.stroke === "invisible" || n?.type === "arrow_open" ? "none" : a,
503
- arrowTypeEnd: n?.stroke === "invisible" || n?.type === "arrow_open" ? "none" : o,
499
+ thickness: t.stroke,
500
+ minlen: t.length,
501
+ classes: t?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
502
+ arrowTypeStart: t?.stroke === "invisible" || t?.type === "arrow_open" ? "none" : i,
503
+ arrowTypeEnd: t?.stroke === "invisible" || t?.type === "arrow_open" ? "none" : a,
504
504
  arrowheadStyle: "fill: #333",
505
- cssCompiledStyles: this.getCompiledStyles(n.classes),
506
- labelStyle: c,
507
- style: c,
508
- pattern: n.stroke,
509
- look: t.look,
510
- animate: n.animate,
511
- animation: n.animation,
512
- curve: n.interpolate || this.edges.defaultInterpolate || t.flowchart?.curve
505
+ cssCompiledStyles: this.getCompiledStyles(t.classes),
506
+ labelStyle: s,
507
+ style: s,
508
+ pattern: t.stroke,
509
+ look: e.look,
510
+ animate: t.animate,
511
+ animation: t.animation,
512
+ curve: t.interpolate || this.edges.defaultInterpolate || e.flowchart?.curve
513
513
  };
514
- r.push(l);
514
+ n.push(c);
515
515
  }), {
516
- nodes: n,
517
- edges: r,
516
+ nodes: t,
517
+ edges: n,
518
518
  other: {},
519
- config: t
519
+ config: e
520
520
  };
521
521
  }
522
522
  defaultConfig() {
@@ -526,32 +526,32 @@ You have to call mermaid.initialize.`);
526
526
  getClasses: /* @__PURE__ */ __name(function(e, t) {
527
527
  return t.db.getClasses();
528
528
  }, "getClasses"),
529
- draw: /* @__PURE__ */ __name(async function(e, r, a, o) {
529
+ draw: /* @__PURE__ */ __name(async function(t, r, i, a) {
530
530
  log.info("REF0:"), log.info("Drawing state diagram (v2)", r);
531
- let { securityLevel: s, flowchart: c, layout: l } = getConfig2(), u;
532
- s === "sandbox" && (u = select_default("#i" + r));
533
- let d = s === "sandbox" ? u.nodes()[0].contentDocument : document;
531
+ let { securityLevel: o, flowchart: s, layout: c } = getConfig2(), u;
532
+ o === "sandbox" && (u = select_default("#i" + r));
533
+ let d = o === "sandbox" ? u.nodes()[0].contentDocument : document;
534
534
  log.debug("Before getData: ");
535
- let f = o.db.getData();
535
+ let f = a.db.getData();
536
536
  log.debug("Data: ", f);
537
- let p = getDiagramElement(r, s), m = o.db.getDirection();
538
- f.type = o.type, f.layoutAlgorithm = getRegisteredLayoutAlgorithm(l), f.layoutAlgorithm === "dagre" && l === "elk" && log.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."), f.direction = m, f.nodeSpacing = c?.nodeSpacing || 50, f.rankSpacing = c?.rankSpacing || 50, f.markers = [
537
+ let p = getDiagramElement(r, o), ee = a.db.getDirection();
538
+ f.type = a.type, f.layoutAlgorithm = getRegisteredLayoutAlgorithm(c), f.layoutAlgorithm === "dagre" && c === "elk" && log.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."), f.direction = ee, f.nodeSpacing = s?.nodeSpacing || 50, f.rankSpacing = s?.rankSpacing || 50, f.markers = [
539
539
  "point",
540
540
  "circle",
541
541
  "cross"
542
542
  ], f.diagramId = r, log.debug("REF1:", f), await render(f, p);
543
- let h = f.config.flowchart?.diagramPadding ?? 8;
544
- utils_default.insertTitle(p, "flowchartTitleText", c?.titleTopMargin || 0, o.db.getDiagramTitle()), setupViewPortForSVG(p, h, "flowchart", c?.useMaxWidth || !1);
543
+ let m = f.config.flowchart?.diagramPadding ?? 8;
544
+ utils_default.insertTitle(p, "flowchartTitleText", s?.titleTopMargin || 0, a.db.getDiagramTitle()), setupViewPortForSVG(p, m, "flowchart", s?.useMaxWidth || !1);
545
545
  for (let e of f.nodes) {
546
546
  let t = select_default(`#${r} [id="${e.id}"]`);
547
547
  if (!t || !e.link) continue;
548
- let n = d.createElementNS("http://www.w3.org/2000/svg", "a");
549
- n.setAttributeNS("http://www.w3.org/2000/svg", "class", e.cssClasses), n.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), s === "sandbox" ? n.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : e.linkTarget && n.setAttributeNS("http://www.w3.org/2000/svg", "target", e.linkTarget);
548
+ let i = d.createElementNS("http://www.w3.org/2000/svg", "a");
549
+ i.setAttributeNS("http://www.w3.org/2000/svg", "class", e.cssClasses), i.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), o === "sandbox" ? i.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : e.linkTarget && i.setAttributeNS("http://www.w3.org/2000/svg", "target", e.linkTarget);
550
550
  let a = t.insert(function() {
551
- return n;
552
- }, ":first-child"), o = t.select(".label-container");
553
- o && a.append(function() {
554
- return o.node();
551
+ return i;
552
+ }, ":first-child"), s = t.select(".label-container");
553
+ s && a.append(function() {
554
+ return s.node();
555
555
  });
556
556
  let c = t.select(".label");
557
557
  c && a.append(function() {
@@ -563,7 +563,7 @@ You have to call mermaid.initialize.`);
563
563
  var e = /* @__PURE__ */ __name(function(e, t, n, r) {
564
564
  for (n ||= {}, r = e.length; r--; n[e[r]] = t);
565
565
  return n;
566
- }, "o"), t = [1, 4], n = [1, 3], i = [1, 5], a = [
566
+ }, "o"), n = [1, 4], r = [1, 3], i = [1, 5], a = [
567
567
  1,
568
568
  8,
569
569
  9,
@@ -593,7 +593,7 @@ You have to call mermaid.initialize.`);
593
593
  122,
594
594
  123,
595
595
  124
596
- ], o = [2, 2], s = [1, 13], c = [1, 14], l = [1, 15], u = [1, 16], ee = [1, 23], d = [1, 25], f = [1, 26], p = [1, 27], m = [1, 49], h = [1, 48], te = [1, 29], g = [1, 30], ne = [1, 31], re = [1, 32], ie = [1, 33], _ = [1, 44], v = [1, 46], y = [1, 42], b = [1, 47], x = [1, 43], S = [1, 50], C = [1, 45], w = [1, 51], T = [1, 52], E = [1, 34], ae = [1, 35], oe = [1, 36], se = [1, 37], D = [1, 57], O = [
596
+ ], o = [2, 2], s = [1, 13], c = [1, 14], l = [1, 15], u = [1, 16], d = [1, 23], f = [1, 25], p = [1, 26], ee = [1, 27], m = [1, 49], h = [1, 48], g = [1, 29], te = [1, 30], ne = [1, 31], re = [1, 32], ie = [1, 33], _ = [1, 44], v = [1, 46], y = [1, 42], b = [1, 47], x = [1, 43], S = [1, 50], C = [1, 45], w = [1, 51], T = [1, 52], E = [1, 34], ae = [1, 35], oe = [1, 36], se = [1, 37], D = [1, 57], O = [
597
597
  1,
598
598
  8,
599
599
  9,
@@ -1632,22 +1632,22 @@ You have to call mermaid.initialize.`);
1632
1632
  {
1633
1633
  3: 1,
1634
1634
  4: 2,
1635
- 9: t,
1636
- 10: n,
1635
+ 9: n,
1636
+ 10: r,
1637
1637
  12: i
1638
1638
  },
1639
1639
  { 1: [3] },
1640
1640
  e(a, o, { 5: 6 }),
1641
1641
  {
1642
1642
  4: 7,
1643
- 9: t,
1644
- 10: n,
1643
+ 9: n,
1644
+ 10: r,
1645
1645
  12: i
1646
1646
  },
1647
1647
  {
1648
1648
  4: 8,
1649
- 9: t,
1650
- 10: n,
1649
+ 9: n,
1650
+ 10: r,
1651
1651
  12: i
1652
1652
  },
1653
1653
  {
@@ -1668,19 +1668,19 @@ You have to call mermaid.initialize.`);
1668
1668
  24: 20,
1669
1669
  25: 21,
1670
1670
  26: 22,
1671
- 27: ee,
1671
+ 27: d,
1672
1672
  33: 24,
1673
- 34: d,
1674
- 36: f,
1675
- 38: p,
1673
+ 34: f,
1674
+ 36: p,
1675
+ 38: ee,
1676
1676
  42: 28,
1677
1677
  43: 38,
1678
1678
  44: m,
1679
1679
  45: 39,
1680
1680
  47: 40,
1681
1681
  60: h,
1682
- 84: te,
1683
- 85: g,
1682
+ 84: g,
1683
+ 85: te,
1684
1684
  86: ne,
1685
1685
  87: re,
1686
1686
  88: ie,
@@ -2250,20 +2250,20 @@ You have to call mermaid.initialize.`);
2250
2250
  24: 20,
2251
2251
  25: 21,
2252
2252
  26: 22,
2253
- 27: ee,
2253
+ 27: d,
2254
2254
  32: [1, 202],
2255
2255
  33: 24,
2256
- 34: d,
2257
- 36: f,
2258
- 38: p,
2256
+ 34: f,
2257
+ 36: p,
2258
+ 38: ee,
2259
2259
  42: 28,
2260
2260
  43: 38,
2261
2261
  44: m,
2262
2262
  45: 39,
2263
2263
  47: 40,
2264
2264
  60: h,
2265
- 84: te,
2266
- 85: g,
2265
+ 84: g,
2266
+ 85: te,
2267
2267
  86: ne,
2268
2268
  87: re,
2269
2269
  88: ie,
@@ -2684,20 +2684,20 @@ You have to call mermaid.initialize.`);
2684
2684
  24: 20,
2685
2685
  25: 21,
2686
2686
  26: 22,
2687
- 27: ee,
2687
+ 27: d,
2688
2688
  32: [1, 266],
2689
2689
  33: 24,
2690
- 34: d,
2691
- 36: f,
2692
- 38: p,
2690
+ 34: f,
2691
+ 36: p,
2692
+ 38: ee,
2693
2693
  42: 28,
2694
2694
  43: 38,
2695
2695
  44: m,
2696
2696
  45: 39,
2697
2697
  47: 40,
2698
2698
  60: h,
2699
- 84: te,
2700
- 85: g,
2699
+ 84: g,
2700
+ 85: te,
2701
2701
  86: ne,
2702
2702
  87: re,
2703
2703
  88: ie,
@@ -2911,20 +2911,20 @@ You have to call mermaid.initialize.`);
2911
2911
  24: 20,
2912
2912
  25: 21,
2913
2913
  26: 22,
2914
- 27: ee,
2914
+ 27: d,
2915
2915
  32: [1, 287],
2916
2916
  33: 24,
2917
- 34: d,
2918
- 36: f,
2919
- 38: p,
2917
+ 34: f,
2918
+ 36: p,
2919
+ 38: ee,
2920
2920
  42: 28,
2921
2921
  43: 38,
2922
2922
  44: m,
2923
2923
  45: 39,
2924
2924
  47: 40,
2925
2925
  60: h,
2926
- 84: te,
2927
- 85: g,
2926
+ 84: g,
2927
+ 85: te,
2928
2928
  86: ne,
2929
2929
  87: re,
2930
2930
  88: ie,
@@ -2983,38 +2983,38 @@ You have to call mermaid.initialize.`);
2983
2983
  }
2984
2984
  }, "parseError"),
2985
2985
  parse: /* @__PURE__ */ __name(function(e) {
2986
- var t = this, n = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, ee = 0, d = 2, f = 1, p = o.slice.call(arguments, 1), m = Object.create(this.lexer), h = { yy: {} };
2987
- for (var te in this.yy) Object.prototype.hasOwnProperty.call(this.yy, te) && (h.yy[te] = this.yy[te]);
2986
+ var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, ee = o.slice.call(arguments, 1), m = Object.create(this.lexer), h = { yy: {} };
2987
+ for (var g in this.yy) Object.prototype.hasOwnProperty.call(this.yy, g) && (h.yy[g] = this.yy[g]);
2988
2988
  m.setInput(e, h.yy), h.yy.lexer = m, h.yy.parser = this, m.yylloc === void 0 && (m.yylloc = {});
2989
- var g = m.yylloc;
2990
- o.push(g);
2989
+ var te = m.yylloc;
2990
+ o.push(te);
2991
2991
  var ne = m.options && m.options.ranges;
2992
2992
  typeof h.yy.parseError == "function" ? this.parseError = h.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
2993
2993
  function re(e) {
2994
- n.length -= 2 * e, a.length -= e, o.length -= e;
2994
+ r.length -= 2 * e, a.length -= e, o.length -= e;
2995
2995
  }
2996
2996
  __name(re, "popStack");
2997
2997
  function ie() {
2998
- var e = i.pop() || m.lex() || f;
2999
- return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = t.symbols_[e] || e), e;
2998
+ var e = i.pop() || m.lex() || p;
2999
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
3000
3000
  }
3001
3001
  __name(ie, "lex");
3002
3002
  for (var _, v, y, b, x, S = {}, C, w, T, E;;) {
3003
- if (y = n[n.length - 1], this.defaultActions[y] ? b = this.defaultActions[y] : (_ ??= ie(), b = s[y] && s[y][_]), b === void 0 || !b.length || !b[0]) {
3003
+ if (y = r[r.length - 1], this.defaultActions[y] ? b = this.defaultActions[y] : (_ ??= ie(), b = s[y] && s[y][_]), b === void 0 || !b.length || !b[0]) {
3004
3004
  var ae = "";
3005
- for (C in E = [], s[y]) this.terminals_[C] && C > d && E.push("'" + this.terminals_[C] + "'");
3006
- ae = m.showPosition ? "Parse error on line " + (l + 1) + ":\n" + m.showPosition() + "\nExpecting " + E.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (_ == f ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(ae, {
3005
+ for (C in E = [], s[y]) this.terminals_[C] && C > f && E.push("'" + this.terminals_[C] + "'");
3006
+ ae = m.showPosition ? "Parse error on line " + (l + 1) + ":\n" + m.showPosition() + "\nExpecting " + E.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (_ == p ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(ae, {
3007
3007
  text: m.match,
3008
3008
  token: this.terminals_[_] || _,
3009
3009
  line: m.yylineno,
3010
- loc: g,
3010
+ loc: te,
3011
3011
  expected: E
3012
3012
  });
3013
3013
  }
3014
3014
  if (b[0] instanceof Array && b.length > 1) throw Error("Parse Error: multiple actions possible at state: " + y + ", token: " + _);
3015
3015
  switch (b[0]) {
3016
3016
  case 1:
3017
- n.push(_), a.push(m.yytext), o.push(m.yylloc), n.push(b[1]), _ = null, v ? (_ = v, v = null) : (u = m.yyleng, c = m.yytext, l = m.yylineno, g = m.yylloc, ee > 0 && ee--);
3017
+ r.push(_), a.push(m.yytext), o.push(m.yylloc), r.push(b[1]), _ = null, v ? (_ = v, v = null) : (u = m.yyleng, c = m.yytext, l = m.yylineno, te = m.yylloc, d > 0 && d--);
3018
3018
  break;
3019
3019
  case 2:
3020
3020
  if (w = this.productions_[b[1]][1], S.$ = a[a.length - w], S._$ = {
@@ -3030,8 +3030,8 @@ You have to call mermaid.initialize.`);
3030
3030
  b[1],
3031
3031
  a,
3032
3032
  o
3033
- ].concat(p)), x !== void 0) return x;
3034
- w && (n = n.slice(0, -1 * w * 2), a = a.slice(0, -1 * w), o = o.slice(0, -1 * w)), n.push(this.productions_[b[1]][0]), a.push(S.$), o.push(S._$), T = s[n[n.length - 2]][n[n.length - 1]], n.push(T);
3033
+ ].concat(ee)), x !== void 0) return x;
3034
+ w && (r = r.slice(0, -1 * w * 2), a = a.slice(0, -1 * w), o = o.slice(0, -1 * w)), r.push(this.productions_[b[1]][0]), a.push(S.$), o.push(S._$), T = s[r[r.length - 2]][r[r.length - 1]], r.push(T);
3035
3035
  break;
3036
3036
  case 3: return !0;
3037
3037
  }