import { __toESM as e } from "../../../../../_virtual/_rolldown/runtime.js";
import { require_dayjs_min as t } from "../../../../dayjs/dayjs.min.js";
import { __name as n, log as r } from "./chunk-AGHRB4JF.js";
import { clear as i, common_default as a, configureSvgSize as o, getAccDescription as s, getAccTitle as c, getConfig2 as l, getDiagramTitle as u, setAccDescription as d, setAccTitle as f, setDiagramTitle as p } from "./chunk-ICPOFSXX.js";
import m from "../../../../d3-array/src/max.js";
import h from "../../../../d3-array/src/min.js";
import { axisBottom as g, axisTop as _ } from "../../../../d3-axis/src/axis.js";
import v from "../../../../d3-selection/src/select.js";
import y from "../../../../d3-interpolate/src/hcl.js";
import b from "../../../../d3-scale/src/linear.js";
import { millisecond as x } from "../../../../d3-time/src/millisecond.js";
import { second as S } from "../../../../d3-time/src/second.js";
import { timeMinute as C } from "../../../../d3-time/src/minute.js";
import { timeHour as w } from "../../../../d3-time/src/hour.js";
import { timeDay as T } from "../../../../d3-time/src/day.js";
import { timeFriday as E, timeMonday as D, timeSaturday as O, timeSunday as k, timeThursday as A, timeTuesday as j, timeWednesday as M } from "../../../../d3-time/src/week.js";
import { timeMonth as ee } from "../../../../d3-time/src/month.js";
import { timeFormat as te } from "../../../../d3-time-format/src/defaultLocale.js";
import ne from "../../../../d3-scale/src/time.js";
import "../../../../d3/src/index.js";
import { require_dist as N } from "../../../../@braintree/sanitize-url/dist/index.js";
import { utils_default as re } from "./chunk-5PVQY5BW.js";
import { require_isoWeek as P } from "../../../../dayjs/plugin/isoWeek.js";
import { require_customParseFormat as ie } from "../../../../dayjs/plugin/customParseFormat.js";
import { require_advancedFormat as F } from "../../../../dayjs/plugin/advancedFormat.js";
import { require_duration as ae } from "../../../../dayjs/plugin/duration.js";
//#region ../../node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-T4ZO3ILL.mjs
var oe = N(), I = /* @__PURE__ */ e(t(), 1), se = /* @__PURE__ */ e(P(), 1), ce = /* @__PURE__ */ e(ie(), 1), le = /* @__PURE__ */ e(F(), 1), ue = /* @__PURE__ */ e(ae(), 1), L = (function() {
	var e = /* @__PURE__ */ n(function(e, t, n, r) {
		for (n ||= {}, r = e.length; r--; n[e[r]] = t);
		return n;
	}, "o"), t = [
		6,
		8,
		10,
		12,
		13,
		14,
		15,
		16,
		17,
		18,
		20,
		21,
		22,
		23,
		24,
		25,
		26,
		27,
		28,
		29,
		30,
		31,
		33,
		35,
		36,
		38,
		40
	], r = [1, 26], i = [1, 27], a = [1, 28], o = [1, 29], s = [1, 30], c = [1, 31], l = [1, 32], u = [1, 33], d = [1, 34], f = [1, 9], p = [1, 10], m = [1, 11], h = [1, 12], g = [1, 13], _ = [1, 14], v = [1, 15], y = [1, 16], b = [1, 19], x = [1, 20], S = [1, 21], C = [1, 22], w = [1, 23], T = [1, 25], E = [1, 35], D = {
		trace: /* @__PURE__ */ n(function() {}, "trace"),
		yy: {},
		symbols_: {
			error: 2,
			start: 3,
			gantt: 4,
			document: 5,
			EOF: 6,
			line: 7,
			SPACE: 8,
			statement: 9,
			NL: 10,
			weekday: 11,
			weekday_monday: 12,
			weekday_tuesday: 13,
			weekday_wednesday: 14,
			weekday_thursday: 15,
			weekday_friday: 16,
			weekday_saturday: 17,
			weekday_sunday: 18,
			weekend: 19,
			weekend_friday: 20,
			weekend_saturday: 21,
			dateFormat: 22,
			inclusiveEndDates: 23,
			topAxis: 24,
			axisFormat: 25,
			tickInterval: 26,
			excludes: 27,
			includes: 28,
			todayMarker: 29,
			title: 30,
			acc_title: 31,
			acc_title_value: 32,
			acc_descr: 33,
			acc_descr_value: 34,
			acc_descr_multiline_value: 35,
			section: 36,
			clickStatement: 37,
			taskTxt: 38,
			taskData: 39,
			click: 40,
			callbackname: 41,
			callbackargs: 42,
			href: 43,
			clickStatementDebug: 44,
			$accept: 0,
			$end: 1
		},
		terminals_: {
			2: "error",
			4: "gantt",
			6: "EOF",
			8: "SPACE",
			10: "NL",
			12: "weekday_monday",
			13: "weekday_tuesday",
			14: "weekday_wednesday",
			15: "weekday_thursday",
			16: "weekday_friday",
			17: "weekday_saturday",
			18: "weekday_sunday",
			20: "weekend_friday",
			21: "weekend_saturday",
			22: "dateFormat",
			23: "inclusiveEndDates",
			24: "topAxis",
			25: "axisFormat",
			26: "tickInterval",
			27: "excludes",
			28: "includes",
			29: "todayMarker",
			30: "title",
			31: "acc_title",
			32: "acc_title_value",
			33: "acc_descr",
			34: "acc_descr_value",
			35: "acc_descr_multiline_value",
			36: "section",
			38: "taskTxt",
			39: "taskData",
			40: "click",
			41: "callbackname",
			42: "callbackargs",
			43: "href"
		},
		productions_: [
			0,
			[3, 3],
			[5, 0],
			[5, 2],
			[7, 2],
			[7, 1],
			[7, 1],
			[7, 1],
			[11, 1],
			[11, 1],
			[11, 1],
			[11, 1],
			[11, 1],
			[11, 1],
			[11, 1],
			[19, 1],
			[19, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 2],
			[9, 2],
			[9, 1],
			[9, 1],
			[9, 1],
			[9, 2],
			[37, 2],
			[37, 3],
			[37, 3],
			[37, 4],
			[37, 3],
			[37, 4],
			[37, 2],
			[44, 2],
			[44, 3],
			[44, 3],
			[44, 4],
			[44, 3],
			[44, 4],
			[44, 2]
		],
		performAction: /* @__PURE__ */ n(function(e, t, n, r, i, a, o) {
			var s = a.length - 1;
			switch (i) {
				case 1: return a[s - 1];
				case 2:
					this.$ = [];
					break;
				case 3:
					a[s - 1].push(a[s]), this.$ = a[s - 1];
					break;
				case 4:
				case 5:
					this.$ = a[s];
					break;
				case 6:
				case 7:
					this.$ = [];
					break;
				case 8:
					r.setWeekday("monday");
					break;
				case 9:
					r.setWeekday("tuesday");
					break;
				case 10:
					r.setWeekday("wednesday");
					break;
				case 11:
					r.setWeekday("thursday");
					break;
				case 12:
					r.setWeekday("friday");
					break;
				case 13:
					r.setWeekday("saturday");
					break;
				case 14:
					r.setWeekday("sunday");
					break;
				case 15:
					r.setWeekend("friday");
					break;
				case 16:
					r.setWeekend("saturday");
					break;
				case 17:
					r.setDateFormat(a[s].substr(11)), this.$ = a[s].substr(11);
					break;
				case 18:
					r.enableInclusiveEndDates(), this.$ = a[s].substr(18);
					break;
				case 19:
					r.TopAxis(), this.$ = a[s].substr(8);
					break;
				case 20:
					r.setAxisFormat(a[s].substr(11)), this.$ = a[s].substr(11);
					break;
				case 21:
					r.setTickInterval(a[s].substr(13)), this.$ = a[s].substr(13);
					break;
				case 22:
					r.setExcludes(a[s].substr(9)), this.$ = a[s].substr(9);
					break;
				case 23:
					r.setIncludes(a[s].substr(9)), this.$ = a[s].substr(9);
					break;
				case 24:
					r.setTodayMarker(a[s].substr(12)), this.$ = a[s].substr(12);
					break;
				case 27:
					r.setDiagramTitle(a[s].substr(6)), this.$ = a[s].substr(6);
					break;
				case 28:
					this.$ = a[s].trim(), r.setAccTitle(this.$);
					break;
				case 29:
				case 30:
					this.$ = a[s].trim(), r.setAccDescription(this.$);
					break;
				case 31:
					r.addSection(a[s].substr(8)), this.$ = a[s].substr(8);
					break;
				case 33:
					r.addTask(a[s - 1], a[s]), this.$ = "task";
					break;
				case 34:
					this.$ = a[s - 1], r.setClickEvent(a[s - 1], a[s], null);
					break;
				case 35:
					this.$ = a[s - 2], r.setClickEvent(a[s - 2], a[s - 1], a[s]);
					break;
				case 36:
					this.$ = a[s - 2], r.setClickEvent(a[s - 2], a[s - 1], null), r.setLink(a[s - 2], a[s]);
					break;
				case 37:
					this.$ = a[s - 3], r.setClickEvent(a[s - 3], a[s - 2], a[s - 1]), r.setLink(a[s - 3], a[s]);
					break;
				case 38:
					this.$ = a[s - 2], r.setClickEvent(a[s - 2], a[s], null), r.setLink(a[s - 2], a[s - 1]);
					break;
				case 39:
					this.$ = a[s - 3], r.setClickEvent(a[s - 3], a[s - 1], a[s]), r.setLink(a[s - 3], a[s - 2]);
					break;
				case 40:
					this.$ = a[s - 1], r.setLink(a[s - 1], a[s]);
					break;
				case 41:
				case 47:
					this.$ = a[s - 1] + " " + a[s];
					break;
				case 42:
				case 43:
				case 45:
					this.$ = a[s - 2] + " " + a[s - 1] + " " + a[s];
					break;
				case 44:
				case 46:
					this.$ = a[s - 3] + " " + a[s - 2] + " " + a[s - 1] + " " + a[s];
					break;
			}
		}, "anonymous"),
		table: [
			{
				3: 1,
				4: [1, 2]
			},
			{ 1: [3] },
			e(t, [2, 2], { 5: 3 }),
			{
				6: [1, 4],
				7: 5,
				8: [1, 6],
				9: 7,
				10: [1, 8],
				11: 17,
				12: r,
				13: i,
				14: a,
				15: o,
				16: s,
				17: c,
				18: l,
				19: 18,
				20: u,
				21: d,
				22: f,
				23: p,
				24: m,
				25: h,
				26: g,
				27: _,
				28: v,
				29: y,
				30: b,
				31: x,
				33: S,
				35: C,
				36: w,
				37: 24,
				38: T,
				40: E
			},
			e(t, [2, 7], { 1: [2, 1] }),
			e(t, [2, 3]),
			{
				9: 36,
				11: 17,
				12: r,
				13: i,
				14: a,
				15: o,
				16: s,
				17: c,
				18: l,
				19: 18,
				20: u,
				21: d,
				22: f,
				23: p,
				24: m,
				25: h,
				26: g,
				27: _,
				28: v,
				29: y,
				30: b,
				31: x,
				33: S,
				35: C,
				36: w,
				37: 24,
				38: T,
				40: E
			},
			e(t, [2, 5]),
			e(t, [2, 6]),
			e(t, [2, 17]),
			e(t, [2, 18]),
			e(t, [2, 19]),
			e(t, [2, 20]),
			e(t, [2, 21]),
			e(t, [2, 22]),
			e(t, [2, 23]),
			e(t, [2, 24]),
			e(t, [2, 25]),
			e(t, [2, 26]),
			e(t, [2, 27]),
			{ 32: [1, 37] },
			{ 34: [1, 38] },
			e(t, [2, 30]),
			e(t, [2, 31]),
			e(t, [2, 32]),
			{ 39: [1, 39] },
			e(t, [2, 8]),
			e(t, [2, 9]),
			e(t, [2, 10]),
			e(t, [2, 11]),
			e(t, [2, 12]),
			e(t, [2, 13]),
			e(t, [2, 14]),
			e(t, [2, 15]),
			e(t, [2, 16]),
			{
				41: [1, 40],
				43: [1, 41]
			},
			e(t, [2, 4]),
			e(t, [2, 28]),
			e(t, [2, 29]),
			e(t, [2, 33]),
			e(t, [2, 34], {
				42: [1, 42],
				43: [1, 43]
			}),
			e(t, [2, 40], { 41: [1, 44] }),
			e(t, [2, 35], { 43: [1, 45] }),
			e(t, [2, 36]),
			e(t, [2, 38], { 42: [1, 46] }),
			e(t, [2, 37]),
			e(t, [2, 39])
		],
		defaultActions: {},
		parseError: /* @__PURE__ */ n(function(e, t) {
			if (t.recoverable) this.trace(e);
			else {
				var n = Error(e);
				throw n.hash = t, n;
			}
		}, "parseError"),
		parse: /* @__PURE__ */ n(function(e) {
			var t = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
			for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
			h.setInput(e, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
			var v = h.yylloc;
			o.push(v);
			var y = h.options && h.options.ranges;
			typeof g.yy.parseError == "function" ? this.parseError = g.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
			function b(e) {
				r.length -= 2 * e, a.length -= e, o.length -= e;
			}
			n(b, "popStack");
			function x() {
				var e = i.pop() || h.lex() || p;
				return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = t.symbols_[e] || e), e;
			}
			n(x, "lex");
			for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
				if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
					var M = "";
					for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
					M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
						text: h.match,
						token: this.terminals_[S] || S,
						line: h.yylineno,
						loc: v,
						expected: j
					});
				}
				if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
				switch (T[0]) {
					case 1:
						r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
						break;
					case 2:
						if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
							first_line: o[o.length - (k || 1)].first_line,
							last_line: o[o.length - 1].last_line,
							first_column: o[o.length - (k || 1)].first_column,
							last_column: o[o.length - 1].last_column
						}, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
							c,
							u,
							l,
							g.yy,
							T[1],
							a,
							o
						].concat(m)), E !== void 0) return E;
						k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
						break;
					case 3: return !0;
				}
			}
			return !0;
		}, "parse")
	};
	D.lexer = /* @__PURE__ */ (function() {
		return {
			EOF: 1,
			parseError: /* @__PURE__ */ n(function(e, t) {
				if (this.yy.parser) this.yy.parser.parseError(e, t);
				else throw Error(e);
			}, "parseError"),
			setInput: /* @__PURE__ */ n(function(e, t) {
				return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
					first_line: 1,
					first_column: 0,
					last_line: 1,
					last_column: 0
				}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
			}, "setInput"),
			input: /* @__PURE__ */ n(function() {
				var e = this._input[0];
				return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
			}, "input"),
			unput: /* @__PURE__ */ n(function(e) {
				var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
				this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
				var r = this.match.split(/(?:\r\n?|\n)/g);
				this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
				var i = this.yylloc.range;
				return this.yylloc = {
					first_line: this.yylloc.first_line,
					last_line: this.yylineno + 1,
					first_column: this.yylloc.first_column,
					last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
				}, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
			}, "unput"),
			more: /* @__PURE__ */ n(function() {
				return this._more = !0, this;
			}, "more"),
			reject: /* @__PURE__ */ n(function() {
				if (this.options.backtrack_lexer) this._backtrack = !0;
				else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
					text: "",
					token: null,
					line: this.yylineno
				});
				return this;
			}, "reject"),
			less: /* @__PURE__ */ n(function(e) {
				this.unput(this.match.slice(e));
			}, "less"),
			pastInput: /* @__PURE__ */ n(function() {
				var e = this.matched.substr(0, this.matched.length - this.match.length);
				return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
			}, "pastInput"),
			upcomingInput: /* @__PURE__ */ n(function() {
				var e = this.match;
				return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
			}, "upcomingInput"),
			showPosition: /* @__PURE__ */ n(function() {
				var e = this.pastInput(), t = Array(e.length + 1).join("-");
				return e + this.upcomingInput() + "\n" + t + "^";
			}, "showPosition"),
			test_match: /* @__PURE__ */ n(function(e, t) {
				var n, r, i;
				if (this.options.backtrack_lexer && (i = {
					yylineno: this.yylineno,
					yylloc: {
						first_line: this.yylloc.first_line,
						last_line: this.last_line,
						first_column: this.yylloc.first_column,
						last_column: this.yylloc.last_column
					},
					yytext: this.yytext,
					match: this.match,
					matches: this.matches,
					matched: this.matched,
					yyleng: this.yyleng,
					offset: this.offset,
					_more: this._more,
					_input: this._input,
					yy: this.yy,
					conditionStack: this.conditionStack.slice(0),
					done: this.done
				}, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
					first_line: this.yylloc.last_line,
					last_line: this.yylineno + 1,
					first_column: this.yylloc.last_column,
					last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
				}, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
				if (this._backtrack) {
					for (var a in i) this[a] = i[a];
					return !1;
				}
				return !1;
			}, "test_match"),
			next: /* @__PURE__ */ n(function() {
				if (this.done) return this.EOF;
				this._input || (this.done = !0);
				var e, t, n, r;
				this._more || (this.yytext = "", this.match = "");
				for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
					if (t = n, r = a, this.options.backtrack_lexer) {
						if (e = this.test_match(n, i[a]), e !== !1) return e;
						if (this._backtrack) {
							t = !1;
							continue;
						} else return !1;
					} else if (!this.options.flex) break;
				}
				return t ? (e = this.test_match(t, i[r]), e === !1 ? !1 : e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
					text: "",
					token: null,
					line: this.yylineno
				});
			}, "next"),
			lex: /* @__PURE__ */ n(function() {
				return this.next() || this.lex();
			}, "lex"),
			begin: /* @__PURE__ */ n(function(e) {
				this.conditionStack.push(e);
			}, "begin"),
			popState: /* @__PURE__ */ n(function() {
				return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
			}, "popState"),
			_currentRules: /* @__PURE__ */ n(function() {
				return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
			}, "_currentRules"),
			topState: /* @__PURE__ */ n(function(e) {
				return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
			}, "topState"),
			pushState: /* @__PURE__ */ n(function(e) {
				this.begin(e);
			}, "pushState"),
			stateStackSize: /* @__PURE__ */ n(function() {
				return this.conditionStack.length;
			}, "stateStackSize"),
			options: { "case-insensitive": !0 },
			performAction: /* @__PURE__ */ n(function(e, t, n, r) {
				switch (n) {
					case 0: return this.begin("open_directive"), "open_directive";
					case 1: return this.begin("acc_title"), 31;
					case 2: return this.popState(), "acc_title_value";
					case 3: return this.begin("acc_descr"), 33;
					case 4: return this.popState(), "acc_descr_value";
					case 5:
						this.begin("acc_descr_multiline");
						break;
					case 6:
						this.popState();
						break;
					case 7: return "acc_descr_multiline_value";
					case 8: break;
					case 9: break;
					case 10: break;
					case 11: return 10;
					case 12: break;
					case 13: break;
					case 14:
						this.begin("href");
						break;
					case 15:
						this.popState();
						break;
					case 16: return 43;
					case 17:
						this.begin("callbackname");
						break;
					case 18:
						this.popState();
						break;
					case 19:
						this.popState(), this.begin("callbackargs");
						break;
					case 20: return 41;
					case 21:
						this.popState();
						break;
					case 22: return 42;
					case 23:
						this.begin("click");
						break;
					case 24:
						this.popState();
						break;
					case 25: return 40;
					case 26: return 4;
					case 27: return 22;
					case 28: return 23;
					case 29: return 24;
					case 30: return 25;
					case 31: return 26;
					case 32: return 28;
					case 33: return 27;
					case 34: return 29;
					case 35: return 12;
					case 36: return 13;
					case 37: return 14;
					case 38: return 15;
					case 39: return 16;
					case 40: return 17;
					case 41: return 18;
					case 42: return 20;
					case 43: return 21;
					case 44: return "date";
					case 45: return 30;
					case 46: return "accDescription";
					case 47: return 36;
					case 48: return 38;
					case 49: return 39;
					case 50: return ":";
					case 51: return 6;
					case 52: return "INVALID";
				}
			}, "anonymous"),
			rules: [
				/^(?:%%\{)/i,
				/^(?:accTitle\s*:\s*)/i,
				/^(?:(?!\n||)*[^\n]*)/i,
				/^(?:accDescr\s*:\s*)/i,
				/^(?:(?!\n||)*[^\n]*)/i,
				/^(?:accDescr\s*\{\s*)/i,
				/^(?:[\}])/i,
				/^(?:[^\}]*)/i,
				/^(?:%%(?!\{)*[^\n]*)/i,
				/^(?:[^\}]%%*[^\n]*)/i,
				/^(?:%%*[^\n]*[\n]*)/i,
				/^(?:[\n]+)/i,
				/^(?:\s+)/i,
				/^(?:%[^\n]*)/i,
				/^(?:href[\s]+["])/i,
				/^(?:["])/i,
				/^(?:[^"]*)/i,
				/^(?:call[\s]+)/i,
				/^(?:\([\s]*\))/i,
				/^(?:\()/i,
				/^(?:[^(]*)/i,
				/^(?:\))/i,
				/^(?:[^)]*)/i,
				/^(?:click[\s]+)/i,
				/^(?:[\s\n])/i,
				/^(?:[^\s\n]*)/i,
				/^(?:gantt\b)/i,
				/^(?:dateFormat\s[^#\n;]+)/i,
				/^(?:inclusiveEndDates\b)/i,
				/^(?:topAxis\b)/i,
				/^(?:axisFormat\s[^#\n;]+)/i,
				/^(?:tickInterval\s[^#\n;]+)/i,
				/^(?:includes\s[^#\n;]+)/i,
				/^(?:excludes\s[^#\n;]+)/i,
				/^(?:todayMarker\s[^\n;]+)/i,
				/^(?:weekday\s+monday\b)/i,
				/^(?:weekday\s+tuesday\b)/i,
				/^(?:weekday\s+wednesday\b)/i,
				/^(?:weekday\s+thursday\b)/i,
				/^(?:weekday\s+friday\b)/i,
				/^(?:weekday\s+saturday\b)/i,
				/^(?:weekday\s+sunday\b)/i,
				/^(?:weekend\s+friday\b)/i,
				/^(?:weekend\s+saturday\b)/i,
				/^(?:\d\d\d\d-\d\d-\d\d\b)/i,
				/^(?:title\s[^\n]+)/i,
				/^(?:accDescription\s[^#\n;]+)/i,
				/^(?:section\s[^\n]+)/i,
				/^(?:[^:\n]+)/i,
				/^(?::[^#\n;]+)/i,
				/^(?::)/i,
				/^(?:$)/i,
				/^(?:.)/i
			],
			conditions: {
				acc_descr_multiline: {
					rules: [6, 7],
					inclusive: !1
				},
				acc_descr: {
					rules: [4],
					inclusive: !1
				},
				acc_title: {
					rules: [2],
					inclusive: !1
				},
				callbackargs: {
					rules: [21, 22],
					inclusive: !1
				},
				callbackname: {
					rules: [
						18,
						19,
						20
					],
					inclusive: !1
				},
				href: {
					rules: [15, 16],
					inclusive: !1
				},
				click: {
					rules: [24, 25],
					inclusive: !1
				},
				INITIAL: {
					rules: [
						0,
						1,
						3,
						5,
						8,
						9,
						10,
						11,
						12,
						13,
						14,
						17,
						23,
						26,
						27,
						28,
						29,
						30,
						31,
						32,
						33,
						34,
						35,
						36,
						37,
						38,
						39,
						40,
						41,
						42,
						43,
						44,
						45,
						46,
						47,
						48,
						49,
						50,
						51,
						52
					],
					inclusive: !0
				}
			}
		};
	})();
	function O() {
		this.yy = {};
	}
	return n(O, "Parser"), O.prototype = D, D.Parser = O, new O();
})();
L.parser = L;
var de = L;
I.default.extend(se.default), I.default.extend(ce.default), I.default.extend(le.default);
var fe = {
	friday: 5,
	saturday: 6
}, R = "", z = "", B = void 0, V = "", H = [], U = [], pe = /* @__PURE__ */ new Map(), me = [], W = [], G = "", he = "", ge = [
	"active",
	"done",
	"crit",
	"milestone",
	"vert"
], _e = [], K = "", q = !1, ve = !1, ye = "sunday", J = "saturday", be = 0, xe = /* @__PURE__ */ n(function() {
	me = [], W = [], G = "", _e = [], et = 0, rt = void 0, X = void 0, Z = [], R = "", z = "", he = "", B = void 0, V = "", H = [], U = [], q = !1, ve = !1, be = 0, pe = /* @__PURE__ */ new Map(), K = "", i(), ye = "sunday", J = "saturday";
}, "clear"), Se = /* @__PURE__ */ n(function(e) {
	K = e;
}, "setDiagramId"), Ce = /* @__PURE__ */ n(function(e) {
	z = e;
}, "setAxisFormat"), we = /* @__PURE__ */ n(function() {
	return z;
}, "getAxisFormat"), Te = /* @__PURE__ */ n(function(e) {
	B = e;
}, "setTickInterval"), Ee = /* @__PURE__ */ n(function() {
	return B;
}, "getTickInterval"), De = /* @__PURE__ */ n(function(e) {
	V = e;
}, "setTodayMarker"), Oe = /* @__PURE__ */ n(function() {
	return V;
}, "getTodayMarker"), ke = /* @__PURE__ */ n(function(e) {
	R = e;
}, "setDateFormat"), Ae = /* @__PURE__ */ n(function() {
	q = !0;
}, "enableInclusiveEndDates"), je = /* @__PURE__ */ n(function() {
	return q;
}, "endDatesAreInclusive"), Me = /* @__PURE__ */ n(function() {
	ve = !0;
}, "enableTopAxis"), Ne = /* @__PURE__ */ n(function() {
	return ve;
}, "topAxisEnabled"), Pe = /* @__PURE__ */ n(function(e) {
	he = e;
}, "setDisplayMode"), Fe = /* @__PURE__ */ n(function() {
	return he;
}, "getDisplayMode"), Ie = /* @__PURE__ */ n(function() {
	return R;
}, "getDateFormat"), Le = /* @__PURE__ */ n(function(e) {
	H = e.toLowerCase().split(/[\s,]+/);
}, "setIncludes"), Re = /* @__PURE__ */ n(function() {
	return H;
}, "getIncludes"), ze = /* @__PURE__ */ n(function(e) {
	U = e.toLowerCase().split(/[\s,]+/);
}, "setExcludes"), Be = /* @__PURE__ */ n(function() {
	return U;
}, "getExcludes"), Ve = /* @__PURE__ */ n(function() {
	return pe;
}, "getLinks"), He = /* @__PURE__ */ n(function(e) {
	G = e, me.push(e);
}, "addSection"), Ue = /* @__PURE__ */ n(function() {
	return me;
}, "getSections"), We = /* @__PURE__ */ n(function() {
	let e = st(), t = 0;
	for (; !e && t < 10;) e = st(), t++;
	return W = Z, W;
}, "getTasks"), Ge = /* @__PURE__ */ n(function(e, t, n, r) {
	let i = e.format(t.trim()), a = e.format("YYYY-MM-DD");
	return r.includes(i) || r.includes(a) ? !1 : n.includes("weekends") && (e.isoWeekday() === fe[J] || e.isoWeekday() === fe[J] + 1) || n.includes(e.format("dddd").toLowerCase()) ? !0 : n.includes(i) || n.includes(a);
}, "isInvalidDate"), Ke = /* @__PURE__ */ n(function(e) {
	ye = e;
}, "setWeekday"), qe = /* @__PURE__ */ n(function() {
	return ye;
}, "getWeekday"), Je = /* @__PURE__ */ n(function(e) {
	J = e;
}, "setWeekend"), Ye = /* @__PURE__ */ n(function(e, t, n, r) {
	if (!n.length || e.manualEndTime) return;
	let i;
	i = e.startTime instanceof Date ? (0, I.default)(e.startTime) : (0, I.default)(e.startTime, t, !0), i = i.add(1, "d");
	let a;
	a = e.endTime instanceof Date ? (0, I.default)(e.endTime) : (0, I.default)(e.endTime, t, !0);
	let [o, s] = Xe(i, a, t, n, r);
	e.endTime = o.toDate(), e.renderEndTime = s;
}, "checkTaskDates"), Xe = /* @__PURE__ */ n(function(e, t, n, r, i) {
	let a = !1, o = null;
	for (; e <= t;) a || (o = t.toDate()), a = Ge(e, n, r, i), a && (t = t.add(1, "d")), e = e.add(1, "d");
	return [t, o];
}, "fixTaskDates"), Ze = /* @__PURE__ */ n(function(e, t, i) {
	if (i = i.trim(), (/* @__PURE__ */ n((e) => {
		let t = e.trim();
		return t === "x" || t === "X";
	}, "isTimestampFormat"))(t) && /^\d+$/.test(i)) return new Date(Number(i));
	let a = /^after\s+(?<ids>[\d\w- ]+)/.exec(i);
	if (a !== null) {
		let e = null;
		for (let t of a.groups.ids.split(" ")) {
			let n = Q(t);
			n !== void 0 && (!e || n.endTime > e.endTime) && (e = n);
		}
		if (e) return e.endTime;
		let t = /* @__PURE__ */ new Date();
		return t.setHours(0, 0, 0, 0), t;
	}
	let o = (0, I.default)(i, t.trim(), !0);
	if (o.isValid()) return o.toDate();
	{
		r.debug("Invalid date:" + i), r.debug("With date format:" + t.trim());
		let e = new Date(i);
		if (e === void 0 || isNaN(e.getTime()) || e.getFullYear() < -1e4 || e.getFullYear() > 1e4) throw Error("Invalid date:" + i);
		return e;
	}
}, "getStartDate"), Qe = /* @__PURE__ */ n(function(e) {
	let t = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());
	return t === null ? [NaN, "ms"] : [Number.parseFloat(t[1]), t[2]];
}, "parseDuration"), $e = /* @__PURE__ */ n(function(e, t, n, r = !1) {
	n = n.trim();
	let i = /^until\s+(?<ids>[\d\w- ]+)/.exec(n);
	if (i !== null) {
		let e = null;
		for (let t of i.groups.ids.split(" ")) {
			let n = Q(t);
			n !== void 0 && (!e || n.startTime < e.startTime) && (e = n);
		}
		if (e) return e.startTime;
		let t = /* @__PURE__ */ new Date();
		return t.setHours(0, 0, 0, 0), t;
	}
	let a = (0, I.default)(n, t.trim(), !0);
	if (a.isValid()) return r && (a = a.add(1, "d")), a.toDate();
	let o = (0, I.default)(e), [s, c] = Qe(n);
	if (!Number.isNaN(s)) {
		let e = o.add(s, c);
		e.isValid() && (o = e);
	}
	return o.toDate();
}, "getEndDate"), et = 0, Y = /* @__PURE__ */ n(function(e) {
	return e === void 0 ? (et += 1, "task" + et) : e;
}, "parseId"), tt = /* @__PURE__ */ n(function(e, t) {
	let n;
	n = t.substr(0, 1) === ":" ? t.substr(1, t.length) : t;
	let r = n.split(","), i = {};
	pt(r, i, ge);
	for (let e = 0; e < r.length; e++) r[e] = r[e].trim();
	let a = "";
	switch (r.length) {
		case 1:
			i.id = Y(), i.startTime = e.endTime, a = r[0];
			break;
		case 2:
			i.id = Y(), i.startTime = Ze(void 0, R, r[0]), a = r[1];
			break;
		case 3:
			i.id = Y(r[0]), i.startTime = Ze(void 0, R, r[1]), a = r[2];
			break;
		default:
	}
	return a && (i.endTime = $e(i.startTime, R, a, q), i.manualEndTime = (0, I.default)(a, "YYYY-MM-DD", !0).isValid(), Ye(i, R, U, H)), i;
}, "compileData"), nt = /* @__PURE__ */ n(function(e, t) {
	let n;
	n = t.substr(0, 1) === ":" ? t.substr(1, t.length) : t;
	let r = n.split(","), i = {};
	pt(r, i, ge);
	for (let e = 0; e < r.length; e++) r[e] = r[e].trim();
	switch (r.length) {
		case 1:
			i.id = Y(), i.startTime = {
				type: "prevTaskEnd",
				id: e
			}, i.endTime = { data: r[0] };
			break;
		case 2:
			i.id = Y(), i.startTime = {
				type: "getStartDate",
				startData: r[0]
			}, i.endTime = { data: r[1] };
			break;
		case 3:
			i.id = Y(r[0]), i.startTime = {
				type: "getStartDate",
				startData: r[1]
			}, i.endTime = { data: r[2] };
			break;
		default:
	}
	return i;
}, "parseData"), rt, X, Z = [], it = {}, at = /* @__PURE__ */ n(function(e, t) {
	let n = {
		section: G,
		type: G,
		processed: !1,
		manualEndTime: !1,
		renderEndTime: null,
		raw: { data: t },
		task: e,
		classes: []
	}, r = nt(X, t);
	n.raw.startTime = r.startTime, n.raw.endTime = r.endTime, n.id = r.id, n.prevTaskId = X, n.active = r.active, n.done = r.done, n.crit = r.crit, n.milestone = r.milestone, n.vert = r.vert, n.order = be, be++;
	let i = Z.push(n);
	X = n.id, it[n.id] = i - 1;
}, "addTask"), Q = /* @__PURE__ */ n(function(e) {
	let t = it[e];
	return Z[t];
}, "findTaskById"), ot = /* @__PURE__ */ n(function(e, t) {
	let n = {
		section: G,
		type: G,
		description: e,
		task: e,
		classes: []
	}, r = tt(rt, t);
	n.startTime = r.startTime, n.endTime = r.endTime, n.id = r.id, n.active = r.active, n.done = r.done, n.crit = r.crit, n.milestone = r.milestone, n.vert = r.vert, rt = n, W.push(n);
}, "addTaskOrg"), st = /* @__PURE__ */ n(function() {
	let e = /* @__PURE__ */ n(function(e) {
		let t = Z[e], n = "";
		switch (Z[e].raw.startTime.type) {
			case "prevTaskEnd":
				t.startTime = Q(t.prevTaskId).endTime;
				break;
			case "getStartDate":
				n = Ze(void 0, R, Z[e].raw.startTime.startData), n && (Z[e].startTime = n);
				break;
		}
		return Z[e].startTime && (Z[e].endTime = $e(Z[e].startTime, R, Z[e].raw.endTime.data, q), Z[e].endTime && (Z[e].processed = !0, Z[e].manualEndTime = (0, I.default)(Z[e].raw.endTime.data, "YYYY-MM-DD", !0).isValid(), Ye(Z[e], R, U, H))), Z[e].processed;
	}, "compileTask"), t = !0;
	for (let [n, r] of Z.entries()) e(n), t &&= r.processed;
	return t;
}, "compileTasks"), ct = /* @__PURE__ */ n(function(e, t) {
	let n = t;
	l().securityLevel !== "loose" && (n = (0, oe.sanitizeUrl)(t)), e.split(",").forEach(function(e) {
		Q(e) !== void 0 && (dt(e, () => {
			window.open(n, "_self");
		}), pe.set(e, n));
	}), lt(e, "clickable");
}, "setLink"), lt = /* @__PURE__ */ n(function(e, t) {
	e.split(",").forEach(function(e) {
		let n = Q(e);
		n !== void 0 && n.classes.push(t);
	});
}, "setClass"), ut = /* @__PURE__ */ n(function(e, t, n) {
	if (l().securityLevel !== "loose" || t === void 0) return;
	let r = [];
	if (typeof n == "string") {
		r = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
		for (let e = 0; e < r.length; e++) {
			let t = r[e].trim();
			t.startsWith("\"") && t.endsWith("\"") && (t = t.substr(1, t.length - 2)), r[e] = t;
		}
	}
	r.length === 0 && r.push(e), Q(e) !== void 0 && dt(e, () => {
		re.runFunc(t, ...r);
	});
}, "setClickFun"), dt = /* @__PURE__ */ n(function(e, t) {
	_e.push(function() {
		let n = K ? `${K}-${e}` : e, r = document.querySelector(`[id="${n}"]`);
		r !== null && r.addEventListener("click", function() {
			t();
		});
	}, function() {
		let n = K ? `${K}-${e}` : e, r = document.querySelector(`[id="${n}-text"]`);
		r !== null && r.addEventListener("click", function() {
			t();
		});
	});
}, "pushFun"), ft = {
	getConfig: /* @__PURE__ */ n(() => l().gantt, "getConfig"),
	clear: xe,
	setDateFormat: ke,
	getDateFormat: Ie,
	enableInclusiveEndDates: Ae,
	endDatesAreInclusive: je,
	enableTopAxis: Me,
	topAxisEnabled: Ne,
	setAxisFormat: Ce,
	getAxisFormat: we,
	setTickInterval: Te,
	getTickInterval: Ee,
	setTodayMarker: De,
	getTodayMarker: Oe,
	setAccTitle: f,
	getAccTitle: c,
	setDiagramTitle: p,
	getDiagramTitle: u,
	setDiagramId: Se,
	setDisplayMode: Pe,
	getDisplayMode: Fe,
	setAccDescription: d,
	getAccDescription: s,
	addSection: He,
	getSections: Ue,
	getTasks: We,
	addTask: at,
	findTaskById: Q,
	addTaskOrg: ot,
	setIncludes: Le,
	getIncludes: Re,
	setExcludes: ze,
	getExcludes: Be,
	setClickEvent: /* @__PURE__ */ n(function(e, t, n) {
		e.split(",").forEach(function(e) {
			ut(e, t, n);
		}), lt(e, "clickable");
	}, "setClickEvent"),
	setLink: ct,
	getLinks: Ve,
	bindFunctions: /* @__PURE__ */ n(function(e) {
		_e.forEach(function(t) {
			t(e);
		});
	}, "bindFunctions"),
	parseDuration: Qe,
	isInvalidDate: Ge,
	setWeekday: Ke,
	getWeekday: qe,
	setWeekend: Je
};
function pt(e, t, n) {
	let r = !0;
	for (; r;) r = !1, n.forEach(function(n) {
		let i = "^\\s*" + n + "\\s*$", a = new RegExp(i);
		e[0].match(a) && (t[n] = !0, e.shift(1), r = !0);
	});
}
n(pt, "getTaskTags"), I.default.extend(ue.default);
var mt = /* @__PURE__ */ n(function() {
	r.debug("Something is calling, setConf, remove the call");
}, "setConf"), ht = {
	monday: D,
	tuesday: j,
	wednesday: M,
	thursday: A,
	friday: E,
	saturday: O,
	sunday: k
}, gt = /* @__PURE__ */ n((e, t) => {
	let n = [...e].map(() => -Infinity), r = [...e].sort((e, t) => e.startTime - t.startTime || e.order - t.order), i = 0;
	for (let e of r) for (let r = 0; r < n.length; r++) if (e.startTime >= n[r]) {
		n[r] = e.endTime, e.order = r + t, r > i && (i = r);
		break;
	}
	return i;
}, "getMaxIntersections"), $, _t = 1e4, vt = {
	parser: de,
	db: ft,
	renderer: {
		setConf: mt,
		draw: /* @__PURE__ */ n(function(e, t, i, s) {
			let c = l().gantt;
			s.db.setDiagramId(t);
			let u = l().securityLevel, d;
			u === "sandbox" && (d = v("#i" + t));
			let f = v(u === "sandbox" ? d.nodes()[0].contentDocument.body : "body"), p = u === "sandbox" ? d.nodes()[0].contentDocument : document, E = p.getElementById(t);
			$ = E.parentElement.offsetWidth, $ === void 0 && ($ = 1200), c.useWidth !== void 0 && ($ = c.useWidth);
			let D = s.db.getTasks(), O = [];
			for (let e of D) O.push(e.type);
			O = ce(O);
			let k = {}, A = 2 * c.topPadding;
			if (s.db.getDisplayMode() === "compact" || c.displayMode === "compact") {
				let e = {};
				for (let t of D) e[t.section] === void 0 ? e[t.section] = [t] : e[t.section].push(t);
				let t = 0;
				for (let n of Object.keys(e)) {
					let r = gt(e[n], t) + 1;
					t += r, A += r * (c.barHeight + c.barGap), k[n] = r;
				}
			} else {
				A += D.length * (c.barHeight + c.barGap);
				for (let e of O) k[e] = D.filter((t) => t.type === e).length;
			}
			E.setAttribute("viewBox", "0 0 " + $ + " " + A);
			let j = f.select(`[id="${t}"]`), M = ne().domain([h(D, function(e) {
				return e.startTime;
			}), m(D, function(e) {
				return e.endTime;
			})]).rangeRound([0, $ - c.leftPadding - c.rightPadding]);
			function N(e, t) {
				let n = e.startTime, r = t.startTime, i = 0;
				return n > r ? i = 1 : n < r && (i = -1), i;
			}
			n(N, "taskCompare"), D.sort(N), re(D, $, A), o(j, A, $, c.useMaxWidth), j.append("text").text(s.db.getDiagramTitle()).attr("x", $ / 2).attr("y", c.titleTopMargin).attr("class", "titleText");
			function re(e, t, n) {
				let r = c.barHeight, i = r + c.barGap, a = c.topPadding, o = c.leftPadding, l = b().domain([0, O.length]).range(["#00B9FA", "#F95002"]).interpolate(y);
				ie(i, a, o, t, n, e, s.db.getExcludes(), s.db.getIncludes()), ae(o, a, t, n), P(e, i, a, o, r, l, t, n), oe(i, a, o, r, l), se(o, a, t, n);
			}
			n(re, "makeGantt");
			function P(e, n, r, i, a, o, u) {
				e.sort((e, t) => e.vert === t.vert ? 0 : e.vert ? 1 : -1);
				let d = [...new Set(e.map((e) => e.order))].map((t) => e.find((e) => e.order === t));
				j.append("g").selectAll("rect").data(d).enter().append("rect").attr("x", 0).attr("y", function(e, t) {
					return t = e.order, t * n + r - 2;
				}).attr("width", function() {
					return u - c.rightPadding / 2;
				}).attr("height", n).attr("class", function(e) {
					for (let [t, n] of O.entries()) if (e.type === n) return "section section" + t % c.numberSectionStyles;
					return "section section0";
				}).enter();
				let f = j.append("g").selectAll("rect").data(e).enter(), p = s.db.getLinks();
				if (f.append("rect").attr("id", function(e) {
					return t + "-" + e.id;
				}).attr("rx", 3).attr("ry", 3).attr("x", function(e) {
					return e.milestone ? M(e.startTime) + i + .5 * (M(e.endTime) - M(e.startTime)) - .5 * a : M(e.startTime) + i;
				}).attr("y", function(e, t) {
					return t = e.order, e.vert ? c.gridLineStartPadding : t * n + r;
				}).attr("width", function(e) {
					return e.milestone ? a : e.vert ? .08 * a : M(e.renderEndTime || e.endTime) - M(e.startTime);
				}).attr("height", function(e) {
					return e.vert ? D.length * (c.barHeight + c.barGap) + c.barHeight * 2 : a;
				}).attr("transform-origin", function(e, t) {
					return t = e.order, (M(e.startTime) + i + .5 * (M(e.endTime) - M(e.startTime))).toString() + "px " + (t * n + r + .5 * a).toString() + "px";
				}).attr("class", function(e) {
					let t = "";
					e.classes.length > 0 && (t = e.classes.join(" "));
					let n = 0;
					for (let [t, r] of O.entries()) e.type === r && (n = t % c.numberSectionStyles);
					let r = "";
					return e.active ? e.crit ? r += " activeCrit" : r = " active" : e.done ? r = e.crit ? " doneCrit" : " done" : e.crit && (r += " crit"), r.length === 0 && (r = " task"), e.milestone && (r = " milestone " + r), e.vert && (r = " vert " + r), r += n, r += " " + t, "task" + r;
				}), f.append("text").attr("id", function(e) {
					return t + "-" + e.id + "-text";
				}).text(function(e) {
					return e.task;
				}).attr("font-size", c.fontSize).attr("x", function(e) {
					let t = M(e.startTime), n = M(e.renderEndTime || e.endTime);
					if (e.milestone && (t += .5 * (M(e.endTime) - M(e.startTime)) - .5 * a, n = t + a), e.vert) return M(e.startTime) + i;
					let r = this.getBBox().width;
					return r > n - t ? n + r + 1.5 * c.leftPadding > u ? t + i - 5 : n + i + 5 : (n - t) / 2 + t + i;
				}).attr("y", function(e, t) {
					return e.vert ? c.gridLineStartPadding + D.length * (c.barHeight + c.barGap) + 60 : (t = e.order, t * n + c.barHeight / 2 + (c.fontSize / 2 - 2) + r);
				}).attr("text-height", a).attr("class", function(e) {
					let t = M(e.startTime), n = M(e.endTime);
					e.milestone && (n = t + a);
					let r = this.getBBox().width, i = "";
					e.classes.length > 0 && (i = e.classes.join(" "));
					let o = 0;
					for (let [t, n] of O.entries()) e.type === n && (o = t % c.numberSectionStyles);
					let s = "";
					return e.active && (s = e.crit ? "activeCritText" + o : "activeText" + o), e.done ? s = e.crit ? s + " doneCritText" + o : s + " doneText" + o : e.crit && (s = s + " critText" + o), e.milestone && (s += " milestoneText"), e.vert && (s += " vertText"), r > n - t ? n + r + 1.5 * c.leftPadding > u ? i + " taskTextOutsideLeft taskTextOutside" + o + " " + s : i + " taskTextOutsideRight taskTextOutside" + o + " " + s + " width-" + r : i + " taskText taskText" + o + " " + s + " width-" + r;
				}), l().securityLevel === "sandbox") {
					let e;
					e = v("#i" + t);
					let n = e.nodes()[0].contentDocument;
					f.filter(function(e) {
						return p.has(e.id);
					}).each(function(e) {
						var r = n.querySelector("#" + CSS.escape(t + "-" + e.id)), i = n.querySelector("#" + CSS.escape(t + "-" + e.id + "-text"));
						let a = r.parentNode;
						var o = n.createElement("a");
						o.setAttribute("xlink:href", p.get(e.id)), o.setAttribute("target", "_top"), a.appendChild(o), o.appendChild(r), o.appendChild(i);
					});
				}
			}
			n(P, "drawRects");
			function ie(e, n, i, a, o, l, u, d) {
				if (u.length === 0 && d.length === 0) return;
				let f, p;
				for (let { startTime: e, endTime: t } of l) (f === void 0 || e < f) && (f = e), (p === void 0 || t > p) && (p = t);
				if (!f || !p) return;
				if ((0, I.default)(p).diff((0, I.default)(f), "year") > 5) {
					r.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");
					return;
				}
				let m = s.db.getDateFormat(), h = [], g = null, _ = (0, I.default)(f);
				for (; _.valueOf() <= p;) s.db.isInvalidDate(_, m, u, d) ? g ? g.end = _ : g = {
					start: _,
					end: _
				} : g &&= (h.push(g), null), _ = _.add(1, "d");
				j.append("g").selectAll("rect").data(h).enter().append("rect").attr("id", (e) => t + "-exclude-" + e.start.format("YYYY-MM-DD")).attr("x", (e) => M(e.start.startOf("day")) + i).attr("y", c.gridLineStartPadding).attr("width", (e) => M(e.end.endOf("day")) - M(e.start.startOf("day"))).attr("height", o - n - c.gridLineStartPadding).attr("transform-origin", function(t, n) {
					return (M(t.start) + i + .5 * (M(t.end) - M(t.start))).toString() + "px " + (n * e + .5 * o).toString() + "px";
				}).attr("class", "exclude-range");
			}
			n(ie, "drawExcludeDays");
			function F(e, t, n, r) {
				if (n <= 0 || e > t) return Infinity;
				let i = t - e, a = I.default.duration({ [r ?? "day"]: n }).asMilliseconds();
				return a <= 0 ? Infinity : Math.ceil(i / a);
			}
			n(F, "getEstimatedTickCount");
			function ae(e, t, n, i) {
				let a = s.db.getDateFormat(), o = s.db.getAxisFormat(), l;
				l = o || (a === "D" ? "%d" : c.axisFormat ?? "%Y-%m-%d");
				let u = g(M).tickSize(-i + t + c.gridLineStartPadding).tickFormat(te(l)), d = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(s.db.getTickInterval() || c.tickInterval);
				if (d !== null) {
					let e = parseInt(d[1], 10);
					if (isNaN(e) || e <= 0) r.warn(`Invalid tick interval value: "${d[1]}". Skipping custom tick interval.`);
					else {
						let t = d[2], n = s.db.getWeekday() || c.weekday, i = M.domain(), a = i[0], o = i[1], l = F(a, o, e, t);
						if (l > _t) r.warn(`The tick interval "${e}${t}" would generate ${l} ticks, which exceeds the maximum allowed (${_t}). This may indicate an invalid date or time range. Skipping custom tick interval.`);
						else switch (t) {
							case "millisecond":
								u.ticks(x.every(e));
								break;
							case "second":
								u.ticks(S.every(e));
								break;
							case "minute":
								u.ticks(C.every(e));
								break;
							case "hour":
								u.ticks(w.every(e));
								break;
							case "day":
								u.ticks(T.every(e));
								break;
							case "week":
								u.ticks(ht[n].every(e));
								break;
							case "month":
								u.ticks(ee.every(e));
								break;
						}
					}
				}
				if (j.append("g").attr("class", "grid").attr("transform", "translate(" + e + ", " + (i - 50) + ")").call(u).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"), s.db.topAxisEnabled() || c.topAxis) {
					let n = _(M).tickSize(-i + t + c.gridLineStartPadding).tickFormat(te(l));
					if (d !== null) {
						let e = parseInt(d[1], 10);
						if (isNaN(e) || e <= 0) r.warn(`Invalid tick interval value: "${d[1]}". Skipping custom tick interval.`);
						else {
							let t = d[2], r = s.db.getWeekday() || c.weekday, i = M.domain(), a = i[0], o = i[1];
							if (F(a, o, e, t) <= _t) switch (t) {
								case "millisecond":
									n.ticks(x.every(e));
									break;
								case "second":
									n.ticks(S.every(e));
									break;
								case "minute":
									n.ticks(C.every(e));
									break;
								case "hour":
									n.ticks(w.every(e));
									break;
								case "day":
									n.ticks(T.every(e));
									break;
								case "week":
									n.ticks(ht[r].every(e));
									break;
								case "month":
									n.ticks(ee.every(e));
									break;
							}
						}
					}
					j.append("g").attr("class", "grid").attr("transform", "translate(" + e + ", " + t + ")").call(n).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10);
				}
			}
			n(ae, "makeGrid");
			function oe(e, t) {
				let n = 0, r = Object.keys(k).map((e) => [e, k[e]]);
				j.append("g").selectAll("text").data(r).enter().append(function(e) {
					let t = e[0].split(a.lineBreakRegex), n = -(t.length - 1) / 2, r = p.createElementNS("http://www.w3.org/2000/svg", "text");
					r.setAttribute("dy", n + "em");
					for (let [e, n] of t.entries()) {
						let t = p.createElementNS("http://www.w3.org/2000/svg", "tspan");
						t.setAttribute("alignment-baseline", "central"), t.setAttribute("x", "10"), e > 0 && t.setAttribute("dy", "1em"), t.textContent = n, r.appendChild(t);
					}
					return r;
				}).attr("x", 10).attr("y", function(i, a) {
					if (a > 0) for (let o = 0; o < a; o++) return n += r[a - 1][1], i[1] * e / 2 + n * e + t;
					else return i[1] * e / 2 + t;
				}).attr("font-size", c.sectionFontSize).attr("class", function(e) {
					for (let [t, n] of O.entries()) if (e[0] === n) return "sectionTitle sectionTitle" + t % c.numberSectionStyles;
					return "sectionTitle";
				});
			}
			n(oe, "vertLabels");
			function se(e, t, n, r) {
				let i = s.db.getTodayMarker();
				if (i === "off") return;
				let a = j.append("g").attr("class", "today"), o = /* @__PURE__ */ new Date(), l = a.append("line");
				l.attr("x1", M(o) + e).attr("x2", M(o) + e).attr("y1", c.titleTopMargin).attr("y2", r - c.titleTopMargin).attr("class", "today"), i !== "" && l.attr("style", i.replace(/,/g, ";"));
			}
			n(se, "drawToday");
			function ce(e) {
				let t = {}, n = [];
				for (let r = 0, i = e.length; r < i; ++r) Object.prototype.hasOwnProperty.call(t, e[r]) || (t[e[r]] = !0, n.push(e[r]));
				return n;
			}
			n(ce, "checkUnique");
		}, "draw")
	},
	styles: /* @__PURE__ */ n((e) => `
  .mermaid-main-font {
        font-family: ${e.fontFamily};
  }

  .exclude-range {
    fill: ${e.excludeBkgColor};
  }

  .section {
    stroke: none;
    opacity: 0.2;
  }

  .section0 {
    fill: ${e.sectionBkgColor};
  }

  .section2 {
    fill: ${e.sectionBkgColor2};
  }

  .section1,
  .section3 {
    fill: ${e.altSectionBkgColor};
    opacity: 0.2;
  }

  .sectionTitle0 {
    fill: ${e.titleColor};
  }

  .sectionTitle1 {
    fill: ${e.titleColor};
  }

  .sectionTitle2 {
    fill: ${e.titleColor};
  }

  .sectionTitle3 {
    fill: ${e.titleColor};
  }

  .sectionTitle {
    text-anchor: start;
    font-family: ${e.fontFamily};
  }


  /* Grid and axis */

  .grid .tick {
    stroke: ${e.gridColor};
    opacity: 0.8;
    shape-rendering: crispEdges;
  }

  .grid .tick text {
    font-family: ${e.fontFamily};
    fill: ${e.textColor};
  }

  .grid path {
    stroke-width: 0;
  }


  /* Today line */

  .today {
    fill: none;
    stroke: ${e.todayLineColor};
    stroke-width: 2px;
  }


  /* Task styling */

  /* Default task */

  .task {
    stroke-width: 2;
  }

  .taskText {
    text-anchor: middle;
    font-family: ${e.fontFamily};
  }

  .taskTextOutsideRight {
    fill: ${e.taskTextDarkColor};
    text-anchor: start;
    font-family: ${e.fontFamily};
  }

  .taskTextOutsideLeft {
    fill: ${e.taskTextDarkColor};
    text-anchor: end;
  }


  /* Special case clickable */

  .task.clickable {
    cursor: pointer;
  }

  .taskText.clickable {
    cursor: pointer;
    fill: ${e.taskTextClickableColor} !important;
    font-weight: bold;
  }

  .taskTextOutsideLeft.clickable {
    cursor: pointer;
    fill: ${e.taskTextClickableColor} !important;
    font-weight: bold;
  }

  .taskTextOutsideRight.clickable {
    cursor: pointer;
    fill: ${e.taskTextClickableColor} !important;
    font-weight: bold;
  }


  /* Specific task settings for the sections*/

  .taskText0,
  .taskText1,
  .taskText2,
  .taskText3 {
    fill: ${e.taskTextColor};
  }

  .task0,
  .task1,
  .task2,
  .task3 {
    fill: ${e.taskBkgColor};
    stroke: ${e.taskBorderColor};
  }

  .taskTextOutside0,
  .taskTextOutside2
  {
    fill: ${e.taskTextOutsideColor};
  }

  .taskTextOutside1,
  .taskTextOutside3 {
    fill: ${e.taskTextOutsideColor};
  }


  /* Active task */

  .active0,
  .active1,
  .active2,
  .active3 {
    fill: ${e.activeTaskBkgColor};
    stroke: ${e.activeTaskBorderColor};
  }

  .activeText0,
  .activeText1,
  .activeText2,
  .activeText3 {
    fill: ${e.taskTextDarkColor} !important;
  }


  /* Completed task */

  .done0,
  .done1,
  .done2,
  .done3 {
    stroke: ${e.doneTaskBorderColor};
    fill: ${e.doneTaskBkgColor};
    stroke-width: 2;
  }

  .doneText0,
  .doneText1,
  .doneText2,
  .doneText3 {
    fill: ${e.taskTextDarkColor} !important;
  }

  /* Done task text displayed outside the bar sits against the diagram background,
     not against the done-task bar, so it must use the outside/contrast color. */
  .doneText0.taskTextOutsideLeft,
  .doneText0.taskTextOutsideRight,
  .doneText1.taskTextOutsideLeft,
  .doneText1.taskTextOutsideRight,
  .doneText2.taskTextOutsideLeft,
  .doneText2.taskTextOutsideRight,
  .doneText3.taskTextOutsideLeft,
  .doneText3.taskTextOutsideRight {
    fill: ${e.taskTextOutsideColor} !important;
  }


  /* Tasks on the critical line */

  .crit0,
  .crit1,
  .crit2,
  .crit3 {
    stroke: ${e.critBorderColor};
    fill: ${e.critBkgColor};
    stroke-width: 2;
  }

  .activeCrit0,
  .activeCrit1,
  .activeCrit2,
  .activeCrit3 {
    stroke: ${e.critBorderColor};
    fill: ${e.activeTaskBkgColor};
    stroke-width: 2;
  }

  .doneCrit0,
  .doneCrit1,
  .doneCrit2,
  .doneCrit3 {
    stroke: ${e.critBorderColor};
    fill: ${e.doneTaskBkgColor};
    stroke-width: 2;
    cursor: pointer;
    shape-rendering: crispEdges;
  }

  .milestone {
    transform: rotate(45deg) scale(0.8,0.8);
  }

  .milestoneText {
    font-style: italic;
  }
  .doneCritText0,
  .doneCritText1,
  .doneCritText2,
  .doneCritText3 {
    fill: ${e.taskTextDarkColor} !important;
  }

  /* Done-crit task text outside the bar \u2014 same reasoning as doneText above. */
  .doneCritText0.taskTextOutsideLeft,
  .doneCritText0.taskTextOutsideRight,
  .doneCritText1.taskTextOutsideLeft,
  .doneCritText1.taskTextOutsideRight,
  .doneCritText2.taskTextOutsideLeft,
  .doneCritText2.taskTextOutsideRight,
  .doneCritText3.taskTextOutsideLeft,
  .doneCritText3.taskTextOutsideRight {
    fill: ${e.taskTextOutsideColor} !important;
  }

  .vert {
    stroke: ${e.vertLineColor};
  }

  .vertText {
    font-size: 15px;
    text-anchor: middle;
    fill: ${e.vertLineColor} !important;
  }

  .activeCritText0,
  .activeCritText1,
  .activeCritText2,
  .activeCritText3 {
    fill: ${e.taskTextDarkColor} !important;
  }

  .titleText {
    text-anchor: middle;
    font-size: 18px;
    fill: ${e.titleColor || e.textColor};
    font-family: ${e.fontFamily};
  }
`, "getStyles")
};
//#endregion
export { vt as diagram };
