1 | import { dedent } from "ts-dedent";
|
2 | import dayjs from "dayjs/esm/index.js";
|
3 | import { sanitizeUrl } from "@braintree/sanitize-url";
|
4 | import { select, curveBasis, curveBasisClosed, curveBasisOpen, curveBumpX, curveBumpY, curveBundle, curveCardinalClosed, curveCardinalOpen, curveCardinal, curveCatmullRomClosed, curveCatmullRomOpen, curveCatmullRom, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore } from "d3";
|
5 | import DOMPurify from "dompurify";
|
6 | import { adjust, invert, darken, lighten, isDark, rgba } from "khroma";
|
7 | import memoize from "lodash-es/memoize.js";
|
8 | import { serialize, compile, stringify } from "stylis";
|
9 | import isEmpty from "lodash-es/isEmpty.js";
|
10 | const LEVELS = {
|
11 | trace: 0,
|
12 | debug: 1,
|
13 | info: 2,
|
14 | warn: 3,
|
15 | error: 4,
|
16 | fatal: 5
|
17 | };
|
18 | const log$1 = {
|
19 | trace: (..._args) => {
|
20 | },
|
21 | debug: (..._args) => {
|
22 | },
|
23 | info: (..._args) => {
|
24 | },
|
25 | warn: (..._args) => {
|
26 | },
|
27 | error: (..._args) => {
|
28 | },
|
29 | fatal: (..._args) => {
|
30 | }
|
31 | };
|
32 | const setLogLevel$1 = function(level = "fatal") {
|
33 | let numericLevel = LEVELS.fatal;
|
34 | if (typeof level === "string") {
|
35 | level = level.toLowerCase();
|
36 | if (level in LEVELS) {
|
37 | numericLevel = LEVELS[level];
|
38 | }
|
39 | } else if (typeof level === "number") {
|
40 | numericLevel = level;
|
41 | }
|
42 | log$1.trace = () => {
|
43 | };
|
44 | log$1.debug = () => {
|
45 | };
|
46 | log$1.info = () => {
|
47 | };
|
48 | log$1.warn = () => {
|
49 | };
|
50 | log$1.error = () => {
|
51 | };
|
52 | log$1.fatal = () => {
|
53 | };
|
54 | if (numericLevel <= LEVELS.fatal) {
|
55 | log$1.fatal = console.error ? console.error.bind(console, format("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", format("FATAL"));
|
56 | }
|
57 | if (numericLevel <= LEVELS.error) {
|
58 | log$1.error = console.error ? console.error.bind(console, format("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", format("ERROR"));
|
59 | }
|
60 | if (numericLevel <= LEVELS.warn) {
|
61 | log$1.warn = console.warn ? console.warn.bind(console, format("WARN"), "color: orange") : console.log.bind(console, `\x1B[33m`, format("WARN"));
|
62 | }
|
63 | if (numericLevel <= LEVELS.info) {
|
64 | log$1.info = console.info ? console.info.bind(console, format("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", format("INFO"));
|
65 | }
|
66 | if (numericLevel <= LEVELS.debug) {
|
67 | log$1.debug = console.debug ? console.debug.bind(console, format("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("DEBUG"));
|
68 | }
|
69 | if (numericLevel <= LEVELS.trace) {
|
70 | log$1.trace = console.debug ? console.debug.bind(console, format("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("TRACE"));
|
71 | }
|
72 | };
|
73 | const format = (level) => {
|
74 | const time = dayjs().format("ss.SSS");
|
75 | return `%c${time} : ${level} : `;
|
76 | };
|
77 | const lineBreakRegex = /<br\s*\/?>/gi;
|
78 | const getRows = (s) => {
|
79 | if (!s) {
|
80 | return [""];
|
81 | }
|
82 | const str2 = breakToPlaceholder(s).replace(/\\n/g, "#br#");
|
83 | return str2.split("#br#");
|
84 | };
|
85 | const removeScript = (txt) => {
|
86 | return DOMPurify.sanitize(txt);
|
87 | };
|
88 | const sanitizeMore = (text, config2) => {
|
89 | var _a;
|
90 | if (((_a = config2.flowchart) == null ? void 0 : _a.htmlLabels) !== false) {
|
91 | const level = config2.securityLevel;
|
92 | if (level === "antiscript" || level === "strict") {
|
93 | text = removeScript(text);
|
94 | } else if (level !== "loose") {
|
95 | text = breakToPlaceholder(text);
|
96 | text = text.replace(/</g, "<").replace(/>/g, ">");
|
97 | text = text.replace(/=/g, "=");
|
98 | text = placeholderToBreak(text);
|
99 | }
|
100 | }
|
101 | return text;
|
102 | };
|
103 | const sanitizeText$2 = (text, config2) => {
|
104 | if (!text) {
|
105 | return text;
|
106 | }
|
107 | if (config2.dompurifyConfig) {
|
108 | text = DOMPurify.sanitize(sanitizeMore(text, config2), config2.dompurifyConfig).toString();
|
109 | } else {
|
110 | text = DOMPurify.sanitize(sanitizeMore(text, config2), {
|
111 | FORBID_TAGS: ["style"]
|
112 | }).toString();
|
113 | }
|
114 | return text;
|
115 | };
|
116 | const sanitizeTextOrArray = (a, config2) => {
|
117 | if (typeof a === "string") {
|
118 | return sanitizeText$2(a, config2);
|
119 | }
|
120 | return a.flat().map((x) => sanitizeText$2(x, config2));
|
121 | };
|
122 | const hasBreaks = (text) => {
|
123 | return lineBreakRegex.test(text);
|
124 | };
|
125 | const splitBreaks = (text) => {
|
126 | return text.split(lineBreakRegex);
|
127 | };
|
128 | const placeholderToBreak = (s) => {
|
129 | return s.replace(/#br#/g, "<br/>");
|
130 | };
|
131 | const breakToPlaceholder = (s) => {
|
132 | return s.replace(lineBreakRegex, "#br#");
|
133 | };
|
134 | const getUrl = (useAbsolute) => {
|
135 | let url = "";
|
136 | if (useAbsolute) {
|
137 | url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
|
138 | url = url.replaceAll(/\(/g, "\\(");
|
139 | url = url.replaceAll(/\)/g, "\\)");
|
140 | }
|
141 | return url;
|
142 | };
|
143 | const evaluate = (val) => val === false || ["false", "null", "0"].includes(String(val).trim().toLowerCase()) ? false : true;
|
144 | const getMax = function(...values) {
|
145 | const newValues = values.filter((value) => {
|
146 | return !isNaN(value);
|
147 | });
|
148 | return Math.max(...newValues);
|
149 | };
|
150 | const getMin = function(...values) {
|
151 | const newValues = values.filter((value) => {
|
152 | return !isNaN(value);
|
153 | });
|
154 | return Math.min(...newValues);
|
155 | };
|
156 | const parseGenericTypes = function(text) {
|
157 | let cleanedText = text;
|
158 | if (text.split("~").length - 1 >= 2) {
|
159 | let newCleanedText = cleanedText;
|
160 | do {
|
161 | cleanedText = newCleanedText;
|
162 | newCleanedText = cleanedText.replace(/~([^\s,:;]+)~/, "<$1>");
|
163 | } while (newCleanedText != cleanedText);
|
164 | return parseGenericTypes(newCleanedText);
|
165 | } else {
|
166 | return cleanedText;
|
167 | }
|
168 | };
|
169 | const common$1 = {
|
170 | getRows,
|
171 | sanitizeText: sanitizeText$2,
|
172 | sanitizeTextOrArray,
|
173 | hasBreaks,
|
174 | splitBreaks,
|
175 | lineBreakRegex,
|
176 | removeScript,
|
177 | getUrl,
|
178 | evaluate,
|
179 | getMax,
|
180 | getMin
|
181 | };
|
182 | const mkBorder = (col, darkMode) => darkMode ? adjust(col, { s: -40, l: 10 }) : adjust(col, { s: -40, l: -10 });
|
183 | const oldAttributeBackgroundColorOdd = "#ffffff";
|
184 | const oldAttributeBackgroundColorEven = "#f2f2f2";
|
185 | let Theme$4 = class Theme {
|
186 | constructor() {
|
187 | this.background = "#f4f4f4";
|
188 | this.primaryColor = "#fff4dd";
|
189 | this.noteBkgColor = "#fff5ad";
|
190 | this.noteTextColor = "#333";
|
191 | this.THEME_COLOR_LIMIT = 12;
|
192 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
193 | this.fontSize = "16px";
|
194 | }
|
195 | updateColors() {
|
196 | this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333");
|
197 | this.secondaryColor = this.secondaryColor || adjust(this.primaryColor, { h: -120 });
|
198 | this.tertiaryColor = this.tertiaryColor || adjust(this.primaryColor, { h: 180, l: 5 });
|
199 | this.primaryBorderColor = this.primaryBorderColor || mkBorder(this.primaryColor, this.darkMode);
|
200 | this.secondaryBorderColor = this.secondaryBorderColor || mkBorder(this.secondaryColor, this.darkMode);
|
201 | this.tertiaryBorderColor = this.tertiaryBorderColor || mkBorder(this.tertiaryColor, this.darkMode);
|
202 | this.noteBorderColor = this.noteBorderColor || mkBorder(this.noteBkgColor, this.darkMode);
|
203 | this.noteBkgColor = this.noteBkgColor || "#fff5ad";
|
204 | this.noteTextColor = this.noteTextColor || "#333";
|
205 | this.secondaryTextColor = this.secondaryTextColor || invert(this.secondaryColor);
|
206 | this.tertiaryTextColor = this.tertiaryTextColor || invert(this.tertiaryColor);
|
207 | this.lineColor = this.lineColor || invert(this.background);
|
208 | this.arrowheadColor = this.arrowheadColor || invert(this.background);
|
209 | this.textColor = this.textColor || this.primaryTextColor;
|
210 | this.border2 = this.border2 || this.tertiaryBorderColor;
|
211 | this.nodeBkg = this.nodeBkg || this.primaryColor;
|
212 | this.mainBkg = this.mainBkg || this.primaryColor;
|
213 | this.nodeBorder = this.nodeBorder || this.primaryBorderColor;
|
214 | this.clusterBkg = this.clusterBkg || this.tertiaryColor;
|
215 | this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor;
|
216 | this.defaultLinkColor = this.defaultLinkColor || this.lineColor;
|
217 | this.titleColor = this.titleColor || this.tertiaryTextColor;
|
218 | this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);
|
219 | this.nodeTextColor = this.nodeTextColor || this.primaryTextColor;
|
220 | this.actorBorder = this.actorBorder || this.primaryBorderColor;
|
221 | this.actorBkg = this.actorBkg || this.mainBkg;
|
222 | this.actorTextColor = this.actorTextColor || this.primaryTextColor;
|
223 | this.actorLineColor = this.actorLineColor || "grey";
|
224 | this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg;
|
225 | this.signalColor = this.signalColor || this.textColor;
|
226 | this.signalTextColor = this.signalTextColor || this.textColor;
|
227 | this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder;
|
228 | this.labelTextColor = this.labelTextColor || this.actorTextColor;
|
229 | this.loopTextColor = this.loopTextColor || this.actorTextColor;
|
230 | this.activationBorderColor = this.activationBorderColor || darken(this.secondaryColor, 10);
|
231 | this.activationBkgColor = this.activationBkgColor || this.secondaryColor;
|
232 | this.sequenceNumberColor = this.sequenceNumberColor || invert(this.lineColor);
|
233 | this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor;
|
234 | this.altSectionBkgColor = this.altSectionBkgColor || "white";
|
235 | this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor;
|
236 | this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor;
|
237 | this.excludeBkgColor = this.excludeBkgColor || "#eeeeee";
|
238 | this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor;
|
239 | this.taskBkgColor = this.taskBkgColor || this.primaryColor;
|
240 | this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor;
|
241 | this.activeTaskBkgColor = this.activeTaskBkgColor || lighten(this.primaryColor, 23);
|
242 | this.gridColor = this.gridColor || "lightgrey";
|
243 | this.doneTaskBkgColor = this.doneTaskBkgColor || "lightgrey";
|
244 | this.doneTaskBorderColor = this.doneTaskBorderColor || "grey";
|
245 | this.critBorderColor = this.critBorderColor || "#ff8888";
|
246 | this.critBkgColor = this.critBkgColor || "red";
|
247 | this.todayLineColor = this.todayLineColor || "red";
|
248 | this.taskTextColor = this.taskTextColor || this.textColor;
|
249 | this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor;
|
250 | this.taskTextLightColor = this.taskTextLightColor || this.textColor;
|
251 | this.taskTextColor = this.taskTextColor || this.primaryTextColor;
|
252 | this.taskTextDarkColor = this.taskTextDarkColor || this.textColor;
|
253 | this.taskTextClickableColor = this.taskTextClickableColor || "#003163";
|
254 | this.personBorder = this.personBorder || this.primaryBorderColor;
|
255 | this.personBkg = this.personBkg || this.mainBkg;
|
256 | this.transitionColor = this.transitionColor || this.lineColor;
|
257 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
258 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
259 | this.stateBkg = this.stateBkg || this.mainBkg;
|
260 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
261 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
262 | this.altBackground = this.altBackground || this.tertiaryColor;
|
263 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
264 | this.compositeBorder = this.compositeBorder || this.nodeBorder;
|
265 | this.innerEndBackground = this.nodeBorder;
|
266 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
267 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
268 | this.transitionColor = this.transitionColor || this.lineColor;
|
269 | this.specialStateColor = this.lineColor;
|
270 | this.cScale0 = this.cScale0 || this.primaryColor;
|
271 | this.cScale1 = this.cScale1 || this.secondaryColor;
|
272 | this.cScale2 = this.cScale2 || this.tertiaryColor;
|
273 | this.cScale3 = this.cScale3 || adjust(this.primaryColor, { h: 30 });
|
274 | this.cScale4 = this.cScale4 || adjust(this.primaryColor, { h: 60 });
|
275 | this.cScale5 = this.cScale5 || adjust(this.primaryColor, { h: 90 });
|
276 | this.cScale6 = this.cScale6 || adjust(this.primaryColor, { h: 120 });
|
277 | this.cScale7 = this.cScale7 || adjust(this.primaryColor, { h: 150 });
|
278 | this.cScale8 = this.cScale8 || adjust(this.primaryColor, { h: 210, l: 150 });
|
279 | this.cScale9 = this.cScale9 || adjust(this.primaryColor, { h: 270 });
|
280 | this.cScale10 = this.cScale10 || adjust(this.primaryColor, { h: 300 });
|
281 | this.cScale11 = this.cScale11 || adjust(this.primaryColor, { h: 330 });
|
282 | if (this.darkMode) {
|
283 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
284 | this["cScale" + i] = darken(this["cScale" + i], 75);
|
285 | }
|
286 | } else {
|
287 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
288 | this["cScale" + i] = darken(this["cScale" + i], 25);
|
289 | }
|
290 | }
|
291 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
292 | this["cScaleInv" + i] = this["cScaleInv" + i] || invert(this["cScale" + i]);
|
293 | }
|
294 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
295 | if (this.darkMode) {
|
296 | this["cScalePeer" + i] = this["cScalePeer" + i] || lighten(this["cScale" + i], 10);
|
297 | } else {
|
298 | this["cScalePeer" + i] = this["cScalePeer" + i] || darken(this["cScale" + i], 10);
|
299 | }
|
300 | }
|
301 | this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor;
|
302 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
303 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
|
304 | }
|
305 | const multiplier = this.darkMode ? -4 : -1;
|
306 | for (let i = 0; i < 5; i++) {
|
307 | this["surface" + i] = this["surface" + i] || adjust(this.mainBkg, { h: 180, s: -15, l: multiplier * (5 + i * 3) });
|
308 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust(this.mainBkg, { h: 180, s: -15, l: multiplier * (8 + i * 3) });
|
309 | }
|
310 | this.classText = this.classText || this.textColor;
|
311 | this.fillType0 = this.fillType0 || this.primaryColor;
|
312 | this.fillType1 = this.fillType1 || this.secondaryColor;
|
313 | this.fillType2 = this.fillType2 || adjust(this.primaryColor, { h: 64 });
|
314 | this.fillType3 = this.fillType3 || adjust(this.secondaryColor, { h: 64 });
|
315 | this.fillType4 = this.fillType4 || adjust(this.primaryColor, { h: -64 });
|
316 | this.fillType5 = this.fillType5 || adjust(this.secondaryColor, { h: -64 });
|
317 | this.fillType6 = this.fillType6 || adjust(this.primaryColor, { h: 128 });
|
318 | this.fillType7 = this.fillType7 || adjust(this.secondaryColor, { h: 128 });
|
319 | this.pie1 = this.pie1 || this.primaryColor;
|
320 | this.pie2 = this.pie2 || this.secondaryColor;
|
321 | this.pie3 = this.pie3 || this.tertiaryColor;
|
322 | this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 });
|
323 | this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 });
|
324 | this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 });
|
325 | this.pie7 = this.pie7 || adjust(this.primaryColor, { h: 60, l: -10 });
|
326 | this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });
|
327 | this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });
|
328 | this.pie10 = this.pie10 || adjust(this.primaryColor, { h: 60, l: -20 });
|
329 | this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 });
|
330 | this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 });
|
331 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
332 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
333 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
334 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
335 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
336 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
337 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
338 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
339 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
340 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
341 | this.pieOpacity = this.pieOpacity || "0.7";
|
342 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
343 | this.quadrant2Fill = this.quadrant2Fill || adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
|
344 | this.quadrant3Fill = this.quadrant3Fill || adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
|
345 | this.quadrant4Fill = this.quadrant4Fill || adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
|
346 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
347 | this.quadrant2TextFill = this.quadrant2TextFill || adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
348 | this.quadrant3TextFill = this.quadrant3TextFill || adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
349 | this.quadrant4TextFill = this.quadrant4TextFill || adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
350 | this.quadrantPointFill = this.quadrantPointFill || isDark(this.quadrant1Fill) ? lighten(this.quadrant1Fill) : darken(this.quadrant1Fill);
|
351 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
352 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
353 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
354 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
355 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
356 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
357 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
358 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
359 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
360 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
361 | this.relationColor = this.relationColor || this.lineColor;
|
362 | this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);
|
363 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
364 | this.git0 = this.git0 || this.primaryColor;
|
365 | this.git1 = this.git1 || this.secondaryColor;
|
366 | this.git2 = this.git2 || this.tertiaryColor;
|
367 | this.git3 = this.git3 || adjust(this.primaryColor, { h: -30 });
|
368 | this.git4 = this.git4 || adjust(this.primaryColor, { h: -60 });
|
369 | this.git5 = this.git5 || adjust(this.primaryColor, { h: -90 });
|
370 | this.git6 = this.git6 || adjust(this.primaryColor, { h: 60 });
|
371 | this.git7 = this.git7 || adjust(this.primaryColor, { h: 120 });
|
372 | if (this.darkMode) {
|
373 | this.git0 = lighten(this.git0, 25);
|
374 | this.git1 = lighten(this.git1, 25);
|
375 | this.git2 = lighten(this.git2, 25);
|
376 | this.git3 = lighten(this.git3, 25);
|
377 | this.git4 = lighten(this.git4, 25);
|
378 | this.git5 = lighten(this.git5, 25);
|
379 | this.git6 = lighten(this.git6, 25);
|
380 | this.git7 = lighten(this.git7, 25);
|
381 | } else {
|
382 | this.git0 = darken(this.git0, 25);
|
383 | this.git1 = darken(this.git1, 25);
|
384 | this.git2 = darken(this.git2, 25);
|
385 | this.git3 = darken(this.git3, 25);
|
386 | this.git4 = darken(this.git4, 25);
|
387 | this.git5 = darken(this.git5, 25);
|
388 | this.git6 = darken(this.git6, 25);
|
389 | this.git7 = darken(this.git7, 25);
|
390 | }
|
391 | this.gitInv0 = this.gitInv0 || invert(this.git0);
|
392 | this.gitInv1 = this.gitInv1 || invert(this.git1);
|
393 | this.gitInv2 = this.gitInv2 || invert(this.git2);
|
394 | this.gitInv3 = this.gitInv3 || invert(this.git3);
|
395 | this.gitInv4 = this.gitInv4 || invert(this.git4);
|
396 | this.gitInv5 = this.gitInv5 || invert(this.git5);
|
397 | this.gitInv6 = this.gitInv6 || invert(this.git6);
|
398 | this.gitInv7 = this.gitInv7 || invert(this.git7);
|
399 | this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor);
|
400 | this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
|
401 | this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;
|
402 | this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor;
|
403 | this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor;
|
404 | this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor;
|
405 | this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor;
|
406 | this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor;
|
407 | this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor;
|
408 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
409 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
410 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
411 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
412 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
413 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
414 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
415 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
|
416 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
|
417 | }
|
418 | calculate(overrides) {
|
419 | if (typeof overrides !== "object") {
|
420 | this.updateColors();
|
421 | return;
|
422 | }
|
423 | const keys = Object.keys(overrides);
|
424 | keys.forEach((k) => {
|
425 | this[k] = overrides[k];
|
426 | });
|
427 | this.updateColors();
|
428 | keys.forEach((k) => {
|
429 | this[k] = overrides[k];
|
430 | });
|
431 | }
|
432 | };
|
433 | const getThemeVariables$4 = (userOverrides) => {
|
434 | const theme2 = new Theme$4();
|
435 | theme2.calculate(userOverrides);
|
436 | return theme2;
|
437 | };
|
438 | let Theme$3 = class Theme2 {
|
439 | constructor() {
|
440 | this.background = "#333";
|
441 | this.primaryColor = "#1f2020";
|
442 | this.secondaryColor = lighten(this.primaryColor, 16);
|
443 | this.tertiaryColor = adjust(this.primaryColor, { h: -160 });
|
444 | this.primaryBorderColor = invert(this.background);
|
445 | this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
446 | this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
447 | this.primaryTextColor = invert(this.primaryColor);
|
448 | this.secondaryTextColor = invert(this.secondaryColor);
|
449 | this.tertiaryTextColor = invert(this.tertiaryColor);
|
450 | this.lineColor = invert(this.background);
|
451 | this.textColor = invert(this.background);
|
452 | this.mainBkg = "#1f2020";
|
453 | this.secondBkg = "calculated";
|
454 | this.mainContrastColor = "lightgrey";
|
455 | this.darkTextColor = lighten(invert("#323D47"), 10);
|
456 | this.lineColor = "calculated";
|
457 | this.border1 = "#81B1DB";
|
458 | this.border2 = rgba(255, 255, 255, 0.25);
|
459 | this.arrowheadColor = "calculated";
|
460 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
461 | this.fontSize = "16px";
|
462 | this.labelBackground = "#181818";
|
463 | this.textColor = "#ccc";
|
464 | this.THEME_COLOR_LIMIT = 12;
|
465 | this.nodeBkg = "calculated";
|
466 | this.nodeBorder = "calculated";
|
467 | this.clusterBkg = "calculated";
|
468 | this.clusterBorder = "calculated";
|
469 | this.defaultLinkColor = "calculated";
|
470 | this.titleColor = "#F9FFFE";
|
471 | this.edgeLabelBackground = "calculated";
|
472 | this.actorBorder = "calculated";
|
473 | this.actorBkg = "calculated";
|
474 | this.actorTextColor = "calculated";
|
475 | this.actorLineColor = "calculated";
|
476 | this.signalColor = "calculated";
|
477 | this.signalTextColor = "calculated";
|
478 | this.labelBoxBkgColor = "calculated";
|
479 | this.labelBoxBorderColor = "calculated";
|
480 | this.labelTextColor = "calculated";
|
481 | this.loopTextColor = "calculated";
|
482 | this.noteBorderColor = "calculated";
|
483 | this.noteBkgColor = "#fff5ad";
|
484 | this.noteTextColor = "calculated";
|
485 | this.activationBorderColor = "calculated";
|
486 | this.activationBkgColor = "calculated";
|
487 | this.sequenceNumberColor = "black";
|
488 | this.sectionBkgColor = darken("#EAE8D9", 30);
|
489 | this.altSectionBkgColor = "calculated";
|
490 | this.sectionBkgColor2 = "#EAE8D9";
|
491 | this.excludeBkgColor = darken(this.sectionBkgColor, 10);
|
492 | this.taskBorderColor = rgba(255, 255, 255, 70);
|
493 | this.taskBkgColor = "calculated";
|
494 | this.taskTextColor = "calculated";
|
495 | this.taskTextLightColor = "calculated";
|
496 | this.taskTextOutsideColor = "calculated";
|
497 | this.taskTextClickableColor = "#003163";
|
498 | this.activeTaskBorderColor = rgba(255, 255, 255, 50);
|
499 | this.activeTaskBkgColor = "#81B1DB";
|
500 | this.gridColor = "calculated";
|
501 | this.doneTaskBkgColor = "calculated";
|
502 | this.doneTaskBorderColor = "grey";
|
503 | this.critBorderColor = "#E83737";
|
504 | this.critBkgColor = "#E83737";
|
505 | this.taskTextDarkColor = "calculated";
|
506 | this.todayLineColor = "#DB5757";
|
507 | this.personBorder = this.primaryBorderColor;
|
508 | this.personBkg = this.mainBkg;
|
509 | this.labelColor = "calculated";
|
510 | this.errorBkgColor = "#a44141";
|
511 | this.errorTextColor = "#ddd";
|
512 | }
|
513 | updateColors() {
|
514 | this.secondBkg = lighten(this.mainBkg, 16);
|
515 | this.lineColor = this.mainContrastColor;
|
516 | this.arrowheadColor = this.mainContrastColor;
|
517 | this.nodeBkg = this.mainBkg;
|
518 | this.nodeBorder = this.border1;
|
519 | this.clusterBkg = this.secondBkg;
|
520 | this.clusterBorder = this.border2;
|
521 | this.defaultLinkColor = this.lineColor;
|
522 | this.edgeLabelBackground = lighten(this.labelBackground, 25);
|
523 | this.actorBorder = this.border1;
|
524 | this.actorBkg = this.mainBkg;
|
525 | this.actorTextColor = this.mainContrastColor;
|
526 | this.actorLineColor = this.mainContrastColor;
|
527 | this.signalColor = this.mainContrastColor;
|
528 | this.signalTextColor = this.mainContrastColor;
|
529 | this.labelBoxBkgColor = this.actorBkg;
|
530 | this.labelBoxBorderColor = this.actorBorder;
|
531 | this.labelTextColor = this.mainContrastColor;
|
532 | this.loopTextColor = this.mainContrastColor;
|
533 | this.noteBorderColor = this.secondaryBorderColor;
|
534 | this.noteBkgColor = this.secondBkg;
|
535 | this.noteTextColor = this.secondaryTextColor;
|
536 | this.activationBorderColor = this.border1;
|
537 | this.activationBkgColor = this.secondBkg;
|
538 | this.altSectionBkgColor = this.background;
|
539 | this.taskBkgColor = lighten(this.mainBkg, 23);
|
540 | this.taskTextColor = this.darkTextColor;
|
541 | this.taskTextLightColor = this.mainContrastColor;
|
542 | this.taskTextOutsideColor = this.taskTextLightColor;
|
543 | this.gridColor = this.mainContrastColor;
|
544 | this.doneTaskBkgColor = this.mainContrastColor;
|
545 | this.taskTextDarkColor = this.darkTextColor;
|
546 | this.transitionColor = this.transitionColor || this.lineColor;
|
547 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
548 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
549 | this.stateBkg = this.stateBkg || this.mainBkg;
|
550 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
551 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
552 | this.altBackground = this.altBackground || "#555";
|
553 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
554 | this.compositeBorder = this.compositeBorder || this.nodeBorder;
|
555 | this.innerEndBackground = this.primaryBorderColor;
|
556 | this.specialStateColor = "#f4f4f4";
|
557 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
558 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
559 | this.fillType0 = this.primaryColor;
|
560 | this.fillType1 = this.secondaryColor;
|
561 | this.fillType2 = adjust(this.primaryColor, { h: 64 });
|
562 | this.fillType3 = adjust(this.secondaryColor, { h: 64 });
|
563 | this.fillType4 = adjust(this.primaryColor, { h: -64 });
|
564 | this.fillType5 = adjust(this.secondaryColor, { h: -64 });
|
565 | this.fillType6 = adjust(this.primaryColor, { h: 128 });
|
566 | this.fillType7 = adjust(this.secondaryColor, { h: 128 });
|
567 | this.cScale1 = this.cScale1 || "#0b0000";
|
568 | this.cScale2 = this.cScale2 || "#4d1037";
|
569 | this.cScale3 = this.cScale3 || "#3f5258";
|
570 | this.cScale4 = this.cScale4 || "#4f2f1b";
|
571 | this.cScale5 = this.cScale5 || "#6e0a0a";
|
572 | this.cScale6 = this.cScale6 || "#3b0048";
|
573 | this.cScale7 = this.cScale7 || "#995a01";
|
574 | this.cScale8 = this.cScale8 || "#154706";
|
575 | this.cScale9 = this.cScale9 || "#161722";
|
576 | this.cScale10 = this.cScale10 || "#00296f";
|
577 | this.cScale11 = this.cScale11 || "#01629c";
|
578 | this.cScale12 = this.cScale12 || "#010029";
|
579 | this.cScale0 = this.cScale0 || this.primaryColor;
|
580 | this.cScale1 = this.cScale1 || this.secondaryColor;
|
581 | this.cScale2 = this.cScale2 || this.tertiaryColor;
|
582 | this.cScale3 = this.cScale3 || adjust(this.primaryColor, { h: 30 });
|
583 | this.cScale4 = this.cScale4 || adjust(this.primaryColor, { h: 60 });
|
584 | this.cScale5 = this.cScale5 || adjust(this.primaryColor, { h: 90 });
|
585 | this.cScale6 = this.cScale6 || adjust(this.primaryColor, { h: 120 });
|
586 | this.cScale7 = this.cScale7 || adjust(this.primaryColor, { h: 150 });
|
587 | this.cScale8 = this.cScale8 || adjust(this.primaryColor, { h: 210 });
|
588 | this.cScale9 = this.cScale9 || adjust(this.primaryColor, { h: 270 });
|
589 | this.cScale10 = this.cScale10 || adjust(this.primaryColor, { h: 300 });
|
590 | this.cScale11 = this.cScale11 || adjust(this.primaryColor, { h: 330 });
|
591 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
592 | this["cScaleInv" + i] = this["cScaleInv" + i] || invert(this["cScale" + i]);
|
593 | }
|
594 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
595 | this["cScalePeer" + i] = this["cScalePeer" + i] || lighten(this["cScale" + i], 10);
|
596 | }
|
597 | for (let i = 0; i < 5; i++) {
|
598 | this["surface" + i] = this["surface" + i] || adjust(this.mainBkg, { h: 30, s: -30, l: -(-10 + i * 4) });
|
599 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust(this.mainBkg, { h: 30, s: -30, l: -(-7 + i * 4) });
|
600 | }
|
601 | this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
|
602 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
603 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
|
604 | }
|
605 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
606 | this["pie" + i] = this["cScale" + i];
|
607 | }
|
608 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
609 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
610 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
611 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
612 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
613 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
614 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
615 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
616 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
617 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
618 | this.pieOpacity = this.pieOpacity || "0.7";
|
619 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
620 | this.quadrant2Fill = this.quadrant2Fill || adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
|
621 | this.quadrant3Fill = this.quadrant3Fill || adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
|
622 | this.quadrant4Fill = this.quadrant4Fill || adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
|
623 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
624 | this.quadrant2TextFill = this.quadrant2TextFill || adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
625 | this.quadrant3TextFill = this.quadrant3TextFill || adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
626 | this.quadrant4TextFill = this.quadrant4TextFill || adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
627 | this.quadrantPointFill = this.quadrantPointFill || isDark(this.quadrant1Fill) ? lighten(this.quadrant1Fill) : darken(this.quadrant1Fill);
|
628 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
629 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
630 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
631 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
632 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
633 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
634 | this.classText = this.primaryTextColor;
|
635 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
636 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
637 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
638 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
639 | this.relationColor = this.relationColor || this.lineColor;
|
640 | this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);
|
641 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
642 | this.git0 = lighten(this.secondaryColor, 20);
|
643 | this.git1 = lighten(this.pie2 || this.secondaryColor, 20);
|
644 | this.git2 = lighten(this.pie3 || this.tertiaryColor, 20);
|
645 | this.git3 = lighten(this.pie4 || adjust(this.primaryColor, { h: -30 }), 20);
|
646 | this.git4 = lighten(this.pie5 || adjust(this.primaryColor, { h: -60 }), 20);
|
647 | this.git5 = lighten(this.pie6 || adjust(this.primaryColor, { h: -90 }), 10);
|
648 | this.git6 = lighten(this.pie7 || adjust(this.primaryColor, { h: 60 }), 10);
|
649 | this.git7 = lighten(this.pie8 || adjust(this.primaryColor, { h: 120 }), 20);
|
650 | this.gitInv0 = this.gitInv0 || invert(this.git0);
|
651 | this.gitInv1 = this.gitInv1 || invert(this.git1);
|
652 | this.gitInv2 = this.gitInv2 || invert(this.git2);
|
653 | this.gitInv3 = this.gitInv3 || invert(this.git3);
|
654 | this.gitInv4 = this.gitInv4 || invert(this.git4);
|
655 | this.gitInv5 = this.gitInv5 || invert(this.git5);
|
656 | this.gitInv6 = this.gitInv6 || invert(this.git6);
|
657 | this.gitInv7 = this.gitInv7 || invert(this.git7);
|
658 | this.gitBranchLabel0 = this.gitBranchLabel0 || invert(this.labelTextColor);
|
659 | this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
660 | this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
661 | this.gitBranchLabel3 = this.gitBranchLabel3 || invert(this.labelTextColor);
|
662 | this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
663 | this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
664 | this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
665 | this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
666 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
667 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
668 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
669 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
670 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
671 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
672 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
673 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || lighten(this.background, 12);
|
674 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || lighten(this.background, 2);
|
675 | }
|
676 | calculate(overrides) {
|
677 | if (typeof overrides !== "object") {
|
678 | this.updateColors();
|
679 | return;
|
680 | }
|
681 | const keys = Object.keys(overrides);
|
682 | keys.forEach((k) => {
|
683 | this[k] = overrides[k];
|
684 | });
|
685 | this.updateColors();
|
686 | keys.forEach((k) => {
|
687 | this[k] = overrides[k];
|
688 | });
|
689 | }
|
690 | };
|
691 | const getThemeVariables$3 = (userOverrides) => {
|
692 | const theme2 = new Theme$3();
|
693 | theme2.calculate(userOverrides);
|
694 | return theme2;
|
695 | };
|
696 | let Theme$2 = class Theme3 {
|
697 | constructor() {
|
698 | this.background = "#f4f4f4";
|
699 | this.primaryColor = "#ECECFF";
|
700 | this.secondaryColor = adjust(this.primaryColor, { h: 120 });
|
701 | this.secondaryColor = "#ffffde";
|
702 | this.tertiaryColor = adjust(this.primaryColor, { h: -160 });
|
703 | this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
|
704 | this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
705 | this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
706 | this.primaryTextColor = invert(this.primaryColor);
|
707 | this.secondaryTextColor = invert(this.secondaryColor);
|
708 | this.tertiaryTextColor = invert(this.tertiaryColor);
|
709 | this.lineColor = invert(this.background);
|
710 | this.textColor = invert(this.background);
|
711 | this.background = "white";
|
712 | this.mainBkg = "#ECECFF";
|
713 | this.secondBkg = "#ffffde";
|
714 | this.lineColor = "#333333";
|
715 | this.border1 = "#9370DB";
|
716 | this.border2 = "#aaaa33";
|
717 | this.arrowheadColor = "#333333";
|
718 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
719 | this.fontSize = "16px";
|
720 | this.labelBackground = "#e8e8e8";
|
721 | this.textColor = "#333";
|
722 | this.THEME_COLOR_LIMIT = 12;
|
723 | this.nodeBkg = "calculated";
|
724 | this.nodeBorder = "calculated";
|
725 | this.clusterBkg = "calculated";
|
726 | this.clusterBorder = "calculated";
|
727 | this.defaultLinkColor = "calculated";
|
728 | this.titleColor = "calculated";
|
729 | this.edgeLabelBackground = "calculated";
|
730 | this.actorBorder = "calculated";
|
731 | this.actorBkg = "calculated";
|
732 | this.actorTextColor = "black";
|
733 | this.actorLineColor = "grey";
|
734 | this.signalColor = "calculated";
|
735 | this.signalTextColor = "calculated";
|
736 | this.labelBoxBkgColor = "calculated";
|
737 | this.labelBoxBorderColor = "calculated";
|
738 | this.labelTextColor = "calculated";
|
739 | this.loopTextColor = "calculated";
|
740 | this.noteBorderColor = "calculated";
|
741 | this.noteBkgColor = "#fff5ad";
|
742 | this.noteTextColor = "calculated";
|
743 | this.activationBorderColor = "#666";
|
744 | this.activationBkgColor = "#f4f4f4";
|
745 | this.sequenceNumberColor = "white";
|
746 | this.sectionBkgColor = "calculated";
|
747 | this.altSectionBkgColor = "calculated";
|
748 | this.sectionBkgColor2 = "calculated";
|
749 | this.excludeBkgColor = "#eeeeee";
|
750 | this.taskBorderColor = "calculated";
|
751 | this.taskBkgColor = "calculated";
|
752 | this.taskTextLightColor = "calculated";
|
753 | this.taskTextColor = this.taskTextLightColor;
|
754 | this.taskTextDarkColor = "calculated";
|
755 | this.taskTextOutsideColor = this.taskTextDarkColor;
|
756 | this.taskTextClickableColor = "calculated";
|
757 | this.activeTaskBorderColor = "calculated";
|
758 | this.activeTaskBkgColor = "calculated";
|
759 | this.gridColor = "calculated";
|
760 | this.doneTaskBkgColor = "calculated";
|
761 | this.doneTaskBorderColor = "calculated";
|
762 | this.critBorderColor = "calculated";
|
763 | this.critBkgColor = "calculated";
|
764 | this.todayLineColor = "calculated";
|
765 | this.sectionBkgColor = rgba(102, 102, 255, 0.49);
|
766 | this.altSectionBkgColor = "white";
|
767 | this.sectionBkgColor2 = "#fff400";
|
768 | this.taskBorderColor = "#534fbc";
|
769 | this.taskBkgColor = "#8a90dd";
|
770 | this.taskTextLightColor = "white";
|
771 | this.taskTextColor = "calculated";
|
772 | this.taskTextDarkColor = "black";
|
773 | this.taskTextOutsideColor = "calculated";
|
774 | this.taskTextClickableColor = "#003163";
|
775 | this.activeTaskBorderColor = "#534fbc";
|
776 | this.activeTaskBkgColor = "#bfc7ff";
|
777 | this.gridColor = "lightgrey";
|
778 | this.doneTaskBkgColor = "lightgrey";
|
779 | this.doneTaskBorderColor = "grey";
|
780 | this.critBorderColor = "#ff8888";
|
781 | this.critBkgColor = "red";
|
782 | this.todayLineColor = "red";
|
783 | this.personBorder = this.primaryBorderColor;
|
784 | this.personBkg = this.mainBkg;
|
785 | this.labelColor = "black";
|
786 | this.errorBkgColor = "#552222";
|
787 | this.errorTextColor = "#552222";
|
788 | this.updateColors();
|
789 | }
|
790 | updateColors() {
|
791 | this.cScale0 = this.cScale0 || this.primaryColor;
|
792 | this.cScale1 = this.cScale1 || this.secondaryColor;
|
793 | this.cScale2 = this.cScale2 || this.tertiaryColor;
|
794 | this.cScale3 = this.cScale3 || adjust(this.primaryColor, { h: 30 });
|
795 | this.cScale4 = this.cScale4 || adjust(this.primaryColor, { h: 60 });
|
796 | this.cScale5 = this.cScale5 || adjust(this.primaryColor, { h: 90 });
|
797 | this.cScale6 = this.cScale6 || adjust(this.primaryColor, { h: 120 });
|
798 | this.cScale7 = this.cScale7 || adjust(this.primaryColor, { h: 150 });
|
799 | this.cScale8 = this.cScale8 || adjust(this.primaryColor, { h: 210 });
|
800 | this.cScale9 = this.cScale9 || adjust(this.primaryColor, { h: 270 });
|
801 | this.cScale10 = this.cScale10 || adjust(this.primaryColor, { h: 300 });
|
802 | this.cScale11 = this.cScale11 || adjust(this.primaryColor, { h: 330 });
|
803 | this["cScalePeer1"] = this["cScalePeer1"] || darken(this.secondaryColor, 45);
|
804 | this["cScalePeer2"] = this["cScalePeer2"] || darken(this.tertiaryColor, 40);
|
805 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
806 | this["cScale" + i] = darken(this["cScale" + i], 10);
|
807 | this["cScalePeer" + i] = this["cScalePeer" + i] || darken(this["cScale" + i], 25);
|
808 | }
|
809 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
810 | this["cScaleInv" + i] = this["cScaleInv" + i] || adjust(this["cScale" + i], { h: 180 });
|
811 | }
|
812 | for (let i = 0; i < 5; i++) {
|
813 | this["surface" + i] = this["surface" + i] || adjust(this.mainBkg, { h: 30, l: -(5 + i * 5) });
|
814 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust(this.mainBkg, { h: 30, l: -(7 + i * 5) });
|
815 | }
|
816 | this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
|
817 | if (this.labelTextColor !== "calculated") {
|
818 | this.cScaleLabel0 = this.cScaleLabel0 || invert(this.labelTextColor);
|
819 | this.cScaleLabel3 = this.cScaleLabel3 || invert(this.labelTextColor);
|
820 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
821 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.labelTextColor;
|
822 | }
|
823 | }
|
824 | this.nodeBkg = this.mainBkg;
|
825 | this.nodeBorder = this.border1;
|
826 | this.clusterBkg = this.secondBkg;
|
827 | this.clusterBorder = this.border2;
|
828 | this.defaultLinkColor = this.lineColor;
|
829 | this.titleColor = this.textColor;
|
830 | this.edgeLabelBackground = this.labelBackground;
|
831 | this.actorBorder = lighten(this.border1, 23);
|
832 | this.actorBkg = this.mainBkg;
|
833 | this.labelBoxBkgColor = this.actorBkg;
|
834 | this.signalColor = this.textColor;
|
835 | this.signalTextColor = this.textColor;
|
836 | this.labelBoxBorderColor = this.actorBorder;
|
837 | this.labelTextColor = this.actorTextColor;
|
838 | this.loopTextColor = this.actorTextColor;
|
839 | this.noteBorderColor = this.border2;
|
840 | this.noteTextColor = this.actorTextColor;
|
841 | this.taskTextColor = this.taskTextLightColor;
|
842 | this.taskTextOutsideColor = this.taskTextDarkColor;
|
843 | this.transitionColor = this.transitionColor || this.lineColor;
|
844 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
845 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
846 | this.stateBkg = this.stateBkg || this.mainBkg;
|
847 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
848 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
849 | this.altBackground = this.altBackground || "#f0f0f0";
|
850 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
851 | this.compositeBorder = this.compositeBorder || this.nodeBorder;
|
852 | this.innerEndBackground = this.nodeBorder;
|
853 | this.specialStateColor = this.lineColor;
|
854 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
855 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
856 | this.transitionColor = this.transitionColor || this.lineColor;
|
857 | this.classText = this.primaryTextColor;
|
858 | this.fillType0 = this.primaryColor;
|
859 | this.fillType1 = this.secondaryColor;
|
860 | this.fillType2 = adjust(this.primaryColor, { h: 64 });
|
861 | this.fillType3 = adjust(this.secondaryColor, { h: 64 });
|
862 | this.fillType4 = adjust(this.primaryColor, { h: -64 });
|
863 | this.fillType5 = adjust(this.secondaryColor, { h: -64 });
|
864 | this.fillType6 = adjust(this.primaryColor, { h: 128 });
|
865 | this.fillType7 = adjust(this.secondaryColor, { h: 128 });
|
866 | this.pie1 = this.pie1 || this.primaryColor;
|
867 | this.pie2 = this.pie2 || this.secondaryColor;
|
868 | this.pie3 = this.pie3 || adjust(this.tertiaryColor, { l: -40 });
|
869 | this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 });
|
870 | this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -30 });
|
871 | this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -20 });
|
872 | this.pie7 = this.pie7 || adjust(this.primaryColor, { h: 60, l: -20 });
|
873 | this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -40 });
|
874 | this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: -40 });
|
875 | this.pie10 = this.pie10 || adjust(this.primaryColor, { h: 60, l: -40 });
|
876 | this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -90, l: -40 });
|
877 | this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -30 });
|
878 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
879 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
880 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
881 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
882 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
883 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
884 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
885 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
886 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
887 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
888 | this.pieOpacity = this.pieOpacity || "0.7";
|
889 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
890 | this.quadrant2Fill = this.quadrant2Fill || adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
|
891 | this.quadrant3Fill = this.quadrant3Fill || adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
|
892 | this.quadrant4Fill = this.quadrant4Fill || adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
|
893 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
894 | this.quadrant2TextFill = this.quadrant2TextFill || adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
895 | this.quadrant3TextFill = this.quadrant3TextFill || adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
896 | this.quadrant4TextFill = this.quadrant4TextFill || adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
897 | this.quadrantPointFill = this.quadrantPointFill || isDark(this.quadrant1Fill) ? lighten(this.quadrant1Fill) : darken(this.quadrant1Fill);
|
898 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
899 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
900 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
901 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
902 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
903 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
904 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
905 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
906 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
907 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
908 | this.relationColor = this.relationColor || this.lineColor;
|
909 | this.relationLabelBackground = this.relationLabelBackground || this.labelBackground;
|
910 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
911 | this.git0 = this.git0 || this.primaryColor;
|
912 | this.git1 = this.git1 || this.secondaryColor;
|
913 | this.git2 = this.git2 || this.tertiaryColor;
|
914 | this.git3 = this.git3 || adjust(this.primaryColor, { h: -30 });
|
915 | this.git4 = this.git4 || adjust(this.primaryColor, { h: -60 });
|
916 | this.git5 = this.git5 || adjust(this.primaryColor, { h: -90 });
|
917 | this.git6 = this.git6 || adjust(this.primaryColor, { h: 60 });
|
918 | this.git7 = this.git7 || adjust(this.primaryColor, { h: 120 });
|
919 | if (this.darkMode) {
|
920 | this.git0 = lighten(this.git0, 25);
|
921 | this.git1 = lighten(this.git1, 25);
|
922 | this.git2 = lighten(this.git2, 25);
|
923 | this.git3 = lighten(this.git3, 25);
|
924 | this.git4 = lighten(this.git4, 25);
|
925 | this.git5 = lighten(this.git5, 25);
|
926 | this.git6 = lighten(this.git6, 25);
|
927 | this.git7 = lighten(this.git7, 25);
|
928 | } else {
|
929 | this.git0 = darken(this.git0, 25);
|
930 | this.git1 = darken(this.git1, 25);
|
931 | this.git2 = darken(this.git2, 25);
|
932 | this.git3 = darken(this.git3, 25);
|
933 | this.git4 = darken(this.git4, 25);
|
934 | this.git5 = darken(this.git5, 25);
|
935 | this.git6 = darken(this.git6, 25);
|
936 | this.git7 = darken(this.git7, 25);
|
937 | }
|
938 | this.gitInv0 = this.gitInv0 || darken(invert(this.git0), 25);
|
939 | this.gitInv1 = this.gitInv1 || invert(this.git1);
|
940 | this.gitInv2 = this.gitInv2 || invert(this.git2);
|
941 | this.gitInv3 = this.gitInv3 || invert(this.git3);
|
942 | this.gitInv4 = this.gitInv4 || invert(this.git4);
|
943 | this.gitInv5 = this.gitInv5 || invert(this.git5);
|
944 | this.gitInv6 = this.gitInv6 || invert(this.git6);
|
945 | this.gitInv7 = this.gitInv7 || invert(this.git7);
|
946 | this.gitBranchLabel0 = this.gitBranchLabel0 || invert(this.labelTextColor);
|
947 | this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
948 | this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
949 | this.gitBranchLabel3 = this.gitBranchLabel3 || invert(this.labelTextColor);
|
950 | this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
951 | this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
952 | this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
953 | this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
954 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
955 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
956 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
957 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
958 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
959 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
960 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
961 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
|
962 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
|
963 | }
|
964 | calculate(overrides) {
|
965 | if (typeof overrides !== "object") {
|
966 | this.updateColors();
|
967 | return;
|
968 | }
|
969 | const keys = Object.keys(overrides);
|
970 | keys.forEach((k) => {
|
971 | this[k] = overrides[k];
|
972 | });
|
973 | this.updateColors();
|
974 | keys.forEach((k) => {
|
975 | this[k] = overrides[k];
|
976 | });
|
977 | }
|
978 | };
|
979 | const getThemeVariables$2 = (userOverrides) => {
|
980 | const theme2 = new Theme$2();
|
981 | theme2.calculate(userOverrides);
|
982 | return theme2;
|
983 | };
|
984 | let Theme$1 = class Theme4 {
|
985 | constructor() {
|
986 | this.background = "#f4f4f4";
|
987 | this.primaryColor = "#cde498";
|
988 | this.secondaryColor = "#cdffb2";
|
989 | this.background = "white";
|
990 | this.mainBkg = "#cde498";
|
991 | this.secondBkg = "#cdffb2";
|
992 | this.lineColor = "green";
|
993 | this.border1 = "#13540c";
|
994 | this.border2 = "#6eaa49";
|
995 | this.arrowheadColor = "green";
|
996 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
997 | this.fontSize = "16px";
|
998 | this.tertiaryColor = lighten("#cde498", 10);
|
999 | this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
|
1000 | this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
1001 | this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
1002 | this.primaryTextColor = invert(this.primaryColor);
|
1003 | this.secondaryTextColor = invert(this.secondaryColor);
|
1004 | this.tertiaryTextColor = invert(this.primaryColor);
|
1005 | this.lineColor = invert(this.background);
|
1006 | this.textColor = invert(this.background);
|
1007 | this.THEME_COLOR_LIMIT = 12;
|
1008 | this.nodeBkg = "calculated";
|
1009 | this.nodeBorder = "calculated";
|
1010 | this.clusterBkg = "calculated";
|
1011 | this.clusterBorder = "calculated";
|
1012 | this.defaultLinkColor = "calculated";
|
1013 | this.titleColor = "#333";
|
1014 | this.edgeLabelBackground = "#e8e8e8";
|
1015 | this.actorBorder = "calculated";
|
1016 | this.actorBkg = "calculated";
|
1017 | this.actorTextColor = "black";
|
1018 | this.actorLineColor = "grey";
|
1019 | this.signalColor = "#333";
|
1020 | this.signalTextColor = "#333";
|
1021 | this.labelBoxBkgColor = "calculated";
|
1022 | this.labelBoxBorderColor = "#326932";
|
1023 | this.labelTextColor = "calculated";
|
1024 | this.loopTextColor = "calculated";
|
1025 | this.noteBorderColor = "calculated";
|
1026 | this.noteBkgColor = "#fff5ad";
|
1027 | this.noteTextColor = "calculated";
|
1028 | this.activationBorderColor = "#666";
|
1029 | this.activationBkgColor = "#f4f4f4";
|
1030 | this.sequenceNumberColor = "white";
|
1031 | this.sectionBkgColor = "#6eaa49";
|
1032 | this.altSectionBkgColor = "white";
|
1033 | this.sectionBkgColor2 = "#6eaa49";
|
1034 | this.excludeBkgColor = "#eeeeee";
|
1035 | this.taskBorderColor = "calculated";
|
1036 | this.taskBkgColor = "#487e3a";
|
1037 | this.taskTextLightColor = "white";
|
1038 | this.taskTextColor = "calculated";
|
1039 | this.taskTextDarkColor = "black";
|
1040 | this.taskTextOutsideColor = "calculated";
|
1041 | this.taskTextClickableColor = "#003163";
|
1042 | this.activeTaskBorderColor = "calculated";
|
1043 | this.activeTaskBkgColor = "calculated";
|
1044 | this.gridColor = "lightgrey";
|
1045 | this.doneTaskBkgColor = "lightgrey";
|
1046 | this.doneTaskBorderColor = "grey";
|
1047 | this.critBorderColor = "#ff8888";
|
1048 | this.critBkgColor = "red";
|
1049 | this.todayLineColor = "red";
|
1050 | this.personBorder = this.primaryBorderColor;
|
1051 | this.personBkg = this.mainBkg;
|
1052 | this.labelColor = "black";
|
1053 | this.errorBkgColor = "#552222";
|
1054 | this.errorTextColor = "#552222";
|
1055 | }
|
1056 | updateColors() {
|
1057 | this.actorBorder = darken(this.mainBkg, 20);
|
1058 | this.actorBkg = this.mainBkg;
|
1059 | this.labelBoxBkgColor = this.actorBkg;
|
1060 | this.labelTextColor = this.actorTextColor;
|
1061 | this.loopTextColor = this.actorTextColor;
|
1062 | this.noteBorderColor = this.border2;
|
1063 | this.noteTextColor = this.actorTextColor;
|
1064 | this.cScale0 = this.cScale0 || this.primaryColor;
|
1065 | this.cScale1 = this.cScale1 || this.secondaryColor;
|
1066 | this.cScale2 = this.cScale2 || this.tertiaryColor;
|
1067 | this.cScale3 = this.cScale3 || adjust(this.primaryColor, { h: 30 });
|
1068 | this.cScale4 = this.cScale4 || adjust(this.primaryColor, { h: 60 });
|
1069 | this.cScale5 = this.cScale5 || adjust(this.primaryColor, { h: 90 });
|
1070 | this.cScale6 = this.cScale6 || adjust(this.primaryColor, { h: 120 });
|
1071 | this.cScale7 = this.cScale7 || adjust(this.primaryColor, { h: 150 });
|
1072 | this.cScale8 = this.cScale8 || adjust(this.primaryColor, { h: 210 });
|
1073 | this.cScale9 = this.cScale9 || adjust(this.primaryColor, { h: 270 });
|
1074 | this.cScale10 = this.cScale10 || adjust(this.primaryColor, { h: 300 });
|
1075 | this.cScale11 = this.cScale11 || adjust(this.primaryColor, { h: 330 });
|
1076 | this["cScalePeer1"] = this["cScalePeer1"] || darken(this.secondaryColor, 45);
|
1077 | this["cScalePeer2"] = this["cScalePeer2"] || darken(this.tertiaryColor, 40);
|
1078 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
1079 | this["cScale" + i] = darken(this["cScale" + i], 10);
|
1080 | this["cScalePeer" + i] = this["cScalePeer" + i] || darken(this["cScale" + i], 25);
|
1081 | }
|
1082 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
1083 | this["cScaleInv" + i] = this["cScaleInv" + i] || adjust(this["cScale" + i], { h: 180 });
|
1084 | }
|
1085 | this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
|
1086 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
1087 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
|
1088 | }
|
1089 | for (let i = 0; i < 5; i++) {
|
1090 | this["surface" + i] = this["surface" + i] || adjust(this.mainBkg, { h: 30, s: -30, l: -(5 + i * 5) });
|
1091 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust(this.mainBkg, { h: 30, s: -30, l: -(8 + i * 5) });
|
1092 | }
|
1093 | this.nodeBkg = this.mainBkg;
|
1094 | this.nodeBorder = this.border1;
|
1095 | this.clusterBkg = this.secondBkg;
|
1096 | this.clusterBorder = this.border2;
|
1097 | this.defaultLinkColor = this.lineColor;
|
1098 | this.taskBorderColor = this.border1;
|
1099 | this.taskTextColor = this.taskTextLightColor;
|
1100 | this.taskTextOutsideColor = this.taskTextDarkColor;
|
1101 | this.activeTaskBorderColor = this.taskBorderColor;
|
1102 | this.activeTaskBkgColor = this.mainBkg;
|
1103 | this.transitionColor = this.transitionColor || this.lineColor;
|
1104 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
1105 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
1106 | this.stateBkg = this.stateBkg || this.mainBkg;
|
1107 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
1108 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
1109 | this.altBackground = this.altBackground || "#f0f0f0";
|
1110 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
1111 | this.compositeBorder = this.compositeBorder || this.nodeBorder;
|
1112 | this.innerEndBackground = this.primaryBorderColor;
|
1113 | this.specialStateColor = this.lineColor;
|
1114 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
1115 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
1116 | this.transitionColor = this.transitionColor || this.lineColor;
|
1117 | this.classText = this.primaryTextColor;
|
1118 | this.fillType0 = this.primaryColor;
|
1119 | this.fillType1 = this.secondaryColor;
|
1120 | this.fillType2 = adjust(this.primaryColor, { h: 64 });
|
1121 | this.fillType3 = adjust(this.secondaryColor, { h: 64 });
|
1122 | this.fillType4 = adjust(this.primaryColor, { h: -64 });
|
1123 | this.fillType5 = adjust(this.secondaryColor, { h: -64 });
|
1124 | this.fillType6 = adjust(this.primaryColor, { h: 128 });
|
1125 | this.fillType7 = adjust(this.secondaryColor, { h: 128 });
|
1126 | this.pie1 = this.pie1 || this.primaryColor;
|
1127 | this.pie2 = this.pie2 || this.secondaryColor;
|
1128 | this.pie3 = this.pie3 || this.tertiaryColor;
|
1129 | this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -30 });
|
1130 | this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -30 });
|
1131 | this.pie6 = this.pie6 || adjust(this.tertiaryColor, { h: 40, l: -40 });
|
1132 | this.pie7 = this.pie7 || adjust(this.primaryColor, { h: 60, l: -10 });
|
1133 | this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });
|
1134 | this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });
|
1135 | this.pie10 = this.pie10 || adjust(this.primaryColor, { h: 60, l: -50 });
|
1136 | this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -50 });
|
1137 | this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -50 });
|
1138 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
1139 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
1140 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
1141 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
1142 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
1143 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
1144 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
1145 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
1146 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
1147 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
1148 | this.pieOpacity = this.pieOpacity || "0.7";
|
1149 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
1150 | this.quadrant2Fill = this.quadrant2Fill || adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
|
1151 | this.quadrant3Fill = this.quadrant3Fill || adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
|
1152 | this.quadrant4Fill = this.quadrant4Fill || adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
|
1153 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
1154 | this.quadrant2TextFill = this.quadrant2TextFill || adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
1155 | this.quadrant3TextFill = this.quadrant3TextFill || adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
1156 | this.quadrant4TextFill = this.quadrant4TextFill || adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
1157 | this.quadrantPointFill = this.quadrantPointFill || isDark(this.quadrant1Fill) ? lighten(this.quadrant1Fill) : darken(this.quadrant1Fill);
|
1158 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
1159 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
1160 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
1161 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
1162 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
1163 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
1164 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
1165 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
1166 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
1167 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
1168 | this.relationColor = this.relationColor || this.lineColor;
|
1169 | this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;
|
1170 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
1171 | this.git0 = this.git0 || this.primaryColor;
|
1172 | this.git1 = this.git1 || this.secondaryColor;
|
1173 | this.git2 = this.git2 || this.tertiaryColor;
|
1174 | this.git3 = this.git3 || adjust(this.primaryColor, { h: -30 });
|
1175 | this.git4 = this.git4 || adjust(this.primaryColor, { h: -60 });
|
1176 | this.git5 = this.git5 || adjust(this.primaryColor, { h: -90 });
|
1177 | this.git6 = this.git6 || adjust(this.primaryColor, { h: 60 });
|
1178 | this.git7 = this.git7 || adjust(this.primaryColor, { h: 120 });
|
1179 | if (this.darkMode) {
|
1180 | this.git0 = lighten(this.git0, 25);
|
1181 | this.git1 = lighten(this.git1, 25);
|
1182 | this.git2 = lighten(this.git2, 25);
|
1183 | this.git3 = lighten(this.git3, 25);
|
1184 | this.git4 = lighten(this.git4, 25);
|
1185 | this.git5 = lighten(this.git5, 25);
|
1186 | this.git6 = lighten(this.git6, 25);
|
1187 | this.git7 = lighten(this.git7, 25);
|
1188 | } else {
|
1189 | this.git0 = darken(this.git0, 25);
|
1190 | this.git1 = darken(this.git1, 25);
|
1191 | this.git2 = darken(this.git2, 25);
|
1192 | this.git3 = darken(this.git3, 25);
|
1193 | this.git4 = darken(this.git4, 25);
|
1194 | this.git5 = darken(this.git5, 25);
|
1195 | this.git6 = darken(this.git6, 25);
|
1196 | this.git7 = darken(this.git7, 25);
|
1197 | }
|
1198 | this.gitInv0 = this.gitInv0 || invert(this.git0);
|
1199 | this.gitInv1 = this.gitInv1 || invert(this.git1);
|
1200 | this.gitInv2 = this.gitInv2 || invert(this.git2);
|
1201 | this.gitInv3 = this.gitInv3 || invert(this.git3);
|
1202 | this.gitInv4 = this.gitInv4 || invert(this.git4);
|
1203 | this.gitInv5 = this.gitInv5 || invert(this.git5);
|
1204 | this.gitInv6 = this.gitInv6 || invert(this.git6);
|
1205 | this.gitInv7 = this.gitInv7 || invert(this.git7);
|
1206 | this.gitBranchLabel0 = this.gitBranchLabel0 || invert(this.labelTextColor);
|
1207 | this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
1208 | this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
1209 | this.gitBranchLabel3 = this.gitBranchLabel3 || invert(this.labelTextColor);
|
1210 | this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
1211 | this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
1212 | this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
1213 | this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
1214 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
1215 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
1216 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
1217 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
1218 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
1219 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
1220 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
1221 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
|
1222 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
|
1223 | }
|
1224 | calculate(overrides) {
|
1225 | if (typeof overrides !== "object") {
|
1226 | this.updateColors();
|
1227 | return;
|
1228 | }
|
1229 | const keys = Object.keys(overrides);
|
1230 | keys.forEach((k) => {
|
1231 | this[k] = overrides[k];
|
1232 | });
|
1233 | this.updateColors();
|
1234 | keys.forEach((k) => {
|
1235 | this[k] = overrides[k];
|
1236 | });
|
1237 | }
|
1238 | };
|
1239 | const getThemeVariables$1 = (userOverrides) => {
|
1240 | const theme2 = new Theme$1();
|
1241 | theme2.calculate(userOverrides);
|
1242 | return theme2;
|
1243 | };
|
1244 | class Theme5 {
|
1245 | constructor() {
|
1246 | this.primaryColor = "#eee";
|
1247 | this.contrast = "#707070";
|
1248 | this.secondaryColor = lighten(this.contrast, 55);
|
1249 | this.background = "#ffffff";
|
1250 | this.tertiaryColor = adjust(this.primaryColor, { h: -160 });
|
1251 | this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
|
1252 | this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
1253 | this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
1254 | this.primaryTextColor = invert(this.primaryColor);
|
1255 | this.secondaryTextColor = invert(this.secondaryColor);
|
1256 | this.tertiaryTextColor = invert(this.tertiaryColor);
|
1257 | this.lineColor = invert(this.background);
|
1258 | this.textColor = invert(this.background);
|
1259 | this.mainBkg = "#eee";
|
1260 | this.secondBkg = "calculated";
|
1261 | this.lineColor = "#666";
|
1262 | this.border1 = "#999";
|
1263 | this.border2 = "calculated";
|
1264 | this.note = "#ffa";
|
1265 | this.text = "#333";
|
1266 | this.critical = "#d42";
|
1267 | this.done = "#bbb";
|
1268 | this.arrowheadColor = "#333333";
|
1269 | this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
1270 | this.fontSize = "16px";
|
1271 | this.THEME_COLOR_LIMIT = 12;
|
1272 | this.nodeBkg = "calculated";
|
1273 | this.nodeBorder = "calculated";
|
1274 | this.clusterBkg = "calculated";
|
1275 | this.clusterBorder = "calculated";
|
1276 | this.defaultLinkColor = "calculated";
|
1277 | this.titleColor = "calculated";
|
1278 | this.edgeLabelBackground = "white";
|
1279 | this.actorBorder = "calculated";
|
1280 | this.actorBkg = "calculated";
|
1281 | this.actorTextColor = "calculated";
|
1282 | this.actorLineColor = "calculated";
|
1283 | this.signalColor = "calculated";
|
1284 | this.signalTextColor = "calculated";
|
1285 | this.labelBoxBkgColor = "calculated";
|
1286 | this.labelBoxBorderColor = "calculated";
|
1287 | this.labelTextColor = "calculated";
|
1288 | this.loopTextColor = "calculated";
|
1289 | this.noteBorderColor = "calculated";
|
1290 | this.noteBkgColor = "calculated";
|
1291 | this.noteTextColor = "calculated";
|
1292 | this.activationBorderColor = "#666";
|
1293 | this.activationBkgColor = "#f4f4f4";
|
1294 | this.sequenceNumberColor = "white";
|
1295 | this.sectionBkgColor = "calculated";
|
1296 | this.altSectionBkgColor = "white";
|
1297 | this.sectionBkgColor2 = "calculated";
|
1298 | this.excludeBkgColor = "#eeeeee";
|
1299 | this.taskBorderColor = "calculated";
|
1300 | this.taskBkgColor = "calculated";
|
1301 | this.taskTextLightColor = "white";
|
1302 | this.taskTextColor = "calculated";
|
1303 | this.taskTextDarkColor = "calculated";
|
1304 | this.taskTextOutsideColor = "calculated";
|
1305 | this.taskTextClickableColor = "#003163";
|
1306 | this.activeTaskBorderColor = "calculated";
|
1307 | this.activeTaskBkgColor = "calculated";
|
1308 | this.gridColor = "calculated";
|
1309 | this.doneTaskBkgColor = "calculated";
|
1310 | this.doneTaskBorderColor = "calculated";
|
1311 | this.critBkgColor = "calculated";
|
1312 | this.critBorderColor = "calculated";
|
1313 | this.todayLineColor = "calculated";
|
1314 | this.personBorder = this.primaryBorderColor;
|
1315 | this.personBkg = this.mainBkg;
|
1316 | this.labelColor = "black";
|
1317 | this.errorBkgColor = "#552222";
|
1318 | this.errorTextColor = "#552222";
|
1319 | }
|
1320 | updateColors() {
|
1321 | this.secondBkg = lighten(this.contrast, 55);
|
1322 | this.border2 = this.contrast;
|
1323 | this.actorBorder = lighten(this.border1, 23);
|
1324 | this.actorBkg = this.mainBkg;
|
1325 | this.actorTextColor = this.text;
|
1326 | this.actorLineColor = this.lineColor;
|
1327 | this.signalColor = this.text;
|
1328 | this.signalTextColor = this.text;
|
1329 | this.labelBoxBkgColor = this.actorBkg;
|
1330 | this.labelBoxBorderColor = this.actorBorder;
|
1331 | this.labelTextColor = this.text;
|
1332 | this.loopTextColor = this.text;
|
1333 | this.noteBorderColor = "#999";
|
1334 | this.noteBkgColor = "#666";
|
1335 | this.noteTextColor = "#fff";
|
1336 | this.cScale0 = this.cScale0 || "#555";
|
1337 | this.cScale1 = this.cScale1 || "#F4F4F4";
|
1338 | this.cScale2 = this.cScale2 || "#555";
|
1339 | this.cScale3 = this.cScale3 || "#BBB";
|
1340 | this.cScale4 = this.cScale4 || "#777";
|
1341 | this.cScale5 = this.cScale5 || "#999";
|
1342 | this.cScale6 = this.cScale6 || "#DDD";
|
1343 | this.cScale7 = this.cScale7 || "#FFF";
|
1344 | this.cScale8 = this.cScale8 || "#DDD";
|
1345 | this.cScale9 = this.cScale9 || "#BBB";
|
1346 | this.cScale10 = this.cScale10 || "#999";
|
1347 | this.cScale11 = this.cScale11 || "#777";
|
1348 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
1349 | this["cScaleInv" + i] = this["cScaleInv" + i] || invert(this["cScale" + i]);
|
1350 | }
|
1351 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
1352 | if (this.darkMode) {
|
1353 | this["cScalePeer" + i] = this["cScalePeer" + i] || lighten(this["cScale" + i], 10);
|
1354 | } else {
|
1355 | this["cScalePeer" + i] = this["cScalePeer" + i] || darken(this["cScale" + i], 10);
|
1356 | }
|
1357 | }
|
1358 | this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
|
1359 | this["cScaleLabel0"] = this["cScaleLabel0"] || this.cScale1;
|
1360 | this["cScaleLabel2"] = this["cScaleLabel2"] || this.cScale1;
|
1361 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
1362 | this["cScaleLabel" + i] = this["cScaleLabel" + i] || this.scaleLabelColor;
|
1363 | }
|
1364 | for (let i = 0; i < 5; i++) {
|
1365 | this["surface" + i] = this["surface" + i] || adjust(this.mainBkg, { l: -(5 + i * 5) });
|
1366 | this["surfacePeer" + i] = this["surfacePeer" + i] || adjust(this.mainBkg, { l: -(8 + i * 5) });
|
1367 | }
|
1368 | this.nodeBkg = this.mainBkg;
|
1369 | this.nodeBorder = this.border1;
|
1370 | this.clusterBkg = this.secondBkg;
|
1371 | this.clusterBorder = this.border2;
|
1372 | this.defaultLinkColor = this.lineColor;
|
1373 | this.titleColor = this.text;
|
1374 | this.sectionBkgColor = lighten(this.contrast, 30);
|
1375 | this.sectionBkgColor2 = lighten(this.contrast, 30);
|
1376 | this.taskBorderColor = darken(this.contrast, 10);
|
1377 | this.taskBkgColor = this.contrast;
|
1378 | this.taskTextColor = this.taskTextLightColor;
|
1379 | this.taskTextDarkColor = this.text;
|
1380 | this.taskTextOutsideColor = this.taskTextDarkColor;
|
1381 | this.activeTaskBorderColor = this.taskBorderColor;
|
1382 | this.activeTaskBkgColor = this.mainBkg;
|
1383 | this.gridColor = lighten(this.border1, 30);
|
1384 | this.doneTaskBkgColor = this.done;
|
1385 | this.doneTaskBorderColor = this.lineColor;
|
1386 | this.critBkgColor = this.critical;
|
1387 | this.critBorderColor = darken(this.critBkgColor, 10);
|
1388 | this.todayLineColor = this.critBkgColor;
|
1389 | this.transitionColor = this.transitionColor || "#000";
|
1390 | this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
1391 | this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
1392 | this.stateBkg = this.stateBkg || this.mainBkg;
|
1393 | this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;
|
1394 | this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;
|
1395 | this.altBackground = this.altBackground || "#f4f4f4";
|
1396 | this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
|
1397 | this.stateBorder = this.stateBorder || "#000";
|
1398 | this.innerEndBackground = this.primaryBorderColor;
|
1399 | this.specialStateColor = "#222";
|
1400 | this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
|
1401 | this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
|
1402 | this.classText = this.primaryTextColor;
|
1403 | this.fillType0 = this.primaryColor;
|
1404 | this.fillType1 = this.secondaryColor;
|
1405 | this.fillType2 = adjust(this.primaryColor, { h: 64 });
|
1406 | this.fillType3 = adjust(this.secondaryColor, { h: 64 });
|
1407 | this.fillType4 = adjust(this.primaryColor, { h: -64 });
|
1408 | this.fillType5 = adjust(this.secondaryColor, { h: -64 });
|
1409 | this.fillType6 = adjust(this.primaryColor, { h: 128 });
|
1410 | this.fillType7 = adjust(this.secondaryColor, { h: 128 });
|
1411 | for (let i = 0; i < this.THEME_COLOR_LIMIT; i++) {
|
1412 | this["pie" + i] = this["cScale" + i];
|
1413 | }
|
1414 | this.pie12 = this.pie0;
|
1415 | this.pieTitleTextSize = this.pieTitleTextSize || "25px";
|
1416 | this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
1417 | this.pieSectionTextSize = this.pieSectionTextSize || "17px";
|
1418 | this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
1419 | this.pieLegendTextSize = this.pieLegendTextSize || "17px";
|
1420 | this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
1421 | this.pieStrokeColor = this.pieStrokeColor || "black";
|
1422 | this.pieStrokeWidth = this.pieStrokeWidth || "2px";
|
1423 | this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px";
|
1424 | this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black";
|
1425 | this.pieOpacity = this.pieOpacity || "0.7";
|
1426 | this.quadrant1Fill = this.quadrant1Fill || this.primaryColor;
|
1427 | this.quadrant2Fill = this.quadrant2Fill || adjust(this.primaryColor, { r: 5, g: 5, b: 5 });
|
1428 | this.quadrant3Fill = this.quadrant3Fill || adjust(this.primaryColor, { r: 10, g: 10, b: 10 });
|
1429 | this.quadrant4Fill = this.quadrant4Fill || adjust(this.primaryColor, { r: 15, g: 15, b: 15 });
|
1430 | this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor;
|
1431 | this.quadrant2TextFill = this.quadrant2TextFill || adjust(this.primaryTextColor, { r: -5, g: -5, b: -5 });
|
1432 | this.quadrant3TextFill = this.quadrant3TextFill || adjust(this.primaryTextColor, { r: -10, g: -10, b: -10 });
|
1433 | this.quadrant4TextFill = this.quadrant4TextFill || adjust(this.primaryTextColor, { r: -15, g: -15, b: -15 });
|
1434 | this.quadrantPointFill = this.quadrantPointFill || isDark(this.quadrant1Fill) ? lighten(this.quadrant1Fill) : darken(this.quadrant1Fill);
|
1435 | this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor;
|
1436 | this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor;
|
1437 | this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor;
|
1438 | this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor;
|
1439 | this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor;
|
1440 | this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor;
|
1441 | this.requirementBackground = this.requirementBackground || this.primaryColor;
|
1442 | this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;
|
1443 | this.requirementBorderSize = this.requirementBorderSize || "1";
|
1444 | this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;
|
1445 | this.relationColor = this.relationColor || this.lineColor;
|
1446 | this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;
|
1447 | this.relationLabelColor = this.relationLabelColor || this.actorTextColor;
|
1448 | this.git0 = darken(this.pie1, 25) || this.primaryColor;
|
1449 | this.git1 = this.pie2 || this.secondaryColor;
|
1450 | this.git2 = this.pie3 || this.tertiaryColor;
|
1451 | this.git3 = this.pie4 || adjust(this.primaryColor, { h: -30 });
|
1452 | this.git4 = this.pie5 || adjust(this.primaryColor, { h: -60 });
|
1453 | this.git5 = this.pie6 || adjust(this.primaryColor, { h: -90 });
|
1454 | this.git6 = this.pie7 || adjust(this.primaryColor, { h: 60 });
|
1455 | this.git7 = this.pie8 || adjust(this.primaryColor, { h: 120 });
|
1456 | this.gitInv0 = this.gitInv0 || invert(this.git0);
|
1457 | this.gitInv1 = this.gitInv1 || invert(this.git1);
|
1458 | this.gitInv2 = this.gitInv2 || invert(this.git2);
|
1459 | this.gitInv3 = this.gitInv3 || invert(this.git3);
|
1460 | this.gitInv4 = this.gitInv4 || invert(this.git4);
|
1461 | this.gitInv5 = this.gitInv5 || invert(this.git5);
|
1462 | this.gitInv6 = this.gitInv6 || invert(this.git6);
|
1463 | this.gitInv7 = this.gitInv7 || invert(this.git7);
|
1464 | this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
|
1465 | this.gitBranchLabel0 = this.branchLabelColor;
|
1466 | this.gitBranchLabel1 = "white";
|
1467 | this.gitBranchLabel2 = this.branchLabelColor;
|
1468 | this.gitBranchLabel3 = "white";
|
1469 | this.gitBranchLabel4 = this.branchLabelColor;
|
1470 | this.gitBranchLabel5 = this.branchLabelColor;
|
1471 | this.gitBranchLabel6 = this.branchLabelColor;
|
1472 | this.gitBranchLabel7 = this.branchLabelColor;
|
1473 | this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
1474 | this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
1475 | this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
1476 | this.tagLabelFontSize = this.tagLabelFontSize || "10px";
|
1477 | this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;
|
1478 | this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;
|
1479 | this.commitLabelFontSize = this.commitLabelFontSize || "10px";
|
1480 | this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || oldAttributeBackgroundColorOdd;
|
1481 | this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || oldAttributeBackgroundColorEven;
|
1482 | }
|
1483 | calculate(overrides) {
|
1484 | if (typeof overrides !== "object") {
|
1485 | this.updateColors();
|
1486 | return;
|
1487 | }
|
1488 | const keys = Object.keys(overrides);
|
1489 | keys.forEach((k) => {
|
1490 | this[k] = overrides[k];
|
1491 | });
|
1492 | this.updateColors();
|
1493 | keys.forEach((k) => {
|
1494 | this[k] = overrides[k];
|
1495 | });
|
1496 | }
|
1497 | }
|
1498 | const getThemeVariables = (userOverrides) => {
|
1499 | const theme2 = new Theme5();
|
1500 | theme2.calculate(userOverrides);
|
1501 | return theme2;
|
1502 | };
|
1503 | const theme = {
|
1504 | base: {
|
1505 | getThemeVariables: getThemeVariables$4
|
1506 | },
|
1507 | dark: {
|
1508 | getThemeVariables: getThemeVariables$3
|
1509 | },
|
1510 | default: {
|
1511 | getThemeVariables: getThemeVariables$2
|
1512 | },
|
1513 | forest: {
|
1514 | getThemeVariables: getThemeVariables$1
|
1515 | },
|
1516 | neutral: {
|
1517 | getThemeVariables
|
1518 | }
|
1519 | };
|
1520 | const config = {
|
1521 | |
1522 |
|
1523 |
|
1524 |
|
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 |
|
1535 |
|
1536 |
|
1537 |
|
1538 |
|
1539 | theme: "default",
|
1540 | themeVariables: theme["default"].getThemeVariables(),
|
1541 | themeCSS: void 0,
|
1542 |
|
1543 | maxTextSize: 5e4,
|
1544 | darkMode: false,
|
1545 | |
1546 |
|
1547 |
|
1548 |
|
1549 |
|
1550 |
|
1551 |
|
1552 | fontFamily: '"trebuchet ms", verdana, arial, sans-serif;',
|
1553 | |
1554 |
|
1555 |
|
1556 |
|
1557 |
|
1558 |
|
1559 |
|
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 | logLevel: 5,
|
1568 | |
1569 |
|
1570 |
|
1571 |
|
1572 |
|
1573 |
|
1574 |
|
1575 |
|
1576 |
|
1577 |
|
1578 |
|
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 | securityLevel: "strict",
|
1584 | |
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 | startOnLoad: true,
|
1592 | |
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 | arrowMarkerAbsolute: false,
|
1604 | |
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 |
|
1613 |
|
1614 | secure: ["secure", "securityLevel", "startOnLoad", "maxTextSize"],
|
1615 | |
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 |
|
1623 |
|
1624 |
|
1625 |
|
1626 |
|
1627 | deterministicIds: false,
|
1628 | |
1629 |
|
1630 |
|
1631 |
|
1632 |
|
1633 | deterministicIDSeed: void 0,
|
1634 |
|
1635 | flowchart: {
|
1636 | |
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 | titleTopMargin: 25,
|
1646 | |
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 |
|
1658 | diagramPadding: 8,
|
1659 | |
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 | htmlLabels: true,
|
1667 | |
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 | nodeSpacing: 50,
|
1680 | |
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 | rankSpacing: 50,
|
1693 | |
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 | curve: "basis",
|
1703 |
|
1704 |
|
1705 | padding: 15,
|
1706 | |
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 | useMaxWidth: true,
|
1719 | |
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 |
|
1727 |
|
1728 |
|
1729 |
|
1730 |
|
1731 |
|
1732 | defaultRenderer: "dagre-wrapper",
|
1733 | |
1734 |
|
1735 |
|
1736 |
|
1737 |
|
1738 |
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 | wrappingWidth: 200
|
1745 | },
|
1746 |
|
1747 | sequence: {
|
1748 | hideUnusedParticipants: false,
|
1749 | |
1750 |
|
1751 |
|
1752 |
|
1753 |
|
1754 |
|
1755 |
|
1756 | activationWidth: 10,
|
1757 | |
1758 |
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
1763 |
|
1764 | diagramMarginX: 50,
|
1765 | |
1766 |
|
1767 |
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 | diagramMarginY: 10,
|
1773 | |
1774 |
|
1775 |
|
1776 |
|
1777 |
|
1778 |
|
1779 |
|
1780 | actorMargin: 50,
|
1781 | |
1782 |
|
1783 |
|
1784 |
|
1785 |
|
1786 |
|
1787 |
|
1788 | width: 150,
|
1789 | |
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 | height: 65,
|
1797 | |
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 | boxMargin: 10,
|
1805 | |
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 | boxTextMargin: 5,
|
1813 | |
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 | noteMargin: 10,
|
1821 | |
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 | messageMargin: 35,
|
1829 | |
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 |
|
1835 |
|
1836 | messageAlign: "center",
|
1837 | |
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 |
|
1843 |
|
1844 | mirrorActors: true,
|
1845 | |
1846 |
|
1847 |
|
1848 |
|
1849 |
|
1850 |
|
1851 |
|
1852 |
|
1853 |
|
1854 | forceMenus: false,
|
1855 | |
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 |
|
1864 |
|
1865 |
|
1866 | bottomMarginAdj: 1,
|
1867 | |
1868 |
|
1869 |
|
1870 |
|
1871 |
|
1872 |
|
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 | useMaxWidth: true,
|
1878 | |
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 |
|
1888 |
|
1889 |
|
1890 | rightAngles: false,
|
1891 | |
1892 |
|
1893 |
|
1894 |
|
1895 |
|
1896 |
|
1897 |
|
1898 | showSequenceNumbers: false,
|
1899 | |
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 |
|
1906 | actorFontSize: 14,
|
1907 | |
1908 |
|
1909 |
|
1910 |
|
1911 |
|
1912 |
|
1913 |
|
1914 | actorFontFamily: '"Open Sans", sans-serif',
|
1915 | |
1916 |
|
1917 |
|
1918 |
|
1919 |
|
1920 | actorFontWeight: 400,
|
1921 | |
1922 |
|
1923 |
|
1924 |
|
1925 |
|
1926 |
|
1927 |
|
1928 | noteFontSize: 14,
|
1929 | |
1930 |
|
1931 |
|
1932 |
|
1933 |
|
1934 |
|
1935 |
|
1936 | noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
|
1937 | |
1938 |
|
1939 |
|
1940 |
|
1941 |
|
1942 | noteFontWeight: 400,
|
1943 | |
1944 |
|
1945 |
|
1946 |
|
1947 |
|
1948 |
|
1949 |
|
1950 | noteAlign: "center",
|
1951 | |
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 |
|
1958 | messageFontSize: 16,
|
1959 | |
1960 |
|
1961 |
|
1962 |
|
1963 |
|
1964 |
|
1965 |
|
1966 | messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
|
1967 | |
1968 |
|
1969 |
|
1970 |
|
1971 |
|
1972 | messageFontWeight: 400,
|
1973 | |
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 | wrap: false,
|
1979 | |
1980 |
|
1981 |
|
1982 |
|
1983 |
|
1984 | wrapPadding: 10,
|
1985 | |
1986 |
|
1987 |
|
1988 |
|
1989 |
|
1990 | labelBoxWidth: 50,
|
1991 | |
1992 |
|
1993 |
|
1994 |
|
1995 |
|
1996 | labelBoxHeight: 20,
|
1997 | messageFont: function() {
|
1998 | return {
|
1999 | fontFamily: this.messageFontFamily,
|
2000 | fontSize: this.messageFontSize,
|
2001 | fontWeight: this.messageFontWeight
|
2002 | };
|
2003 | },
|
2004 | noteFont: function() {
|
2005 | return {
|
2006 | fontFamily: this.noteFontFamily,
|
2007 | fontSize: this.noteFontSize,
|
2008 | fontWeight: this.noteFontWeight
|
2009 | };
|
2010 | },
|
2011 | actorFont: function() {
|
2012 | return {
|
2013 | fontFamily: this.actorFontFamily,
|
2014 | fontSize: this.actorFontSize,
|
2015 | fontWeight: this.actorFontWeight
|
2016 | };
|
2017 | }
|
2018 | },
|
2019 |
|
2020 | gantt: {
|
2021 | |
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 |
|
2029 |
|
2030 | titleTopMargin: 25,
|
2031 | |
2032 |
|
2033 |
|
2034 |
|
2035 |
|
2036 |
|
2037 |
|
2038 | barHeight: 20,
|
2039 | |
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 | barGap: 4,
|
2047 | |
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 | topPadding: 50,
|
2055 | |
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 | rightPadding: 75,
|
2063 | |
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 | leftPadding: 75,
|
2071 | |
2072 |
|
2073 |
|
2074 |
|
2075 |
|
2076 |
|
2077 |
|
2078 | gridLineStartPadding: 35,
|
2079 | |
2080 |
|
2081 |
|
2082 |
|
2083 |
|
2084 |
|
2085 |
|
2086 | fontSize: 11,
|
2087 | |
2088 |
|
2089 |
|
2090 |
|
2091 |
|
2092 |
|
2093 |
|
2094 | sectionFontSize: 11,
|
2095 | |
2096 |
|
2097 |
|
2098 |
|
2099 |
|
2100 |
|
2101 |
|
2102 | numberSectionStyles: 4,
|
2103 | |
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 |
|
2111 |
|
2112 | displayMode: "",
|
2113 | |
2114 |
|
2115 |
|
2116 |
|
2117 |
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 |
|
2124 | axisFormat: "%Y-%m-%d",
|
2125 | |
2126 |
|
2127 |
|
2128 |
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 | tickInterval: void 0,
|
2137 | |
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 |
|
2149 | useMaxWidth: true,
|
2150 | |
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 |
|
2159 | topAxis: false,
|
2160 | useWidth: void 0
|
2161 | },
|
2162 |
|
2163 | journey: {
|
2164 | |
2165 |
|
2166 |
|
2167 |
|
2168 |
|
2169 |
|
2170 |
|
2171 | diagramMarginX: 50,
|
2172 | |
2173 |
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 | diagramMarginY: 10,
|
2180 | |
2181 |
|
2182 |
|
2183 |
|
2184 |
|
2185 |
|
2186 |
|
2187 | leftMargin: 150,
|
2188 | |
2189 |
|
2190 |
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 | width: 150,
|
2196 | |
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 | height: 50,
|
2204 | |
2205 |
|
2206 |
|
2207 |
|
2208 |
|
2209 |
|
2210 |
|
2211 | boxMargin: 10,
|
2212 | |
2213 |
|
2214 |
|
2215 |
|
2216 |
|
2217 |
|
2218 |
|
2219 | boxTextMargin: 5,
|
2220 | |
2221 |
|
2222 |
|
2223 |
|
2224 |
|
2225 |
|
2226 |
|
2227 | noteMargin: 10,
|
2228 | |
2229 |
|
2230 |
|
2231 |
|
2232 |
|
2233 |
|
2234 |
|
2235 |
|
2236 |
|
2237 |
|
2238 |
|
2239 | messageMargin: 35,
|
2240 | |
2241 |
|
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 | messageAlign: "center",
|
2248 | |
2249 |
|
2250 |
|
2251 |
|
2252 |
|
2253 |
|
2254 |
|
2255 |
|
2256 |
|
2257 |
|
2258 |
|
2259 | bottomMarginAdj: 1,
|
2260 | |
2261 |
|
2262 |
|
2263 |
|
2264 |
|
2265 |
|
2266 |
|
2267 |
|
2268 |
|
2269 |
|
2270 |
|
2271 |
|
2272 | useMaxWidth: true,
|
2273 | |
2274 |
|
2275 |
|
2276 |
|
2277 |
|
2278 |
|
2279 |
|
2280 |
|
2281 |
|
2282 |
|
2283 |
|
2284 |
|
2285 | rightAngles: false,
|
2286 | taskFontSize: 14,
|
2287 | taskFontFamily: '"Open Sans", sans-serif',
|
2288 | taskMargin: 50,
|
2289 |
|
2290 | activationWidth: 10,
|
2291 |
|
2292 | textPlacement: "fo",
|
2293 | actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"],
|
2294 | sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"],
|
2295 | sectionColours: ["#fff"]
|
2296 | },
|
2297 |
|
2298 | timeline: {
|
2299 | |
2300 |
|
2301 |
|
2302 |
|
2303 |
|
2304 |
|
2305 |
|
2306 | diagramMarginX: 50,
|
2307 | |
2308 |
|
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 |
|
2314 | diagramMarginY: 10,
|
2315 | |
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 |
|
2321 |
|
2322 | leftMargin: 150,
|
2323 | |
2324 |
|
2325 |
|
2326 |
|
2327 |
|
2328 |
|
2329 |
|
2330 | width: 150,
|
2331 | |
2332 |
|
2333 |
|
2334 |
|
2335 |
|
2336 |
|
2337 |
|
2338 | height: 50,
|
2339 | |
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 | boxMargin: 10,
|
2347 | |
2348 |
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 | boxTextMargin: 5,
|
2355 | |
2356 |
|
2357 |
|
2358 |
|
2359 |
|
2360 |
|
2361 |
|
2362 | noteMargin: 10,
|
2363 | |
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 |
|
2369 |
|
2370 |
|
2371 |
|
2372 |
|
2373 |
|
2374 | messageMargin: 35,
|
2375 | |
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 | messageAlign: "center",
|
2383 | |
2384 |
|
2385 |
|
2386 |
|
2387 |
|
2388 |
|
2389 |
|
2390 |
|
2391 |
|
2392 |
|
2393 |
|
2394 | bottomMarginAdj: 1,
|
2395 | |
2396 |
|
2397 |
|
2398 |
|
2399 |
|
2400 |
|
2401 |
|
2402 |
|
2403 |
|
2404 |
|
2405 |
|
2406 |
|
2407 | useMaxWidth: true,
|
2408 | |
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 |
|
2416 |
|
2417 |
|
2418 |
|
2419 |
|
2420 | rightAngles: false,
|
2421 | taskFontSize: 14,
|
2422 | taskFontFamily: '"Open Sans", sans-serif',
|
2423 | taskMargin: 50,
|
2424 |
|
2425 | activationWidth: 10,
|
2426 |
|
2427 | textPlacement: "fo",
|
2428 | actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"],
|
2429 | sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"],
|
2430 | sectionColours: ["#fff"],
|
2431 | disableMulticolor: false
|
2432 | },
|
2433 | class: {
|
2434 | |
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 | titleTopMargin: 25,
|
2444 | arrowMarkerAbsolute: false,
|
2445 | dividerMargin: 10,
|
2446 | padding: 5,
|
2447 | textHeight: 10,
|
2448 | |
2449 |
|
2450 |
|
2451 |
|
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 |
|
2460 | useMaxWidth: true,
|
2461 | |
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 |
|
2471 |
|
2472 |
|
2473 | defaultRenderer: "dagre-wrapper"
|
2474 | },
|
2475 | state: {
|
2476 | |
2477 |
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 | titleTopMargin: 25,
|
2486 | dividerMargin: 10,
|
2487 | sizeUnit: 5,
|
2488 | padding: 8,
|
2489 | textHeight: 10,
|
2490 | titleShift: -15,
|
2491 | noteMargin: 10,
|
2492 | forkWidth: 70,
|
2493 | forkHeight: 7,
|
2494 |
|
2495 | miniPadding: 2,
|
2496 |
|
2497 |
|
2498 | fontSizeFactor: 5.02,
|
2499 | fontSize: 24,
|
2500 | labelHeight: 16,
|
2501 | edgeLengthFactor: "20",
|
2502 | compositTitleSize: 35,
|
2503 | radius: 5,
|
2504 | |
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 | useMaxWidth: true,
|
2517 | |
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 |
|
2524 |
|
2525 |
|
2526 |
|
2527 |
|
2528 |
|
2529 | defaultRenderer: "dagre-wrapper"
|
2530 | },
|
2531 |
|
2532 | er: {
|
2533 | |
2534 |
|
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 |
|
2542 | titleTopMargin: 25,
|
2543 | |
2544 |
|
2545 |
|
2546 |
|
2547 |
|
2548 |
|
2549 |
|
2550 |
|
2551 |
|
2552 |
|
2553 |
|
2554 |
|
2555 | diagramPadding: 20,
|
2556 | |
2557 |
|
2558 |
|
2559 |
|
2560 |
|
2561 |
|
2562 |
|
2563 |
|
2564 |
|
2565 |
|
2566 |
|
2567 |
|
2568 |
|
2569 | layoutDirection: "TB",
|
2570 | |
2571 |
|
2572 |
|
2573 |
|
2574 |
|
2575 |
|
2576 |
|
2577 | minEntityWidth: 100,
|
2578 | |
2579 |
|
2580 |
|
2581 |
|
2582 |
|
2583 |
|
2584 |
|
2585 | minEntityHeight: 75,
|
2586 | |
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 |
|
2593 |
|
2594 |
|
2595 |
|
2596 |
|
2597 |
|
2598 | entityPadding: 15,
|
2599 | |
2600 |
|
2601 |
|
2602 |
|
2603 |
|
2604 |
|
2605 |
|
2606 | stroke: "gray",
|
2607 | |
2608 |
|
2609 |
|
2610 |
|
2611 |
|
2612 |
|
2613 |
|
2614 | fill: "honeydew",
|
2615 | |
2616 |
|
2617 |
|
2618 |
|
2619 |
|
2620 |
|
2621 |
|
2622 |
|
2623 |
|
2624 | fontSize: 12,
|
2625 | |
2626 |
|
2627 |
|
2628 |
|
2629 |
|
2630 |
|
2631 |
|
2632 |
|
2633 |
|
2634 |
|
2635 |
|
2636 |
|
2637 | useMaxWidth: true
|
2638 | },
|
2639 |
|
2640 | pie: {
|
2641 | useWidth: void 0,
|
2642 | |
2643 |
|
2644 |
|
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 | useMaxWidth: true,
|
2655 | |
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 | textPosition: 0.75
|
2663 | },
|
2664 | quadrantChart: {
|
2665 | |
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 | chartWidth: 500,
|
2674 | |
2675 |
|
2676 |
|
2677 |
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 | chartHeight: 500,
|
2683 | |
2684 |
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 |
|
2691 | titlePadding: 10,
|
2692 | |
2693 |
|
2694 |
|
2695 |
|
2696 |
|
2697 |
|
2698 |
|
2699 |
|
2700 | titleFontSize: 20,
|
2701 | |
2702 |
|
2703 |
|
2704 |
|
2705 |
|
2706 |
|
2707 |
|
2708 |
|
2709 | quadrantPadding: 5,
|
2710 | |
2711 |
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 |
|
2718 | quadrantTextTopPadding: 5,
|
2719 | |
2720 |
|
2721 |
|
2722 |
|
2723 |
|
2724 |
|
2725 |
|
2726 |
|
2727 | quadrantLabelFontSize: 16,
|
2728 | |
2729 |
|
2730 |
|
2731 |
|
2732 |
|
2733 |
|
2734 |
|
2735 |
|
2736 | quadrantInternalBorderStrokeWidth: 1,
|
2737 | |
2738 |
|
2739 |
|
2740 |
|
2741 |
|
2742 |
|
2743 |
|
2744 |
|
2745 | quadrantExternalBorderStrokeWidth: 2,
|
2746 | |
2747 |
|
2748 |
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 | xAxisLabelPadding: 5,
|
2755 | |
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 | xAxisLabelFontSize: 16,
|
2764 | |
2765 |
|
2766 |
|
2767 |
|
2768 |
|
2769 |
|
2770 |
|
2771 |
|
2772 | xAxisPosition: "top",
|
2773 | |
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 | yAxisLabelPadding: 5,
|
2782 | |
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 | yAxisLabelFontSize: 16,
|
2791 | |
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 |
|
2797 |
|
2798 |
|
2799 | yAxisPosition: "left",
|
2800 | |
2801 |
|
2802 |
|
2803 |
|
2804 |
|
2805 |
|
2806 |
|
2807 |
|
2808 | pointTextPadding: 5,
|
2809 | |
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 | pointLabelFontSize: 12,
|
2818 | |
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 |
|
2825 |
|
2826 | pointRadius: 5,
|
2827 | |
2828 |
|
2829 |
|
2830 |
|
2831 |
|
2832 |
|
2833 |
|
2834 |
|
2835 |
|
2836 |
|
2837 |
|
2838 |
|
2839 | useMaxWidth: true
|
2840 | },
|
2841 |
|
2842 | requirement: {
|
2843 | useWidth: void 0,
|
2844 | |
2845 |
|
2846 |
|
2847 |
|
2848 |
|
2849 |
|
2850 |
|
2851 |
|
2852 |
|
2853 |
|
2854 |
|
2855 |
|
2856 | useMaxWidth: true,
|
2857 | rect_fill: "#f9f9f9",
|
2858 | text_color: "#333",
|
2859 | rect_border_size: "0.5px",
|
2860 | rect_border_color: "#bbb",
|
2861 | rect_min_width: 200,
|
2862 | rect_min_height: 200,
|
2863 | fontSize: 14,
|
2864 | rect_padding: 10,
|
2865 | line_height: 20
|
2866 | },
|
2867 | gitGraph: {
|
2868 | |
2869 |
|
2870 |
|
2871 |
|
2872 |
|
2873 |
|
2874 |
|
2875 |
|
2876 |
|
2877 | titleTopMargin: 25,
|
2878 | diagramPadding: 8,
|
2879 | nodeLabel: {
|
2880 | width: 75,
|
2881 | height: 100,
|
2882 | x: -25,
|
2883 | y: 0
|
2884 | },
|
2885 | mainBranchName: "main",
|
2886 | mainBranchOrder: 0,
|
2887 | showCommitLabel: true,
|
2888 | showBranches: true,
|
2889 | rotateCommitLabel: true
|
2890 | },
|
2891 |
|
2892 | c4: {
|
2893 | useWidth: void 0,
|
2894 | |
2895 |
|
2896 |
|
2897 |
|
2898 |
|
2899 |
|
2900 |
|
2901 | diagramMarginX: 50,
|
2902 | |
2903 |
|
2904 |
|
2905 |
|
2906 |
|
2907 |
|
2908 |
|
2909 | diagramMarginY: 10,
|
2910 | |
2911 |
|
2912 |
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 | c4ShapeMargin: 50,
|
2918 | |
2919 |
|
2920 |
|
2921 |
|
2922 |
|
2923 |
|
2924 |
|
2925 | c4ShapePadding: 20,
|
2926 | |
2927 |
|
2928 |
|
2929 |
|
2930 |
|
2931 |
|
2932 |
|
2933 | width: 216,
|
2934 | |
2935 |
|
2936 |
|
2937 |
|
2938 |
|
2939 |
|
2940 |
|
2941 | height: 60,
|
2942 | |
2943 |
|
2944 |
|
2945 |
|
2946 |
|
2947 |
|
2948 |
|
2949 | boxMargin: 10,
|
2950 | |
2951 |
|
2952 |
|
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 |
|
2958 |
|
2959 |
|
2960 | useMaxWidth: true,
|
2961 | |
2962 |
|
2963 |
|
2964 |
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 |
|
2970 | c4ShapeInRow: 4,
|
2971 | nextLinePaddingX: 0,
|
2972 | |
2973 |
|
2974 |
|
2975 |
|
2976 |
|
2977 |
|
2978 |
|
2979 |
|
2980 |
|
2981 | c4BoundaryInRow: 2,
|
2982 | |
2983 |
|
2984 |
|
2985 |
|
2986 |
|
2987 | personFontSize: 14,
|
2988 | |
2989 |
|
2990 |
|
2991 |
|
2992 |
|
2993 | personFontFamily: '"Open Sans", sans-serif',
|
2994 | |
2995 |
|
2996 |
|
2997 |
|
2998 |
|
2999 | personFontWeight: "normal",
|
3000 | |
3001 |
|
3002 |
|
3003 |
|
3004 |
|
3005 | external_personFontSize: 14,
|
3006 | |
3007 |
|
3008 |
|
3009 |
|
3010 |
|
3011 | external_personFontFamily: '"Open Sans", sans-serif',
|
3012 | |
3013 |
|
3014 |
|
3015 |
|
3016 |
|
3017 | external_personFontWeight: "normal",
|
3018 | |
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 | systemFontSize: 14,
|
3024 | |
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 | systemFontFamily: '"Open Sans", sans-serif',
|
3030 | |
3031 |
|
3032 |
|
3033 |
|
3034 |
|
3035 | systemFontWeight: "normal",
|
3036 | |
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 | external_systemFontSize: 14,
|
3042 | |
3043 |
|
3044 |
|
3045 |
|
3046 |
|
3047 | external_systemFontFamily: '"Open Sans", sans-serif',
|
3048 | |
3049 |
|
3050 |
|
3051 |
|
3052 |
|
3053 | external_systemFontWeight: "normal",
|
3054 | |
3055 |
|
3056 |
|
3057 |
|
3058 |
|
3059 | system_dbFontSize: 14,
|
3060 | |
3061 |
|
3062 |
|
3063 |
|
3064 |
|
3065 | system_dbFontFamily: '"Open Sans", sans-serif',
|
3066 | |
3067 |
|
3068 |
|
3069 |
|
3070 |
|
3071 | system_dbFontWeight: "normal",
|
3072 | |
3073 |
|
3074 |
|
3075 |
|
3076 |
|
3077 | external_system_dbFontSize: 14,
|
3078 | |
3079 |
|
3080 |
|
3081 |
|
3082 |
|
3083 | external_system_dbFontFamily: '"Open Sans", sans-serif',
|
3084 | |
3085 |
|
3086 |
|
3087 |
|
3088 |
|
3089 | external_system_dbFontWeight: "normal",
|
3090 | |
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 | system_queueFontSize: 14,
|
3096 | |
3097 |
|
3098 |
|
3099 |
|
3100 |
|
3101 | system_queueFontFamily: '"Open Sans", sans-serif',
|
3102 | |
3103 |
|
3104 |
|
3105 |
|
3106 |
|
3107 | system_queueFontWeight: "normal",
|
3108 | |
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 | external_system_queueFontSize: 14,
|
3114 | |
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 | external_system_queueFontFamily: '"Open Sans", sans-serif',
|
3120 | |
3121 |
|
3122 |
|
3123 |
|
3124 |
|
3125 | external_system_queueFontWeight: "normal",
|
3126 | |
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 | boundaryFontSize: 14,
|
3132 | |
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 | boundaryFontFamily: '"Open Sans", sans-serif',
|
3138 | |
3139 |
|
3140 |
|
3141 |
|
3142 |
|
3143 | boundaryFontWeight: "normal",
|
3144 | |
3145 |
|
3146 |
|
3147 |
|
3148 |
|
3149 | messageFontSize: 12,
|
3150 | |
3151 |
|
3152 |
|
3153 |
|
3154 |
|
3155 | messageFontFamily: '"Open Sans", sans-serif',
|
3156 | |
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 | messageFontWeight: "normal",
|
3162 | |
3163 |
|
3164 |
|
3165 |
|
3166 |
|
3167 | containerFontSize: 14,
|
3168 | |
3169 |
|
3170 |
|
3171 |
|
3172 |
|
3173 | containerFontFamily: '"Open Sans", sans-serif',
|
3174 | |
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 | containerFontWeight: "normal",
|
3180 | |
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 | external_containerFontSize: 14,
|
3186 | |
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 | external_containerFontFamily: '"Open Sans", sans-serif',
|
3192 | |
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 | external_containerFontWeight: "normal",
|
3198 | |
3199 |
|
3200 |
|
3201 |
|
3202 |
|
3203 | container_dbFontSize: 14,
|
3204 | |
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 | container_dbFontFamily: '"Open Sans", sans-serif',
|
3210 | |
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 | container_dbFontWeight: "normal",
|
3216 | |
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 | external_container_dbFontSize: 14,
|
3222 | |
3223 |
|
3224 |
|
3225 |
|
3226 |
|
3227 | external_container_dbFontFamily: '"Open Sans", sans-serif',
|
3228 | |
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 | external_container_dbFontWeight: "normal",
|
3234 | |
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 | container_queueFontSize: 14,
|
3240 | |
3241 |
|
3242 |
|
3243 |
|
3244 |
|
3245 | container_queueFontFamily: '"Open Sans", sans-serif',
|
3246 | |
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 | container_queueFontWeight: "normal",
|
3252 | |
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 | external_container_queueFontSize: 14,
|
3258 | |
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 | external_container_queueFontFamily: '"Open Sans", sans-serif',
|
3264 | |
3265 |
|
3266 |
|
3267 |
|
3268 |
|
3269 | external_container_queueFontWeight: "normal",
|
3270 | |
3271 |
|
3272 |
|
3273 |
|
3274 |
|
3275 | componentFontSize: 14,
|
3276 | |
3277 |
|
3278 |
|
3279 |
|
3280 |
|
3281 | componentFontFamily: '"Open Sans", sans-serif',
|
3282 | |
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 | componentFontWeight: "normal",
|
3288 | |
3289 |
|
3290 |
|
3291 |
|
3292 |
|
3293 | external_componentFontSize: 14,
|
3294 | |
3295 |
|
3296 |
|
3297 |
|
3298 |
|
3299 | external_componentFontFamily: '"Open Sans", sans-serif',
|
3300 | |
3301 |
|
3302 |
|
3303 |
|
3304 |
|
3305 | external_componentFontWeight: "normal",
|
3306 | |
3307 |
|
3308 |
|
3309 |
|
3310 |
|
3311 | component_dbFontSize: 14,
|
3312 | |
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 | component_dbFontFamily: '"Open Sans", sans-serif',
|
3318 | |
3319 |
|
3320 |
|
3321 |
|
3322 |
|
3323 | component_dbFontWeight: "normal",
|
3324 | |
3325 |
|
3326 |
|
3327 |
|
3328 |
|
3329 | external_component_dbFontSize: 14,
|
3330 | |
3331 |
|
3332 |
|
3333 |
|
3334 |
|
3335 | external_component_dbFontFamily: '"Open Sans", sans-serif',
|
3336 | |
3337 |
|
3338 |
|
3339 |
|
3340 |
|
3341 | external_component_dbFontWeight: "normal",
|
3342 | |
3343 |
|
3344 |
|
3345 |
|
3346 |
|
3347 | component_queueFontSize: 14,
|
3348 | |
3349 |
|
3350 |
|
3351 |
|
3352 |
|
3353 | component_queueFontFamily: '"Open Sans", sans-serif',
|
3354 | |
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 | component_queueFontWeight: "normal",
|
3360 | |
3361 |
|
3362 |
|
3363 |
|
3364 |
|
3365 | external_component_queueFontSize: 14,
|
3366 | |
3367 |
|
3368 |
|
3369 |
|
3370 |
|
3371 | external_component_queueFontFamily: '"Open Sans", sans-serif',
|
3372 | |
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 | external_component_queueFontWeight: "normal",
|
3378 | |
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 | wrap: true,
|
3384 | |
3385 |
|
3386 |
|
3387 |
|
3388 |
|
3389 | wrapPadding: 10,
|
3390 | personFont: function() {
|
3391 | return {
|
3392 | fontFamily: this.personFontFamily,
|
3393 | fontSize: this.personFontSize,
|
3394 | fontWeight: this.personFontWeight
|
3395 | };
|
3396 | },
|
3397 | external_personFont: function() {
|
3398 | return {
|
3399 | fontFamily: this.external_personFontFamily,
|
3400 | fontSize: this.external_personFontSize,
|
3401 | fontWeight: this.external_personFontWeight
|
3402 | };
|
3403 | },
|
3404 | systemFont: function() {
|
3405 | return {
|
3406 | fontFamily: this.systemFontFamily,
|
3407 | fontSize: this.systemFontSize,
|
3408 | fontWeight: this.systemFontWeight
|
3409 | };
|
3410 | },
|
3411 | external_systemFont: function() {
|
3412 | return {
|
3413 | fontFamily: this.external_systemFontFamily,
|
3414 | fontSize: this.external_systemFontSize,
|
3415 | fontWeight: this.external_systemFontWeight
|
3416 | };
|
3417 | },
|
3418 | system_dbFont: function() {
|
3419 | return {
|
3420 | fontFamily: this.system_dbFontFamily,
|
3421 | fontSize: this.system_dbFontSize,
|
3422 | fontWeight: this.system_dbFontWeight
|
3423 | };
|
3424 | },
|
3425 | external_system_dbFont: function() {
|
3426 | return {
|
3427 | fontFamily: this.external_system_dbFontFamily,
|
3428 | fontSize: this.external_system_dbFontSize,
|
3429 | fontWeight: this.external_system_dbFontWeight
|
3430 | };
|
3431 | },
|
3432 | system_queueFont: function() {
|
3433 | return {
|
3434 | fontFamily: this.system_queueFontFamily,
|
3435 | fontSize: this.system_queueFontSize,
|
3436 | fontWeight: this.system_queueFontWeight
|
3437 | };
|
3438 | },
|
3439 | external_system_queueFont: function() {
|
3440 | return {
|
3441 | fontFamily: this.external_system_queueFontFamily,
|
3442 | fontSize: this.external_system_queueFontSize,
|
3443 | fontWeight: this.external_system_queueFontWeight
|
3444 | };
|
3445 | },
|
3446 | containerFont: function() {
|
3447 | return {
|
3448 | fontFamily: this.containerFontFamily,
|
3449 | fontSize: this.containerFontSize,
|
3450 | fontWeight: this.containerFontWeight
|
3451 | };
|
3452 | },
|
3453 | external_containerFont: function() {
|
3454 | return {
|
3455 | fontFamily: this.external_containerFontFamily,
|
3456 | fontSize: this.external_containerFontSize,
|
3457 | fontWeight: this.external_containerFontWeight
|
3458 | };
|
3459 | },
|
3460 | container_dbFont: function() {
|
3461 | return {
|
3462 | fontFamily: this.container_dbFontFamily,
|
3463 | fontSize: this.container_dbFontSize,
|
3464 | fontWeight: this.container_dbFontWeight
|
3465 | };
|
3466 | },
|
3467 | external_container_dbFont: function() {
|
3468 | return {
|
3469 | fontFamily: this.external_container_dbFontFamily,
|
3470 | fontSize: this.external_container_dbFontSize,
|
3471 | fontWeight: this.external_container_dbFontWeight
|
3472 | };
|
3473 | },
|
3474 | container_queueFont: function() {
|
3475 | return {
|
3476 | fontFamily: this.container_queueFontFamily,
|
3477 | fontSize: this.container_queueFontSize,
|
3478 | fontWeight: this.container_queueFontWeight
|
3479 | };
|
3480 | },
|
3481 | external_container_queueFont: function() {
|
3482 | return {
|
3483 | fontFamily: this.external_container_queueFontFamily,
|
3484 | fontSize: this.external_container_queueFontSize,
|
3485 | fontWeight: this.external_container_queueFontWeight
|
3486 | };
|
3487 | },
|
3488 | componentFont: function() {
|
3489 | return {
|
3490 | fontFamily: this.componentFontFamily,
|
3491 | fontSize: this.componentFontSize,
|
3492 | fontWeight: this.componentFontWeight
|
3493 | };
|
3494 | },
|
3495 | external_componentFont: function() {
|
3496 | return {
|
3497 | fontFamily: this.external_componentFontFamily,
|
3498 | fontSize: this.external_componentFontSize,
|
3499 | fontWeight: this.external_componentFontWeight
|
3500 | };
|
3501 | },
|
3502 | component_dbFont: function() {
|
3503 | return {
|
3504 | fontFamily: this.component_dbFontFamily,
|
3505 | fontSize: this.component_dbFontSize,
|
3506 | fontWeight: this.component_dbFontWeight
|
3507 | };
|
3508 | },
|
3509 | external_component_dbFont: function() {
|
3510 | return {
|
3511 | fontFamily: this.external_component_dbFontFamily,
|
3512 | fontSize: this.external_component_dbFontSize,
|
3513 | fontWeight: this.external_component_dbFontWeight
|
3514 | };
|
3515 | },
|
3516 | component_queueFont: function() {
|
3517 | return {
|
3518 | fontFamily: this.component_queueFontFamily,
|
3519 | fontSize: this.component_queueFontSize,
|
3520 | fontWeight: this.component_queueFontWeight
|
3521 | };
|
3522 | },
|
3523 | external_component_queueFont: function() {
|
3524 | return {
|
3525 | fontFamily: this.external_component_queueFontFamily,
|
3526 | fontSize: this.external_component_queueFontSize,
|
3527 | fontWeight: this.external_component_queueFontWeight
|
3528 | };
|
3529 | },
|
3530 | boundaryFont: function() {
|
3531 | return {
|
3532 | fontFamily: this.boundaryFontFamily,
|
3533 | fontSize: this.boundaryFontSize,
|
3534 | fontWeight: this.boundaryFontWeight
|
3535 | };
|
3536 | },
|
3537 | messageFont: function() {
|
3538 | return {
|
3539 | fontFamily: this.messageFontFamily,
|
3540 | fontSize: this.messageFontSize,
|
3541 | fontWeight: this.messageFontWeight
|
3542 | };
|
3543 | },
|
3544 |
|
3545 |
|
3546 | person_bg_color: "#08427B",
|
3547 | person_border_color: "#073B6F",
|
3548 | external_person_bg_color: "#686868",
|
3549 | external_person_border_color: "#8A8A8A",
|
3550 | system_bg_color: "#1168BD",
|
3551 | system_border_color: "#3C7FC0",
|
3552 | system_db_bg_color: "#1168BD",
|
3553 | system_db_border_color: "#3C7FC0",
|
3554 | system_queue_bg_color: "#1168BD",
|
3555 | system_queue_border_color: "#3C7FC0",
|
3556 | external_system_bg_color: "#999999",
|
3557 | external_system_border_color: "#8A8A8A",
|
3558 | external_system_db_bg_color: "#999999",
|
3559 | external_system_db_border_color: "#8A8A8A",
|
3560 | external_system_queue_bg_color: "#999999",
|
3561 | external_system_queue_border_color: "#8A8A8A",
|
3562 | container_bg_color: "#438DD5",
|
3563 | container_border_color: "#3C7FC0",
|
3564 | container_db_bg_color: "#438DD5",
|
3565 | container_db_border_color: "#3C7FC0",
|
3566 | container_queue_bg_color: "#438DD5",
|
3567 | container_queue_border_color: "#3C7FC0",
|
3568 | external_container_bg_color: "#B3B3B3",
|
3569 | external_container_border_color: "#A6A6A6",
|
3570 | external_container_db_bg_color: "#B3B3B3",
|
3571 | external_container_db_border_color: "#A6A6A6",
|
3572 | external_container_queue_bg_color: "#B3B3B3",
|
3573 | external_container_queue_border_color: "#A6A6A6",
|
3574 | component_bg_color: "#85BBF0",
|
3575 | component_border_color: "#78A8D8",
|
3576 | component_db_bg_color: "#85BBF0",
|
3577 | component_db_border_color: "#78A8D8",
|
3578 | component_queue_bg_color: "#85BBF0",
|
3579 | component_queue_border_color: "#78A8D8",
|
3580 | external_component_bg_color: "#CCCCCC",
|
3581 | external_component_border_color: "#BFBFBF",
|
3582 | external_component_db_bg_color: "#CCCCCC",
|
3583 | external_component_db_border_color: "#BFBFBF",
|
3584 | external_component_queue_bg_color: "#CCCCCC",
|
3585 | external_component_queue_border_color: "#BFBFBF"
|
3586 | },
|
3587 | mindmap: {
|
3588 | useMaxWidth: true,
|
3589 | padding: 10,
|
3590 | maxNodeWidth: 200
|
3591 | },
|
3592 | fontSize: 16
|
3593 | };
|
3594 | if (config.class) {
|
3595 | config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
3596 | }
|
3597 | if (config.gitGraph) {
|
3598 | config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
3599 | }
|
3600 | const keyify = (obj, prefix = "") => Object.keys(obj).reduce((res, el) => {
|
3601 | if (Array.isArray(obj[el])) {
|
3602 | return res;
|
3603 | } else if (typeof obj[el] === "object" && obj[el] !== null) {
|
3604 | return [...res, prefix + el, ...keyify(obj[el], "")];
|
3605 | }
|
3606 | return [...res, prefix + el];
|
3607 | }, []);
|
3608 | const configKeys = keyify(config, "");
|
3609 | const defaultConfig$1 = config;
|
3610 |
|
3611 | function isNothing(subject) {
|
3612 | return typeof subject === "undefined" || subject === null;
|
3613 | }
|
3614 | function isObject(subject) {
|
3615 | return typeof subject === "object" && subject !== null;
|
3616 | }
|
3617 | function toArray(sequence2) {
|
3618 | if (Array.isArray(sequence2))
|
3619 | return sequence2;
|
3620 | else if (isNothing(sequence2))
|
3621 | return [];
|
3622 | return [sequence2];
|
3623 | }
|
3624 | function extend(target, source) {
|
3625 | var index, length, key, sourceKeys;
|
3626 | if (source) {
|
3627 | sourceKeys = Object.keys(source);
|
3628 | for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
3629 | key = sourceKeys[index];
|
3630 | target[key] = source[key];
|
3631 | }
|
3632 | }
|
3633 | return target;
|
3634 | }
|
3635 | function repeat(string, count) {
|
3636 | var result = "", cycle;
|
3637 | for (cycle = 0; cycle < count; cycle += 1) {
|
3638 | result += string;
|
3639 | }
|
3640 | return result;
|
3641 | }
|
3642 | function isNegativeZero(number) {
|
3643 | return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
3644 | }
|
3645 | var isNothing_1 = isNothing;
|
3646 | var isObject_1 = isObject;
|
3647 | var toArray_1 = toArray;
|
3648 | var repeat_1 = repeat;
|
3649 | var isNegativeZero_1 = isNegativeZero;
|
3650 | var extend_1 = extend;
|
3651 | var common = {
|
3652 | isNothing: isNothing_1,
|
3653 | isObject: isObject_1,
|
3654 | toArray: toArray_1,
|
3655 | repeat: repeat_1,
|
3656 | isNegativeZero: isNegativeZero_1,
|
3657 | extend: extend_1
|
3658 | };
|
3659 | function formatError(exception2, compact) {
|
3660 | var where = "", message = exception2.reason || "(unknown reason)";
|
3661 | if (!exception2.mark)
|
3662 | return message;
|
3663 | if (exception2.mark.name) {
|
3664 | where += 'in "' + exception2.mark.name + '" ';
|
3665 | }
|
3666 | where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
|
3667 | if (!compact && exception2.mark.snippet) {
|
3668 | where += "\n\n" + exception2.mark.snippet;
|
3669 | }
|
3670 | return message + " " + where;
|
3671 | }
|
3672 | function YAMLException$1(reason, mark) {
|
3673 | Error.call(this);
|
3674 | this.name = "YAMLException";
|
3675 | this.reason = reason;
|
3676 | this.mark = mark;
|
3677 | this.message = formatError(this, false);
|
3678 | if (Error.captureStackTrace) {
|
3679 | Error.captureStackTrace(this, this.constructor);
|
3680 | } else {
|
3681 | this.stack = new Error().stack || "";
|
3682 | }
|
3683 | }
|
3684 | YAMLException$1.prototype = Object.create(Error.prototype);
|
3685 | YAMLException$1.prototype.constructor = YAMLException$1;
|
3686 | YAMLException$1.prototype.toString = function toString(compact) {
|
3687 | return this.name + ": " + formatError(this, compact);
|
3688 | };
|
3689 | var exception = YAMLException$1;
|
3690 | function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
3691 | var head = "";
|
3692 | var tail = "";
|
3693 | var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
3694 | if (position - lineStart > maxHalfLength) {
|
3695 | head = " ... ";
|
3696 | lineStart = position - maxHalfLength + head.length;
|
3697 | }
|
3698 | if (lineEnd - position > maxHalfLength) {
|
3699 | tail = " ...";
|
3700 | lineEnd = position + maxHalfLength - tail.length;
|
3701 | }
|
3702 | return {
|
3703 | str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail,
|
3704 | pos: position - lineStart + head.length
|
3705 |
|
3706 | };
|
3707 | }
|
3708 | function padStart(string, max) {
|
3709 | return common.repeat(" ", max - string.length) + string;
|
3710 | }
|
3711 | function makeSnippet(mark, options) {
|
3712 | options = Object.create(options || null);
|
3713 | if (!mark.buffer)
|
3714 | return null;
|
3715 | if (!options.maxLength)
|
3716 | options.maxLength = 79;
|
3717 | if (typeof options.indent !== "number")
|
3718 | options.indent = 1;
|
3719 | if (typeof options.linesBefore !== "number")
|
3720 | options.linesBefore = 3;
|
3721 | if (typeof options.linesAfter !== "number")
|
3722 | options.linesAfter = 2;
|
3723 | var re = /\r?\n|\r|\0/g;
|
3724 | var lineStarts = [0];
|
3725 | var lineEnds = [];
|
3726 | var match;
|
3727 | var foundLineNo = -1;
|
3728 | while (match = re.exec(mark.buffer)) {
|
3729 | lineEnds.push(match.index);
|
3730 | lineStarts.push(match.index + match[0].length);
|
3731 | if (mark.position <= match.index && foundLineNo < 0) {
|
3732 | foundLineNo = lineStarts.length - 2;
|
3733 | }
|
3734 | }
|
3735 | if (foundLineNo < 0)
|
3736 | foundLineNo = lineStarts.length - 1;
|
3737 | var result = "", i, line;
|
3738 | var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
3739 | var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
3740 | for (i = 1; i <= options.linesBefore; i++) {
|
3741 | if (foundLineNo - i < 0)
|
3742 | break;
|
3743 | line = getLine(
|
3744 | mark.buffer,
|
3745 | lineStarts[foundLineNo - i],
|
3746 | lineEnds[foundLineNo - i],
|
3747 | mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
|
3748 | maxLineLength
|
3749 | );
|
3750 | result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
|
3751 | }
|
3752 | line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
3753 | result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
3754 | result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
3755 | for (i = 1; i <= options.linesAfter; i++) {
|
3756 | if (foundLineNo + i >= lineEnds.length)
|
3757 | break;
|
3758 | line = getLine(
|
3759 | mark.buffer,
|
3760 | lineStarts[foundLineNo + i],
|
3761 | lineEnds[foundLineNo + i],
|
3762 | mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
|
3763 | maxLineLength
|
3764 | );
|
3765 | result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
3766 | }
|
3767 | return result.replace(/\n$/, "");
|
3768 | }
|
3769 | var snippet = makeSnippet;
|
3770 | var TYPE_CONSTRUCTOR_OPTIONS = [
|
3771 | "kind",
|
3772 | "multi",
|
3773 | "resolve",
|
3774 | "construct",
|
3775 | "instanceOf",
|
3776 | "predicate",
|
3777 | "represent",
|
3778 | "representName",
|
3779 | "defaultStyle",
|
3780 | "styleAliases"
|
3781 | ];
|
3782 | var YAML_NODE_KINDS = [
|
3783 | "scalar",
|
3784 | "sequence",
|
3785 | "mapping"
|
3786 | ];
|
3787 | function compileStyleAliases(map2) {
|
3788 | var result = {};
|
3789 | if (map2 !== null) {
|
3790 | Object.keys(map2).forEach(function(style) {
|
3791 | map2[style].forEach(function(alias) {
|
3792 | result[String(alias)] = style;
|
3793 | });
|
3794 | });
|
3795 | }
|
3796 | return result;
|
3797 | }
|
3798 | function Type$1(tag, options) {
|
3799 | options = options || {};
|
3800 | Object.keys(options).forEach(function(name) {
|
3801 | if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
3802 | throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
3803 | }
|
3804 | });
|
3805 | this.options = options;
|
3806 | this.tag = tag;
|
3807 | this.kind = options["kind"] || null;
|
3808 | this.resolve = options["resolve"] || function() {
|
3809 | return true;
|
3810 | };
|
3811 | this.construct = options["construct"] || function(data) {
|
3812 | return data;
|
3813 | };
|
3814 | this.instanceOf = options["instanceOf"] || null;
|
3815 | this.predicate = options["predicate"] || null;
|
3816 | this.represent = options["represent"] || null;
|
3817 | this.representName = options["representName"] || null;
|
3818 | this.defaultStyle = options["defaultStyle"] || null;
|
3819 | this.multi = options["multi"] || false;
|
3820 | this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
3821 | if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
3822 | throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
3823 | }
|
3824 | }
|
3825 | var type = Type$1;
|
3826 | function compileList(schema2, name) {
|
3827 | var result = [];
|
3828 | schema2[name].forEach(function(currentType) {
|
3829 | var newIndex = result.length;
|
3830 | result.forEach(function(previousType, previousIndex) {
|
3831 | if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
3832 | newIndex = previousIndex;
|
3833 | }
|
3834 | });
|
3835 | result[newIndex] = currentType;
|
3836 | });
|
3837 | return result;
|
3838 | }
|
3839 | function compileMap() {
|
3840 | var result = {
|
3841 | scalar: {},
|
3842 | sequence: {},
|
3843 | mapping: {},
|
3844 | fallback: {},
|
3845 | multi: {
|
3846 | scalar: [],
|
3847 | sequence: [],
|
3848 | mapping: [],
|
3849 | fallback: []
|
3850 | }
|
3851 | }, index, length;
|
3852 | function collectType(type2) {
|
3853 | if (type2.multi) {
|
3854 | result.multi[type2.kind].push(type2);
|
3855 | result.multi["fallback"].push(type2);
|
3856 | } else {
|
3857 | result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
|
3858 | }
|
3859 | }
|
3860 | for (index = 0, length = arguments.length; index < length; index += 1) {
|
3861 | arguments[index].forEach(collectType);
|
3862 | }
|
3863 | return result;
|
3864 | }
|
3865 | function Schema$1(definition) {
|
3866 | return this.extend(definition);
|
3867 | }
|
3868 | Schema$1.prototype.extend = function extend2(definition) {
|
3869 | var implicit = [];
|
3870 | var explicit = [];
|
3871 | if (definition instanceof type) {
|
3872 | explicit.push(definition);
|
3873 | } else if (Array.isArray(definition)) {
|
3874 | explicit = explicit.concat(definition);
|
3875 | } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
3876 | if (definition.implicit)
|
3877 | implicit = implicit.concat(definition.implicit);
|
3878 | if (definition.explicit)
|
3879 | explicit = explicit.concat(definition.explicit);
|
3880 | } else {
|
3881 | throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
3882 | }
|
3883 | implicit.forEach(function(type$1) {
|
3884 | if (!(type$1 instanceof type)) {
|
3885 | throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
3886 | }
|
3887 | if (type$1.loadKind && type$1.loadKind !== "scalar") {
|
3888 | throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
3889 | }
|
3890 | if (type$1.multi) {
|
3891 | throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
3892 | }
|
3893 | });
|
3894 | explicit.forEach(function(type$1) {
|
3895 | if (!(type$1 instanceof type)) {
|
3896 | throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
3897 | }
|
3898 | });
|
3899 | var result = Object.create(Schema$1.prototype);
|
3900 | result.implicit = (this.implicit || []).concat(implicit);
|
3901 | result.explicit = (this.explicit || []).concat(explicit);
|
3902 | result.compiledImplicit = compileList(result, "implicit");
|
3903 | result.compiledExplicit = compileList(result, "explicit");
|
3904 | result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
3905 | return result;
|
3906 | };
|
3907 | var schema = Schema$1;
|
3908 | var str = new type("tag:yaml.org,2002:str", {
|
3909 | kind: "scalar",
|
3910 | construct: function(data) {
|
3911 | return data !== null ? data : "";
|
3912 | }
|
3913 | });
|
3914 | var seq = new type("tag:yaml.org,2002:seq", {
|
3915 | kind: "sequence",
|
3916 | construct: function(data) {
|
3917 | return data !== null ? data : [];
|
3918 | }
|
3919 | });
|
3920 | var map = new type("tag:yaml.org,2002:map", {
|
3921 | kind: "mapping",
|
3922 | construct: function(data) {
|
3923 | return data !== null ? data : {};
|
3924 | }
|
3925 | });
|
3926 | var failsafe = new schema({
|
3927 | explicit: [
|
3928 | str,
|
3929 | seq,
|
3930 | map
|
3931 | ]
|
3932 | });
|
3933 | function resolveYamlNull(data) {
|
3934 | if (data === null)
|
3935 | return true;
|
3936 | var max = data.length;
|
3937 | return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
3938 | }
|
3939 | function constructYamlNull() {
|
3940 | return null;
|
3941 | }
|
3942 | function isNull(object) {
|
3943 | return object === null;
|
3944 | }
|
3945 | var _null = new type("tag:yaml.org,2002:null", {
|
3946 | kind: "scalar",
|
3947 | resolve: resolveYamlNull,
|
3948 | construct: constructYamlNull,
|
3949 | predicate: isNull,
|
3950 | represent: {
|
3951 | canonical: function() {
|
3952 | return "~";
|
3953 | },
|
3954 | lowercase: function() {
|
3955 | return "null";
|
3956 | },
|
3957 | uppercase: function() {
|
3958 | return "NULL";
|
3959 | },
|
3960 | camelcase: function() {
|
3961 | return "Null";
|
3962 | },
|
3963 | empty: function() {
|
3964 | return "";
|
3965 | }
|
3966 | },
|
3967 | defaultStyle: "lowercase"
|
3968 | });
|
3969 | function resolveYamlBoolean(data) {
|
3970 | if (data === null)
|
3971 | return false;
|
3972 | var max = data.length;
|
3973 | return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
3974 | }
|
3975 | function constructYamlBoolean(data) {
|
3976 | return data === "true" || data === "True" || data === "TRUE";
|
3977 | }
|
3978 | function isBoolean(object) {
|
3979 | return Object.prototype.toString.call(object) === "[object Boolean]";
|
3980 | }
|
3981 | var bool = new type("tag:yaml.org,2002:bool", {
|
3982 | kind: "scalar",
|
3983 | resolve: resolveYamlBoolean,
|
3984 | construct: constructYamlBoolean,
|
3985 | predicate: isBoolean,
|
3986 | represent: {
|
3987 | lowercase: function(object) {
|
3988 | return object ? "true" : "false";
|
3989 | },
|
3990 | uppercase: function(object) {
|
3991 | return object ? "TRUE" : "FALSE";
|
3992 | },
|
3993 | camelcase: function(object) {
|
3994 | return object ? "True" : "False";
|
3995 | }
|
3996 | },
|
3997 | defaultStyle: "lowercase"
|
3998 | });
|
3999 | function isHexCode(c) {
|
4000 | return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
4001 | }
|
4002 | function isOctCode(c) {
|
4003 | return 48 <= c && c <= 55;
|
4004 | }
|
4005 | function isDecCode(c) {
|
4006 | return 48 <= c && c <= 57;
|
4007 | }
|
4008 | function resolveYamlInteger(data) {
|
4009 | if (data === null)
|
4010 | return false;
|
4011 | var max = data.length, index = 0, hasDigits = false, ch;
|
4012 | if (!max)
|
4013 | return false;
|
4014 | ch = data[index];
|
4015 | if (ch === "-" || ch === "+") {
|
4016 | ch = data[++index];
|
4017 | }
|
4018 | if (ch === "0") {
|
4019 | if (index + 1 === max)
|
4020 | return true;
|
4021 | ch = data[++index];
|
4022 | if (ch === "b") {
|
4023 | index++;
|
4024 | for (; index < max; index++) {
|
4025 | ch = data[index];
|
4026 | if (ch === "_")
|
4027 | continue;
|
4028 | if (ch !== "0" && ch !== "1")
|
4029 | return false;
|
4030 | hasDigits = true;
|
4031 | }
|
4032 | return hasDigits && ch !== "_";
|
4033 | }
|
4034 | if (ch === "x") {
|
4035 | index++;
|
4036 | for (; index < max; index++) {
|
4037 | ch = data[index];
|
4038 | if (ch === "_")
|
4039 | continue;
|
4040 | if (!isHexCode(data.charCodeAt(index)))
|
4041 | return false;
|
4042 | hasDigits = true;
|
4043 | }
|
4044 | return hasDigits && ch !== "_";
|
4045 | }
|
4046 | if (ch === "o") {
|
4047 | index++;
|
4048 | for (; index < max; index++) {
|
4049 | ch = data[index];
|
4050 | if (ch === "_")
|
4051 | continue;
|
4052 | if (!isOctCode(data.charCodeAt(index)))
|
4053 | return false;
|
4054 | hasDigits = true;
|
4055 | }
|
4056 | return hasDigits && ch !== "_";
|
4057 | }
|
4058 | }
|
4059 | if (ch === "_")
|
4060 | return false;
|
4061 | for (; index < max; index++) {
|
4062 | ch = data[index];
|
4063 | if (ch === "_")
|
4064 | continue;
|
4065 | if (!isDecCode(data.charCodeAt(index))) {
|
4066 | return false;
|
4067 | }
|
4068 | hasDigits = true;
|
4069 | }
|
4070 | if (!hasDigits || ch === "_")
|
4071 | return false;
|
4072 | return true;
|
4073 | }
|
4074 | function constructYamlInteger(data) {
|
4075 | var value = data, sign = 1, ch;
|
4076 | if (value.indexOf("_") !== -1) {
|
4077 | value = value.replace(/_/g, "");
|
4078 | }
|
4079 | ch = value[0];
|
4080 | if (ch === "-" || ch === "+") {
|
4081 | if (ch === "-")
|
4082 | sign = -1;
|
4083 | value = value.slice(1);
|
4084 | ch = value[0];
|
4085 | }
|
4086 | if (value === "0")
|
4087 | return 0;
|
4088 | if (ch === "0") {
|
4089 | if (value[1] === "b")
|
4090 | return sign * parseInt(value.slice(2), 2);
|
4091 | if (value[1] === "x")
|
4092 | return sign * parseInt(value.slice(2), 16);
|
4093 | if (value[1] === "o")
|
4094 | return sign * parseInt(value.slice(2), 8);
|
4095 | }
|
4096 | return sign * parseInt(value, 10);
|
4097 | }
|
4098 | function isInteger(object) {
|
4099 | return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
|
4100 | }
|
4101 | var int = new type("tag:yaml.org,2002:int", {
|
4102 | kind: "scalar",
|
4103 | resolve: resolveYamlInteger,
|
4104 | construct: constructYamlInteger,
|
4105 | predicate: isInteger,
|
4106 | represent: {
|
4107 | binary: function(obj) {
|
4108 | return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
4109 | },
|
4110 | octal: function(obj) {
|
4111 | return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
4112 | },
|
4113 | decimal: function(obj) {
|
4114 | return obj.toString(10);
|
4115 | },
|
4116 |
|
4117 | hexadecimal: function(obj) {
|
4118 | return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
4119 | }
|
4120 | },
|
4121 | defaultStyle: "decimal",
|
4122 | styleAliases: {
|
4123 | binary: [2, "bin"],
|
4124 | octal: [8, "oct"],
|
4125 | decimal: [10, "dec"],
|
4126 | hexadecimal: [16, "hex"]
|
4127 | }
|
4128 | });
|
4129 | var YAML_FLOAT_PATTERN = new RegExp(
|
4130 |
|
4131 | "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
4132 | );
|
4133 | function resolveYamlFloat(data) {
|
4134 | if (data === null)
|
4135 | return false;
|
4136 | if (!YAML_FLOAT_PATTERN.test(data) ||
|
4137 |
|
4138 | data[data.length - 1] === "_") {
|
4139 | return false;
|
4140 | }
|
4141 | return true;
|
4142 | }
|
4143 | function constructYamlFloat(data) {
|
4144 | var value, sign;
|
4145 | value = data.replace(/_/g, "").toLowerCase();
|
4146 | sign = value[0] === "-" ? -1 : 1;
|
4147 | if ("+-".indexOf(value[0]) >= 0) {
|
4148 | value = value.slice(1);
|
4149 | }
|
4150 | if (value === ".inf") {
|
4151 | return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
4152 | } else if (value === ".nan") {
|
4153 | return NaN;
|
4154 | }
|
4155 | return sign * parseFloat(value, 10);
|
4156 | }
|
4157 | var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
4158 | function representYamlFloat(object, style) {
|
4159 | var res;
|
4160 | if (isNaN(object)) {
|
4161 | switch (style) {
|
4162 | case "lowercase":
|
4163 | return ".nan";
|
4164 | case "uppercase":
|
4165 | return ".NAN";
|
4166 | case "camelcase":
|
4167 | return ".NaN";
|
4168 | }
|
4169 | } else if (Number.POSITIVE_INFINITY === object) {
|
4170 | switch (style) {
|
4171 | case "lowercase":
|
4172 | return ".inf";
|
4173 | case "uppercase":
|
4174 | return ".INF";
|
4175 | case "camelcase":
|
4176 | return ".Inf";
|
4177 | }
|
4178 | } else if (Number.NEGATIVE_INFINITY === object) {
|
4179 | switch (style) {
|
4180 | case "lowercase":
|
4181 | return "-.inf";
|
4182 | case "uppercase":
|
4183 | return "-.INF";
|
4184 | case "camelcase":
|
4185 | return "-.Inf";
|
4186 | }
|
4187 | } else if (common.isNegativeZero(object)) {
|
4188 | return "-0.0";
|
4189 | }
|
4190 | res = object.toString(10);
|
4191 | return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
4192 | }
|
4193 | function isFloat(object) {
|
4194 | return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
4195 | }
|
4196 | var float = new type("tag:yaml.org,2002:float", {
|
4197 | kind: "scalar",
|
4198 | resolve: resolveYamlFloat,
|
4199 | construct: constructYamlFloat,
|
4200 | predicate: isFloat,
|
4201 | represent: representYamlFloat,
|
4202 | defaultStyle: "lowercase"
|
4203 | });
|
4204 | var json = failsafe.extend({
|
4205 | implicit: [
|
4206 | _null,
|
4207 | bool,
|
4208 | int,
|
4209 | float
|
4210 | ]
|
4211 | });
|
4212 | var core = json;
|
4213 | var YAML_DATE_REGEXP = new RegExp(
|
4214 | "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
4215 | );
|
4216 | var YAML_TIMESTAMP_REGEXP = new RegExp(
|
4217 | "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
4218 | );
|
4219 | function resolveYamlTimestamp(data) {
|
4220 | if (data === null)
|
4221 | return false;
|
4222 | if (YAML_DATE_REGEXP.exec(data) !== null)
|
4223 | return true;
|
4224 | if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
|
4225 | return true;
|
4226 | return false;
|
4227 | }
|
4228 | function constructYamlTimestamp(data) {
|
4229 | var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
4230 | match = YAML_DATE_REGEXP.exec(data);
|
4231 | if (match === null)
|
4232 | match = YAML_TIMESTAMP_REGEXP.exec(data);
|
4233 | if (match === null)
|
4234 | throw new Error("Date resolve error");
|
4235 | year = +match[1];
|
4236 | month = +match[2] - 1;
|
4237 | day = +match[3];
|
4238 | if (!match[4]) {
|
4239 | return new Date(Date.UTC(year, month, day));
|
4240 | }
|
4241 | hour = +match[4];
|
4242 | minute = +match[5];
|
4243 | second = +match[6];
|
4244 | if (match[7]) {
|
4245 | fraction = match[7].slice(0, 3);
|
4246 | while (fraction.length < 3) {
|
4247 | fraction += "0";
|
4248 | }
|
4249 | fraction = +fraction;
|
4250 | }
|
4251 | if (match[9]) {
|
4252 | tz_hour = +match[10];
|
4253 | tz_minute = +(match[11] || 0);
|
4254 | delta = (tz_hour * 60 + tz_minute) * 6e4;
|
4255 | if (match[9] === "-")
|
4256 | delta = -delta;
|
4257 | }
|
4258 | date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
4259 | if (delta)
|
4260 | date.setTime(date.getTime() - delta);
|
4261 | return date;
|
4262 | }
|
4263 | function representYamlTimestamp(object) {
|
4264 | return object.toISOString();
|
4265 | }
|
4266 | var timestamp = new type("tag:yaml.org,2002:timestamp", {
|
4267 | kind: "scalar",
|
4268 | resolve: resolveYamlTimestamp,
|
4269 | construct: constructYamlTimestamp,
|
4270 | instanceOf: Date,
|
4271 | represent: representYamlTimestamp
|
4272 | });
|
4273 | function resolveYamlMerge(data) {
|
4274 | return data === "<<" || data === null;
|
4275 | }
|
4276 | var merge = new type("tag:yaml.org,2002:merge", {
|
4277 | kind: "scalar",
|
4278 | resolve: resolveYamlMerge
|
4279 | });
|
4280 | var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
4281 | function resolveYamlBinary(data) {
|
4282 | if (data === null)
|
4283 | return false;
|
4284 | var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
|
4285 | for (idx = 0; idx < max; idx++) {
|
4286 | code = map2.indexOf(data.charAt(idx));
|
4287 | if (code > 64)
|
4288 | continue;
|
4289 | if (code < 0)
|
4290 | return false;
|
4291 | bitlen += 6;
|
4292 | }
|
4293 | return bitlen % 8 === 0;
|
4294 | }
|
4295 | function constructYamlBinary(data) {
|
4296 | var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
|
4297 | for (idx = 0; idx < max; idx++) {
|
4298 | if (idx % 4 === 0 && idx) {
|
4299 | result.push(bits >> 16 & 255);
|
4300 | result.push(bits >> 8 & 255);
|
4301 | result.push(bits & 255);
|
4302 | }
|
4303 | bits = bits << 6 | map2.indexOf(input.charAt(idx));
|
4304 | }
|
4305 | tailbits = max % 4 * 6;
|
4306 | if (tailbits === 0) {
|
4307 | result.push(bits >> 16 & 255);
|
4308 | result.push(bits >> 8 & 255);
|
4309 | result.push(bits & 255);
|
4310 | } else if (tailbits === 18) {
|
4311 | result.push(bits >> 10 & 255);
|
4312 | result.push(bits >> 2 & 255);
|
4313 | } else if (tailbits === 12) {
|
4314 | result.push(bits >> 4 & 255);
|
4315 | }
|
4316 | return new Uint8Array(result);
|
4317 | }
|
4318 | function representYamlBinary(object) {
|
4319 | var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
|
4320 | for (idx = 0; idx < max; idx++) {
|
4321 | if (idx % 3 === 0 && idx) {
|
4322 | result += map2[bits >> 18 & 63];
|
4323 | result += map2[bits >> 12 & 63];
|
4324 | result += map2[bits >> 6 & 63];
|
4325 | result += map2[bits & 63];
|
4326 | }
|
4327 | bits = (bits << 8) + object[idx];
|
4328 | }
|
4329 | tail = max % 3;
|
4330 | if (tail === 0) {
|
4331 | result += map2[bits >> 18 & 63];
|
4332 | result += map2[bits >> 12 & 63];
|
4333 | result += map2[bits >> 6 & 63];
|
4334 | result += map2[bits & 63];
|
4335 | } else if (tail === 2) {
|
4336 | result += map2[bits >> 10 & 63];
|
4337 | result += map2[bits >> 4 & 63];
|
4338 | result += map2[bits << 2 & 63];
|
4339 | result += map2[64];
|
4340 | } else if (tail === 1) {
|
4341 | result += map2[bits >> 2 & 63];
|
4342 | result += map2[bits << 4 & 63];
|
4343 | result += map2[64];
|
4344 | result += map2[64];
|
4345 | }
|
4346 | return result;
|
4347 | }
|
4348 | function isBinary(obj) {
|
4349 | return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
4350 | }
|
4351 | var binary = new type("tag:yaml.org,2002:binary", {
|
4352 | kind: "scalar",
|
4353 | resolve: resolveYamlBinary,
|
4354 | construct: constructYamlBinary,
|
4355 | predicate: isBinary,
|
4356 | represent: representYamlBinary
|
4357 | });
|
4358 | var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
4359 | var _toString$2 = Object.prototype.toString;
|
4360 | function resolveYamlOmap(data) {
|
4361 | if (data === null)
|
4362 | return true;
|
4363 | var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
4364 | for (index = 0, length = object.length; index < length; index += 1) {
|
4365 | pair = object[index];
|
4366 | pairHasKey = false;
|
4367 | if (_toString$2.call(pair) !== "[object Object]")
|
4368 | return false;
|
4369 | for (pairKey in pair) {
|
4370 | if (_hasOwnProperty$3.call(pair, pairKey)) {
|
4371 | if (!pairHasKey)
|
4372 | pairHasKey = true;
|
4373 | else
|
4374 | return false;
|
4375 | }
|
4376 | }
|
4377 | if (!pairHasKey)
|
4378 | return false;
|
4379 | if (objectKeys.indexOf(pairKey) === -1)
|
4380 | objectKeys.push(pairKey);
|
4381 | else
|
4382 | return false;
|
4383 | }
|
4384 | return true;
|
4385 | }
|
4386 | function constructYamlOmap(data) {
|
4387 | return data !== null ? data : [];
|
4388 | }
|
4389 | var omap = new type("tag:yaml.org,2002:omap", {
|
4390 | kind: "sequence",
|
4391 | resolve: resolveYamlOmap,
|
4392 | construct: constructYamlOmap
|
4393 | });
|
4394 | var _toString$1 = Object.prototype.toString;
|
4395 | function resolveYamlPairs(data) {
|
4396 | if (data === null)
|
4397 | return true;
|
4398 | var index, length, pair, keys, result, object = data;
|
4399 | result = new Array(object.length);
|
4400 | for (index = 0, length = object.length; index < length; index += 1) {
|
4401 | pair = object[index];
|
4402 | if (_toString$1.call(pair) !== "[object Object]")
|
4403 | return false;
|
4404 | keys = Object.keys(pair);
|
4405 | if (keys.length !== 1)
|
4406 | return false;
|
4407 | result[index] = [keys[0], pair[keys[0]]];
|
4408 | }
|
4409 | return true;
|
4410 | }
|
4411 | function constructYamlPairs(data) {
|
4412 | if (data === null)
|
4413 | return [];
|
4414 | var index, length, pair, keys, result, object = data;
|
4415 | result = new Array(object.length);
|
4416 | for (index = 0, length = object.length; index < length; index += 1) {
|
4417 | pair = object[index];
|
4418 | keys = Object.keys(pair);
|
4419 | result[index] = [keys[0], pair[keys[0]]];
|
4420 | }
|
4421 | return result;
|
4422 | }
|
4423 | var pairs = new type("tag:yaml.org,2002:pairs", {
|
4424 | kind: "sequence",
|
4425 | resolve: resolveYamlPairs,
|
4426 | construct: constructYamlPairs
|
4427 | });
|
4428 | var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
4429 | function resolveYamlSet(data) {
|
4430 | if (data === null)
|
4431 | return true;
|
4432 | var key, object = data;
|
4433 | for (key in object) {
|
4434 | if (_hasOwnProperty$2.call(object, key)) {
|
4435 | if (object[key] !== null)
|
4436 | return false;
|
4437 | }
|
4438 | }
|
4439 | return true;
|
4440 | }
|
4441 | function constructYamlSet(data) {
|
4442 | return data !== null ? data : {};
|
4443 | }
|
4444 | var set = new type("tag:yaml.org,2002:set", {
|
4445 | kind: "mapping",
|
4446 | resolve: resolveYamlSet,
|
4447 | construct: constructYamlSet
|
4448 | });
|
4449 | var _default = core.extend({
|
4450 | implicit: [
|
4451 | timestamp,
|
4452 | merge
|
4453 | ],
|
4454 | explicit: [
|
4455 | binary,
|
4456 | omap,
|
4457 | pairs,
|
4458 | set
|
4459 | ]
|
4460 | });
|
4461 | var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
4462 | var CONTEXT_FLOW_IN = 1;
|
4463 | var CONTEXT_FLOW_OUT = 2;
|
4464 | var CONTEXT_BLOCK_IN = 3;
|
4465 | var CONTEXT_BLOCK_OUT = 4;
|
4466 | var CHOMPING_CLIP = 1;
|
4467 | var CHOMPING_STRIP = 2;
|
4468 | var CHOMPING_KEEP = 3;
|
4469 | var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
4470 | var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
4471 | var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
4472 | var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
4473 | var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
4474 | function _class(obj) {
|
4475 | return Object.prototype.toString.call(obj);
|
4476 | }
|
4477 | function is_EOL(c) {
|
4478 | return c === 10 || c === 13;
|
4479 | }
|
4480 | function is_WHITE_SPACE(c) {
|
4481 | return c === 9 || c === 32;
|
4482 | }
|
4483 | function is_WS_OR_EOL(c) {
|
4484 | return c === 9 || c === 32 || c === 10 || c === 13;
|
4485 | }
|
4486 | function is_FLOW_INDICATOR(c) {
|
4487 | return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
4488 | }
|
4489 | function fromHexCode(c) {
|
4490 | var lc;
|
4491 | if (48 <= c && c <= 57) {
|
4492 | return c - 48;
|
4493 | }
|
4494 | lc = c | 32;
|
4495 | if (97 <= lc && lc <= 102) {
|
4496 | return lc - 97 + 10;
|
4497 | }
|
4498 | return -1;
|
4499 | }
|
4500 | function escapedHexLen(c) {
|
4501 | if (c === 120) {
|
4502 | return 2;
|
4503 | }
|
4504 | if (c === 117) {
|
4505 | return 4;
|
4506 | }
|
4507 | if (c === 85) {
|
4508 | return 8;
|
4509 | }
|
4510 | return 0;
|
4511 | }
|
4512 | function fromDecimalCode(c) {
|
4513 | if (48 <= c && c <= 57) {
|
4514 | return c - 48;
|
4515 | }
|
4516 | return -1;
|
4517 | }
|
4518 | function simpleEscapeSequence(c) {
|
4519 | return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "
" : c === 95 ? " " : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
4520 | }
|
4521 | function charFromCodepoint(c) {
|
4522 | if (c <= 65535) {
|
4523 | return String.fromCharCode(c);
|
4524 | }
|
4525 | return String.fromCharCode(
|
4526 | (c - 65536 >> 10) + 55296,
|
4527 | (c - 65536 & 1023) + 56320
|
4528 | );
|
4529 | }
|
4530 | var simpleEscapeCheck = new Array(256);
|
4531 | var simpleEscapeMap = new Array(256);
|
4532 | for (var i = 0; i < 256; i++) {
|
4533 | simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
4534 | simpleEscapeMap[i] = simpleEscapeSequence(i);
|
4535 | }
|
4536 | function State$1(input, options) {
|
4537 | this.input = input;
|
4538 | this.filename = options["filename"] || null;
|
4539 | this.schema = options["schema"] || _default;
|
4540 | this.onWarning = options["onWarning"] || null;
|
4541 | this.legacy = options["legacy"] || false;
|
4542 | this.json = options["json"] || false;
|
4543 | this.listener = options["listener"] || null;
|
4544 | this.implicitTypes = this.schema.compiledImplicit;
|
4545 | this.typeMap = this.schema.compiledTypeMap;
|
4546 | this.length = input.length;
|
4547 | this.position = 0;
|
4548 | this.line = 0;
|
4549 | this.lineStart = 0;
|
4550 | this.lineIndent = 0;
|
4551 | this.firstTabInLine = -1;
|
4552 | this.documents = [];
|
4553 | }
|
4554 | function generateError(state2, message) {
|
4555 | var mark = {
|
4556 | name: state2.filename,
|
4557 | buffer: state2.input.slice(0, -1),
|
4558 |
|
4559 | position: state2.position,
|
4560 | line: state2.line,
|
4561 | column: state2.position - state2.lineStart
|
4562 | };
|
4563 | mark.snippet = snippet(mark);
|
4564 | return new exception(message, mark);
|
4565 | }
|
4566 | function throwError(state2, message) {
|
4567 | throw generateError(state2, message);
|
4568 | }
|
4569 | function throwWarning(state2, message) {
|
4570 | if (state2.onWarning) {
|
4571 | state2.onWarning.call(null, generateError(state2, message));
|
4572 | }
|
4573 | }
|
4574 | var directiveHandlers = {
|
4575 | YAML: function handleYamlDirective(state2, name, args) {
|
4576 | var match, major, minor;
|
4577 | if (state2.version !== null) {
|
4578 | throwError(state2, "duplication of %YAML directive");
|
4579 | }
|
4580 | if (args.length !== 1) {
|
4581 | throwError(state2, "YAML directive accepts exactly one argument");
|
4582 | }
|
4583 | match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
4584 | if (match === null) {
|
4585 | throwError(state2, "ill-formed argument of the YAML directive");
|
4586 | }
|
4587 | major = parseInt(match[1], 10);
|
4588 | minor = parseInt(match[2], 10);
|
4589 | if (major !== 1) {
|
4590 | throwError(state2, "unacceptable YAML version of the document");
|
4591 | }
|
4592 | state2.version = args[0];
|
4593 | state2.checkLineBreaks = minor < 2;
|
4594 | if (minor !== 1 && minor !== 2) {
|
4595 | throwWarning(state2, "unsupported YAML version of the document");
|
4596 | }
|
4597 | },
|
4598 | TAG: function handleTagDirective(state2, name, args) {
|
4599 | var handle, prefix;
|
4600 | if (args.length !== 2) {
|
4601 | throwError(state2, "TAG directive accepts exactly two arguments");
|
4602 | }
|
4603 | handle = args[0];
|
4604 | prefix = args[1];
|
4605 | if (!PATTERN_TAG_HANDLE.test(handle)) {
|
4606 | throwError(state2, "ill-formed tag handle (first argument) of the TAG directive");
|
4607 | }
|
4608 | if (_hasOwnProperty$1.call(state2.tagMap, handle)) {
|
4609 | throwError(state2, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
4610 | }
|
4611 | if (!PATTERN_TAG_URI.test(prefix)) {
|
4612 | throwError(state2, "ill-formed tag prefix (second argument) of the TAG directive");
|
4613 | }
|
4614 | try {
|
4615 | prefix = decodeURIComponent(prefix);
|
4616 | } catch (err) {
|
4617 | throwError(state2, "tag prefix is malformed: " + prefix);
|
4618 | }
|
4619 | state2.tagMap[handle] = prefix;
|
4620 | }
|
4621 | };
|
4622 | function captureSegment(state2, start, end, checkJson) {
|
4623 | var _position, _length, _character, _result;
|
4624 | if (start < end) {
|
4625 | _result = state2.input.slice(start, end);
|
4626 | if (checkJson) {
|
4627 | for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
4628 | _character = _result.charCodeAt(_position);
|
4629 | if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
4630 | throwError(state2, "expected valid JSON character");
|
4631 | }
|
4632 | }
|
4633 | } else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
4634 | throwError(state2, "the stream contains non-printable characters");
|
4635 | }
|
4636 | state2.result += _result;
|
4637 | }
|
4638 | }
|
4639 | function mergeMappings(state2, destination, source, overridableKeys) {
|
4640 | var sourceKeys, key, index, quantity;
|
4641 | if (!common.isObject(source)) {
|
4642 | throwError(state2, "cannot merge mappings; the provided source object is unacceptable");
|
4643 | }
|
4644 | sourceKeys = Object.keys(source);
|
4645 | for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
4646 | key = sourceKeys[index];
|
4647 | if (!_hasOwnProperty$1.call(destination, key)) {
|
4648 | destination[key] = source[key];
|
4649 | overridableKeys[key] = true;
|
4650 | }
|
4651 | }
|
4652 | }
|
4653 | function storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
4654 | var index, quantity;
|
4655 | if (Array.isArray(keyNode)) {
|
4656 | keyNode = Array.prototype.slice.call(keyNode);
|
4657 | for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
4658 | if (Array.isArray(keyNode[index])) {
|
4659 | throwError(state2, "nested arrays are not supported inside keys");
|
4660 | }
|
4661 | if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
4662 | keyNode[index] = "[object Object]";
|
4663 | }
|
4664 | }
|
4665 | }
|
4666 | if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
4667 | keyNode = "[object Object]";
|
4668 | }
|
4669 | keyNode = String(keyNode);
|
4670 | if (_result === null) {
|
4671 | _result = {};
|
4672 | }
|
4673 | if (keyTag === "tag:yaml.org,2002:merge") {
|
4674 | if (Array.isArray(valueNode)) {
|
4675 | for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
4676 | mergeMappings(state2, _result, valueNode[index], overridableKeys);
|
4677 | }
|
4678 | } else {
|
4679 | mergeMappings(state2, _result, valueNode, overridableKeys);
|
4680 | }
|
4681 | } else {
|
4682 | if (!state2.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
|
4683 | state2.line = startLine || state2.line;
|
4684 | state2.lineStart = startLineStart || state2.lineStart;
|
4685 | state2.position = startPos || state2.position;
|
4686 | throwError(state2, "duplicated mapping key");
|
4687 | }
|
4688 | if (keyNode === "__proto__") {
|
4689 | Object.defineProperty(_result, keyNode, {
|
4690 | configurable: true,
|
4691 | enumerable: true,
|
4692 | writable: true,
|
4693 | value: valueNode
|
4694 | });
|
4695 | } else {
|
4696 | _result[keyNode] = valueNode;
|
4697 | }
|
4698 | delete overridableKeys[keyNode];
|
4699 | }
|
4700 | return _result;
|
4701 | }
|
4702 | function readLineBreak(state2) {
|
4703 | var ch;
|
4704 | ch = state2.input.charCodeAt(state2.position);
|
4705 | if (ch === 10) {
|
4706 | state2.position++;
|
4707 | } else if (ch === 13) {
|
4708 | state2.position++;
|
4709 | if (state2.input.charCodeAt(state2.position) === 10) {
|
4710 | state2.position++;
|
4711 | }
|
4712 | } else {
|
4713 | throwError(state2, "a line break is expected");
|
4714 | }
|
4715 | state2.line += 1;
|
4716 | state2.lineStart = state2.position;
|
4717 | state2.firstTabInLine = -1;
|
4718 | }
|
4719 | function skipSeparationSpace(state2, allowComments, checkIndent) {
|
4720 | var lineBreaks = 0, ch = state2.input.charCodeAt(state2.position);
|
4721 | while (ch !== 0) {
|
4722 | while (is_WHITE_SPACE(ch)) {
|
4723 | if (ch === 9 && state2.firstTabInLine === -1) {
|
4724 | state2.firstTabInLine = state2.position;
|
4725 | }
|
4726 | ch = state2.input.charCodeAt(++state2.position);
|
4727 | }
|
4728 | if (allowComments && ch === 35) {
|
4729 | do {
|
4730 | ch = state2.input.charCodeAt(++state2.position);
|
4731 | } while (ch !== 10 && ch !== 13 && ch !== 0);
|
4732 | }
|
4733 | if (is_EOL(ch)) {
|
4734 | readLineBreak(state2);
|
4735 | ch = state2.input.charCodeAt(state2.position);
|
4736 | lineBreaks++;
|
4737 | state2.lineIndent = 0;
|
4738 | while (ch === 32) {
|
4739 | state2.lineIndent++;
|
4740 | ch = state2.input.charCodeAt(++state2.position);
|
4741 | }
|
4742 | } else {
|
4743 | break;
|
4744 | }
|
4745 | }
|
4746 | if (checkIndent !== -1 && lineBreaks !== 0 && state2.lineIndent < checkIndent) {
|
4747 | throwWarning(state2, "deficient indentation");
|
4748 | }
|
4749 | return lineBreaks;
|
4750 | }
|
4751 | function testDocumentSeparator(state2) {
|
4752 | var _position = state2.position, ch;
|
4753 | ch = state2.input.charCodeAt(_position);
|
4754 | if ((ch === 45 || ch === 46) && ch === state2.input.charCodeAt(_position + 1) && ch === state2.input.charCodeAt(_position + 2)) {
|
4755 | _position += 3;
|
4756 | ch = state2.input.charCodeAt(_position);
|
4757 | if (ch === 0 || is_WS_OR_EOL(ch)) {
|
4758 | return true;
|
4759 | }
|
4760 | }
|
4761 | return false;
|
4762 | }
|
4763 | function writeFoldedLines(state2, count) {
|
4764 | if (count === 1) {
|
4765 | state2.result += " ";
|
4766 | } else if (count > 1) {
|
4767 | state2.result += common.repeat("\n", count - 1);
|
4768 | }
|
4769 | }
|
4770 | function readPlainScalar(state2, nodeIndent, withinFlowCollection) {
|
4771 | var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state2.kind, _result = state2.result, ch;
|
4772 | ch = state2.input.charCodeAt(state2.position);
|
4773 | if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
|
4774 | return false;
|
4775 | }
|
4776 | if (ch === 63 || ch === 45) {
|
4777 | following = state2.input.charCodeAt(state2.position + 1);
|
4778 | if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
4779 | return false;
|
4780 | }
|
4781 | }
|
4782 | state2.kind = "scalar";
|
4783 | state2.result = "";
|
4784 | captureStart = captureEnd = state2.position;
|
4785 | hasPendingContent = false;
|
4786 | while (ch !== 0) {
|
4787 | if (ch === 58) {
|
4788 | following = state2.input.charCodeAt(state2.position + 1);
|
4789 | if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
4790 | break;
|
4791 | }
|
4792 | } else if (ch === 35) {
|
4793 | preceding = state2.input.charCodeAt(state2.position - 1);
|
4794 | if (is_WS_OR_EOL(preceding)) {
|
4795 | break;
|
4796 | }
|
4797 | } else if (state2.position === state2.lineStart && testDocumentSeparator(state2) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
4798 | break;
|
4799 | } else if (is_EOL(ch)) {
|
4800 | _line = state2.line;
|
4801 | _lineStart = state2.lineStart;
|
4802 | _lineIndent = state2.lineIndent;
|
4803 | skipSeparationSpace(state2, false, -1);
|
4804 | if (state2.lineIndent >= nodeIndent) {
|
4805 | hasPendingContent = true;
|
4806 | ch = state2.input.charCodeAt(state2.position);
|
4807 | continue;
|
4808 | } else {
|
4809 | state2.position = captureEnd;
|
4810 | state2.line = _line;
|
4811 | state2.lineStart = _lineStart;
|
4812 | state2.lineIndent = _lineIndent;
|
4813 | break;
|
4814 | }
|
4815 | }
|
4816 | if (hasPendingContent) {
|
4817 | captureSegment(state2, captureStart, captureEnd, false);
|
4818 | writeFoldedLines(state2, state2.line - _line);
|
4819 | captureStart = captureEnd = state2.position;
|
4820 | hasPendingContent = false;
|
4821 | }
|
4822 | if (!is_WHITE_SPACE(ch)) {
|
4823 | captureEnd = state2.position + 1;
|
4824 | }
|
4825 | ch = state2.input.charCodeAt(++state2.position);
|
4826 | }
|
4827 | captureSegment(state2, captureStart, captureEnd, false);
|
4828 | if (state2.result) {
|
4829 | return true;
|
4830 | }
|
4831 | state2.kind = _kind;
|
4832 | state2.result = _result;
|
4833 | return false;
|
4834 | }
|
4835 | function readSingleQuotedScalar(state2, nodeIndent) {
|
4836 | var ch, captureStart, captureEnd;
|
4837 | ch = state2.input.charCodeAt(state2.position);
|
4838 | if (ch !== 39) {
|
4839 | return false;
|
4840 | }
|
4841 | state2.kind = "scalar";
|
4842 | state2.result = "";
|
4843 | state2.position++;
|
4844 | captureStart = captureEnd = state2.position;
|
4845 | while ((ch = state2.input.charCodeAt(state2.position)) !== 0) {
|
4846 | if (ch === 39) {
|
4847 | captureSegment(state2, captureStart, state2.position, true);
|
4848 | ch = state2.input.charCodeAt(++state2.position);
|
4849 | if (ch === 39) {
|
4850 | captureStart = state2.position;
|
4851 | state2.position++;
|
4852 | captureEnd = state2.position;
|
4853 | } else {
|
4854 | return true;
|
4855 | }
|
4856 | } else if (is_EOL(ch)) {
|
4857 | captureSegment(state2, captureStart, captureEnd, true);
|
4858 | writeFoldedLines(state2, skipSeparationSpace(state2, false, nodeIndent));
|
4859 | captureStart = captureEnd = state2.position;
|
4860 | } else if (state2.position === state2.lineStart && testDocumentSeparator(state2)) {
|
4861 | throwError(state2, "unexpected end of the document within a single quoted scalar");
|
4862 | } else {
|
4863 | state2.position++;
|
4864 | captureEnd = state2.position;
|
4865 | }
|
4866 | }
|
4867 | throwError(state2, "unexpected end of the stream within a single quoted scalar");
|
4868 | }
|
4869 | function readDoubleQuotedScalar(state2, nodeIndent) {
|
4870 | var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
4871 | ch = state2.input.charCodeAt(state2.position);
|
4872 | if (ch !== 34) {
|
4873 | return false;
|
4874 | }
|
4875 | state2.kind = "scalar";
|
4876 | state2.result = "";
|
4877 | state2.position++;
|
4878 | captureStart = captureEnd = state2.position;
|
4879 | while ((ch = state2.input.charCodeAt(state2.position)) !== 0) {
|
4880 | if (ch === 34) {
|
4881 | captureSegment(state2, captureStart, state2.position, true);
|
4882 | state2.position++;
|
4883 | return true;
|
4884 | } else if (ch === 92) {
|
4885 | captureSegment(state2, captureStart, state2.position, true);
|
4886 | ch = state2.input.charCodeAt(++state2.position);
|
4887 | if (is_EOL(ch)) {
|
4888 | skipSeparationSpace(state2, false, nodeIndent);
|
4889 | } else if (ch < 256 && simpleEscapeCheck[ch]) {
|
4890 | state2.result += simpleEscapeMap[ch];
|
4891 | state2.position++;
|
4892 | } else if ((tmp = escapedHexLen(ch)) > 0) {
|
4893 | hexLength = tmp;
|
4894 | hexResult = 0;
|
4895 | for (; hexLength > 0; hexLength--) {
|
4896 | ch = state2.input.charCodeAt(++state2.position);
|
4897 | if ((tmp = fromHexCode(ch)) >= 0) {
|
4898 | hexResult = (hexResult << 4) + tmp;
|
4899 | } else {
|
4900 | throwError(state2, "expected hexadecimal character");
|
4901 | }
|
4902 | }
|
4903 | state2.result += charFromCodepoint(hexResult);
|
4904 | state2.position++;
|
4905 | } else {
|
4906 | throwError(state2, "unknown escape sequence");
|
4907 | }
|
4908 | captureStart = captureEnd = state2.position;
|
4909 | } else if (is_EOL(ch)) {
|
4910 | captureSegment(state2, captureStart, captureEnd, true);
|
4911 | writeFoldedLines(state2, skipSeparationSpace(state2, false, nodeIndent));
|
4912 | captureStart = captureEnd = state2.position;
|
4913 | } else if (state2.position === state2.lineStart && testDocumentSeparator(state2)) {
|
4914 | throwError(state2, "unexpected end of the document within a double quoted scalar");
|
4915 | } else {
|
4916 | state2.position++;
|
4917 | captureEnd = state2.position;
|
4918 | }
|
4919 | }
|
4920 | throwError(state2, "unexpected end of the stream within a double quoted scalar");
|
4921 | }
|
4922 | function readFlowCollection(state2, nodeIndent) {
|
4923 | var readNext = true, _line, _lineStart, _pos, _tag = state2.tag, _result, _anchor = state2.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch;
|
4924 | ch = state2.input.charCodeAt(state2.position);
|
4925 | if (ch === 91) {
|
4926 | terminator = 93;
|
4927 | isMapping = false;
|
4928 | _result = [];
|
4929 | } else if (ch === 123) {
|
4930 | terminator = 125;
|
4931 | isMapping = true;
|
4932 | _result = {};
|
4933 | } else {
|
4934 | return false;
|
4935 | }
|
4936 | if (state2.anchor !== null) {
|
4937 | state2.anchorMap[state2.anchor] = _result;
|
4938 | }
|
4939 | ch = state2.input.charCodeAt(++state2.position);
|
4940 | while (ch !== 0) {
|
4941 | skipSeparationSpace(state2, true, nodeIndent);
|
4942 | ch = state2.input.charCodeAt(state2.position);
|
4943 | if (ch === terminator) {
|
4944 | state2.position++;
|
4945 | state2.tag = _tag;
|
4946 | state2.anchor = _anchor;
|
4947 | state2.kind = isMapping ? "mapping" : "sequence";
|
4948 | state2.result = _result;
|
4949 | return true;
|
4950 | } else if (!readNext) {
|
4951 | throwError(state2, "missed comma between flow collection entries");
|
4952 | } else if (ch === 44) {
|
4953 | throwError(state2, "expected the node content, but found ','");
|
4954 | }
|
4955 | keyTag = keyNode = valueNode = null;
|
4956 | isPair = isExplicitPair = false;
|
4957 | if (ch === 63) {
|
4958 | following = state2.input.charCodeAt(state2.position + 1);
|
4959 | if (is_WS_OR_EOL(following)) {
|
4960 | isPair = isExplicitPair = true;
|
4961 | state2.position++;
|
4962 | skipSeparationSpace(state2, true, nodeIndent);
|
4963 | }
|
4964 | }
|
4965 | _line = state2.line;
|
4966 | _lineStart = state2.lineStart;
|
4967 | _pos = state2.position;
|
4968 | composeNode(state2, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
4969 | keyTag = state2.tag;
|
4970 | keyNode = state2.result;
|
4971 | skipSeparationSpace(state2, true, nodeIndent);
|
4972 | ch = state2.input.charCodeAt(state2.position);
|
4973 | if ((isExplicitPair || state2.line === _line) && ch === 58) {
|
4974 | isPair = true;
|
4975 | ch = state2.input.charCodeAt(++state2.position);
|
4976 | skipSeparationSpace(state2, true, nodeIndent);
|
4977 | composeNode(state2, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
4978 | valueNode = state2.result;
|
4979 | }
|
4980 | if (isMapping) {
|
4981 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
4982 | } else if (isPair) {
|
4983 | _result.push(storeMappingPair(state2, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
4984 | } else {
|
4985 | _result.push(keyNode);
|
4986 | }
|
4987 | skipSeparationSpace(state2, true, nodeIndent);
|
4988 | ch = state2.input.charCodeAt(state2.position);
|
4989 | if (ch === 44) {
|
4990 | readNext = true;
|
4991 | ch = state2.input.charCodeAt(++state2.position);
|
4992 | } else {
|
4993 | readNext = false;
|
4994 | }
|
4995 | }
|
4996 | throwError(state2, "unexpected end of the stream within a flow collection");
|
4997 | }
|
4998 | function readBlockScalar(state2, nodeIndent) {
|
4999 | var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
5000 | ch = state2.input.charCodeAt(state2.position);
|
5001 | if (ch === 124) {
|
5002 | folding = false;
|
5003 | } else if (ch === 62) {
|
5004 | folding = true;
|
5005 | } else {
|
5006 | return false;
|
5007 | }
|
5008 | state2.kind = "scalar";
|
5009 | state2.result = "";
|
5010 | while (ch !== 0) {
|
5011 | ch = state2.input.charCodeAt(++state2.position);
|
5012 | if (ch === 43 || ch === 45) {
|
5013 | if (CHOMPING_CLIP === chomping) {
|
5014 | chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
5015 | } else {
|
5016 | throwError(state2, "repeat of a chomping mode identifier");
|
5017 | }
|
5018 | } else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
5019 | if (tmp === 0) {
|
5020 | throwError(state2, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
5021 | } else if (!detectedIndent) {
|
5022 | textIndent = nodeIndent + tmp - 1;
|
5023 | detectedIndent = true;
|
5024 | } else {
|
5025 | throwError(state2, "repeat of an indentation width identifier");
|
5026 | }
|
5027 | } else {
|
5028 | break;
|
5029 | }
|
5030 | }
|
5031 | if (is_WHITE_SPACE(ch)) {
|
5032 | do {
|
5033 | ch = state2.input.charCodeAt(++state2.position);
|
5034 | } while (is_WHITE_SPACE(ch));
|
5035 | if (ch === 35) {
|
5036 | do {
|
5037 | ch = state2.input.charCodeAt(++state2.position);
|
5038 | } while (!is_EOL(ch) && ch !== 0);
|
5039 | }
|
5040 | }
|
5041 | while (ch !== 0) {
|
5042 | readLineBreak(state2);
|
5043 | state2.lineIndent = 0;
|
5044 | ch = state2.input.charCodeAt(state2.position);
|
5045 | while ((!detectedIndent || state2.lineIndent < textIndent) && ch === 32) {
|
5046 | state2.lineIndent++;
|
5047 | ch = state2.input.charCodeAt(++state2.position);
|
5048 | }
|
5049 | if (!detectedIndent && state2.lineIndent > textIndent) {
|
5050 | textIndent = state2.lineIndent;
|
5051 | }
|
5052 | if (is_EOL(ch)) {
|
5053 | emptyLines++;
|
5054 | continue;
|
5055 | }
|
5056 | if (state2.lineIndent < textIndent) {
|
5057 | if (chomping === CHOMPING_KEEP) {
|
5058 | state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
5059 | } else if (chomping === CHOMPING_CLIP) {
|
5060 | if (didReadContent) {
|
5061 | state2.result += "\n";
|
5062 | }
|
5063 | }
|
5064 | break;
|
5065 | }
|
5066 | if (folding) {
|
5067 | if (is_WHITE_SPACE(ch)) {
|
5068 | atMoreIndented = true;
|
5069 | state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
5070 | } else if (atMoreIndented) {
|
5071 | atMoreIndented = false;
|
5072 | state2.result += common.repeat("\n", emptyLines + 1);
|
5073 | } else if (emptyLines === 0) {
|
5074 | if (didReadContent) {
|
5075 | state2.result += " ";
|
5076 | }
|
5077 | } else {
|
5078 | state2.result += common.repeat("\n", emptyLines);
|
5079 | }
|
5080 | } else {
|
5081 | state2.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
5082 | }
|
5083 | didReadContent = true;
|
5084 | detectedIndent = true;
|
5085 | emptyLines = 0;
|
5086 | captureStart = state2.position;
|
5087 | while (!is_EOL(ch) && ch !== 0) {
|
5088 | ch = state2.input.charCodeAt(++state2.position);
|
5089 | }
|
5090 | captureSegment(state2, captureStart, state2.position, false);
|
5091 | }
|
5092 | return true;
|
5093 | }
|
5094 | function readBlockSequence(state2, nodeIndent) {
|
5095 | var _line, _tag = state2.tag, _anchor = state2.anchor, _result = [], following, detected = false, ch;
|
5096 | if (state2.firstTabInLine !== -1)
|
5097 | return false;
|
5098 | if (state2.anchor !== null) {
|
5099 | state2.anchorMap[state2.anchor] = _result;
|
5100 | }
|
5101 | ch = state2.input.charCodeAt(state2.position);
|
5102 | while (ch !== 0) {
|
5103 | if (state2.firstTabInLine !== -1) {
|
5104 | state2.position = state2.firstTabInLine;
|
5105 | throwError(state2, "tab characters must not be used in indentation");
|
5106 | }
|
5107 | if (ch !== 45) {
|
5108 | break;
|
5109 | }
|
5110 | following = state2.input.charCodeAt(state2.position + 1);
|
5111 | if (!is_WS_OR_EOL(following)) {
|
5112 | break;
|
5113 | }
|
5114 | detected = true;
|
5115 | state2.position++;
|
5116 | if (skipSeparationSpace(state2, true, -1)) {
|
5117 | if (state2.lineIndent <= nodeIndent) {
|
5118 | _result.push(null);
|
5119 | ch = state2.input.charCodeAt(state2.position);
|
5120 | continue;
|
5121 | }
|
5122 | }
|
5123 | _line = state2.line;
|
5124 | composeNode(state2, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
5125 | _result.push(state2.result);
|
5126 | skipSeparationSpace(state2, true, -1);
|
5127 | ch = state2.input.charCodeAt(state2.position);
|
5128 | if ((state2.line === _line || state2.lineIndent > nodeIndent) && ch !== 0) {
|
5129 | throwError(state2, "bad indentation of a sequence entry");
|
5130 | } else if (state2.lineIndent < nodeIndent) {
|
5131 | break;
|
5132 | }
|
5133 | }
|
5134 | if (detected) {
|
5135 | state2.tag = _tag;
|
5136 | state2.anchor = _anchor;
|
5137 | state2.kind = "sequence";
|
5138 | state2.result = _result;
|
5139 | return true;
|
5140 | }
|
5141 | return false;
|
5142 | }
|
5143 | function readBlockMapping(state2, nodeIndent, flowIndent) {
|
5144 | var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state2.tag, _anchor = state2.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
5145 | if (state2.firstTabInLine !== -1)
|
5146 | return false;
|
5147 | if (state2.anchor !== null) {
|
5148 | state2.anchorMap[state2.anchor] = _result;
|
5149 | }
|
5150 | ch = state2.input.charCodeAt(state2.position);
|
5151 | while (ch !== 0) {
|
5152 | if (!atExplicitKey && state2.firstTabInLine !== -1) {
|
5153 | state2.position = state2.firstTabInLine;
|
5154 | throwError(state2, "tab characters must not be used in indentation");
|
5155 | }
|
5156 | following = state2.input.charCodeAt(state2.position + 1);
|
5157 | _line = state2.line;
|
5158 | if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
5159 | if (ch === 63) {
|
5160 | if (atExplicitKey) {
|
5161 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
5162 | keyTag = keyNode = valueNode = null;
|
5163 | }
|
5164 | detected = true;
|
5165 | atExplicitKey = true;
|
5166 | allowCompact = true;
|
5167 | } else if (atExplicitKey) {
|
5168 | atExplicitKey = false;
|
5169 | allowCompact = true;
|
5170 | } else {
|
5171 | throwError(state2, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
5172 | }
|
5173 | state2.position += 1;
|
5174 | ch = following;
|
5175 | } else {
|
5176 | _keyLine = state2.line;
|
5177 | _keyLineStart = state2.lineStart;
|
5178 | _keyPos = state2.position;
|
5179 | if (!composeNode(state2, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
5180 | break;
|
5181 | }
|
5182 | if (state2.line === _line) {
|
5183 | ch = state2.input.charCodeAt(state2.position);
|
5184 | while (is_WHITE_SPACE(ch)) {
|
5185 | ch = state2.input.charCodeAt(++state2.position);
|
5186 | }
|
5187 | if (ch === 58) {
|
5188 | ch = state2.input.charCodeAt(++state2.position);
|
5189 | if (!is_WS_OR_EOL(ch)) {
|
5190 | throwError(state2, "a whitespace character is expected after the key-value separator within a block mapping");
|
5191 | }
|
5192 | if (atExplicitKey) {
|
5193 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
5194 | keyTag = keyNode = valueNode = null;
|
5195 | }
|
5196 | detected = true;
|
5197 | atExplicitKey = false;
|
5198 | allowCompact = false;
|
5199 | keyTag = state2.tag;
|
5200 | keyNode = state2.result;
|
5201 | } else if (detected) {
|
5202 | throwError(state2, "can not read an implicit mapping pair; a colon is missed");
|
5203 | } else {
|
5204 | state2.tag = _tag;
|
5205 | state2.anchor = _anchor;
|
5206 | return true;
|
5207 | }
|
5208 | } else if (detected) {
|
5209 | throwError(state2, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
5210 | } else {
|
5211 | state2.tag = _tag;
|
5212 | state2.anchor = _anchor;
|
5213 | return true;
|
5214 | }
|
5215 | }
|
5216 | if (state2.line === _line || state2.lineIndent > nodeIndent) {
|
5217 | if (atExplicitKey) {
|
5218 | _keyLine = state2.line;
|
5219 | _keyLineStart = state2.lineStart;
|
5220 | _keyPos = state2.position;
|
5221 | }
|
5222 | if (composeNode(state2, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
5223 | if (atExplicitKey) {
|
5224 | keyNode = state2.result;
|
5225 | } else {
|
5226 | valueNode = state2.result;
|
5227 | }
|
5228 | }
|
5229 | if (!atExplicitKey) {
|
5230 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
5231 | keyTag = keyNode = valueNode = null;
|
5232 | }
|
5233 | skipSeparationSpace(state2, true, -1);
|
5234 | ch = state2.input.charCodeAt(state2.position);
|
5235 | }
|
5236 | if ((state2.line === _line || state2.lineIndent > nodeIndent) && ch !== 0) {
|
5237 | throwError(state2, "bad indentation of a mapping entry");
|
5238 | } else if (state2.lineIndent < nodeIndent) {
|
5239 | break;
|
5240 | }
|
5241 | }
|
5242 | if (atExplicitKey) {
|
5243 | storeMappingPair(state2, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
5244 | }
|
5245 | if (detected) {
|
5246 | state2.tag = _tag;
|
5247 | state2.anchor = _anchor;
|
5248 | state2.kind = "mapping";
|
5249 | state2.result = _result;
|
5250 | }
|
5251 | return detected;
|
5252 | }
|
5253 | function readTagProperty(state2) {
|
5254 | var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
5255 | ch = state2.input.charCodeAt(state2.position);
|
5256 | if (ch !== 33)
|
5257 | return false;
|
5258 | if (state2.tag !== null) {
|
5259 | throwError(state2, "duplication of a tag property");
|
5260 | }
|
5261 | ch = state2.input.charCodeAt(++state2.position);
|
5262 | if (ch === 60) {
|
5263 | isVerbatim = true;
|
5264 | ch = state2.input.charCodeAt(++state2.position);
|
5265 | } else if (ch === 33) {
|
5266 | isNamed = true;
|
5267 | tagHandle = "!!";
|
5268 | ch = state2.input.charCodeAt(++state2.position);
|
5269 | } else {
|
5270 | tagHandle = "!";
|
5271 | }
|
5272 | _position = state2.position;
|
5273 | if (isVerbatim) {
|
5274 | do {
|
5275 | ch = state2.input.charCodeAt(++state2.position);
|
5276 | } while (ch !== 0 && ch !== 62);
|
5277 | if (state2.position < state2.length) {
|
5278 | tagName = state2.input.slice(_position, state2.position);
|
5279 | ch = state2.input.charCodeAt(++state2.position);
|
5280 | } else {
|
5281 | throwError(state2, "unexpected end of the stream within a verbatim tag");
|
5282 | }
|
5283 | } else {
|
5284 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
5285 | if (ch === 33) {
|
5286 | if (!isNamed) {
|
5287 | tagHandle = state2.input.slice(_position - 1, state2.position + 1);
|
5288 | if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
5289 | throwError(state2, "named tag handle cannot contain such characters");
|
5290 | }
|
5291 | isNamed = true;
|
5292 | _position = state2.position + 1;
|
5293 | } else {
|
5294 | throwError(state2, "tag suffix cannot contain exclamation marks");
|
5295 | }
|
5296 | }
|
5297 | ch = state2.input.charCodeAt(++state2.position);
|
5298 | }
|
5299 | tagName = state2.input.slice(_position, state2.position);
|
5300 | if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
5301 | throwError(state2, "tag suffix cannot contain flow indicator characters");
|
5302 | }
|
5303 | }
|
5304 | if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
5305 | throwError(state2, "tag name cannot contain such characters: " + tagName);
|
5306 | }
|
5307 | try {
|
5308 | tagName = decodeURIComponent(tagName);
|
5309 | } catch (err) {
|
5310 | throwError(state2, "tag name is malformed: " + tagName);
|
5311 | }
|
5312 | if (isVerbatim) {
|
5313 | state2.tag = tagName;
|
5314 | } else if (_hasOwnProperty$1.call(state2.tagMap, tagHandle)) {
|
5315 | state2.tag = state2.tagMap[tagHandle] + tagName;
|
5316 | } else if (tagHandle === "!") {
|
5317 | state2.tag = "!" + tagName;
|
5318 | } else if (tagHandle === "!!") {
|
5319 | state2.tag = "tag:yaml.org,2002:" + tagName;
|
5320 | } else {
|
5321 | throwError(state2, 'undeclared tag handle "' + tagHandle + '"');
|
5322 | }
|
5323 | return true;
|
5324 | }
|
5325 | function readAnchorProperty(state2) {
|
5326 | var _position, ch;
|
5327 | ch = state2.input.charCodeAt(state2.position);
|
5328 | if (ch !== 38)
|
5329 | return false;
|
5330 | if (state2.anchor !== null) {
|
5331 | throwError(state2, "duplication of an anchor property");
|
5332 | }
|
5333 | ch = state2.input.charCodeAt(++state2.position);
|
5334 | _position = state2.position;
|
5335 | while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
5336 | ch = state2.input.charCodeAt(++state2.position);
|
5337 | }
|
5338 | if (state2.position === _position) {
|
5339 | throwError(state2, "name of an anchor node must contain at least one character");
|
5340 | }
|
5341 | state2.anchor = state2.input.slice(_position, state2.position);
|
5342 | return true;
|
5343 | }
|
5344 | function readAlias(state2) {
|
5345 | var _position, alias, ch;
|
5346 | ch = state2.input.charCodeAt(state2.position);
|
5347 | if (ch !== 42)
|
5348 | return false;
|
5349 | ch = state2.input.charCodeAt(++state2.position);
|
5350 | _position = state2.position;
|
5351 | while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
5352 | ch = state2.input.charCodeAt(++state2.position);
|
5353 | }
|
5354 | if (state2.position === _position) {
|
5355 | throwError(state2, "name of an alias node must contain at least one character");
|
5356 | }
|
5357 | alias = state2.input.slice(_position, state2.position);
|
5358 | if (!_hasOwnProperty$1.call(state2.anchorMap, alias)) {
|
5359 | throwError(state2, 'unidentified alias "' + alias + '"');
|
5360 | }
|
5361 | state2.result = state2.anchorMap[alias];
|
5362 | skipSeparationSpace(state2, true, -1);
|
5363 | return true;
|
5364 | }
|
5365 | function composeNode(state2, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
5366 | var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
|
5367 | if (state2.listener !== null) {
|
5368 | state2.listener("open", state2);
|
5369 | }
|
5370 | state2.tag = null;
|
5371 | state2.anchor = null;
|
5372 | state2.kind = null;
|
5373 | state2.result = null;
|
5374 | allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
5375 | if (allowToSeek) {
|
5376 | if (skipSeparationSpace(state2, true, -1)) {
|
5377 | atNewLine = true;
|
5378 | if (state2.lineIndent > parentIndent) {
|
5379 | indentStatus = 1;
|
5380 | } else if (state2.lineIndent === parentIndent) {
|
5381 | indentStatus = 0;
|
5382 | } else if (state2.lineIndent < parentIndent) {
|
5383 | indentStatus = -1;
|
5384 | }
|
5385 | }
|
5386 | }
|
5387 | if (indentStatus === 1) {
|
5388 | while (readTagProperty(state2) || readAnchorProperty(state2)) {
|
5389 | if (skipSeparationSpace(state2, true, -1)) {
|
5390 | atNewLine = true;
|
5391 | allowBlockCollections = allowBlockStyles;
|
5392 | if (state2.lineIndent > parentIndent) {
|
5393 | indentStatus = 1;
|
5394 | } else if (state2.lineIndent === parentIndent) {
|
5395 | indentStatus = 0;
|
5396 | } else if (state2.lineIndent < parentIndent) {
|
5397 | indentStatus = -1;
|
5398 | }
|
5399 | } else {
|
5400 | allowBlockCollections = false;
|
5401 | }
|
5402 | }
|
5403 | }
|
5404 | if (allowBlockCollections) {
|
5405 | allowBlockCollections = atNewLine || allowCompact;
|
5406 | }
|
5407 | if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
5408 | if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
5409 | flowIndent = parentIndent;
|
5410 | } else {
|
5411 | flowIndent = parentIndent + 1;
|
5412 | }
|
5413 | blockIndent = state2.position - state2.lineStart;
|
5414 | if (indentStatus === 1) {
|
5415 | if (allowBlockCollections && (readBlockSequence(state2, blockIndent) || readBlockMapping(state2, blockIndent, flowIndent)) || readFlowCollection(state2, flowIndent)) {
|
5416 | hasContent = true;
|
5417 | } else {
|
5418 | if (allowBlockScalars && readBlockScalar(state2, flowIndent) || readSingleQuotedScalar(state2, flowIndent) || readDoubleQuotedScalar(state2, flowIndent)) {
|
5419 | hasContent = true;
|
5420 | } else if (readAlias(state2)) {
|
5421 | hasContent = true;
|
5422 | if (state2.tag !== null || state2.anchor !== null) {
|
5423 | throwError(state2, "alias node should not have any properties");
|
5424 | }
|
5425 | } else if (readPlainScalar(state2, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
5426 | hasContent = true;
|
5427 | if (state2.tag === null) {
|
5428 | state2.tag = "?";
|
5429 | }
|
5430 | }
|
5431 | if (state2.anchor !== null) {
|
5432 | state2.anchorMap[state2.anchor] = state2.result;
|
5433 | }
|
5434 | }
|
5435 | } else if (indentStatus === 0) {
|
5436 | hasContent = allowBlockCollections && readBlockSequence(state2, blockIndent);
|
5437 | }
|
5438 | }
|
5439 | if (state2.tag === null) {
|
5440 | if (state2.anchor !== null) {
|
5441 | state2.anchorMap[state2.anchor] = state2.result;
|
5442 | }
|
5443 | } else if (state2.tag === "?") {
|
5444 | if (state2.result !== null && state2.kind !== "scalar") {
|
5445 | throwError(state2, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state2.kind + '"');
|
5446 | }
|
5447 | for (typeIndex = 0, typeQuantity = state2.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
5448 | type2 = state2.implicitTypes[typeIndex];
|
5449 | if (type2.resolve(state2.result)) {
|
5450 | state2.result = type2.construct(state2.result);
|
5451 | state2.tag = type2.tag;
|
5452 | if (state2.anchor !== null) {
|
5453 | state2.anchorMap[state2.anchor] = state2.result;
|
5454 | }
|
5455 | break;
|
5456 | }
|
5457 | }
|
5458 | } else if (state2.tag !== "!") {
|
5459 | if (_hasOwnProperty$1.call(state2.typeMap[state2.kind || "fallback"], state2.tag)) {
|
5460 | type2 = state2.typeMap[state2.kind || "fallback"][state2.tag];
|
5461 | } else {
|
5462 | type2 = null;
|
5463 | typeList = state2.typeMap.multi[state2.kind || "fallback"];
|
5464 | for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
|
5465 | if (state2.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
5466 | type2 = typeList[typeIndex];
|
5467 | break;
|
5468 | }
|
5469 | }
|
5470 | }
|
5471 | if (!type2) {
|
5472 | throwError(state2, "unknown tag !<" + state2.tag + ">");
|
5473 | }
|
5474 | if (state2.result !== null && type2.kind !== state2.kind) {
|
5475 | throwError(state2, "unacceptable node kind for !<" + state2.tag + '> tag; it should be "' + type2.kind + '", not "' + state2.kind + '"');
|
5476 | }
|
5477 | if (!type2.resolve(state2.result, state2.tag)) {
|
5478 | throwError(state2, "cannot resolve a node with !<" + state2.tag + "> explicit tag");
|
5479 | } else {
|
5480 | state2.result = type2.construct(state2.result, state2.tag);
|
5481 | if (state2.anchor !== null) {
|
5482 | state2.anchorMap[state2.anchor] = state2.result;
|
5483 | }
|
5484 | }
|
5485 | }
|
5486 | if (state2.listener !== null) {
|
5487 | state2.listener("close", state2);
|
5488 | }
|
5489 | return state2.tag !== null || state2.anchor !== null || hasContent;
|
5490 | }
|
5491 | function readDocument(state2) {
|
5492 | var documentStart = state2.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
5493 | state2.version = null;
|
5494 | state2.checkLineBreaks = state2.legacy;
|
5495 | state2.tagMap = Object.create(null);
|
5496 | state2.anchorMap = Object.create(null);
|
5497 | while ((ch = state2.input.charCodeAt(state2.position)) !== 0) {
|
5498 | skipSeparationSpace(state2, true, -1);
|
5499 | ch = state2.input.charCodeAt(state2.position);
|
5500 | if (state2.lineIndent > 0 || ch !== 37) {
|
5501 | break;
|
5502 | }
|
5503 | hasDirectives = true;
|
5504 | ch = state2.input.charCodeAt(++state2.position);
|
5505 | _position = state2.position;
|
5506 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
5507 | ch = state2.input.charCodeAt(++state2.position);
|
5508 | }
|
5509 | directiveName = state2.input.slice(_position, state2.position);
|
5510 | directiveArgs = [];
|
5511 | if (directiveName.length < 1) {
|
5512 | throwError(state2, "directive name must not be less than one character in length");
|
5513 | }
|
5514 | while (ch !== 0) {
|
5515 | while (is_WHITE_SPACE(ch)) {
|
5516 | ch = state2.input.charCodeAt(++state2.position);
|
5517 | }
|
5518 | if (ch === 35) {
|
5519 | do {
|
5520 | ch = state2.input.charCodeAt(++state2.position);
|
5521 | } while (ch !== 0 && !is_EOL(ch));
|
5522 | break;
|
5523 | }
|
5524 | if (is_EOL(ch))
|
5525 | break;
|
5526 | _position = state2.position;
|
5527 | while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
5528 | ch = state2.input.charCodeAt(++state2.position);
|
5529 | }
|
5530 | directiveArgs.push(state2.input.slice(_position, state2.position));
|
5531 | }
|
5532 | if (ch !== 0)
|
5533 | readLineBreak(state2);
|
5534 | if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
|
5535 | directiveHandlers[directiveName](state2, directiveName, directiveArgs);
|
5536 | } else {
|
5537 | throwWarning(state2, 'unknown document directive "' + directiveName + '"');
|
5538 | }
|
5539 | }
|
5540 | skipSeparationSpace(state2, true, -1);
|
5541 | if (state2.lineIndent === 0 && state2.input.charCodeAt(state2.position) === 45 && state2.input.charCodeAt(state2.position + 1) === 45 && state2.input.charCodeAt(state2.position + 2) === 45) {
|
5542 | state2.position += 3;
|
5543 | skipSeparationSpace(state2, true, -1);
|
5544 | } else if (hasDirectives) {
|
5545 | throwError(state2, "directives end mark is expected");
|
5546 | }
|
5547 | composeNode(state2, state2.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
5548 | skipSeparationSpace(state2, true, -1);
|
5549 | if (state2.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state2.input.slice(documentStart, state2.position))) {
|
5550 | throwWarning(state2, "non-ASCII line breaks are interpreted as content");
|
5551 | }
|
5552 | state2.documents.push(state2.result);
|
5553 | if (state2.position === state2.lineStart && testDocumentSeparator(state2)) {
|
5554 | if (state2.input.charCodeAt(state2.position) === 46) {
|
5555 | state2.position += 3;
|
5556 | skipSeparationSpace(state2, true, -1);
|
5557 | }
|
5558 | return;
|
5559 | }
|
5560 | if (state2.position < state2.length - 1) {
|
5561 | throwError(state2, "end of the stream or a document separator is expected");
|
5562 | } else {
|
5563 | return;
|
5564 | }
|
5565 | }
|
5566 | function loadDocuments(input, options) {
|
5567 | input = String(input);
|
5568 | options = options || {};
|
5569 | if (input.length !== 0) {
|
5570 | if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
5571 | input += "\n";
|
5572 | }
|
5573 | if (input.charCodeAt(0) === 65279) {
|
5574 | input = input.slice(1);
|
5575 | }
|
5576 | }
|
5577 | var state2 = new State$1(input, options);
|
5578 | var nullpos = input.indexOf("\0");
|
5579 | if (nullpos !== -1) {
|
5580 | state2.position = nullpos;
|
5581 | throwError(state2, "null byte is not allowed in input");
|
5582 | }
|
5583 | state2.input += "\0";
|
5584 | while (state2.input.charCodeAt(state2.position) === 32) {
|
5585 | state2.lineIndent += 1;
|
5586 | state2.position += 1;
|
5587 | }
|
5588 | while (state2.position < state2.length - 1) {
|
5589 | readDocument(state2);
|
5590 | }
|
5591 | return state2.documents;
|
5592 | }
|
5593 | function loadAll$1(input, iterator2, options) {
|
5594 | if (iterator2 !== null && typeof iterator2 === "object" && typeof options === "undefined") {
|
5595 | options = iterator2;
|
5596 | iterator2 = null;
|
5597 | }
|
5598 | var documents = loadDocuments(input, options);
|
5599 | if (typeof iterator2 !== "function") {
|
5600 | return documents;
|
5601 | }
|
5602 | for (var index = 0, length = documents.length; index < length; index += 1) {
|
5603 | iterator2(documents[index]);
|
5604 | }
|
5605 | }
|
5606 | function load$1(input, options) {
|
5607 | var documents = loadDocuments(input, options);
|
5608 | if (documents.length === 0) {
|
5609 | return void 0;
|
5610 | } else if (documents.length === 1) {
|
5611 | return documents[0];
|
5612 | }
|
5613 | throw new exception("expected a single document in the stream, but found more");
|
5614 | }
|
5615 | var loadAll_1 = loadAll$1;
|
5616 | var load_1 = load$1;
|
5617 | var loader$j = {
|
5618 | loadAll: loadAll_1,
|
5619 | load: load_1
|
5620 | };
|
5621 | var FAILSAFE_SCHEMA = failsafe;
|
5622 | var load = loader$j.load;
|
5623 | const frontMatterRegex = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;
|
5624 | function extractFrontMatter(text, db) {
|
5625 | var _a, _b;
|
5626 | const matches = text.match(frontMatterRegex);
|
5627 | if (matches) {
|
5628 | const parsed = load(matches[1], {
|
5629 |
|
5630 |
|
5631 | schema: FAILSAFE_SCHEMA
|
5632 | });
|
5633 | if (parsed == null ? void 0 : parsed.title) {
|
5634 | (_a = db.setDiagramTitle) == null ? void 0 : _a.call(db, parsed.title);
|
5635 | }
|
5636 | if (parsed == null ? void 0 : parsed.displayMode) {
|
5637 | (_b = db.setDisplayMode) == null ? void 0 : _b.call(db, parsed.displayMode);
|
5638 | }
|
5639 | return text.slice(matches[0].length);
|
5640 | } else {
|
5641 | return text;
|
5642 | }
|
5643 | }
|
5644 | const assignWithDepth = function(dst, src, config2) {
|
5645 | const { depth, clobber } = Object.assign({ depth: 2, clobber: false }, config2);
|
5646 | if (Array.isArray(src) && !Array.isArray(dst)) {
|
5647 | src.forEach((s) => assignWithDepth(dst, s, config2));
|
5648 | return dst;
|
5649 | } else if (Array.isArray(src) && Array.isArray(dst)) {
|
5650 | src.forEach((s) => {
|
5651 | if (!dst.includes(s)) {
|
5652 | dst.push(s);
|
5653 | }
|
5654 | });
|
5655 | return dst;
|
5656 | }
|
5657 | if (dst === void 0 || depth <= 0) {
|
5658 | if (dst !== void 0 && dst !== null && typeof dst === "object" && typeof src === "object") {
|
5659 | return Object.assign(dst, src);
|
5660 | } else {
|
5661 | return src;
|
5662 | }
|
5663 | }
|
5664 | if (src !== void 0 && typeof dst === "object" && typeof src === "object") {
|
5665 | Object.keys(src).forEach((key) => {
|
5666 | if (typeof src[key] === "object" && (dst[key] === void 0 || typeof dst[key] === "object")) {
|
5667 | if (dst[key] === void 0) {
|
5668 | dst[key] = Array.isArray(src[key]) ? [] : {};
|
5669 | }
|
5670 | dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber });
|
5671 | } else if (clobber || typeof dst[key] !== "object" && typeof src[key] !== "object") {
|
5672 | dst[key] = src[key];
|
5673 | }
|
5674 | });
|
5675 | }
|
5676 | return dst;
|
5677 | };
|
5678 | const assignWithDepth$1 = assignWithDepth;
|
5679 | const defaultConfig = Object.freeze(defaultConfig$1);
|
5680 | let siteConfig = assignWithDepth$1({}, defaultConfig);
|
5681 | let configFromInitialize;
|
5682 | let directives = [];
|
5683 | let currentConfig = assignWithDepth$1({}, defaultConfig);
|
5684 | const updateCurrentConfig = (siteCfg, _directives) => {
|
5685 | let cfg = assignWithDepth$1({}, siteCfg);
|
5686 | let sumOfDirectives = {};
|
5687 | for (const d of _directives) {
|
5688 | sanitize(d);
|
5689 | sumOfDirectives = assignWithDepth$1(sumOfDirectives, d);
|
5690 | }
|
5691 | cfg = assignWithDepth$1(cfg, sumOfDirectives);
|
5692 | if (sumOfDirectives.theme && sumOfDirectives.theme in theme) {
|
5693 | const tmpConfigFromInitialize = assignWithDepth$1({}, configFromInitialize);
|
5694 | const themeVariables = assignWithDepth$1(
|
5695 | tmpConfigFromInitialize.themeVariables || {},
|
5696 | sumOfDirectives.themeVariables
|
5697 | );
|
5698 | if (cfg.theme && cfg.theme in theme) {
|
5699 | cfg.themeVariables = theme[cfg.theme].getThemeVariables(themeVariables);
|
5700 | }
|
5701 | }
|
5702 | currentConfig = cfg;
|
5703 | checkConfig(currentConfig);
|
5704 | return currentConfig;
|
5705 | };
|
5706 | const setSiteConfig = (conf) => {
|
5707 | siteConfig = assignWithDepth$1({}, defaultConfig);
|
5708 | siteConfig = assignWithDepth$1(siteConfig, conf);
|
5709 | if (conf.theme && theme[conf.theme]) {
|
5710 | siteConfig.themeVariables = theme[conf.theme].getThemeVariables(conf.themeVariables);
|
5711 | }
|
5712 | updateCurrentConfig(siteConfig, directives);
|
5713 | return siteConfig;
|
5714 | };
|
5715 | const saveConfigFromInitialize = (conf) => {
|
5716 | configFromInitialize = assignWithDepth$1({}, conf);
|
5717 | };
|
5718 | const updateSiteConfig = (conf) => {
|
5719 | siteConfig = assignWithDepth$1(siteConfig, conf);
|
5720 | updateCurrentConfig(siteConfig, directives);
|
5721 | return siteConfig;
|
5722 | };
|
5723 | const getSiteConfig = () => {
|
5724 | return assignWithDepth$1({}, siteConfig);
|
5725 | };
|
5726 | const setConfig = (conf) => {
|
5727 | checkConfig(conf);
|
5728 | assignWithDepth$1(currentConfig, conf);
|
5729 | return getConfig$1();
|
5730 | };
|
5731 | const getConfig$1 = () => {
|
5732 | return assignWithDepth$1({}, currentConfig);
|
5733 | };
|
5734 | const sanitize = (options) => {
|
5735 | ["secure", ...siteConfig.secure ?? []].forEach((key) => {
|
5736 | if (options[key] !== void 0) {
|
5737 | log$1.debug(`Denied attempt to modify a secure key ${key}`, options[key]);
|
5738 | delete options[key];
|
5739 | }
|
5740 | });
|
5741 | Object.keys(options).forEach((key) => {
|
5742 | if (key.indexOf("__") === 0) {
|
5743 | delete options[key];
|
5744 | }
|
5745 | });
|
5746 | Object.keys(options).forEach((key) => {
|
5747 | if (typeof options[key] === "string" && (options[key].includes("<") || options[key].includes(">") || options[key].includes("url(data:"))) {
|
5748 | delete options[key];
|
5749 | }
|
5750 | if (typeof options[key] === "object") {
|
5751 | sanitize(options[key]);
|
5752 | }
|
5753 | });
|
5754 | };
|
5755 | const addDirective = (directive2) => {
|
5756 | if (directive2.fontFamily) {
|
5757 | if (!directive2.themeVariables) {
|
5758 | directive2.themeVariables = { fontFamily: directive2.fontFamily };
|
5759 | } else {
|
5760 | if (!directive2.themeVariables.fontFamily) {
|
5761 | directive2.themeVariables = { fontFamily: directive2.fontFamily };
|
5762 | }
|
5763 | }
|
5764 | }
|
5765 | directives.push(directive2);
|
5766 | updateCurrentConfig(siteConfig, directives);
|
5767 | };
|
5768 | const reset = (config2 = siteConfig) => {
|
5769 | directives = [];
|
5770 | updateCurrentConfig(config2, directives);
|
5771 | };
|
5772 | var ConfigWarning = ((ConfigWarning2) => {
|
5773 | ConfigWarning2["LAZY_LOAD_DEPRECATED"] = "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.";
|
5774 | return ConfigWarning2;
|
5775 | })(ConfigWarning || {});
|
5776 | const issuedWarnings = {};
|
5777 | const issueWarning = (warning) => {
|
5778 | if (issuedWarnings[warning]) {
|
5779 | return;
|
5780 | }
|
5781 | log$1.warn(ConfigWarning[warning]);
|
5782 | issuedWarnings[warning] = true;
|
5783 | };
|
5784 | const checkConfig = (config2) => {
|
5785 | if (!config2) {
|
5786 | return;
|
5787 | }
|
5788 | if (config2.lazyLoadedDiagrams || config2.loadExternalDiagramsAtStartup) {
|
5789 | issueWarning("LAZY_LOAD_DEPRECATED");
|
5790 | }
|
5791 | };
|
5792 | const d3Attrs = function(d3Elem, attrs) {
|
5793 | for (let attr of attrs) {
|
5794 | d3Elem.attr(attr[0], attr[1]);
|
5795 | }
|
5796 | };
|
5797 | const calculateSvgSizeAttrs = function(height, width, useMaxWidth) {
|
5798 | let attrs = new Map();
|
5799 | if (useMaxWidth) {
|
5800 | attrs.set("width", "100%");
|
5801 | attrs.set("style", `max-width: ${width}px;`);
|
5802 | } else {
|
5803 | attrs.set("height", height);
|
5804 | attrs.set("width", width);
|
5805 | }
|
5806 | return attrs;
|
5807 | };
|
5808 | const configureSvgSize = function(svgElem, height, width, useMaxWidth) {
|
5809 | const attrs = calculateSvgSizeAttrs(height, width, useMaxWidth);
|
5810 | d3Attrs(svgElem, attrs);
|
5811 | };
|
5812 | const setupGraphViewbox$1 = function(graph, svgElem, padding, useMaxWidth) {
|
5813 | const svgBounds = svgElem.node().getBBox();
|
5814 | const sWidth = svgBounds.width;
|
5815 | const sHeight = svgBounds.height;
|
5816 | log$1.info(`SVG bounds: ${sWidth}x${sHeight}`, svgBounds);
|
5817 | let width = 0;
|
5818 | let height = 0;
|
5819 | log$1.info(`Graph bounds: ${width}x${height}`, graph);
|
5820 | width = sWidth + padding * 2;
|
5821 | height = sHeight + padding * 2;
|
5822 | log$1.info(`Calculated bounds: ${width}x${height}`);
|
5823 | configureSvgSize(svgElem, height, width, useMaxWidth);
|
5824 | const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${svgBounds.width + 2 * padding} ${svgBounds.height + 2 * padding}`;
|
5825 | svgElem.attr("viewBox", vBox);
|
5826 | };
|
5827 | const themes = {};
|
5828 | const getStyles$1 = (type2, userStyles, options) => {
|
5829 | let diagramStyles = "";
|
5830 | if (type2 in themes && themes[type2]) {
|
5831 | diagramStyles = themes[type2](options);
|
5832 | } else {
|
5833 | log$1.warn(`No theme found for ${type2}`);
|
5834 | }
|
5835 | return ` & {
|
5836 | font-family: ${options.fontFamily};
|
5837 | font-size: ${options.fontSize};
|
5838 | fill: ${options.textColor}
|
5839 | }
|
5840 |
|
5841 | /* Classes common for multiple diagrams */
|
5842 |
|
5843 | & .error-icon {
|
5844 | fill: ${options.errorBkgColor};
|
5845 | }
|
5846 | & .error-text {
|
5847 | fill: ${options.errorTextColor};
|
5848 | stroke: ${options.errorTextColor};
|
5849 | }
|
5850 |
|
5851 | & .edge-thickness-normal {
|
5852 | stroke-width: 2px;
|
5853 | }
|
5854 | & .edge-thickness-thick {
|
5855 | stroke-width: 3.5px
|
5856 | }
|
5857 | & .edge-pattern-solid {
|
5858 | stroke-dasharray: 0;
|
5859 | }
|
5860 |
|
5861 | & .edge-pattern-dashed{
|
5862 | stroke-dasharray: 3;
|
5863 | }
|
5864 | .edge-pattern-dotted {
|
5865 | stroke-dasharray: 2;
|
5866 | }
|
5867 |
|
5868 | & .marker {
|
5869 | fill: ${options.lineColor};
|
5870 | stroke: ${options.lineColor};
|
5871 | }
|
5872 | & .marker.cross {
|
5873 | stroke: ${options.lineColor};
|
5874 | }
|
5875 |
|
5876 | & svg {
|
5877 | font-family: ${options.fontFamily};
|
5878 | font-size: ${options.fontSize};
|
5879 | }
|
5880 |
|
5881 | ${diagramStyles}
|
5882 |
|
5883 | ${userStyles}
|
5884 | `;
|
5885 | };
|
5886 | const addStylesForDiagram = (type2, diagramTheme) => {
|
5887 | themes[type2] = diagramTheme;
|
5888 | };
|
5889 | const getStyles$2 = getStyles$1;
|
5890 | let title = "";
|
5891 | let diagramTitle = "";
|
5892 | let description = "";
|
5893 | const sanitizeText$1 = (txt) => sanitizeText$2(txt, getConfig$1());
|
5894 | const clear = function() {
|
5895 | title = "";
|
5896 | description = "";
|
5897 | diagramTitle = "";
|
5898 | };
|
5899 | const setAccTitle = function(txt) {
|
5900 | title = sanitizeText$1(txt).replace(/^\s+/g, "");
|
5901 | };
|
5902 | const getAccTitle = function() {
|
5903 | return title || diagramTitle;
|
5904 | };
|
5905 | const setAccDescription = function(txt) {
|
5906 | description = sanitizeText$1(txt).replace(/\n\s+/g, "\n");
|
5907 | };
|
5908 | const getAccDescription = function() {
|
5909 | return description;
|
5910 | };
|
5911 | const setDiagramTitle = function(txt) {
|
5912 | diagramTitle = sanitizeText$1(txt);
|
5913 | };
|
5914 | const getDiagramTitle = function() {
|
5915 | return diagramTitle;
|
5916 | };
|
5917 | const commonDb = {
|
5918 | getAccTitle,
|
5919 | setAccTitle,
|
5920 | getDiagramTitle,
|
5921 | setDiagramTitle,
|
5922 | getAccDescription,
|
5923 | setAccDescription,
|
5924 | clear
|
5925 | };
|
5926 | const commonDb$1 = Object.freeze( Object.defineProperty({
|
5927 | __proto__: null,
|
5928 | clear,
|
5929 | default: commonDb,
|
5930 | getAccDescription,
|
5931 | getAccTitle,
|
5932 | getDiagramTitle,
|
5933 | setAccDescription,
|
5934 | setAccTitle,
|
5935 | setDiagramTitle
|
5936 | }, Symbol.toStringTag, { value: "Module" }));
|
5937 | let currentDirective = {};
|
5938 | const parseDirective$1 = function(p, statement, context, type2) {
|
5939 | log$1.debug("parseDirective is being called", statement, context, type2);
|
5940 | try {
|
5941 | if (statement !== void 0) {
|
5942 | statement = statement.trim();
|
5943 | switch (context) {
|
5944 | case "open_directive":
|
5945 | currentDirective = {};
|
5946 | break;
|
5947 | case "type_directive":
|
5948 | if (!currentDirective) {
|
5949 | throw new Error("currentDirective is undefined");
|
5950 | }
|
5951 | currentDirective.type = statement.toLowerCase();
|
5952 | break;
|
5953 | case "arg_directive":
|
5954 | if (!currentDirective) {
|
5955 | throw new Error("currentDirective is undefined");
|
5956 | }
|
5957 | currentDirective.args = JSON.parse(statement);
|
5958 | break;
|
5959 | case "close_directive":
|
5960 | handleDirective(p, currentDirective, type2);
|
5961 | currentDirective = void 0;
|
5962 | break;
|
5963 | }
|
5964 | }
|
5965 | } catch (error) {
|
5966 | log$1.error(
|
5967 | `Error while rendering sequenceDiagram directive: ${statement} jison context: ${context}`
|
5968 | );
|
5969 | log$1.error(error.message);
|
5970 | }
|
5971 | };
|
5972 | const handleDirective = function(p, directive2, type2) {
|
5973 | log$1.info(`Directive type=${directive2.type} with args:`, directive2.args);
|
5974 | switch (directive2.type) {
|
5975 | case "init":
|
5976 | case "initialize": {
|
5977 | ["config"].forEach((prop) => {
|
5978 | if (directive2.args[prop] !== void 0) {
|
5979 | if (type2 === "flowchart-v2") {
|
5980 | type2 = "flowchart";
|
5981 | }
|
5982 | directive2.args[type2] = directive2.args[prop];
|
5983 | delete directive2.args[prop];
|
5984 | }
|
5985 | });
|
5986 | log$1.info("sanitize in handleDirective", directive2.args);
|
5987 | directiveSanitizer(directive2.args);
|
5988 | log$1.info("sanitize in handleDirective (done)", directive2.args);
|
5989 | addDirective(directive2.args);
|
5990 | break;
|
5991 | }
|
5992 | case "wrap":
|
5993 | case "nowrap":
|
5994 | if (p && p["setWrap"]) {
|
5995 | p.setWrap(directive2.type === "wrap");
|
5996 | }
|
5997 | break;
|
5998 | case "themeCss":
|
5999 | log$1.warn("themeCss encountered");
|
6000 | break;
|
6001 | default:
|
6002 | log$1.warn(
|
6003 | `Unhandled directive: source: '%%{${directive2.type}: ${JSON.stringify(
|
6004 | directive2.args ? directive2.args : {}
|
6005 | )}}%%`,
|
6006 | directive2
|
6007 | );
|
6008 | break;
|
6009 | }
|
6010 | };
|
6011 | const log = log$1;
|
6012 | const setLogLevel = setLogLevel$1;
|
6013 | const getConfig = getConfig$1;
|
6014 | const sanitizeText = (text) => sanitizeText$2(text, getConfig());
|
6015 | const setupGraphViewbox = setupGraphViewbox$1;
|
6016 | const getCommonDb = () => {
|
6017 | return commonDb$1;
|
6018 | };
|
6019 | const parseDirective = (p, statement, context, type2) => parseDirective$1(p, statement, context, type2);
|
6020 | const diagrams = {};
|
6021 | const registerDiagram = (id2, diagram2, detector2) => {
|
6022 | if (diagrams[id2]) {
|
6023 | throw new Error(`Diagram ${id2} already registered.`);
|
6024 | }
|
6025 | diagrams[id2] = diagram2;
|
6026 | if (detector2) {
|
6027 | addDetector(id2, detector2);
|
6028 | }
|
6029 | addStylesForDiagram(id2, diagram2.styles);
|
6030 | if (diagram2.injectUtils) {
|
6031 | diagram2.injectUtils(
|
6032 | log,
|
6033 | setLogLevel,
|
6034 | getConfig,
|
6035 | sanitizeText,
|
6036 | setupGraphViewbox,
|
6037 | getCommonDb(),
|
6038 | parseDirective
|
6039 | );
|
6040 | }
|
6041 | };
|
6042 | const getDiagram = (name) => {
|
6043 | if (name in diagrams) {
|
6044 | return diagrams[name];
|
6045 | }
|
6046 | throw new Error(`Diagram ${name} not found.`);
|
6047 | };
|
6048 | class UnknownDiagramError extends Error {
|
6049 | constructor(message) {
|
6050 | super(message);
|
6051 | this.name = "UnknownDiagramError";
|
6052 | }
|
6053 | }
|
6054 | const directive$1 = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
6055 | const anyComment = /\s*%%.*\n/gm;
|
6056 | const detectors = {};
|
6057 | const detectType = function(text, config2) {
|
6058 | text = text.replace(frontMatterRegex, "").replace(directive$1, "").replace(anyComment, "\n");
|
6059 | for (const [key, { detector: detector2 }] of Object.entries(detectors)) {
|
6060 | const diagram2 = detector2(text, config2);
|
6061 | if (diagram2) {
|
6062 | return key;
|
6063 | }
|
6064 | }
|
6065 | throw new UnknownDiagramError(
|
6066 | `No diagram type detected matching given configuration for text: ${text}`
|
6067 | );
|
6068 | };
|
6069 | const registerLazyLoadedDiagrams = (...diagrams2) => {
|
6070 | for (const { id: id2, detector: detector2, loader: loader2 } of diagrams2) {
|
6071 | addDetector(id2, detector2, loader2);
|
6072 | }
|
6073 | };
|
6074 | const loadRegisteredDiagrams = async () => {
|
6075 | log$1.debug(`Loading registered diagrams`);
|
6076 | const results = await Promise.allSettled(
|
6077 | Object.entries(detectors).map(async ([key, { detector: detector2, loader: loader2 }]) => {
|
6078 | if (loader2) {
|
6079 | try {
|
6080 | getDiagram(key);
|
6081 | } catch (error) {
|
6082 | try {
|
6083 | const { diagram: diagram2, id: id2 } = await loader2();
|
6084 | registerDiagram(id2, diagram2, detector2);
|
6085 | } catch (err) {
|
6086 | log$1.error(`Failed to load external diagram with key ${key}. Removing from detectors.`);
|
6087 | delete detectors[key];
|
6088 | throw err;
|
6089 | }
|
6090 | }
|
6091 | }
|
6092 | })
|
6093 | );
|
6094 | const failed = results.filter((result) => result.status === "rejected");
|
6095 | if (failed.length > 0) {
|
6096 | log$1.error(`Failed to load ${failed.length} external diagrams`);
|
6097 | for (const res of failed) {
|
6098 | log$1.error(res);
|
6099 | }
|
6100 | throw new Error(`Failed to load ${failed.length} external diagrams`);
|
6101 | }
|
6102 | };
|
6103 | const addDetector = (key, detector2, loader2) => {
|
6104 | if (detectors[key]) {
|
6105 | log$1.error(`Detector with key ${key} already exists`);
|
6106 | } else {
|
6107 | detectors[key] = { detector: detector2, loader: loader2 };
|
6108 | }
|
6109 | log$1.debug(`Detector with key ${key} added${loader2 ? " with loader" : ""}`);
|
6110 | };
|
6111 | const getDiagramLoader = (key) => {
|
6112 | return detectors[key].loader;
|
6113 | };
|
6114 | const d3CurveTypes = {
|
6115 | curveBasis,
|
6116 | curveBasisClosed,
|
6117 | curveBasisOpen,
|
6118 | curveBumpX,
|
6119 | curveBumpY,
|
6120 | curveBundle,
|
6121 | curveCardinalClosed,
|
6122 | curveCardinalOpen,
|
6123 | curveCardinal,
|
6124 | curveCatmullRomClosed,
|
6125 | curveCatmullRomOpen,
|
6126 | curveCatmullRom,
|
6127 | curveLinear,
|
6128 | curveLinearClosed,
|
6129 | curveMonotoneX,
|
6130 | curveMonotoneY,
|
6131 | curveNatural,
|
6132 | curveStep,
|
6133 | curveStepAfter,
|
6134 | curveStepBefore
|
6135 | };
|
6136 | const directive = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
6137 | const directiveWithoutOpen = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
6138 | const detectInit = function(text, config2) {
|
6139 | const inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/);
|
6140 | let results = {};
|
6141 | if (Array.isArray(inits)) {
|
6142 | const args = inits.map((init2) => init2.args);
|
6143 | directiveSanitizer(args);
|
6144 | results = assignWithDepth$1(results, [...args]);
|
6145 | } else {
|
6146 | results = inits.args;
|
6147 | }
|
6148 | if (results) {
|
6149 | let type2 = detectType(text, config2);
|
6150 | ["config"].forEach((prop) => {
|
6151 | if (results[prop] !== void 0) {
|
6152 | if (type2 === "flowchart-v2") {
|
6153 | type2 = "flowchart";
|
6154 | }
|
6155 | results[type2] = results[prop];
|
6156 | delete results[prop];
|
6157 | }
|
6158 | });
|
6159 | }
|
6160 | return results;
|
6161 | };
|
6162 | const detectDirective = function(text, type2 = null) {
|
6163 | try {
|
6164 | const commentWithoutDirectives = new RegExp(
|
6165 | `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*
|
6166 | `,
|
6167 | "ig"
|
6168 | );
|
6169 | text = text.trim().replace(commentWithoutDirectives, "").replace(/'/gm, '"');
|
6170 | log$1.debug(
|
6171 | `Detecting diagram directive${type2 !== null ? " type:" + type2 : ""} based on the text:${text}`
|
6172 | );
|
6173 | let match;
|
6174 | const result = [];
|
6175 | while ((match = directive.exec(text)) !== null) {
|
6176 | if (match.index === directive.lastIndex) {
|
6177 | directive.lastIndex++;
|
6178 | }
|
6179 | if (match && !type2 || type2 && match[1] && match[1].match(type2) || type2 && match[2] && match[2].match(type2)) {
|
6180 | const type22 = match[1] ? match[1] : match[2];
|
6181 | const args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null;
|
6182 | result.push({ type: type22, args });
|
6183 | }
|
6184 | }
|
6185 | if (result.length === 0) {
|
6186 | result.push({ type: text, args: null });
|
6187 | }
|
6188 | return result.length === 1 ? result[0] : result;
|
6189 | } catch (error) {
|
6190 | log$1.error(
|
6191 | `ERROR: ${error.message} - Unable to parse directive
|
6192 | ${type2 !== null ? " type:" + type2 : ""} based on the text:${text}`
|
6193 | );
|
6194 | return { type: null, args: null };
|
6195 | }
|
6196 | };
|
6197 | const isSubstringInArray = function(str2, arr) {
|
6198 | for (const [i, element] of arr.entries()) {
|
6199 | if (element.match(str2)) {
|
6200 | return i;
|
6201 | }
|
6202 | }
|
6203 | return -1;
|
6204 | };
|
6205 | function interpolateToCurve(interpolate, defaultCurve) {
|
6206 | if (!interpolate) {
|
6207 | return defaultCurve;
|
6208 | }
|
6209 | const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;
|
6210 | return d3CurveTypes[curveName] || defaultCurve;
|
6211 | }
|
6212 | function formatUrl(linkStr, config2) {
|
6213 | const url = linkStr.trim();
|
6214 | if (url) {
|
6215 | if (config2.securityLevel !== "loose") {
|
6216 | return sanitizeUrl(url);
|
6217 | }
|
6218 | return url;
|
6219 | }
|
6220 | }
|
6221 | const runFunc = (functionName, ...params) => {
|
6222 | const arrPaths = functionName.split(".");
|
6223 | const len = arrPaths.length - 1;
|
6224 | const fnName = arrPaths[len];
|
6225 | let obj = window;
|
6226 | for (let i = 0; i < len; i++) {
|
6227 | obj = obj[arrPaths[i]];
|
6228 | if (!obj) {
|
6229 | return;
|
6230 | }
|
6231 | }
|
6232 | obj[fnName](...params);
|
6233 | };
|
6234 | function distance(p1, p2) {
|
6235 | return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0;
|
6236 | }
|
6237 | function traverseEdge(points) {
|
6238 | let prevPoint;
|
6239 | let totalDistance = 0;
|
6240 | points.forEach((point) => {
|
6241 | totalDistance += distance(point, prevPoint);
|
6242 | prevPoint = point;
|
6243 | });
|
6244 | let remainingDistance = totalDistance / 2;
|
6245 | let center = void 0;
|
6246 | prevPoint = void 0;
|
6247 | points.forEach((point) => {
|
6248 | if (prevPoint && !center) {
|
6249 | const vectorDistance = distance(point, prevPoint);
|
6250 | if (vectorDistance < remainingDistance) {
|
6251 | remainingDistance -= vectorDistance;
|
6252 | } else {
|
6253 | const distanceRatio = remainingDistance / vectorDistance;
|
6254 | if (distanceRatio <= 0) {
|
6255 | center = prevPoint;
|
6256 | }
|
6257 | if (distanceRatio >= 1) {
|
6258 | center = { x: point.x, y: point.y };
|
6259 | }
|
6260 | if (distanceRatio > 0 && distanceRatio < 1) {
|
6261 | center = {
|
6262 | x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,
|
6263 | y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y
|
6264 | };
|
6265 | }
|
6266 | }
|
6267 | }
|
6268 | prevPoint = point;
|
6269 | });
|
6270 | return center;
|
6271 | }
|
6272 | function calcLabelPosition(points) {
|
6273 | if (points.length === 1) {
|
6274 | return points[0];
|
6275 | }
|
6276 | return traverseEdge(points);
|
6277 | }
|
6278 | const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => {
|
6279 | let prevPoint;
|
6280 | log$1.info(`our points ${JSON.stringify(points)}`);
|
6281 | if (points[0] !== initialPosition) {
|
6282 | points = points.reverse();
|
6283 | }
|
6284 | const distanceToCardinalityPoint = 25;
|
6285 | let remainingDistance = distanceToCardinalityPoint;
|
6286 | let center;
|
6287 | prevPoint = void 0;
|
6288 | points.forEach((point) => {
|
6289 | if (prevPoint && !center) {
|
6290 | const vectorDistance = distance(point, prevPoint);
|
6291 | if (vectorDistance < remainingDistance) {
|
6292 | remainingDistance -= vectorDistance;
|
6293 | } else {
|
6294 | const distanceRatio = remainingDistance / vectorDistance;
|
6295 | if (distanceRatio <= 0) {
|
6296 | center = prevPoint;
|
6297 | }
|
6298 | if (distanceRatio >= 1) {
|
6299 | center = { x: point.x, y: point.y };
|
6300 | }
|
6301 | if (distanceRatio > 0 && distanceRatio < 1) {
|
6302 | center = {
|
6303 | x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,
|
6304 | y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y
|
6305 | };
|
6306 | }
|
6307 | }
|
6308 | }
|
6309 | prevPoint = point;
|
6310 | });
|
6311 | const d = isRelationTypePresent ? 10 : 5;
|
6312 | const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
|
6313 | const cardinalityPosition = { x: 0, y: 0 };
|
6314 | cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
|
6315 | cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
|
6316 | return cardinalityPosition;
|
6317 | };
|
6318 | function calcTerminalLabelPosition(terminalMarkerSize, position, _points) {
|
6319 | let points = JSON.parse(JSON.stringify(_points));
|
6320 | let prevPoint;
|
6321 | log$1.info("our points", points);
|
6322 | if (position !== "start_left" && position !== "start_right") {
|
6323 | points = points.reverse();
|
6324 | }
|
6325 | points.forEach((point) => {
|
6326 | prevPoint = point;
|
6327 | });
|
6328 | const distanceToCardinalityPoint = 25 + terminalMarkerSize;
|
6329 | let remainingDistance = distanceToCardinalityPoint;
|
6330 | let center;
|
6331 | prevPoint = void 0;
|
6332 | points.forEach((point) => {
|
6333 | if (prevPoint && !center) {
|
6334 | const vectorDistance = distance(point, prevPoint);
|
6335 | if (vectorDistance < remainingDistance) {
|
6336 | remainingDistance -= vectorDistance;
|
6337 | } else {
|
6338 | const distanceRatio = remainingDistance / vectorDistance;
|
6339 | if (distanceRatio <= 0) {
|
6340 | center = prevPoint;
|
6341 | }
|
6342 | if (distanceRatio >= 1) {
|
6343 | center = { x: point.x, y: point.y };
|
6344 | }
|
6345 | if (distanceRatio > 0 && distanceRatio < 1) {
|
6346 | center = {
|
6347 | x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,
|
6348 | y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y
|
6349 | };
|
6350 | }
|
6351 | }
|
6352 | }
|
6353 | prevPoint = point;
|
6354 | });
|
6355 | const d = 10 + terminalMarkerSize * 0.5;
|
6356 | const angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
|
6357 | const cardinalityPosition = { x: 0, y: 0 };
|
6358 | cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
|
6359 | cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
|
6360 | if (position === "start_left") {
|
6361 | cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2;
|
6362 | cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2;
|
6363 | }
|
6364 | if (position === "end_right") {
|
6365 | cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5;
|
6366 | cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5;
|
6367 | }
|
6368 | if (position === "end_left") {
|
6369 | cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5;
|
6370 | cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5;
|
6371 | }
|
6372 | return cardinalityPosition;
|
6373 | }
|
6374 | function getStylesFromArray(arr) {
|
6375 | let style = "";
|
6376 | let labelStyle = "";
|
6377 | for (const element of arr) {
|
6378 | if (element !== void 0) {
|
6379 | if (element.startsWith("color:") || element.startsWith("text-align:")) {
|
6380 | labelStyle = labelStyle + element + ";";
|
6381 | } else {
|
6382 | style = style + element + ";";
|
6383 | }
|
6384 | }
|
6385 | }
|
6386 | return { style, labelStyle };
|
6387 | }
|
6388 | let cnt = 0;
|
6389 | const generateId = () => {
|
6390 | cnt++;
|
6391 | return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
|
6392 | };
|
6393 | function makeid(length) {
|
6394 | let result = "";
|
6395 | const characters = "0123456789abcdef";
|
6396 | const charactersLength = characters.length;
|
6397 | for (let i = 0; i < length; i++) {
|
6398 | result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
6399 | }
|
6400 | return result;
|
6401 | }
|
6402 | const random = (options) => {
|
6403 | return makeid(options.length);
|
6404 | };
|
6405 | const getTextObj = function() {
|
6406 | return {
|
6407 | x: 0,
|
6408 | y: 0,
|
6409 | fill: void 0,
|
6410 | anchor: "start",
|
6411 | style: "#666",
|
6412 | width: 100,
|
6413 | height: 100,
|
6414 | textMargin: 0,
|
6415 | rx: 0,
|
6416 | ry: 0,
|
6417 | valign: void 0
|
6418 | };
|
6419 | };
|
6420 | const drawSimpleText = function(elem, textData) {
|
6421 | const nText = textData.text.replace(common$1.lineBreakRegex, " ");
|
6422 | const [, _fontSizePx] = parseFontSize(textData.fontSize);
|
6423 | const textElem = elem.append("text");
|
6424 | textElem.attr("x", textData.x);
|
6425 | textElem.attr("y", textData.y);
|
6426 | textElem.style("text-anchor", textData.anchor);
|
6427 | textElem.style("font-family", textData.fontFamily);
|
6428 | textElem.style("font-size", _fontSizePx);
|
6429 | textElem.style("font-weight", textData.fontWeight);
|
6430 | textElem.attr("fill", textData.fill);
|
6431 | if (textData.class !== void 0) {
|
6432 | textElem.attr("class", textData.class);
|
6433 | }
|
6434 | const span = textElem.append("tspan");
|
6435 | span.attr("x", textData.x + textData.textMargin * 2);
|
6436 | span.attr("fill", textData.fill);
|
6437 | span.text(nText);
|
6438 | return textElem;
|
6439 | };
|
6440 | const wrapLabel = memoize(
|
6441 | (label, maxWidth, config2) => {
|
6442 | if (!label) {
|
6443 | return label;
|
6444 | }
|
6445 | config2 = Object.assign(
|
6446 | { fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "<br/>" },
|
6447 | config2
|
6448 | );
|
6449 | if (common$1.lineBreakRegex.test(label)) {
|
6450 | return label;
|
6451 | }
|
6452 | const words = label.split(" ");
|
6453 | const completedLines = [];
|
6454 | let nextLine = "";
|
6455 | words.forEach((word, index) => {
|
6456 | const wordLength = calculateTextWidth(`${word} `, config2);
|
6457 | const nextLineLength = calculateTextWidth(nextLine, config2);
|
6458 | if (wordLength > maxWidth) {
|
6459 | const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, "-", config2);
|
6460 | completedLines.push(nextLine, ...hyphenatedStrings);
|
6461 | nextLine = remainingWord;
|
6462 | } else if (nextLineLength + wordLength >= maxWidth) {
|
6463 | completedLines.push(nextLine);
|
6464 | nextLine = word;
|
6465 | } else {
|
6466 | nextLine = [nextLine, word].filter(Boolean).join(" ");
|
6467 | }
|
6468 | const currentWord = index + 1;
|
6469 | const isLastWord = currentWord === words.length;
|
6470 | if (isLastWord) {
|
6471 | completedLines.push(nextLine);
|
6472 | }
|
6473 | });
|
6474 | return completedLines.filter((line) => line !== "").join(config2.joinWith);
|
6475 | },
|
6476 | (label, maxWidth, config2) => `${label}${maxWidth}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}${config2.joinWith}`
|
6477 | );
|
6478 | const breakString = memoize(
|
6479 | (word, maxWidth, hyphenCharacter = "-", config2) => {
|
6480 | config2 = Object.assign(
|
6481 | { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 },
|
6482 | config2
|
6483 | );
|
6484 | const characters = [...word];
|
6485 | const lines = [];
|
6486 | let currentLine = "";
|
6487 | characters.forEach((character, index) => {
|
6488 | const nextLine = `${currentLine}${character}`;
|
6489 | const lineWidth = calculateTextWidth(nextLine, config2);
|
6490 | if (lineWidth >= maxWidth) {
|
6491 | const currentCharacter = index + 1;
|
6492 | const isLastLine = characters.length === currentCharacter;
|
6493 | const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`;
|
6494 | lines.push(isLastLine ? nextLine : hyphenatedNextLine);
|
6495 | currentLine = "";
|
6496 | } else {
|
6497 | currentLine = nextLine;
|
6498 | }
|
6499 | });
|
6500 | return { hyphenatedStrings: lines, remainingWord: currentLine };
|
6501 | },
|
6502 | (word, maxWidth, hyphenCharacter = "-", config2) => `${word}${maxWidth}${hyphenCharacter}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}`
|
6503 | );
|
6504 | function calculateTextHeight(text, config2) {
|
6505 | config2 = Object.assign(
|
6506 | { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 15 },
|
6507 | config2
|
6508 | );
|
6509 | return calculateTextDimensions(text, config2).height;
|
6510 | }
|
6511 | function calculateTextWidth(text, config2) {
|
6512 | config2 = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, config2);
|
6513 | return calculateTextDimensions(text, config2).width;
|
6514 | }
|
6515 | const calculateTextDimensions = memoize(
|
6516 | (text, config2) => {
|
6517 | config2 = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, config2);
|
6518 | const { fontSize, fontFamily, fontWeight } = config2;
|
6519 | if (!text) {
|
6520 | return { width: 0, height: 0 };
|
6521 | }
|
6522 | const [, _fontSizePx] = parseFontSize(fontSize);
|
6523 | const fontFamilies = ["sans-serif", fontFamily];
|
6524 | const lines = text.split(common$1.lineBreakRegex);
|
6525 | const dims = [];
|
6526 | const body = select("body");
|
6527 | if (!body.remove) {
|
6528 | return { width: 0, height: 0, lineHeight: 0 };
|
6529 | }
|
6530 | const g = body.append("svg");
|
6531 | for (const fontFamily2 of fontFamilies) {
|
6532 | let cheight = 0;
|
6533 | const dim = { width: 0, height: 0, lineHeight: 0 };
|
6534 | for (const line of lines) {
|
6535 | const textObj = getTextObj();
|
6536 | textObj.text = line;
|
6537 | const textElem = drawSimpleText(g, textObj).style("font-size", _fontSizePx).style("font-weight", fontWeight).style("font-family", fontFamily2);
|
6538 | const bBox = (textElem._groups || textElem)[0][0].getBBox();
|
6539 | if (bBox.width === 0 && bBox.height === 0) {
|
6540 | throw new Error("svg element not in render tree");
|
6541 | }
|
6542 | dim.width = Math.round(Math.max(dim.width, bBox.width));
|
6543 | cheight = Math.round(bBox.height);
|
6544 | dim.height += cheight;
|
6545 | dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight));
|
6546 | }
|
6547 | dims.push(dim);
|
6548 | }
|
6549 | g.remove();
|
6550 | const index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1;
|
6551 | return dims[index];
|
6552 | },
|
6553 | (text, config2) => `${text}${config2.fontSize}${config2.fontWeight}${config2.fontFamily}`
|
6554 | );
|
6555 | const initIdGenerator = class iterator {
|
6556 | constructor(deterministic, seed) {
|
6557 | this.deterministic = deterministic;
|
6558 | this.seed = seed;
|
6559 | this.count = seed ? seed.length : 0;
|
6560 | }
|
6561 | next() {
|
6562 | if (!this.deterministic) {
|
6563 | return Date.now();
|
6564 | }
|
6565 | return this.count++;
|
6566 | }
|
6567 | };
|
6568 | let decoder;
|
6569 | const entityDecode = function(html) {
|
6570 | decoder = decoder || document.createElement("div");
|
6571 | html = escape(html).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";");
|
6572 | decoder.innerHTML = html;
|
6573 | return unescape(decoder.textContent);
|
6574 | };
|
6575 | const directiveSanitizer = (args) => {
|
6576 | log$1.debug("directiveSanitizer called with", args);
|
6577 | if (typeof args === "object") {
|
6578 | if (args.length) {
|
6579 | args.forEach((arg) => directiveSanitizer(arg));
|
6580 | } else {
|
6581 | Object.keys(args).forEach((key) => {
|
6582 | log$1.debug("Checking key", key);
|
6583 | if (key.startsWith("__")) {
|
6584 | log$1.debug("sanitize deleting __ option", key);
|
6585 | delete args[key];
|
6586 | }
|
6587 | if (key.includes("proto")) {
|
6588 | log$1.debug("sanitize deleting proto option", key);
|
6589 | delete args[key];
|
6590 | }
|
6591 | if (key.includes("constr")) {
|
6592 | log$1.debug("sanitize deleting constr option", key);
|
6593 | delete args[key];
|
6594 | }
|
6595 | if (key.includes("themeCSS")) {
|
6596 | log$1.debug("sanitizing themeCss option");
|
6597 | args[key] = sanitizeCss(args[key]);
|
6598 | }
|
6599 | if (key.includes("fontFamily")) {
|
6600 | log$1.debug("sanitizing fontFamily option");
|
6601 | args[key] = sanitizeCss(args[key]);
|
6602 | }
|
6603 | if (key.includes("altFontFamily")) {
|
6604 | log$1.debug("sanitizing altFontFamily option");
|
6605 | args[key] = sanitizeCss(args[key]);
|
6606 | }
|
6607 | if (!configKeys.includes(key)) {
|
6608 | log$1.debug("sanitize deleting option", key);
|
6609 | delete args[key];
|
6610 | } else {
|
6611 | if (typeof args[key] === "object") {
|
6612 | log$1.debug("sanitize deleting object", key);
|
6613 | directiveSanitizer(args[key]);
|
6614 | }
|
6615 | }
|
6616 | });
|
6617 | }
|
6618 | }
|
6619 | if (args.themeVariables) {
|
6620 | const kArr = Object.keys(args.themeVariables);
|
6621 | for (const k of kArr) {
|
6622 | const val = args.themeVariables[k];
|
6623 | if (val && val.match && !val.match(/^[\d "#%(),.;A-Za-z]+$/)) {
|
6624 | args.themeVariables[k] = "";
|
6625 | }
|
6626 | }
|
6627 | }
|
6628 | log$1.debug("After sanitization", args);
|
6629 | };
|
6630 | const sanitizeCss = (str2) => {
|
6631 | let startCnt = 0;
|
6632 | let endCnt = 0;
|
6633 | for (const element of str2) {
|
6634 | if (startCnt < endCnt) {
|
6635 | return "{ /* ERROR: Unbalanced CSS */ }";
|
6636 | }
|
6637 | if (element === "{") {
|
6638 | startCnt++;
|
6639 | } else if (element === "}") {
|
6640 | endCnt++;
|
6641 | }
|
6642 | }
|
6643 | if (startCnt !== endCnt) {
|
6644 | return "{ /* ERROR: Unbalanced CSS */ }";
|
6645 | }
|
6646 | return str2;
|
6647 | };
|
6648 | function isDetailedError(error) {
|
6649 | return "str" in error;
|
6650 | }
|
6651 | function getErrorMessage(error) {
|
6652 | if (error instanceof Error) {
|
6653 | return error.message;
|
6654 | }
|
6655 | return String(error);
|
6656 | }
|
6657 | const insertTitle = (parent, cssClass, titleTopMargin, title2) => {
|
6658 | if (!title2) {
|
6659 | return;
|
6660 | }
|
6661 | const bounds = parent.node().getBBox();
|
6662 | parent.append("text").text(title2).attr("x", bounds.x + bounds.width / 2).attr("y", -titleTopMargin).attr("class", cssClass);
|
6663 | };
|
6664 | const parseFontSize = (fontSize) => {
|
6665 | if (typeof fontSize === "number") {
|
6666 | return [fontSize, fontSize + "px"];
|
6667 | }
|
6668 | const fontSizeNumber = parseInt(fontSize, 10);
|
6669 | if (Number.isNaN(fontSizeNumber)) {
|
6670 | return [void 0, void 0];
|
6671 | } else if (fontSize === String(fontSizeNumber)) {
|
6672 | return [fontSizeNumber, fontSize + "px"];
|
6673 | } else {
|
6674 | return [fontSizeNumber, fontSize];
|
6675 | }
|
6676 | };
|
6677 | const utils = {
|
6678 | assignWithDepth: assignWithDepth$1,
|
6679 | wrapLabel,
|
6680 | calculateTextHeight,
|
6681 | calculateTextWidth,
|
6682 | calculateTextDimensions,
|
6683 | detectInit,
|
6684 | detectDirective,
|
6685 | isSubstringInArray,
|
6686 | interpolateToCurve,
|
6687 | calcLabelPosition,
|
6688 | calcCardinalityPosition,
|
6689 | calcTerminalLabelPosition,
|
6690 | formatUrl,
|
6691 | getStylesFromArray,
|
6692 | generateId,
|
6693 | random,
|
6694 | runFunc,
|
6695 | entityDecode,
|
6696 | initIdGenerator,
|
6697 | directiveSanitizer,
|
6698 | sanitizeCss,
|
6699 | insertTitle,
|
6700 | parseFontSize
|
6701 | };
|
6702 | const version = "10.2.0";
|
6703 | const id$i = "c4";
|
6704 | const detector$i = (txt) => {
|
6705 | return txt.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/) !== null;
|
6706 | };
|
6707 | const loader$i = async () => {
|
6708 | const { diagram: diagram2 } = await import("./c4Diagram-4a1de0c4.js");
|
6709 | return { id: id$i, diagram: diagram2 };
|
6710 | };
|
6711 | const plugin$i = {
|
6712 | id: id$i,
|
6713 | detector: detector$i,
|
6714 | loader: loader$i
|
6715 | };
|
6716 | const c4 = plugin$i;
|
6717 | const id$h = "flowchart";
|
6718 | const detector$h = (txt, config2) => {
|
6719 | var _a, _b;
|
6720 | if (((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper" || ((_b = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _b.defaultRenderer) === "elk") {
|
6721 | return false;
|
6722 | }
|
6723 | return txt.match(/^\s*graph/) !== null;
|
6724 | };
|
6725 | const loader$h = async () => {
|
6726 | const { diagram: diagram2 } = await import("./flowDiagram-702318ad.js");
|
6727 | return { id: id$h, diagram: diagram2 };
|
6728 | };
|
6729 | const plugin$h = {
|
6730 | id: id$h,
|
6731 | detector: detector$h,
|
6732 | loader: loader$h
|
6733 | };
|
6734 | const flowchart = plugin$h;
|
6735 | const id$g = "flowchart-v2";
|
6736 | const detector$g = (txt, config2) => {
|
6737 | var _a, _b, _c;
|
6738 | if (((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "dagre-d3" || ((_b = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _b.defaultRenderer) === "elk") {
|
6739 | return false;
|
6740 | }
|
6741 | if (txt.match(/^\s*graph/) !== null && ((_c = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _c.defaultRenderer) === "dagre-wrapper") {
|
6742 | return true;
|
6743 | }
|
6744 | return txt.match(/^\s*flowchart/) !== null;
|
6745 | };
|
6746 | const loader$g = async () => {
|
6747 | const { diagram: diagram2 } = await import("./flowDiagram-v2-8716a26e.js");
|
6748 | return { id: id$g, diagram: diagram2 };
|
6749 | };
|
6750 | const plugin$g = {
|
6751 | id: id$g,
|
6752 | detector: detector$g,
|
6753 | loader: loader$g
|
6754 | };
|
6755 | const flowchartV2 = plugin$g;
|
6756 | const id$f = "er";
|
6757 | const detector$f = (txt) => {
|
6758 | return txt.match(/^\s*erDiagram/) !== null;
|
6759 | };
|
6760 | const loader$f = async () => {
|
6761 | const { diagram: diagram2 } = await import("./erDiagram-5e907343.js");
|
6762 | return { id: id$f, diagram: diagram2 };
|
6763 | };
|
6764 | const plugin$f = {
|
6765 | id: id$f,
|
6766 | detector: detector$f,
|
6767 | loader: loader$f
|
6768 | };
|
6769 | const er = plugin$f;
|
6770 | const id$e = "gitGraph";
|
6771 | const detector$e = (txt) => {
|
6772 | return txt.match(/^\s*gitGraph/) !== null;
|
6773 | };
|
6774 | const loader$e = async () => {
|
6775 | const { diagram: diagram2 } = await import("./gitGraphDiagram-127727f3.js");
|
6776 | return { id: id$e, diagram: diagram2 };
|
6777 | };
|
6778 | const plugin$e = {
|
6779 | id: id$e,
|
6780 | detector: detector$e,
|
6781 | loader: loader$e
|
6782 | };
|
6783 | const git = plugin$e;
|
6784 | const id$d = "gantt";
|
6785 | const detector$d = (txt) => {
|
6786 | return txt.match(/^\s*gantt/) !== null;
|
6787 | };
|
6788 | const loader$d = async () => {
|
6789 | const { diagram: diagram2 } = await import("./ganttDiagram-3bc7fa50.js");
|
6790 | return { id: id$d, diagram: diagram2 };
|
6791 | };
|
6792 | const plugin$d = {
|
6793 | id: id$d,
|
6794 | detector: detector$d,
|
6795 | loader: loader$d
|
6796 | };
|
6797 | const gantt = plugin$d;
|
6798 | const id$c = "info";
|
6799 | const detector$c = (txt) => {
|
6800 | return txt.match(/^\s*info/) !== null;
|
6801 | };
|
6802 | const loader$c = async () => {
|
6803 | const { diagram: diagram2 } = await import("./infoDiagram-4374b389.js");
|
6804 | return { id: id$c, diagram: diagram2 };
|
6805 | };
|
6806 | const plugin$c = {
|
6807 | id: id$c,
|
6808 | detector: detector$c,
|
6809 | loader: loader$c
|
6810 | };
|
6811 | const info = plugin$c;
|
6812 | const id$b = "pie";
|
6813 | const detector$b = (txt) => {
|
6814 | return txt.match(/^\s*pie/) !== null;
|
6815 | };
|
6816 | const loader$b = async () => {
|
6817 | const { diagram: diagram2 } = await import("./pieDiagram-f5e05a25.js");
|
6818 | return { id: id$b, diagram: diagram2 };
|
6819 | };
|
6820 | const plugin$b = {
|
6821 | id: id$b,
|
6822 | detector: detector$b,
|
6823 | loader: loader$b
|
6824 | };
|
6825 | const pie = plugin$b;
|
6826 | const id$a = "quadrantChart";
|
6827 | const detector$a = (txt) => {
|
6828 | return txt.match(/^\s*quadrantChart/) !== null;
|
6829 | };
|
6830 | const loader$a = async () => {
|
6831 | const { diagram: diagram2 } = await import("./quadrantDiagram-652558cb.js");
|
6832 | return { id: id$a, diagram: diagram2 };
|
6833 | };
|
6834 | const plugin$a = {
|
6835 | id: id$a,
|
6836 | detector: detector$a,
|
6837 | loader: loader$a
|
6838 | };
|
6839 | const quadrantChart = plugin$a;
|
6840 | const id$9 = "requirement";
|
6841 | const detector$9 = (txt) => {
|
6842 | return txt.match(/^\s*requirement(Diagram)?/) !== null;
|
6843 | };
|
6844 | const loader$9 = async () => {
|
6845 | const { diagram: diagram2 } = await import("./requirementDiagram-730b4d6e.js");
|
6846 | return { id: id$9, diagram: diagram2 };
|
6847 | };
|
6848 | const plugin$9 = {
|
6849 | id: id$9,
|
6850 | detector: detector$9,
|
6851 | loader: loader$9
|
6852 | };
|
6853 | const requirement = plugin$9;
|
6854 | const id$8 = "sequence";
|
6855 | const detector$8 = (txt) => {
|
6856 | return txt.match(/^\s*sequenceDiagram/) !== null;
|
6857 | };
|
6858 | const loader$8 = async () => {
|
6859 | const { diagram: diagram2 } = await import("./sequenceDiagram-edd7e28f.js");
|
6860 | return { id: id$8, diagram: diagram2 };
|
6861 | };
|
6862 | const plugin$8 = {
|
6863 | id: id$8,
|
6864 | detector: detector$8,
|
6865 | loader: loader$8
|
6866 | };
|
6867 | const sequence = plugin$8;
|
6868 | const id$7 = "class";
|
6869 | const detector$7 = (txt, config2) => {
|
6870 | var _a;
|
6871 | if (((_a = config2 == null ? void 0 : config2.class) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") {
|
6872 | return false;
|
6873 | }
|
6874 | return txt.match(/^\s*classDiagram/) !== null;
|
6875 | };
|
6876 | const loader$7 = async () => {
|
6877 | const { diagram: diagram2 } = await import("./classDiagram-62cfb02d.js");
|
6878 | return { id: id$7, diagram: diagram2 };
|
6879 | };
|
6880 | const plugin$7 = {
|
6881 | id: id$7,
|
6882 | detector: detector$7,
|
6883 | loader: loader$7
|
6884 | };
|
6885 | const classDiagram = plugin$7;
|
6886 | const id$6 = "classDiagram";
|
6887 | const detector$6 = (txt, config2) => {
|
6888 | var _a;
|
6889 | if (txt.match(/^\s*classDiagram/) !== null && ((_a = config2 == null ? void 0 : config2.class) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") {
|
6890 | return true;
|
6891 | }
|
6892 | return txt.match(/^\s*classDiagram-v2/) !== null;
|
6893 | };
|
6894 | const loader$6 = async () => {
|
6895 | const { diagram: diagram2 } = await import("./classDiagram-v2-c1dfb0e0.js");
|
6896 | return { id: id$6, diagram: diagram2 };
|
6897 | };
|
6898 | const plugin$6 = {
|
6899 | id: id$6,
|
6900 | detector: detector$6,
|
6901 | loader: loader$6
|
6902 | };
|
6903 | const classDiagramV2 = plugin$6;
|
6904 | const id$5 = "state";
|
6905 | const detector$5 = (txt, config2) => {
|
6906 | var _a;
|
6907 | if (((_a = config2 == null ? void 0 : config2.state) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") {
|
6908 | return false;
|
6909 | }
|
6910 | return txt.match(/^\s*stateDiagram/) !== null;
|
6911 | };
|
6912 | const loader$5 = async () => {
|
6913 | const { diagram: diagram2 } = await import("./stateDiagram-d766d74d.js");
|
6914 | return { id: id$5, diagram: diagram2 };
|
6915 | };
|
6916 | const plugin$5 = {
|
6917 | id: id$5,
|
6918 | detector: detector$5,
|
6919 | loader: loader$5
|
6920 | };
|
6921 | const state = plugin$5;
|
6922 | const id$4 = "stateDiagram";
|
6923 | const detector$4 = (text, config2) => {
|
6924 | var _a, _b;
|
6925 | if (text.match(/^\s*stateDiagram-v2/) !== null) {
|
6926 | return true;
|
6927 | }
|
6928 | if (text.match(/^\s*stateDiagram/) && ((_a = config2 == null ? void 0 : config2.state) == null ? void 0 : _a.defaultRenderer) === "dagre-wrapper") {
|
6929 | return true;
|
6930 | }
|
6931 | if (text.match(/^\s*stateDiagram/) && ((_b = config2 == null ? void 0 : config2.state) == null ? void 0 : _b.defaultRenderer) === "dagre-wrapper") {
|
6932 | return true;
|
6933 | }
|
6934 | return false;
|
6935 | };
|
6936 | const loader$4 = async () => {
|
6937 | const { diagram: diagram2 } = await import("./stateDiagram-v2-978d1189.js");
|
6938 | return { id: id$4, diagram: diagram2 };
|
6939 | };
|
6940 | const plugin$4 = {
|
6941 | id: id$4,
|
6942 | detector: detector$4,
|
6943 | loader: loader$4
|
6944 | };
|
6945 | const stateV2 = plugin$4;
|
6946 | const id$3 = "journey";
|
6947 | const detector$3 = (txt) => {
|
6948 | return txt.match(/^\s*journey/) !== null;
|
6949 | };
|
6950 | const loader$3 = async () => {
|
6951 | const { diagram: diagram2 } = await import("./journeyDiagram-ccf0174b.js");
|
6952 | return { id: id$3, diagram: diagram2 };
|
6953 | };
|
6954 | const plugin$3 = {
|
6955 | id: id$3,
|
6956 | detector: detector$3,
|
6957 | loader: loader$3
|
6958 | };
|
6959 | const journey = plugin$3;
|
6960 | const getStyles = () => ``;
|
6961 | const styles = getStyles;
|
6962 | const setConf = function() {
|
6963 | };
|
6964 | const draw = (_text, id2, mermaidVersion) => {
|
6965 | try {
|
6966 | log$1.debug("Renering svg for syntax error\n");
|
6967 | const svg = select("#" + id2);
|
6968 | const g = svg.append("g");
|
6969 | g.append("path").attr("class", "error-icon").attr(
|
6970 | "d",
|
6971 | "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"
|
6972 | );
|
6973 | g.append("path").attr("class", "error-icon").attr(
|
6974 | "d",
|
6975 | "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"
|
6976 | );
|
6977 | g.append("path").attr("class", "error-icon").attr(
|
6978 | "d",
|
6979 | "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"
|
6980 | );
|
6981 | g.append("path").attr("class", "error-icon").attr(
|
6982 | "d",
|
6983 | "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"
|
6984 | );
|
6985 | g.append("path").attr("class", "error-icon").attr(
|
6986 | "d",
|
6987 | "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"
|
6988 | );
|
6989 | g.append("path").attr("class", "error-icon").attr(
|
6990 | "d",
|
6991 | "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"
|
6992 | );
|
6993 | g.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text");
|
6994 | g.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text("mermaid version " + mermaidVersion);
|
6995 | svg.attr("height", 100);
|
6996 | svg.attr("width", 500);
|
6997 | svg.attr("viewBox", "768 0 912 512");
|
6998 | } catch (e) {
|
6999 | log$1.error("Error while rendering info diagram");
|
7000 | log$1.error(getErrorMessage(e));
|
7001 | }
|
7002 | };
|
7003 | const errorRenderer = {
|
7004 | setConf,
|
7005 | draw
|
7006 | };
|
7007 | const diagram = {
|
7008 | db: {
|
7009 | clear: () => {
|
7010 | }
|
7011 | },
|
7012 | styles,
|
7013 | renderer: errorRenderer,
|
7014 | parser: {
|
7015 | parser: { yy: {} },
|
7016 | parse: () => {
|
7017 | }
|
7018 | },
|
7019 | init: () => {
|
7020 | }
|
7021 | };
|
7022 | const errorDiagram = diagram;
|
7023 | const id$2 = "flowchart-elk";
|
7024 | const detector$2 = (txt, config2) => {
|
7025 | var _a;
|
7026 | if (
|
7027 |
|
7028 | txt.match(/^\s*flowchart-elk/) ||
|
7029 | txt.match(/^\s*flowchart|graph/) && ((_a = config2 == null ? void 0 : config2.flowchart) == null ? void 0 : _a.defaultRenderer) === "elk"
|
7030 | ) {
|
7031 | return true;
|
7032 | }
|
7033 | return false;
|
7034 | };
|
7035 | const loader$2 = async () => {
|
7036 | const { diagram: diagram2 } = await import("./flowchart-elk-definition-206a7d68.js");
|
7037 | return { id: id$2, diagram: diagram2 };
|
7038 | };
|
7039 | const plugin$2 = {
|
7040 | id: id$2,
|
7041 | detector: detector$2,
|
7042 | loader: loader$2
|
7043 | };
|
7044 | const flowchartElk = plugin$2;
|
7045 | const id$1 = "timeline";
|
7046 | const detector$1 = (txt) => {
|
7047 | return txt.match(/^\s*timeline/) !== null;
|
7048 | };
|
7049 | const loader$1 = async () => {
|
7050 | const { diagram: diagram2 } = await import("./timeline-definition-d53f6d76.js");
|
7051 | return { id: id$1, diagram: diagram2 };
|
7052 | };
|
7053 | const plugin$1 = {
|
7054 | id: id$1,
|
7055 | detector: detector$1,
|
7056 | loader: loader$1
|
7057 | };
|
7058 | const timeline = plugin$1;
|
7059 | const id = "mindmap";
|
7060 | const detector = (txt) => {
|
7061 | return txt.match(/^\s*mindmap/) !== null;
|
7062 | };
|
7063 | const loader = async () => {
|
7064 | const { diagram: diagram2 } = await import("./mindmap-definition-74e4e806.js");
|
7065 | return { id, diagram: diagram2 };
|
7066 | };
|
7067 | const plugin = {
|
7068 | id,
|
7069 | detector,
|
7070 | loader
|
7071 | };
|
7072 | const mindmap = plugin;
|
7073 | let hasLoadedDiagrams = false;
|
7074 | const addDiagrams = () => {
|
7075 | if (hasLoadedDiagrams) {
|
7076 | return;
|
7077 | }
|
7078 | hasLoadedDiagrams = true;
|
7079 | registerDiagram("error", errorDiagram, (text) => {
|
7080 | return text.toLowerCase().trim() === "error";
|
7081 | });
|
7082 | registerDiagram(
|
7083 | "---",
|
7084 |
|
7085 | {
|
7086 | db: {
|
7087 | clear: () => {
|
7088 | }
|
7089 | },
|
7090 | styles: {},
|
7091 |
|
7092 | renderer: {},
|
7093 |
|
7094 | parser: {
|
7095 | parser: { yy: {} },
|
7096 | parse: () => {
|
7097 | throw new Error(
|
7098 | "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks"
|
7099 | );
|
7100 | }
|
7101 | },
|
7102 | init: () => null
|
7103 |
|
7104 | },
|
7105 | (text) => {
|
7106 | return text.toLowerCase().trimStart().startsWith("---");
|
7107 | }
|
7108 | );
|
7109 | registerLazyLoadedDiagrams(
|
7110 | c4,
|
7111 | classDiagramV2,
|
7112 | classDiagram,
|
7113 | er,
|
7114 | gantt,
|
7115 | info,
|
7116 | pie,
|
7117 | requirement,
|
7118 | sequence,
|
7119 | flowchartElk,
|
7120 | flowchartV2,
|
7121 | flowchart,
|
7122 | mindmap,
|
7123 | timeline,
|
7124 | git,
|
7125 | stateV2,
|
7126 | state,
|
7127 | journey,
|
7128 | quadrantChart
|
7129 | );
|
7130 | };
|
7131 | const cleanupComments = (text) => {
|
7132 | return text.trimStart().replace(/^\s*%%(?!{)[^\n]+\n?/gm, "");
|
7133 | };
|
7134 | class Diagram {
|
7135 | constructor(text) {
|
7136 | var _a, _b;
|
7137 | this.text = text;
|
7138 | this.type = "graph";
|
7139 | this.text += "\n";
|
7140 | const cnf = getConfig$1();
|
7141 | try {
|
7142 | this.type = detectType(text, cnf);
|
7143 | } catch (e) {
|
7144 | this.type = "error";
|
7145 | this.detectError = e;
|
7146 | }
|
7147 | const diagram2 = getDiagram(this.type);
|
7148 | log$1.debug("Type " + this.type);
|
7149 | this.db = diagram2.db;
|
7150 | (_b = (_a = this.db).clear) == null ? void 0 : _b.call(_a);
|
7151 | this.renderer = diagram2.renderer;
|
7152 | this.parser = diagram2.parser;
|
7153 | const originalParse = this.parser.parse.bind(this.parser);
|
7154 | this.parser.parse = (text2) => originalParse(cleanupComments(extractFrontMatter(text2, this.db)));
|
7155 | this.parser.parser.yy = this.db;
|
7156 | if (diagram2.init) {
|
7157 | diagram2.init(cnf);
|
7158 | log$1.info("Initialized diagram " + this.type, cnf);
|
7159 | }
|
7160 | this.parse();
|
7161 | }
|
7162 | parse() {
|
7163 | var _a, _b;
|
7164 | if (this.detectError) {
|
7165 | throw this.detectError;
|
7166 | }
|
7167 | (_b = (_a = this.db).clear) == null ? void 0 : _b.call(_a);
|
7168 | this.parser.parse(this.text);
|
7169 | }
|
7170 | async render(id2, version2) {
|
7171 | await this.renderer.draw(this.text, id2, version2, this);
|
7172 | }
|
7173 | getParser() {
|
7174 | return this.parser;
|
7175 | }
|
7176 | getType() {
|
7177 | return this.type;
|
7178 | }
|
7179 | }
|
7180 | const getDiagramFromText = async (text) => {
|
7181 | const type2 = detectType(text, getConfig$1());
|
7182 | try {
|
7183 | getDiagram(type2);
|
7184 | } catch (error) {
|
7185 | const loader2 = getDiagramLoader(type2);
|
7186 | if (!loader2) {
|
7187 | throw new UnknownDiagramError(`Diagram ${type2} not found.`);
|
7188 | }
|
7189 | const { id: id2, diagram: diagram2 } = await loader2();
|
7190 | registerDiagram(id2, diagram2);
|
7191 | }
|
7192 | return new Diagram(text);
|
7193 | };
|
7194 | let interactionFunctions = [];
|
7195 | const addFunction = (func) => {
|
7196 | interactionFunctions.push(func);
|
7197 | };
|
7198 | const attachFunctions = () => {
|
7199 | interactionFunctions.forEach((f) => {
|
7200 | f();
|
7201 | });
|
7202 | interactionFunctions = [];
|
7203 | };
|
7204 | const SVG_ROLE = "graphics-document document";
|
7205 | function setA11yDiagramInfo(svg, diagramType) {
|
7206 | svg.attr("role", SVG_ROLE);
|
7207 | if (!isEmpty(diagramType)) {
|
7208 | svg.attr("aria-roledescription", diagramType);
|
7209 | }
|
7210 | }
|
7211 | function addSVGa11yTitleDescription(svg, a11yTitle, a11yDesc, baseId) {
|
7212 | if (svg.insert === void 0) {
|
7213 | return;
|
7214 | }
|
7215 | if (a11yTitle || a11yDesc) {
|
7216 | if (a11yDesc) {
|
7217 | const descId = "chart-desc-" + baseId;
|
7218 | svg.attr("aria-describedby", descId);
|
7219 | svg.insert("desc", ":first-child").attr("id", descId).text(a11yDesc);
|
7220 | }
|
7221 | if (a11yTitle) {
|
7222 | const titleId = "chart-title-" + baseId;
|
7223 | svg.attr("aria-labelledby", titleId);
|
7224 | svg.insert("title", ":first-child").attr("id", titleId).text(a11yTitle);
|
7225 | }
|
7226 | } else {
|
7227 | return;
|
7228 | }
|
7229 | }
|
7230 | const CLASSDEF_DIAGRAMS = [
|
7231 | "graph",
|
7232 | "flowchart",
|
7233 | "flowchart-v2",
|
7234 | "flowchart-elk",
|
7235 | "stateDiagram",
|
7236 | "stateDiagram-v2"
|
7237 | ];
|
7238 | const MAX_TEXTLENGTH = 5e4;
|
7239 | const MAX_TEXTLENGTH_EXCEEDED_MSG = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa";
|
7240 | const SECURITY_LVL_SANDBOX = "sandbox";
|
7241 | const SECURITY_LVL_LOOSE = "loose";
|
7242 | const XMLNS_SVG_STD = "http://www.w3.org/2000/svg";
|
7243 | const XMLNS_XLINK_STD = "http://www.w3.org/1999/xlink";
|
7244 | const XMLNS_XHTML_STD = "http://www.w3.org/1999/xhtml";
|
7245 | const IFRAME_WIDTH = "100%";
|
7246 | const IFRAME_HEIGHT = "100%";
|
7247 | const IFRAME_STYLES = "border:0;margin:0;";
|
7248 | const IFRAME_BODY_STYLE = "margin:0";
|
7249 | const IFRAME_SANDBOX_OPTS = "allow-top-navigation-by-user-activation allow-popups";
|
7250 | const IFRAME_NOT_SUPPORTED_MSG = 'The "iframe" tag is not supported by your browser.';
|
7251 | const DOMPURIFY_TAGS = ["foreignobject"];
|
7252 | const DOMPURIFY_ATTR = ["dominant-baseline"];
|
7253 | async function parse$1(text, parseOptions) {
|
7254 | addDiagrams();
|
7255 | try {
|
7256 | const diagram2 = await getDiagramFromText(text);
|
7257 | diagram2.parse();
|
7258 | } catch (error) {
|
7259 | if (parseOptions == null ? void 0 : parseOptions.suppressErrors) {
|
7260 | return false;
|
7261 | }
|
7262 | throw error;
|
7263 | }
|
7264 | return true;
|
7265 | }
|
7266 | const encodeEntities = function(text) {
|
7267 | let txt = text;
|
7268 | txt = txt.replace(/style.*:\S*#.*;/g, function(s) {
|
7269 | return s.substring(0, s.length - 1);
|
7270 | });
|
7271 | txt = txt.replace(/classDef.*:\S*#.*;/g, function(s) {
|
7272 | return s.substring(0, s.length - 1);
|
7273 | });
|
7274 | txt = txt.replace(/#\w+;/g, function(s) {
|
7275 | const innerTxt = s.substring(1, s.length - 1);
|
7276 | const isInt = /^\+?\d+$/.test(innerTxt);
|
7277 | if (isInt) {
|
7278 | return "fl°°" + innerTxt + "¶ß";
|
7279 | } else {
|
7280 | return "fl°" + innerTxt + "¶ß";
|
7281 | }
|
7282 | });
|
7283 | return txt;
|
7284 | };
|
7285 | const decodeEntities = function(text) {
|
7286 | return text.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";");
|
7287 | };
|
7288 | const cssImportantStyles = (cssClass, element, cssClasses = []) => {
|
7289 | return `
|
7290 | .${cssClass} ${element} { ${cssClasses.join(" !important; ")} !important; }`;
|
7291 | };
|
7292 | const createCssStyles = (config2, graphType, classDefs = {}) => {
|
7293 | var _a;
|
7294 | let cssStyles = "";
|
7295 | if (config2.themeCSS !== void 0) {
|
7296 | cssStyles += `
|
7297 | ${config2.themeCSS}`;
|
7298 | }
|
7299 | if (config2.fontFamily !== void 0) {
|
7300 | cssStyles += `
|
7301 | :root { --mermaid-font-family: ${config2.fontFamily}}`;
|
7302 | }
|
7303 | if (config2.altFontFamily !== void 0) {
|
7304 | cssStyles += `
|
7305 | :root { --mermaid-alt-font-family: ${config2.altFontFamily}}`;
|
7306 | }
|
7307 | if (!isEmpty(classDefs) && CLASSDEF_DIAGRAMS.includes(graphType)) {
|
7308 | const htmlLabels = config2.htmlLabels || ((_a = config2.flowchart) == null ? void 0 : _a.htmlLabels);
|
7309 | const cssHtmlElements = ["> *", "span"];
|
7310 | const cssShapeElements = ["rect", "polygon", "ellipse", "circle", "path"];
|
7311 | const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements;
|
7312 | for (const classId in classDefs) {
|
7313 | const styleClassDef = classDefs[classId];
|
7314 | if (!isEmpty(styleClassDef.styles)) {
|
7315 | cssElements.forEach((cssElement) => {
|
7316 | cssStyles += cssImportantStyles(styleClassDef.id, cssElement, styleClassDef.styles);
|
7317 | });
|
7318 | }
|
7319 | if (!isEmpty(styleClassDef.textStyles)) {
|
7320 | cssStyles += cssImportantStyles(styleClassDef.id, "tspan", styleClassDef.textStyles);
|
7321 | }
|
7322 | }
|
7323 | }
|
7324 | return cssStyles;
|
7325 | };
|
7326 | const createUserStyles = (config2, graphType, classDefs, svgId) => {
|
7327 | const userCSSstyles = createCssStyles(config2, graphType, classDefs);
|
7328 | const allStyles = getStyles$2(graphType, userCSSstyles, config2.themeVariables);
|
7329 | return serialize(compile(`${svgId}{${allStyles}}`), stringify);
|
7330 | };
|
7331 | const cleanUpSvgCode = (svgCode = "", inSandboxMode, useArrowMarkerUrls) => {
|
7332 | let cleanedUpSvg = svgCode;
|
7333 | if (!useArrowMarkerUrls && !inSandboxMode) {
|
7334 | cleanedUpSvg = cleanedUpSvg.replace(/marker-end="url\(.*?#/g, 'marker-end="url(#');
|
7335 | }
|
7336 | cleanedUpSvg = decodeEntities(cleanedUpSvg);
|
7337 | cleanedUpSvg = cleanedUpSvg.replace(/<br>/g, "<br/>");
|
7338 | return cleanedUpSvg;
|
7339 | };
|
7340 | const putIntoIFrame = (svgCode = "", svgElement) => {
|
7341 | const height = svgElement ? svgElement.viewBox.baseVal.height + "px" : IFRAME_HEIGHT;
|
7342 | const base64encodedSrc = btoa('<body style="' + IFRAME_BODY_STYLE + '">' + svgCode + "</body>");
|
7343 | return `<iframe style="width:${IFRAME_WIDTH};height:${height};${IFRAME_STYLES}" src="data:text/html;base64,${base64encodedSrc}" sandbox="${IFRAME_SANDBOX_OPTS}">
|
7344 | ${IFRAME_NOT_SUPPORTED_MSG}
|
7345 | </iframe>`;
|
7346 | };
|
7347 | const appendDivSvgG = (parentRoot, id2, enclosingDivId, divStyle, svgXlink) => {
|
7348 | const enclosingDiv = parentRoot.append("div");
|
7349 | enclosingDiv.attr("id", enclosingDivId);
|
7350 | if (divStyle) {
|
7351 | enclosingDiv.attr("style", divStyle);
|
7352 | }
|
7353 | const svgNode = enclosingDiv.append("svg").attr("id", id2).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD);
|
7354 | if (svgXlink) {
|
7355 | svgNode.attr("xmlns:xlink", svgXlink);
|
7356 | }
|
7357 | svgNode.append("g");
|
7358 | return parentRoot;
|
7359 | };
|
7360 | function sandboxedIframe(parentNode, iFrameId) {
|
7361 | return parentNode.append("iframe").attr("id", iFrameId).attr("style", "width: 100%; height: 100%;").attr("sandbox", "");
|
7362 | }
|
7363 | const removeExistingElements = (doc, id2, divId, iFrameId) => {
|
7364 | var _a, _b, _c;
|
7365 | (_a = doc.getElementById(id2)) == null ? void 0 : _a.remove();
|
7366 | (_b = doc.getElementById(divId)) == null ? void 0 : _b.remove();
|
7367 | (_c = doc.getElementById(iFrameId)) == null ? void 0 : _c.remove();
|
7368 | };
|
7369 | const render$1 = async function(id2, text, svgContainingElement) {
|
7370 | var _a, _b, _c, _d;
|
7371 | addDiagrams();
|
7372 | reset();
|
7373 | const graphInit = utils.detectInit(text);
|
7374 | if (graphInit) {
|
7375 | directiveSanitizer(graphInit);
|
7376 | addDirective(graphInit);
|
7377 | }
|
7378 | const config2 = getConfig$1();
|
7379 | log$1.debug(config2);
|
7380 | if (text.length > ((config2 == null ? void 0 : config2.maxTextSize) ?? MAX_TEXTLENGTH)) {
|
7381 | text = MAX_TEXTLENGTH_EXCEEDED_MSG;
|
7382 | }
|
7383 | text = text.replace(/\r\n?/g, "\n");
|
7384 | text = text.replace(
|
7385 | /<(\w+)([^>]*)>/g,
|
7386 | (match, tag, attributes) => "<" + tag + attributes.replace(/="([^"]*)"/g, "='$1'") + ">"
|
7387 | );
|
7388 | const idSelector = "#" + id2;
|
7389 | const iFrameID = "i" + id2;
|
7390 | const iFrameID_selector = "#" + iFrameID;
|
7391 | const enclosingDivID = "d" + id2;
|
7392 | const enclosingDivID_selector = "#" + enclosingDivID;
|
7393 | let root = select("body");
|
7394 | const isSandboxed = config2.securityLevel === SECURITY_LVL_SANDBOX;
|
7395 | const isLooseSecurityLevel = config2.securityLevel === SECURITY_LVL_LOOSE;
|
7396 | const fontFamily = config2.fontFamily;
|
7397 | if (svgContainingElement !== void 0) {
|
7398 | if (svgContainingElement) {
|
7399 | svgContainingElement.innerHTML = "";
|
7400 | }
|
7401 | if (isSandboxed) {
|
7402 | const iframe = sandboxedIframe(select(svgContainingElement), iFrameID);
|
7403 | root = select(iframe.nodes()[0].contentDocument.body);
|
7404 | root.node().style.margin = 0;
|
7405 | } else {
|
7406 | root = select(svgContainingElement);
|
7407 | }
|
7408 | appendDivSvgG(root, id2, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD);
|
7409 | } else {
|
7410 | removeExistingElements(document, id2, enclosingDivID, iFrameID);
|
7411 | if (isSandboxed) {
|
7412 | const iframe = sandboxedIframe(select("body"), iFrameID);
|
7413 | root = select(iframe.nodes()[0].contentDocument.body);
|
7414 | root.node().style.margin = 0;
|
7415 | } else {
|
7416 | root = select("body");
|
7417 | }
|
7418 | appendDivSvgG(root, id2, enclosingDivID);
|
7419 | }
|
7420 | text = encodeEntities(text);
|
7421 | let diag;
|
7422 | let parseEncounteredException;
|
7423 | try {
|
7424 | diag = await getDiagramFromText(text);
|
7425 | } catch (error) {
|
7426 | diag = new Diagram("error");
|
7427 | parseEncounteredException = error;
|
7428 | }
|
7429 | const element = root.select(enclosingDivID_selector).node();
|
7430 | const graphType = diag.type;
|
7431 | const svg = element.firstChild;
|
7432 | const firstChild = svg.firstChild;
|
7433 | const diagramClassDefs = CLASSDEF_DIAGRAMS.includes(graphType) ? diag.renderer.getClasses(text, diag) : {};
|
7434 | const rules = createUserStyles(
|
7435 | config2,
|
7436 | graphType,
|
7437 | // @ts-ignore convert renderer to TS.
|
7438 | diagramClassDefs,
|
7439 | idSelector
|
7440 | );
|
7441 | const style1 = document.createElement("style");
|
7442 | style1.innerHTML = rules;
|
7443 | svg.insertBefore(style1, firstChild);
|
7444 | try {
|
7445 | await diag.renderer.draw(text, id2, version, diag);
|
7446 | } catch (e) {
|
7447 | errorRenderer.draw(text, id2, version);
|
7448 | throw e;
|
7449 | }
|
7450 | const svgNode = root.select(`${enclosingDivID_selector} svg`);
|
7451 | const a11yTitle = (_b = (_a = diag.db).getAccTitle) == null ? void 0 : _b.call(_a);
|
7452 | const a11yDescr = (_d = (_c = diag.db).getAccDescription) == null ? void 0 : _d.call(_c);
|
7453 | addA11yInfo(graphType, svgNode, a11yTitle, a11yDescr);
|
7454 | root.select(`[id="${id2}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD);
|
7455 | let svgCode = root.select(enclosingDivID_selector).node().innerHTML;
|
7456 | log$1.debug("config.arrowMarkerAbsolute", config2.arrowMarkerAbsolute);
|
7457 | svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config2.arrowMarkerAbsolute));
|
7458 | if (isSandboxed) {
|
7459 | const svgEl = root.select(enclosingDivID_selector + " svg").node();
|
7460 | svgCode = putIntoIFrame(svgCode, svgEl);
|
7461 | } else if (!isLooseSecurityLevel) {
|
7462 | svgCode = DOMPurify.sanitize(svgCode, {
|
7463 | ADD_TAGS: DOMPURIFY_TAGS,
|
7464 | ADD_ATTR: DOMPURIFY_ATTR
|
7465 | });
|
7466 | }
|
7467 | attachFunctions();
|
7468 | if (parseEncounteredException) {
|
7469 | throw parseEncounteredException;
|
7470 | }
|
7471 | const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector;
|
7472 | const node = select(tmpElementSelector).node();
|
7473 | if (node && "remove" in node) {
|
7474 | node.remove();
|
7475 | }
|
7476 | return {
|
7477 | svg: svgCode,
|
7478 | bindFunctions: diag.db.bindFunctions
|
7479 | };
|
7480 | };
|
7481 | function initialize$1(options = {}) {
|
7482 | var _a;
|
7483 | if ((options == null ? void 0 : options.fontFamily) && !((_a = options.themeVariables) == null ? void 0 : _a.fontFamily)) {
|
7484 | if (!options.themeVariables) {
|
7485 | options.themeVariables = {};
|
7486 | }
|
7487 | options.themeVariables.fontFamily = options.fontFamily;
|
7488 | }
|
7489 | saveConfigFromInitialize(options);
|
7490 | if ((options == null ? void 0 : options.theme) && options.theme in theme) {
|
7491 | options.themeVariables = theme[options.theme].getThemeVariables(
|
7492 | options.themeVariables
|
7493 | );
|
7494 | } else if (options) {
|
7495 | options.themeVariables = theme.default.getThemeVariables(options.themeVariables);
|
7496 | }
|
7497 | const config2 = typeof options === "object" ? setSiteConfig(options) : getSiteConfig();
|
7498 | setLogLevel$1(config2.logLevel);
|
7499 | addDiagrams();
|
7500 | }
|
7501 | function addA11yInfo(graphType, svgNode, a11yTitle, a11yDescr) {
|
7502 | setA11yDiagramInfo(svgNode, graphType);
|
7503 | addSVGa11yTitleDescription(svgNode, a11yTitle, a11yDescr, svgNode.attr("id"));
|
7504 | }
|
7505 | const mermaidAPI = Object.freeze({
|
7506 | render: render$1,
|
7507 | parse: parse$1,
|
7508 | parseDirective: parseDirective$1,
|
7509 | getDiagramFromText,
|
7510 | initialize: initialize$1,
|
7511 | getConfig: getConfig$1,
|
7512 | setConfig,
|
7513 | getSiteConfig,
|
7514 | updateSiteConfig,
|
7515 | reset: () => {
|
7516 | reset();
|
7517 | },
|
7518 | globalReset: () => {
|
7519 | reset(defaultConfig);
|
7520 | },
|
7521 | defaultConfig
|
7522 | });
|
7523 | setLogLevel$1(getConfig$1().logLevel);
|
7524 | reset(getConfig$1());
|
7525 | const handleError = (error, errors, parseError) => {
|
7526 | log$1.warn(error);
|
7527 | if (isDetailedError(error)) {
|
7528 | if (parseError) {
|
7529 | parseError(error.str, error.hash);
|
7530 | }
|
7531 | errors.push({ ...error, message: error.str, error });
|
7532 | } else {
|
7533 | if (parseError) {
|
7534 | parseError(error);
|
7535 | }
|
7536 | if (error instanceof Error) {
|
7537 | errors.push({
|
7538 | str: error.message,
|
7539 | message: error.message,
|
7540 | hash: error.name,
|
7541 | error
|
7542 | });
|
7543 | }
|
7544 | }
|
7545 | };
|
7546 | const run = async function(options = {
|
7547 | querySelector: ".mermaid"
|
7548 | }) {
|
7549 | try {
|
7550 | await runThrowsErrors(options);
|
7551 | } catch (e) {
|
7552 | if (isDetailedError(e)) {
|
7553 | log$1.error(e.str);
|
7554 | }
|
7555 | if (mermaid.parseError) {
|
7556 | mermaid.parseError(e);
|
7557 | }
|
7558 | if (!options.suppressErrors) {
|
7559 | log$1.error("Use the suppressErrors option to suppress these errors");
|
7560 | throw e;
|
7561 | }
|
7562 | }
|
7563 | };
|
7564 | const runThrowsErrors = async function({ postRenderCallback, querySelector, nodes } = {
|
7565 | querySelector: ".mermaid"
|
7566 | }) {
|
7567 | const conf = mermaidAPI.getConfig();
|
7568 | log$1.debug(`${!postRenderCallback ? "No " : ""}Callback function found`);
|
7569 | let nodesToProcess;
|
7570 | if (nodes) {
|
7571 | nodesToProcess = nodes;
|
7572 | } else if (querySelector) {
|
7573 | nodesToProcess = document.querySelectorAll(querySelector);
|
7574 | } else {
|
7575 | throw new Error("Nodes and querySelector are both undefined");
|
7576 | }
|
7577 | log$1.debug(`Found ${nodesToProcess.length} diagrams`);
|
7578 | if ((conf == null ? void 0 : conf.startOnLoad) !== void 0) {
|
7579 | log$1.debug("Start On Load: " + (conf == null ? void 0 : conf.startOnLoad));
|
7580 | mermaidAPI.updateSiteConfig({ startOnLoad: conf == null ? void 0 : conf.startOnLoad });
|
7581 | }
|
7582 | const idGenerator = new utils.initIdGenerator(conf.deterministicIds, conf.deterministicIDSeed);
|
7583 | let txt;
|
7584 | const errors = [];
|
7585 | for (const element of Array.from(nodesToProcess)) {
|
7586 | log$1.info("Rendering diagram: " + element.id);
|
7587 | /*! Check if previously processed */
|
7588 | if (element.getAttribute("data-processed")) {
|
7589 | continue;
|
7590 | }
|
7591 | element.setAttribute("data-processed", "true");
|
7592 | const id2 = `mermaid-${idGenerator.next()}`;
|
7593 | txt = element.innerHTML;
|
7594 | txt = dedent(utils.entityDecode(txt)).trim().replace(/<br\s*\/?>/gi, "<br/>");
|
7595 | const init2 = utils.detectInit(txt);
|
7596 | if (init2) {
|
7597 | log$1.debug("Detected early reinit: ", init2);
|
7598 | }
|
7599 | try {
|
7600 | const { svg, bindFunctions } = await render(id2, txt, element);
|
7601 | element.innerHTML = svg;
|
7602 | if (postRenderCallback) {
|
7603 | await postRenderCallback(id2);
|
7604 | }
|
7605 | if (bindFunctions) {
|
7606 | bindFunctions(element);
|
7607 | }
|
7608 | } catch (error) {
|
7609 | handleError(error, errors, mermaid.parseError);
|
7610 | }
|
7611 | }
|
7612 | if (errors.length > 0) {
|
7613 | throw errors[0];
|
7614 | }
|
7615 | };
|
7616 | const initialize = function(config2) {
|
7617 | mermaidAPI.initialize(config2);
|
7618 | };
|
7619 | const init = async function(config2, nodes, callback) {
|
7620 | log$1.warn("mermaid.init is deprecated. Please use run instead.");
|
7621 | if (config2) {
|
7622 | initialize(config2);
|
7623 | }
|
7624 | const runOptions = { postRenderCallback: callback, querySelector: ".mermaid" };
|
7625 | if (typeof nodes === "string") {
|
7626 | runOptions.querySelector = nodes;
|
7627 | } else if (nodes) {
|
7628 | if (nodes instanceof HTMLElement) {
|
7629 | runOptions.nodes = [nodes];
|
7630 | } else {
|
7631 | runOptions.nodes = nodes;
|
7632 | }
|
7633 | }
|
7634 | await run(runOptions);
|
7635 | };
|
7636 | const registerExternalDiagrams = async (diagrams2, {
|
7637 | lazyLoad = true
|
7638 | } = {}) => {
|
7639 | registerLazyLoadedDiagrams(...diagrams2);
|
7640 | if (lazyLoad === false) {
|
7641 | await loadRegisteredDiagrams();
|
7642 | }
|
7643 | };
|
7644 | const contentLoaded = function() {
|
7645 | if (mermaid.startOnLoad) {
|
7646 | const { startOnLoad } = mermaidAPI.getConfig();
|
7647 | if (startOnLoad) {
|
7648 | mermaid.run().catch((err) => log$1.error("Mermaid failed to initialize", err));
|
7649 | }
|
7650 | }
|
7651 | };
|
7652 | if (typeof document !== "undefined") {
|
7653 | /*!
|
7654 | * Wait for document loaded before starting the execution
|
7655 | */
|
7656 | window.addEventListener("load", contentLoaded, false);
|
7657 | }
|
7658 | const setParseErrorHandler = function(parseErrorHandler) {
|
7659 | mermaid.parseError = parseErrorHandler;
|
7660 | };
|
7661 | const executionQueue = [];
|
7662 | let executionQueueRunning = false;
|
7663 | const executeQueue = async () => {
|
7664 | if (executionQueueRunning) {
|
7665 | return;
|
7666 | }
|
7667 | executionQueueRunning = true;
|
7668 | while (executionQueue.length > 0) {
|
7669 | const f = executionQueue.shift();
|
7670 | if (f) {
|
7671 | try {
|
7672 | await f();
|
7673 | } catch (e) {
|
7674 | log$1.error("Error executing queue", e);
|
7675 | }
|
7676 | }
|
7677 | }
|
7678 | executionQueueRunning = false;
|
7679 | };
|
7680 | const parse = async (text, parseOptions) => {
|
7681 | return new Promise((resolve, reject) => {
|
7682 | const performCall = () => new Promise((res, rej) => {
|
7683 | mermaidAPI.parse(text, parseOptions).then(
|
7684 | (r) => {
|
7685 | res(r);
|
7686 | resolve(r);
|
7687 | },
|
7688 | (e) => {
|
7689 | var _a;
|
7690 | log$1.error("Error parsing", e);
|
7691 | (_a = mermaid.parseError) == null ? void 0 : _a.call(mermaid, e);
|
7692 | rej(e);
|
7693 | reject(e);
|
7694 | }
|
7695 | );
|
7696 | });
|
7697 | executionQueue.push(performCall);
|
7698 | executeQueue().catch(reject);
|
7699 | });
|
7700 | };
|
7701 | const render = (id2, text, container) => {
|
7702 | return new Promise((resolve, reject) => {
|
7703 | const performCall = () => new Promise((res, rej) => {
|
7704 | mermaidAPI.render(id2, text, container).then(
|
7705 | (r) => {
|
7706 | res(r);
|
7707 | resolve(r);
|
7708 | },
|
7709 | (e) => {
|
7710 | var _a;
|
7711 | log$1.error("Error parsing", e);
|
7712 | (_a = mermaid.parseError) == null ? void 0 : _a.call(mermaid, e);
|
7713 | rej(e);
|
7714 | reject(e);
|
7715 | }
|
7716 | );
|
7717 | });
|
7718 | executionQueue.push(performCall);
|
7719 | executeQueue().catch(reject);
|
7720 | });
|
7721 | };
|
7722 | const mermaid = {
|
7723 | startOnLoad: true,
|
7724 | mermaidAPI,
|
7725 | parse,
|
7726 | render,
|
7727 | init,
|
7728 | run,
|
7729 | registerExternalDiagrams,
|
7730 | initialize,
|
7731 | parseError: void 0,
|
7732 | contentLoaded,
|
7733 | setParseErrorHandler,
|
7734 | detectType
|
7735 | };
|
7736 | export {
|
7737 | setupGraphViewbox as A,
|
7738 | parseFontSize as B,
|
7739 | getThemeVariables$2 as C,
|
7740 | defaultConfig$1 as D,
|
7741 | addFunction as E,
|
7742 | generateId as F,
|
7743 | defaultConfig as G,
|
7744 | decodeEntities as H,
|
7745 | commonDb$1 as I,
|
7746 | parseDirective$1 as J,
|
7747 | mermaid as K,
|
7748 | getAccDescription as a,
|
7749 | setAccDescription as b,
|
7750 | getConfig$1 as c,
|
7751 | sanitizeText$2 as d,
|
7752 | common$1 as e,
|
7753 | assignWithDepth$1 as f,
|
7754 | getAccTitle as g,
|
7755 | calculateTextWidth as h,
|
7756 | configureSvgSize as i,
|
7757 | calculateTextHeight as j,
|
7758 | getStylesFromArray as k,
|
7759 | log$1 as l,
|
7760 | mermaidAPI as m,
|
7761 | evaluate as n,
|
7762 | interpolateToCurve as o,
|
7763 | setupGraphViewbox$1 as p,
|
7764 | setConfig as q,
|
7765 | setDiagramTitle as r,
|
7766 | setAccTitle as s,
|
7767 | getDiagramTitle as t,
|
7768 | utils as u,
|
7769 | clear as v,
|
7770 | wrapLabel as w,
|
7771 | parseGenericTypes as x,
|
7772 | random as y,
|
7773 | getConfig as z
|
7774 | };
|