@qwen-code/web-shell 0.27.1 → 0.27.2-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/NOTICES.txt +10721 -958
  2. package/dist/{PierreFilePreview-BT_JRIvF.js → PierreFilePreview-B4n5WCtp.js} +1 -1
  3. package/dist/SpreadsheetPreview-Bbxqbb8z.js +379 -0
  4. package/dist/{WorkspaceFileBrowser-G1yA2eBf.js → WorkspaceFileBrowser-Bj4bedRP.js} +2 -2
  5. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  6. package/dist/abnfDiagram-VCTEODGH-CQWhk3bg.js +87 -0
  7. package/dist/abnfDiagram-VCTEODGH-DXK3iWaN.js +87 -0
  8. package/dist/{agents-route-bkxyBAkN.js → agents-route-CT-Zjn4s.js} +2 -2
  9. package/dist/arc-BcP3aO-G.js +83 -0
  10. package/dist/arc-DkZAOzaU.js +83 -0
  11. package/dist/architectureDiagram-5GKGNRK7-DhcVEkLQ.js +4775 -0
  12. package/dist/architectureDiagram-5GKGNRK7-DusU8ybk.js +4776 -0
  13. package/dist/blockDiagram-NRAW4CY4-BMOuo5wl.js +1414 -0
  14. package/dist/blockDiagram-NRAW4CY4-YciA8-8I.js +1414 -0
  15. package/dist/c4Diagram-UCG6FXSJ-BJxpHO4v.js +1508 -0
  16. package/dist/c4Diagram-UCG6FXSJ-DNpq-cdF.js +1508 -0
  17. package/dist/channel-CfhQTpjX.js +5 -0
  18. package/dist/channel-QZAYPfF8.js +5 -0
  19. package/dist/chunk-2Q5K7J3B-EGbMOnEe.js +15 -0
  20. package/dist/chunk-2Q5K7J3B-mtpkChaF.js +15 -0
  21. package/dist/chunk-5VM5RSS4-CP4Q2W8n.js +19 -0
  22. package/dist/chunk-5VM5RSS4-CucJ3wyB.js +19 -0
  23. package/dist/chunk-F27PBJKO-CS9kzvAx.js +68 -0
  24. package/dist/chunk-F27PBJKO-Cfw_29T-.js +68 -0
  25. package/dist/chunk-G27WJ6UU-BZzmQ8FW.js +1408 -0
  26. package/dist/chunk-G27WJ6UU-DdeEiwmL.js +1408 -0
  27. package/dist/chunk-JWPE2WC7-BL_hjRLf.js +8 -0
  28. package/dist/chunk-JWPE2WC7-C03UDQBx.js +8 -0
  29. package/dist/chunk-LCL6LL3I-CNn3XyuL.js +1533 -0
  30. package/dist/chunk-LCL6LL3I-CR-IGGIM.js +1533 -0
  31. package/dist/chunk-POPQ4Y6H-BVQbxVHz.js +19 -0
  32. package/dist/chunk-POPQ4Y6H-UJK1fYGP.js +19 -0
  33. package/dist/chunk-SVP7TREG-B-E-xFG8.js +664 -0
  34. package/dist/chunk-SVP7TREG-BUmyTmov.js +664 -0
  35. package/dist/chunk-XXDRQBXY-BDcf4DQz.js +8 -0
  36. package/dist/chunk-XXDRQBXY-BHAq0mtL.js +8 -0
  37. package/dist/classDiagram-DTDB5LWJ-CVA3J-EH.js +16 -0
  38. package/dist/classDiagram-DTDB5LWJ-Dh121Rlt.js +16 -0
  39. package/dist/classDiagram-v2-JRS7N3AN-CVA3J-EH.js +16 -0
  40. package/dist/classDiagram-v2-JRS7N3AN-Dh121Rlt.js +16 -0
  41. package/dist/cose-bilkent-JH36ORCC-CLe0kcHa.js +2605 -0
  42. package/dist/cose-bilkent-JH36ORCC-DpMM48hA.js +2606 -0
  43. package/dist/cynefin-OW5HDTMX-CyO3b088.js +23750 -0
  44. package/dist/cynefinDiagram-5FMLGOSQ-C5xaWeuA.js +299 -0
  45. package/dist/cynefinDiagram-5FMLGOSQ-mLaK-3R3.js +299 -0
  46. package/dist/cytoscape.esm-DCrf4dL8.js +18782 -0
  47. package/dist/daemon-react-sdk.js +1 -1
  48. package/dist/dagre-3AP2YEHR-CmNFrtW9.js +456 -0
  49. package/dist/dagre-3AP2YEHR-zDm3fBQq.js +456 -0
  50. package/dist/defaultLocale-BgPVtth8.js +171 -0
  51. package/dist/diagram-S7CK7UJ4-BQtgRcGU.js +346 -0
  52. package/dist/diagram-S7CK7UJ4-Clojnf04.js +346 -0
  53. package/dist/diagram-UQ7AKVKN-B3Ll3rB4.js +219 -0
  54. package/dist/diagram-UQ7AKVKN-CTn4O0fd.js +219 -0
  55. package/dist/diagram-VSXAHHWV-BeYXDVEh.js +463 -0
  56. package/dist/diagram-VSXAHHWV-mdxkNEZP.js +463 -0
  57. package/dist/diagram-VX7I27RA-C3bzQYLd.js +529 -0
  58. package/dist/diagram-VX7I27RA-DaPLIQOr.js +529 -0
  59. package/dist/diagram-Z3DM3KII-BImvaL3c.js +142 -0
  60. package/dist/diagram-Z3DM3KII-CkkdGhWO.js +142 -0
  61. package/dist/{docx-preview-BucJeYCm.js → docx-preview-BfV4m8Qp.js} +503 -506
  62. package/dist/ebnfDiagram-PWID7BFC-C8RUggbp.js +109 -0
  63. package/dist/ebnfDiagram-PWID7BFC-gJHJx-lt.js +109 -0
  64. package/dist/erDiagram-SSCWMZ5O-CKFzjLCd.js +1059 -0
  65. package/dist/erDiagram-SSCWMZ5O-DLJjXFG9.js +1059 -0
  66. package/dist/flowDiagram-A5DVABFB-BHAeEzG1.js +1689 -0
  67. package/dist/flowDiagram-A5DVABFB-BOdsfJ-4.js +1689 -0
  68. package/dist/ganttDiagram-EL5Y4UJY-CtL6LAbW.js +2703 -0
  69. package/dist/ganttDiagram-EL5Y4UJY-D0hNphpF.js +2704 -0
  70. package/dist/gitGraphDiagram-WWUBYQGX-8XcPnT4w.js +815 -0
  71. package/dist/gitGraphDiagram-WWUBYQGX-DxHtQ0ba.js +815 -0
  72. package/dist/{index-B6wNHUaX.js → index-CULFv0Jj.js} +69284 -64504
  73. package/dist/index.js +3 -3
  74. package/dist/infoDiagram-RXCK75RN-B-Ds06LN.js +24 -0
  75. package/dist/infoDiagram-RXCK75RN-Dhirg4if.js +24 -0
  76. package/dist/init-DjUOC4st.js +16 -0
  77. package/dist/ishikawaDiagram-5VMMS53U-BJPKneVd.js +621 -0
  78. package/dist/ishikawaDiagram-5VMMS53U-CsttzTkq.js +621 -0
  79. package/dist/journeyDiagram-EYS64GPL-BBAEhOQ9.js +836 -0
  80. package/dist/journeyDiagram-EYS64GPL-DfXS6tI_.js +836 -0
  81. package/dist/kanban-definition-3QL26DDD-Bh1Jz01C.js +723 -0
  82. package/dist/kanban-definition-3QL26DDD-C8yOTG02.js +723 -0
  83. package/dist/layout-Dxab-q-T.js +1704 -0
  84. package/dist/layout-sTbo9v3C.js +1704 -0
  85. package/dist/linear-BhTDfwHZ.js +259 -0
  86. package/dist/linear-CjDL9r_e.js +259 -0
  87. package/dist/mermaid.core-CFV16zMl.js +19742 -0
  88. package/dist/mermaid.core-DBp8atac.js +19747 -0
  89. package/dist/mindmap-definition-FBJOCRG2-KPo1Z4it.js +826 -0
  90. package/dist/mindmap-definition-FBJOCRG2-vau9OLMK.js +826 -0
  91. package/dist/ordinal-DfAQgscy.js +61 -0
  92. package/dist/pegDiagram-XKGWAZYB-CFjH6RoO.js +95 -0
  93. package/dist/pegDiagram-XKGWAZYB-EeXt14MX.js +95 -0
  94. package/dist/pieDiagram-E7YTZNPT-CJa9GbCV.js +208 -0
  95. package/dist/pieDiagram-E7YTZNPT-JyO_8fWF.js +208 -0
  96. package/dist/quadrantDiagram-AXDQQJYC-B7tyPD89.js +1023 -0
  97. package/dist/quadrantDiagram-AXDQQJYC-G9wAekw0.js +1023 -0
  98. package/dist/railroadDiagram-O6MQD6OU-3-cuTnqH.js +77 -0
  99. package/dist/railroadDiagram-O6MQD6OU-SyM4QCMp.js +77 -0
  100. package/dist/requirementDiagram-EFPCY7ZU-BJal3W63.js +882 -0
  101. package/dist/requirementDiagram-EFPCY7ZU-bMW72Av_.js +882 -0
  102. package/dist/sankeyDiagram-P5KCCOFB-BKP8fccK.js +847 -0
  103. package/dist/sankeyDiagram-P5KCCOFB-C4KDi8Ty.js +847 -0
  104. package/dist/sequenceDiagram-WJ2MYXX4-DFvbPjPG.js +2888 -0
  105. package/dist/sequenceDiagram-WJ2MYXX4-DvgRoXFL.js +2888 -0
  106. package/dist/sizeCapture-X5ZJPWSS-DPkvpCxM.js +46 -0
  107. package/dist/sizeCapture-X5ZJPWSS-DU4nf5aV.js +46 -0
  108. package/dist/stateDiagram-HBIQ2CUA-CWp0mOcF.js +262 -0
  109. package/dist/stateDiagram-HBIQ2CUA-DkN3hNFV.js +262 -0
  110. package/dist/stateDiagram-v2-4QOOHH4V-Bh7H2ZBJ.js +16 -0
  111. package/dist/stateDiagram-v2-4QOOHH4V-DX-OvV9U.js +16 -0
  112. package/dist/sw.js +1 -1
  113. package/dist/swimlanes-XN3QIQJK-2s4fbN8J.js +5219 -0
  114. package/dist/swimlanes-XN3QIQJK-CI3ENZQA.js +5219 -0
  115. package/dist/swimlanesDiagram-VK2B7HYN-BEjeqDmx.js +13 -0
  116. package/dist/swimlanesDiagram-VK2B7HYN-DWJY6BGD.js +13 -0
  117. package/dist/timeline-definition-24CTP7MA-C_tZHri9.js +1057 -0
  118. package/dist/timeline-definition-24CTP7MA-DYXEracn.js +1057 -0
  119. package/dist/transcript.js +14564 -11549
  120. package/dist/types/App.d.ts +10 -1
  121. package/dist/types/components/ComposerUsageStats.d.ts +34 -0
  122. package/dist/types/components/WelcomeHeader.d.ts +8 -0
  123. package/dist/types/components/artifacts/tokenUsageTotals.d.ts +36 -0
  124. package/dist/types/components/channels/ChannelEditorDialog.d.ts +10 -1
  125. package/dist/types/components/channels/ChannelQrLogin.d.ts +13 -0
  126. package/dist/types/components/channels/WeixinLoginPanel.d.ts +17 -0
  127. package/dist/types/components/channels/channel-editor-state.d.ts +8 -1
  128. package/dist/types/components/channels/channel-platform.d.ts +2 -1
  129. package/dist/types/components/channels/weixin-auth-api.d.ts +32 -0
  130. package/dist/types/components/managed/ManagedRuntimeSkillsImporter.d.ts +10 -0
  131. package/dist/types/components/managed/ManagedSideQueryPanel.d.ts +5 -0
  132. package/dist/types/components/managed/WorkspaceBindingCreator.d.ts +26 -1
  133. package/dist/types/components/managed/generated/managed-agent-api.d.ts +605 -0
  134. package/dist/types/components/managed/java-managed-agent-client.d.ts +122 -1
  135. package/dist/types/components/managed/managed-agent-provider.d.ts +14 -1
  136. package/dist/types/components/managed/managed-diagnostics-messages.d.ts +14 -1
  137. package/dist/types/components/managed/managed-extension-install.d.ts +5 -2
  138. package/dist/types/components/managed/managed-extension-messages.d.ts +7 -0
  139. package/dist/types/components/managed/managed-extension-types.d.ts +4 -0
  140. package/dist/types/components/managed/managed-session-storage.d.ts +35 -0
  141. package/dist/types/components/managed/managed-side-query-command.d.ts +5 -0
  142. package/dist/types/components/managed/managed-side-query-types.d.ts +21 -0
  143. package/dist/types/components/managed/managed-side-query.test-fixtures.d.ts +3 -0
  144. package/dist/types/components/managed/use-managed-side-queries.d.ts +26 -0
  145. package/dist/types/customization.d.ts +31 -0
  146. package/dist/types/daemon/workspace/hooks/useDaemonChannels.d.ts +2 -1
  147. package/dist/types/daemon/workspace/types.d.ts +8 -1
  148. package/dist/types/index.d.ts +1 -0
  149. package/dist/{useDaemonMidTurnInjected-tBzI77Ar.js → useDaemonMidTurnInjected-B7dPEdqk.js} +2040 -1825
  150. package/dist/vennDiagram-4TSXK5OY-Bi3e_aHN.js +1578 -0
  151. package/dist/vennDiagram-4TSXK5OY-DZCe1Ffi.js +1578 -0
  152. package/dist/wardleyDiagram-VM6X3IG4-BNV5jzew.js +675 -0
  153. package/dist/wardleyDiagram-VM6X3IG4-DqFJHRmt.js +675 -0
  154. package/dist/xychartDiagram-S5SC5T6Z-BVIJ86ch.js +1492 -0
  155. package/dist/xychartDiagram-S5SC5T6Z-J8xP-hcH.js +1492 -0
  156. package/package.json +19 -9
  157. package/dist/SpreadsheetPreview-d5XL70Ho.js +0 -379
  158. package/dist/types/components/artifacts/excel-preview-parser.d.ts +0 -5
@@ -0,0 +1,1057 @@
1
+ import { _ as c, A as pt, ac as Rt, ad as Ct, ae as Wt, c as gt, l as E, G as Pt, a2 as Bt, af as ft, j as U, v as Vt, ag as Ft, r as zt } from "./mermaid.core-CFV16zMl.js";
2
+ import { d as ot } from "./arc-DkZAOzaU.js";
3
+ var tt = function() {
4
+ var e = /* @__PURE__ */ c(function(k, s, d, l) {
5
+ for (d = d || {}, l = k.length; l--; d[k[l]] = s) ;
6
+ return d;
7
+ }, "o"), t = [6, 11, 13, 14, 15, 17, 19, 20, 23, 24], n = [1, 12], i = [1, 13], r = [1, 14], h = [1, 15], o = [1, 16], a = [1, 19], f = [1, 20], g = {
8
+ trace: /* @__PURE__ */ c(function() {
9
+ }, "trace"),
10
+ yy: {},
11
+ symbols_: { error: 2, start: 3, timeline_header: 4, document: 5, EOF: 6, timeline: 7, timeline_lr: 8, timeline_td: 9, line: 10, SPACE: 11, statement: 12, NEWLINE: 13, title: 14, acc_title: 15, acc_title_value: 16, acc_descr: 17, acc_descr_value: 18, acc_descr_multiline_value: 19, section: 20, period_statement: 21, event_statement: 22, period: 23, event: 24, $accept: 0, $end: 1 },
12
+ terminals_: { 2: "error", 6: "EOF", 7: "timeline", 8: "timeline_lr", 9: "timeline_td", 11: "SPACE", 13: "NEWLINE", 14: "title", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 23: "period", 24: "event" },
13
+ productions_: [0, [3, 3], [4, 1], [4, 1], [4, 1], [5, 0], [5, 2], [10, 2], [10, 1], [10, 1], [10, 1], [12, 1], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [21, 1], [22, 1]],
14
+ performAction: /* @__PURE__ */ c(function(s, d, l, p, x, u, S) {
15
+ var v = u.length - 1;
16
+ switch (x) {
17
+ case 1:
18
+ return u[v - 1];
19
+ case 3:
20
+ p.setDirection("LR");
21
+ break;
22
+ case 4:
23
+ p.setDirection("TD");
24
+ break;
25
+ case 5:
26
+ this.$ = [];
27
+ break;
28
+ case 6:
29
+ u[v - 1].push(u[v]), this.$ = u[v - 1];
30
+ break;
31
+ case 7:
32
+ case 8:
33
+ this.$ = u[v];
34
+ break;
35
+ case 9:
36
+ case 10:
37
+ this.$ = [];
38
+ break;
39
+ case 11:
40
+ p.getCommonDb().setDiagramTitle(u[v].substr(6)), this.$ = u[v].substr(6);
41
+ break;
42
+ case 12:
43
+ this.$ = u[v].trim(), p.getCommonDb().setAccTitle(this.$);
44
+ break;
45
+ case 13:
46
+ case 14:
47
+ this.$ = u[v].trim(), p.getCommonDb().setAccDescription(this.$);
48
+ break;
49
+ case 15:
50
+ p.addSection(u[v].substr(8)), this.$ = u[v].substr(8);
51
+ break;
52
+ case 18:
53
+ p.addTask(u[v], 0, ""), this.$ = u[v];
54
+ break;
55
+ case 19:
56
+ p.addEvent(u[v].substr(2)), this.$ = u[v];
57
+ break;
58
+ }
59
+ }, "anonymous"),
60
+ table: [{ 3: 1, 4: 2, 7: [1, 3], 8: [1, 4], 9: [1, 5] }, { 1: [3] }, e(t, [2, 5], { 5: 6 }), e(t, [2, 2]), e(t, [2, 3]), e(t, [2, 4]), { 6: [1, 7], 10: 8, 11: [1, 9], 12: 10, 13: [1, 11], 14: n, 15: i, 17: r, 19: h, 20: o, 21: 17, 22: 18, 23: a, 24: f }, e(t, [2, 10], { 1: [2, 1] }), e(t, [2, 6]), { 12: 21, 14: n, 15: i, 17: r, 19: h, 20: o, 21: 17, 22: 18, 23: a, 24: f }, e(t, [2, 8]), e(t, [2, 9]), e(t, [2, 11]), { 16: [1, 22] }, { 18: [1, 23] }, e(t, [2, 14]), e(t, [2, 15]), e(t, [2, 16]), e(t, [2, 17]), e(t, [2, 18]), e(t, [2, 19]), e(t, [2, 7]), e(t, [2, 12]), e(t, [2, 13])],
61
+ defaultActions: {},
62
+ parseError: /* @__PURE__ */ c(function(s, d) {
63
+ if (d.recoverable)
64
+ this.trace(s);
65
+ else {
66
+ var l = new Error(s);
67
+ throw l.hash = d, l;
68
+ }
69
+ }, "parseError"),
70
+ parse: /* @__PURE__ */ c(function(s) {
71
+ var d = this, l = [0], p = [], x = [null], u = [], S = this.table, v = "", I = 0, R = 0, W = 2, O = 1, L = u.slice.call(arguments, 1), w = Object.create(this.lexer), H = { yy: {} };
72
+ for (var V in this.yy)
73
+ Object.prototype.hasOwnProperty.call(this.yy, V) && (H.yy[V] = this.yy[V]);
74
+ w.setInput(s, H.yy), H.yy.lexer = w, H.yy.parser = this, typeof w.yylloc > "u" && (w.yylloc = {});
75
+ var F = w.yylloc;
76
+ u.push(F);
77
+ var K = w.options && w.options.ranges;
78
+ typeof H.yy.parseError == "function" ? this.parseError = H.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
79
+ function N(A) {
80
+ l.length = l.length - 2 * A, x.length = x.length - A, u.length = u.length - A;
81
+ }
82
+ c(N, "popStack");
83
+ function b() {
84
+ var A;
85
+ return A = p.pop() || w.lex() || O, typeof A != "number" && (A instanceof Array && (p = A, A = p.pop()), A = d.symbols_[A] || A), A;
86
+ }
87
+ c(b, "lex");
88
+ for (var _, $, T, P, C = {}, G, B, X, Z; ; ) {
89
+ if ($ = l[l.length - 1], this.defaultActions[$] ? T = this.defaultActions[$] : ((_ === null || typeof _ > "u") && (_ = b()), T = S[$] && S[$][_]), typeof T > "u" || !T.length || !T[0]) {
90
+ var Y = "";
91
+ Z = [];
92
+ for (G in S[$])
93
+ this.terminals_[G] && G > W && Z.push("'" + this.terminals_[G] + "'");
94
+ w.showPosition ? Y = "Parse error on line " + (I + 1) + `:
95
+ ` + w.showPosition() + `
96
+ Expecting ` + Z.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : Y = "Parse error on line " + (I + 1) + ": Unexpected " + (_ == O ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(Y, {
97
+ text: w.match,
98
+ token: this.terminals_[_] || _,
99
+ line: w.yylineno,
100
+ loc: F,
101
+ expected: Z
102
+ });
103
+ }
104
+ if (T[0] instanceof Array && T.length > 1)
105
+ throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + _);
106
+ switch (T[0]) {
107
+ case 1:
108
+ l.push(_), x.push(w.yytext), u.push(w.yylloc), l.push(T[1]), _ = null, R = w.yyleng, v = w.yytext, I = w.yylineno, F = w.yylloc;
109
+ break;
110
+ case 2:
111
+ if (B = this.productions_[T[1]][1], C.$ = x[x.length - B], C._$ = {
112
+ first_line: u[u.length - (B || 1)].first_line,
113
+ last_line: u[u.length - 1].last_line,
114
+ first_column: u[u.length - (B || 1)].first_column,
115
+ last_column: u[u.length - 1].last_column
116
+ }, K && (C._$.range = [
117
+ u[u.length - (B || 1)].range[0],
118
+ u[u.length - 1].range[1]
119
+ ]), P = this.performAction.apply(C, [
120
+ v,
121
+ R,
122
+ I,
123
+ H.yy,
124
+ T[1],
125
+ x,
126
+ u
127
+ ].concat(L)), typeof P < "u")
128
+ return P;
129
+ B && (l = l.slice(0, -1 * B * 2), x = x.slice(0, -1 * B), u = u.slice(0, -1 * B)), l.push(this.productions_[T[1]][0]), x.push(C.$), u.push(C._$), X = S[l[l.length - 2]][l[l.length - 1]], l.push(X);
130
+ break;
131
+ case 3:
132
+ return !0;
133
+ }
134
+ }
135
+ return !0;
136
+ }, "parse")
137
+ }, m = /* @__PURE__ */ function() {
138
+ var k = {
139
+ EOF: 1,
140
+ parseError: /* @__PURE__ */ c(function(d, l) {
141
+ if (this.yy.parser)
142
+ this.yy.parser.parseError(d, l);
143
+ else
144
+ throw new Error(d);
145
+ }, "parseError"),
146
+ // resets the lexer, sets new input
147
+ setInput: /* @__PURE__ */ c(function(s, d) {
148
+ return this.yy = d || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
149
+ first_line: 1,
150
+ first_column: 0,
151
+ last_line: 1,
152
+ last_column: 0
153
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
154
+ }, "setInput"),
155
+ // consumes and returns one char from the input
156
+ input: /* @__PURE__ */ c(function() {
157
+ var s = this._input[0];
158
+ this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
159
+ var d = s.match(/(?:\r\n?|\n).*/g);
160
+ return d ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
161
+ }, "input"),
162
+ // unshifts one char (or a string) into the input
163
+ unput: /* @__PURE__ */ c(function(s) {
164
+ var d = s.length, l = s.split(/(?:\r\n?|\n)/g);
165
+ this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - d), this.offset -= d;
166
+ var p = this.match.split(/(?:\r\n?|\n)/g);
167
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1);
168
+ var x = this.yylloc.range;
169
+ return this.yylloc = {
170
+ first_line: this.yylloc.first_line,
171
+ last_line: this.yylineno + 1,
172
+ first_column: this.yylloc.first_column,
173
+ last_column: l ? (l.length === p.length ? this.yylloc.first_column : 0) + p[p.length - l.length].length - l[0].length : this.yylloc.first_column - d
174
+ }, this.options.ranges && (this.yylloc.range = [x[0], x[0] + this.yyleng - d]), this.yyleng = this.yytext.length, this;
175
+ }, "unput"),
176
+ // When called from action, caches matched text and appends it on next action
177
+ more: /* @__PURE__ */ c(function() {
178
+ return this._more = !0, this;
179
+ }, "more"),
180
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
181
+ reject: /* @__PURE__ */ c(function() {
182
+ if (this.options.backtrack_lexer)
183
+ this._backtrack = !0;
184
+ else
185
+ 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).
186
+ ` + this.showPosition(), {
187
+ text: "",
188
+ token: null,
189
+ line: this.yylineno
190
+ });
191
+ return this;
192
+ }, "reject"),
193
+ // retain first n characters of the match
194
+ less: /* @__PURE__ */ c(function(s) {
195
+ this.unput(this.match.slice(s));
196
+ }, "less"),
197
+ // displays already matched input, i.e. for error messages
198
+ pastInput: /* @__PURE__ */ c(function() {
199
+ var s = this.matched.substr(0, this.matched.length - this.match.length);
200
+ return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
201
+ }, "pastInput"),
202
+ // displays upcoming input, i.e. for error messages
203
+ upcomingInput: /* @__PURE__ */ c(function() {
204
+ var s = this.match;
205
+ return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
206
+ }, "upcomingInput"),
207
+ // displays the character position where the lexing error occurred, i.e. for error messages
208
+ showPosition: /* @__PURE__ */ c(function() {
209
+ var s = this.pastInput(), d = new Array(s.length + 1).join("-");
210
+ return s + this.upcomingInput() + `
211
+ ` + d + "^";
212
+ }, "showPosition"),
213
+ // test the lexed token: return FALSE when not a match, otherwise return token
214
+ test_match: /* @__PURE__ */ c(function(s, d) {
215
+ var l, p, x;
216
+ if (this.options.backtrack_lexer && (x = {
217
+ yylineno: this.yylineno,
218
+ yylloc: {
219
+ first_line: this.yylloc.first_line,
220
+ last_line: this.last_line,
221
+ first_column: this.yylloc.first_column,
222
+ last_column: this.yylloc.last_column
223
+ },
224
+ yytext: this.yytext,
225
+ match: this.match,
226
+ matches: this.matches,
227
+ matched: this.matched,
228
+ yyleng: this.yyleng,
229
+ offset: this.offset,
230
+ _more: this._more,
231
+ _input: this._input,
232
+ yy: this.yy,
233
+ conditionStack: this.conditionStack.slice(0),
234
+ done: this.done
235
+ }, this.options.ranges && (x.yylloc.range = this.yylloc.range.slice(0))), p = s[0].match(/(?:\r\n?|\n).*/g), p && (this.yylineno += p.length), this.yylloc = {
236
+ first_line: this.yylloc.last_line,
237
+ last_line: this.yylineno + 1,
238
+ first_column: this.yylloc.last_column,
239
+ last_column: p ? p[p.length - 1].length - p[p.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
240
+ }, this.yytext += s[0], this.match += s[0], this.matches = s, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(s[0].length), this.matched += s[0], l = this.performAction.call(this, this.yy, this, d, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
241
+ return l;
242
+ if (this._backtrack) {
243
+ for (var u in x)
244
+ this[u] = x[u];
245
+ return !1;
246
+ }
247
+ return !1;
248
+ }, "test_match"),
249
+ // return next match in input
250
+ next: /* @__PURE__ */ c(function() {
251
+ if (this.done)
252
+ return this.EOF;
253
+ this._input || (this.done = !0);
254
+ var s, d, l, p;
255
+ this._more || (this.yytext = "", this.match = "");
256
+ for (var x = this._currentRules(), u = 0; u < x.length; u++)
257
+ if (l = this._input.match(this.rules[x[u]]), l && (!d || l[0].length > d[0].length)) {
258
+ if (d = l, p = u, this.options.backtrack_lexer) {
259
+ if (s = this.test_match(l, x[u]), s !== !1)
260
+ return s;
261
+ if (this._backtrack) {
262
+ d = !1;
263
+ continue;
264
+ } else
265
+ return !1;
266
+ } else if (!this.options.flex)
267
+ break;
268
+ }
269
+ return d ? (s = this.test_match(d, x[p]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
270
+ ` + this.showPosition(), {
271
+ text: "",
272
+ token: null,
273
+ line: this.yylineno
274
+ });
275
+ }, "next"),
276
+ // return next match that has a token
277
+ lex: /* @__PURE__ */ c(function() {
278
+ var d = this.next();
279
+ return d || this.lex();
280
+ }, "lex"),
281
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
282
+ begin: /* @__PURE__ */ c(function(d) {
283
+ this.conditionStack.push(d);
284
+ }, "begin"),
285
+ // pop the previously active lexer condition state off the condition stack
286
+ popState: /* @__PURE__ */ c(function() {
287
+ var d = this.conditionStack.length - 1;
288
+ return d > 0 ? this.conditionStack.pop() : this.conditionStack[0];
289
+ }, "popState"),
290
+ // produce the lexer rule set which is active for the currently active lexer condition state
291
+ _currentRules: /* @__PURE__ */ c(function() {
292
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
293
+ }, "_currentRules"),
294
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
295
+ topState: /* @__PURE__ */ c(function(d) {
296
+ return d = this.conditionStack.length - 1 - Math.abs(d || 0), d >= 0 ? this.conditionStack[d] : "INITIAL";
297
+ }, "topState"),
298
+ // alias for begin(condition)
299
+ pushState: /* @__PURE__ */ c(function(d) {
300
+ this.begin(d);
301
+ }, "pushState"),
302
+ // return the number of states currently on the stack
303
+ stateStackSize: /* @__PURE__ */ c(function() {
304
+ return this.conditionStack.length;
305
+ }, "stateStackSize"),
306
+ options: { "case-insensitive": !0 },
307
+ performAction: /* @__PURE__ */ c(function(d, l, p, x) {
308
+ switch (p) {
309
+ case 0:
310
+ break;
311
+ case 1:
312
+ break;
313
+ case 2:
314
+ return 13;
315
+ case 3:
316
+ break;
317
+ case 4:
318
+ break;
319
+ case 5:
320
+ return 8;
321
+ case 6:
322
+ return 9;
323
+ case 7:
324
+ return 7;
325
+ case 8:
326
+ return 14;
327
+ case 9:
328
+ return this.begin("acc_title"), 15;
329
+ case 10:
330
+ return this.popState(), "acc_title_value";
331
+ case 11:
332
+ return this.begin("acc_descr"), 17;
333
+ case 12:
334
+ return this.popState(), "acc_descr_value";
335
+ case 13:
336
+ this.begin("acc_descr_multiline");
337
+ break;
338
+ case 14:
339
+ this.popState();
340
+ break;
341
+ case 15:
342
+ return "acc_descr_multiline_value";
343
+ case 16:
344
+ return 20;
345
+ case 17:
346
+ return 24;
347
+ case 18:
348
+ return 23;
349
+ case 19:
350
+ return 6;
351
+ case 20:
352
+ return "INVALID";
353
+ }
354
+ }, "anonymous"),
355
+ rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline[ \t]+LR\b)/i, /^(?:timeline[ \t]+TD\b)/i, /^(?:timeline\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^:\n]+)/i, /^(?::\s(?:[^:\n]|:(?!\s))+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i],
356
+ conditions: { acc_descr_multiline: { rules: [14, 15], inclusive: !1 }, acc_descr: { rules: [12], inclusive: !1 }, acc_title: { rules: [10], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 16, 17, 18, 19, 20], inclusive: !0 } }
357
+ };
358
+ return k;
359
+ }();
360
+ g.lexer = m;
361
+ function y() {
362
+ this.yy = {};
363
+ }
364
+ return c(y, "Parser"), y.prototype = g, g.Parser = y, new y();
365
+ }();
366
+ tt.parser = tt;
367
+ var Ot = tt, yt = {};
368
+ Vt(yt, {
369
+ addEvent: () => Tt,
370
+ addSection: () => _t,
371
+ addTask: () => Et,
372
+ addTaskOrg: () => $t,
373
+ clear: () => kt,
374
+ default: () => Gt,
375
+ getCommonDb: () => xt,
376
+ getDirection: () => bt,
377
+ getSections: () => wt,
378
+ getTasks: () => St,
379
+ setDirection: () => vt
380
+ });
381
+ var D = "", mt = 0, nt = "LR", rt = [], q = [], j = [], xt = /* @__PURE__ */ c(() => Ft, "getCommonDb"), kt = /* @__PURE__ */ c(function() {
382
+ rt.length = 0, q.length = 0, D = "", j.length = 0, nt = "LR", zt();
383
+ }, "clear"), vt = /* @__PURE__ */ c(function(e) {
384
+ nt = e;
385
+ }, "setDirection"), bt = /* @__PURE__ */ c(function() {
386
+ return nt;
387
+ }, "getDirection"), _t = /* @__PURE__ */ c(function(e) {
388
+ D = e, rt.push(e);
389
+ }, "addSection"), wt = /* @__PURE__ */ c(function() {
390
+ return rt;
391
+ }, "getSections"), St = /* @__PURE__ */ c(function() {
392
+ let e = ct();
393
+ const t = 100;
394
+ let n = 0;
395
+ for (; !e && n < t; )
396
+ e = ct(), n++;
397
+ return q.push(...j), q;
398
+ }, "getTasks"), Et = /* @__PURE__ */ c(function(e, t, n) {
399
+ const i = {
400
+ id: mt++,
401
+ section: D,
402
+ type: D,
403
+ task: e,
404
+ score: t || 0,
405
+ //if event is defined, then add it the events array
406
+ events: n ? [n] : []
407
+ };
408
+ j.push(i);
409
+ }, "addTask"), Tt = /* @__PURE__ */ c(function(e) {
410
+ j.find((n) => n.id === mt - 1).events.push(e);
411
+ }, "addEvent"), $t = /* @__PURE__ */ c(function(e) {
412
+ const t = {
413
+ section: D,
414
+ type: D,
415
+ description: e,
416
+ task: e,
417
+ classes: []
418
+ };
419
+ q.push(t);
420
+ }, "addTaskOrg"), ct = /* @__PURE__ */ c(function() {
421
+ const e = /* @__PURE__ */ c(function(n) {
422
+ return j[n].processed;
423
+ }, "compileTask");
424
+ let t = !0;
425
+ for (const [n, i] of j.entries())
426
+ e(n), t = t && i.processed;
427
+ return t;
428
+ }, "compileTasks"), Gt = {
429
+ clear: kt,
430
+ getCommonDb: xt,
431
+ getDirection: bt,
432
+ setDirection: vt,
433
+ addSection: _t,
434
+ getSections: wt,
435
+ getTasks: St,
436
+ addTask: Et,
437
+ addTaskOrg: $t,
438
+ addEvent: Tt
439
+ }, Nt = 0, J = /* @__PURE__ */ c(function(e, t) {
440
+ const n = e.append("rect");
441
+ return n.attr("x", t.x), n.attr("y", t.y), n.attr("fill", t.fill), n.attr("stroke", t.stroke), n.attr("width", t.width), n.attr("height", t.height), n.attr("rx", t.rx), n.attr("ry", t.ry), t.class !== void 0 && n.attr("class", t.class), n;
442
+ }, "drawRect"), Dt = /* @__PURE__ */ c(function(e, t) {
443
+ const i = e.append("circle").attr("cx", t.cx).attr("cy", t.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), r = e.append("g");
444
+ r.append("circle").attr("cx", t.cx - 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), r.append("circle").attr("cx", t.cx + 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
445
+ function h(f) {
446
+ const g = ot().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
447
+ f.append("path").attr("class", "mouth").attr("d", g).attr("transform", "translate(" + t.cx + "," + (t.cy + 2) + ")");
448
+ }
449
+ c(h, "smile");
450
+ function o(f) {
451
+ const g = ot().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
452
+ f.append("path").attr("class", "mouth").attr("d", g).attr("transform", "translate(" + t.cx + "," + (t.cy + 7) + ")");
453
+ }
454
+ c(o, "sad");
455
+ function a(f) {
456
+ f.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", t.cx - 5).attr("y1", t.cy + 7).attr("x2", t.cx + 5).attr("y2", t.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
457
+ }
458
+ return c(a, "ambivalent"), t.score > 3 ? h(r) : t.score < 3 ? o(r) : a(r), i;
459
+ }, "drawFace"), jt = /* @__PURE__ */ c(function(e, t) {
460
+ const n = e.append("circle");
461
+ return n.attr("cx", t.cx), n.attr("cy", t.cy), n.attr("class", "actor-" + t.pos), n.attr("fill", t.fill), n.attr("stroke", t.stroke), n.attr("r", t.r), n.class !== void 0 && n.attr("class", n.class), t.title !== void 0 && n.append("title").text(t.title), n;
462
+ }, "drawCircle"), It = /* @__PURE__ */ c(function(e, t) {
463
+ const n = t.text.replace(/<br\s*\/?>/gi, " "), i = e.append("text");
464
+ i.attr("x", t.x), i.attr("y", t.y), i.attr("class", "legend"), i.style("text-anchor", t.anchor), t.class !== void 0 && i.attr("class", t.class);
465
+ const r = i.append("tspan");
466
+ return r.attr("x", t.x + t.textMargin * 2), r.text(n), i;
467
+ }, "drawText"), Kt = /* @__PURE__ */ c(function(e, t) {
468
+ function n(r, h, o, a, f) {
469
+ return r + "," + h + " " + (r + o) + "," + h + " " + (r + o) + "," + (h + a - f) + " " + (r + o - f * 1.2) + "," + (h + a) + " " + r + "," + (h + a);
470
+ }
471
+ c(n, "genPoints");
472
+ const i = e.append("polygon");
473
+ i.attr("points", n(t.x, t.y, 50, 20, 7)), i.attr("class", "labelBox"), t.y = t.y + t.labelMargin, t.x = t.x + 0.5 * t.labelMargin, It(e, t);
474
+ }, "drawLabel"), Ut = /* @__PURE__ */ c(function(e, t, n) {
475
+ const i = e.append("g"), r = st();
476
+ r.x = t.x, r.y = t.y, r.fill = t.fill, r.width = n.width, r.height = n.height, r.class = "journey-section section-type-" + t.num, r.rx = 3, r.ry = 3, J(i, r), Ht(n)(
477
+ t.text,
478
+ i,
479
+ r.x,
480
+ r.y,
481
+ r.width,
482
+ r.height,
483
+ { class: "journey-section section-type-" + t.num },
484
+ n,
485
+ t.colour
486
+ );
487
+ }, "drawSection"), et = -1, Xt = /* @__PURE__ */ c(function(e, t, n, i) {
488
+ const r = t.x + n.width / 2, h = e.append("g");
489
+ et++;
490
+ const o = 300 + 5 * 30;
491
+ h.append("line").attr("id", i + "-task" + et).attr("x1", r).attr("y1", t.y).attr("x2", r).attr("y2", o).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Dt(h, {
492
+ cx: r,
493
+ cy: 300 + (5 - t.score) * 30,
494
+ score: t.score
495
+ });
496
+ const a = st();
497
+ a.x = t.x, a.y = t.y, a.fill = t.fill, a.width = n.width, a.height = n.height, a.class = "task task-type-" + t.num, a.rx = 3, a.ry = 3, J(h, a), Ht(n)(
498
+ t.task,
499
+ h,
500
+ a.x,
501
+ a.y,
502
+ a.width,
503
+ a.height,
504
+ { class: "task" },
505
+ n,
506
+ t.colour
507
+ );
508
+ }, "drawTask"), Zt = /* @__PURE__ */ c(function(e, t) {
509
+ J(e, {
510
+ x: t.startx,
511
+ y: t.starty,
512
+ width: t.stopx - t.startx,
513
+ height: t.stopy - t.starty,
514
+ fill: t.fill,
515
+ class: "rect"
516
+ }).lower();
517
+ }, "drawBackgroundRect"), qt = /* @__PURE__ */ c(function() {
518
+ return {
519
+ x: 0,
520
+ y: 0,
521
+ fill: void 0,
522
+ "text-anchor": "start",
523
+ width: 100,
524
+ height: 100,
525
+ textMargin: 0,
526
+ rx: 0,
527
+ ry: 0
528
+ };
529
+ }, "getTextObj"), st = /* @__PURE__ */ c(function() {
530
+ return {
531
+ x: 0,
532
+ y: 0,
533
+ width: 100,
534
+ anchor: "start",
535
+ height: 100,
536
+ rx: 0,
537
+ ry: 0
538
+ };
539
+ }, "getNoteRect"), Ht = /* @__PURE__ */ function() {
540
+ function e(r, h, o, a, f, g, m, y) {
541
+ const k = h.append("text").attr("x", o + f / 2).attr("y", a + g / 2 + 5).style("font-color", y).style("text-anchor", "middle").text(r);
542
+ i(k, m);
543
+ }
544
+ c(e, "byText");
545
+ function t(r, h, o, a, f, g, m, y, k) {
546
+ const { taskFontSize: s, taskFontFamily: d } = y, l = r.split(/<br\s*\/?>/gi);
547
+ for (let p = 0; p < l.length; p++) {
548
+ const x = p * s - s * (l.length - 1) / 2, u = h.append("text").attr("x", o + f / 2).attr("y", a).attr("fill", k).style("text-anchor", "middle").style("font-size", s).style("font-family", d);
549
+ u.append("tspan").attr("x", o + f / 2).attr("dy", x).text(l[p]), u.attr("y", a + g / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), i(u, m);
550
+ }
551
+ }
552
+ c(t, "byTspan");
553
+ function n(r, h, o, a, f, g, m, y) {
554
+ const k = h.append("switch"), d = k.append("foreignObject").attr("x", o).attr("y", a).attr("width", f).attr("height", g).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
555
+ d.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, k, o, a, f, g, m, y), i(d, m);
556
+ }
557
+ c(n, "byFo");
558
+ function i(r, h) {
559
+ for (const o in h)
560
+ o in h && r.attr(o, h[o]);
561
+ }
562
+ return c(i, "_setTextAttrs"), function(r) {
563
+ return r.textPlacement === "fo" ? n : r.textPlacement === "old" ? e : t;
564
+ };
565
+ }(), Jt = /* @__PURE__ */ c(function(e, t) {
566
+ Nt = 0, et = -1, e.append("defs").append("marker").attr("id", t + "-arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
567
+ }, "initGraphics");
568
+ function it(e, t) {
569
+ e.each(function() {
570
+ var n = U(this), i = n.text().split(/(\s+|<br>)/).reverse(), r, h = [], o = 1.1, a = n.attr("y"), f = parseFloat(n.attr("dy")), g = n.text(null).append("tspan").attr("x", 0).attr("y", a).attr("dy", f + "em");
571
+ for (let m = 0; m < i.length; m++)
572
+ r = i[i.length - 1 - m], h.push(r), g.text(h.join(" ").trim()), (g.node().getComputedTextLength() > t || r === "<br>") && (h.pop(), g.text(h.join(" ").trim()), r === "<br>" ? h = [""] : h = [r], g = n.append("tspan").attr("x", 0).attr("y", a).attr("dy", o + "em").text(r));
573
+ });
574
+ }
575
+ c(it, "wrap");
576
+ var Qt = /* @__PURE__ */ c(function(e, t, n, i, r, h = !1) {
577
+ const { theme: o, look: a } = i, f = o?.includes("redux"), g = i?.themeVariables?.THEME_COLOR_LIMIT ?? 12, m = n % g - 1, y = e.append("g");
578
+ t.section = m, y.attr(
579
+ "class",
580
+ (t.class ? t.class + " " : "") + "timeline-node " + ("section-" + m)
581
+ );
582
+ const k = y.append("g"), s = y.append("g"), l = s.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(it, t.width).node().getBBox(), p = i.fontSize?.replace ? i.fontSize.replace("px", "") : i.fontSize;
583
+ if (t.height = l.height + p * 1.1 * 0.5 + t.padding, t.height = Math.max(t.height, t.maxHeight), t.width = t.width + 2 * t.padding, s.attr("transform", "translate(" + t.width / 2 + ", " + t.padding / 2 + ")"), f && s.attr(
584
+ "transform",
585
+ `translate(${t.width / 2}, ${h ? t.padding / 2 + 3 : t.padding})`
586
+ ), te(k, t, m, r, i), a === "neo" && (y.attr("data-look", "neo"), f)) {
587
+ const x = o.includes("dark"), u = e.node()?.ownerSVGElement ?? e.node(), S = U(u), v = S.attr("id") ?? "", I = v ? `${v}-drop-shadow` : "drop-shadow";
588
+ if (S.select(`#${I}`).empty()) {
589
+ const R = S.select("defs");
590
+ (R.empty() ? S.append("defs") : R).append("filter").attr("id", I).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", x ? "0.2" : "0.06").attr("flood-color", x ? "#FFFFFF" : "#000000");
591
+ }
592
+ }
593
+ return t;
594
+ }, "drawNode"), Yt = /* @__PURE__ */ c(function(e, t, n) {
595
+ const i = e.append("g"), h = i.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(it, t.width).node().getBBox(), o = n.fontSize?.replace ? n.fontSize.replace("px", "") : n.fontSize;
596
+ return i.remove(), h.height + o * 1.1 * 0.5 + t.padding;
597
+ }, "getVirtualNodeHeight"), te = /* @__PURE__ */ c(function(e, t, n, i, r) {
598
+ const { theme: h } = r, o = h?.includes("redux") ? 0 : 5, a = 5, f = o > 0 ? `M0 ${t.height - a} v${-t.height + 2 * a} q0,-${o},${o},-${o} h${t.width - 2 * a} q${o},0,${o},${o} v${t.height - a} H0 Z` : `M0 ${t.height - a} v${-(t.height - a)} h${t.width} v${t.height} H0 Z`;
599
+ e.append("path").attr("id", i + "-node-" + Nt++).attr("class", "node-bkg node-" + t.type).attr("d", f), h?.includes("redux") || e.append("line").attr("class", "node-line-" + n).attr("x1", 0).attr("y1", t.height).attr("x2", t.width).attr("y2", t.height);
600
+ }, "defaultBkg"), M = {
601
+ drawRect: J,
602
+ drawCircle: jt,
603
+ drawSection: Ut,
604
+ drawText: It,
605
+ drawLabel: Kt,
606
+ drawTask: Xt,
607
+ drawBackgroundRect: Zt,
608
+ getTextObj: qt,
609
+ getNoteRect: st,
610
+ initGraphics: Jt,
611
+ drawNode: Qt,
612
+ getVirtualNodeHeight: Yt
613
+ }, ee = /* @__PURE__ */ c(function(e, t, n, i) {
614
+ const r = gt(), { look: h, theme: o, themeVariables: a } = r, { useGradient: f, gradientStart: g, gradientStop: m } = a, y = r.timeline?.leftMargin ?? 50;
615
+ E.debug("timeline", i.db);
616
+ const k = r.securityLevel;
617
+ let s;
618
+ k === "sandbox" && (s = U("#i" + t));
619
+ const l = (k === "sandbox" ? U(s.nodes()[0].contentDocument.body) : U("body")).select("#" + t);
620
+ l.append("g");
621
+ const p = i.db.getTasks(), x = i.db.getCommonDb().getDiagramTitle();
622
+ E.debug("task", p), M.initGraphics(l, t);
623
+ const u = i.db.getSections();
624
+ E.debug("sections", u);
625
+ let S = 0, v = 0, I = 0, R = 0, W = 50 + y, O = 50;
626
+ R = 50;
627
+ let L = 0, w = !0;
628
+ u.forEach(function(N) {
629
+ const b = {
630
+ number: L,
631
+ descr: N,
632
+ section: L,
633
+ width: 150,
634
+ padding: 20,
635
+ maxHeight: S
636
+ }, _ = M.getVirtualNodeHeight(l, b, r);
637
+ E.debug("sectionHeight before draw", _), S = Math.max(S, _ + 20);
638
+ });
639
+ let H = 0, V = 0;
640
+ E.debug("tasks.length", p.length);
641
+ for (const [N, b] of p.entries()) {
642
+ const _ = {
643
+ number: N,
644
+ descr: b,
645
+ section: b.section,
646
+ width: 150,
647
+ padding: 20,
648
+ maxHeight: v
649
+ }, $ = M.getVirtualNodeHeight(l, _, r);
650
+ E.debug("taskHeight before draw", $), v = Math.max(v, $ + 20), H = Math.max(H, b.events.length);
651
+ let T = 0;
652
+ for (const P of b.events) {
653
+ const C = {
654
+ descr: P,
655
+ section: b.section,
656
+ number: b.section,
657
+ width: 150,
658
+ padding: 20,
659
+ maxHeight: 50
660
+ };
661
+ T += M.getVirtualNodeHeight(l, C, r);
662
+ }
663
+ b.events.length > 0 && (T += (b.events.length - 1) * 10), V = Math.max(V, T);
664
+ }
665
+ E.debug("maxSectionHeight before draw", S), E.debug("maxTaskHeight before draw", v), u && u.length > 0 ? u.forEach((N) => {
666
+ const b = p.filter((P) => P.section === N), _ = {
667
+ number: L,
668
+ descr: N,
669
+ section: L,
670
+ width: 200 * Math.max(b.length, 1) - 50,
671
+ padding: 20,
672
+ maxHeight: S
673
+ };
674
+ E.debug("sectionNode", _);
675
+ const $ = l.append("g"), T = M.drawNode($, _, L, r, t);
676
+ E.debug("sectionNode output", T), $.attr("transform", `translate(${W}, ${R})`), O += S + 50, b.length > 0 && lt(
677
+ l,
678
+ b,
679
+ L,
680
+ W,
681
+ O,
682
+ v,
683
+ r,
684
+ H,
685
+ V,
686
+ S,
687
+ !1,
688
+ t
689
+ ), W += 200 * Math.max(b.length, 1), O = R, L++;
690
+ }) : (w = !1, lt(
691
+ l,
692
+ p,
693
+ L,
694
+ W,
695
+ O,
696
+ v,
697
+ r,
698
+ H,
699
+ V,
700
+ S,
701
+ !0,
702
+ t
703
+ ));
704
+ const F = l.node().getBBox();
705
+ if (E.debug("bounds", F), x && l.append("text").text(x).attr("x", h === "neo" ? F.x * 2 + y : F.width / 2 - y).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), I = w ? S + v + 150 : v + 100, l.append("g").attr("class", "lineWrapper").append("line").attr("x1", y).attr("y1", I).attr("x2", F.width + 3 * y).attr("y2", I).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", `url(#${t}-arrowhead)`), h === "neo" && f && o !== "neutral") {
706
+ const N = l.select("defs"), _ = (N.empty() ? l.append("defs") : N).append("linearGradient").attr("id", l.attr("id") + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
707
+ _.append("stop").attr("offset", "0%").attr("stop-color", g).attr("stop-opacity", 1), _.append("stop").attr("offset", "100%").attr("stop-color", m).attr("stop-opacity", 1);
708
+ }
709
+ ft(
710
+ void 0,
711
+ l,
712
+ r.timeline?.padding ?? 50,
713
+ r.timeline?.useMaxWidth ?? !1
714
+ );
715
+ }, "draw"), lt = /* @__PURE__ */ c(function(e, t, n, i, r, h, o, a, f, g, m, y) {
716
+ for (const k of t) {
717
+ const s = {
718
+ descr: k.task,
719
+ section: n,
720
+ number: n,
721
+ width: 150,
722
+ padding: 20,
723
+ maxHeight: h
724
+ };
725
+ E.debug("taskNode", s);
726
+ const d = e.append("g").attr("class", "taskWrapper"), p = M.drawNode(d, s, n, o, y).height;
727
+ if (E.debug("taskHeight after draw", p), d.attr("transform", `translate(${i}, ${r})`), h = Math.max(h, p), k.events) {
728
+ const x = e.append("g").attr("class", "lineWrapper");
729
+ let u = h;
730
+ r += 100, u = u + ne(e, k.events, n, i, r, o, y), r -= 100, x.append("line").attr("x1", i + 190 / 2).attr("y1", r + h).attr("x2", i + 190 / 2).attr("y2", r + h + 100 + f + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", `url(#${y}-arrowhead)`).attr("stroke-dasharray", "5,5");
731
+ }
732
+ i = i + 200, m && !o.timeline?.disableMulticolor && n++;
733
+ }
734
+ r = r - 10;
735
+ }, "drawTasks"), ne = /* @__PURE__ */ c(function(e, t, n, i, r, h, o) {
736
+ let a = 0;
737
+ const f = r;
738
+ r = r + 100;
739
+ for (const g of t) {
740
+ const m = {
741
+ descr: g,
742
+ section: n,
743
+ number: n,
744
+ width: 150,
745
+ padding: 20,
746
+ maxHeight: 50
747
+ };
748
+ E.debug("eventNode", m);
749
+ const y = e.append("g").attr("class", "eventWrapper"), s = M.drawNode(y, m, n, h, o, !0).height;
750
+ a = a + s, y.attr("transform", `translate(${i}, ${r})`), r = r + 10 + s;
751
+ }
752
+ return r = f, a;
753
+ }, "drawEvents"), re = {
754
+ setConf: /* @__PURE__ */ c(() => {
755
+ }, "setConf"),
756
+ draw: ee
757
+ }, Q = 200, z = 5, se = Q + z * 2, at = Q + 100, ie = at + z * 2, Lt = 10, ae = 0, ht = 20, Mt = 20, dt = 30, At = 50, oe = /* @__PURE__ */ c(function(e, t, n, i) {
758
+ const r = gt(), h = r.timeline?.leftMargin ?? 50;
759
+ E.debug("timeline", i.db);
760
+ const o = Pt(t);
761
+ o.append("g");
762
+ const a = i.db.getTasks(), f = i.db.getCommonDb().getDiagramTitle();
763
+ E.debug("task", a), M.initGraphics(o);
764
+ const g = i.db.getSections();
765
+ E.debug("sections", g);
766
+ let m = 0, y = 0;
767
+ const k = 50 + h;
768
+ let s = 50;
769
+ const d = s, l = k, p = se + Mt, x = ie + At, u = l + p;
770
+ let S = 0;
771
+ const v = g && g.length > 0, I = v ? u : k + p, R = Math.max(50, p + x - z * 2);
772
+ g.forEach(function(N) {
773
+ const b = {
774
+ number: S,
775
+ descr: N,
776
+ section: S,
777
+ width: R,
778
+ padding: z,
779
+ maxHeight: m
780
+ }, _ = M.getVirtualNodeHeight(o, b, r);
781
+ E.debug("sectionHeight before draw", _), m = Math.max(m, _);
782
+ });
783
+ let W = 0;
784
+ E.debug("tasks.length", a.length);
785
+ for (const [N, b] of a.entries()) {
786
+ const _ = {
787
+ number: N,
788
+ descr: b,
789
+ section: b.section,
790
+ width: Q,
791
+ padding: z,
792
+ maxHeight: y
793
+ }, $ = M.getVirtualNodeHeight(o, _, r);
794
+ E.debug("taskHeight before draw", $), y = Math.max(y, $);
795
+ let T = 0;
796
+ for (const P of b.events) {
797
+ const C = {
798
+ descr: P,
799
+ section: b.section,
800
+ number: b.section,
801
+ width: at,
802
+ padding: z,
803
+ maxHeight: 50
804
+ };
805
+ T += M.getVirtualNodeHeight(o, C, r);
806
+ }
807
+ b.events.length > 0 && (T += (b.events.length - 1) * Lt), W = Math.max(W, T) + ae;
808
+ }
809
+ E.debug("maxSectionHeight before draw", m), E.debug("maxTaskHeight before draw", y);
810
+ const L = Math.max(y, W) + dt;
811
+ v ? g.forEach((N) => {
812
+ const b = a.filter((X) => X.section === N), _ = {
813
+ number: S,
814
+ descr: N,
815
+ section: S,
816
+ width: R,
817
+ padding: z,
818
+ maxHeight: m
819
+ };
820
+ E.debug("sectionNode", _);
821
+ const $ = o.append("g"), T = M.drawNode($, _, S, r);
822
+ E.debug("sectionNode output", T);
823
+ const P = I - p;
824
+ $.attr("transform", `translate(${P}, ${s})`);
825
+ const C = s + T.height + ht;
826
+ b.length > 0 && ut(
827
+ o,
828
+ b,
829
+ S,
830
+ I,
831
+ C,
832
+ y,
833
+ r,
834
+ L,
835
+ !1
836
+ );
837
+ const G = b.length, B = T.height + ht + L * Math.max(G, 1) - (G > 0 ? dt * 2 : 0);
838
+ s += B, S++;
839
+ }) : ut(
840
+ o,
841
+ a,
842
+ S,
843
+ I,
844
+ s,
845
+ y,
846
+ r,
847
+ L,
848
+ !0
849
+ );
850
+ let w = o.node()?.getBBox();
851
+ if (!w)
852
+ throw new Error("bbox not found");
853
+ if (E.debug("bounds", w), f) {
854
+ if (o.append("text").text(f).attr("x", w.width / 2 - h).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), w = o.node()?.getBBox(), !w)
855
+ throw new Error("bbox not found");
856
+ E.debug("bounds after title", w);
857
+ }
858
+ const [H] = Bt(r.fontSize), V = (H ?? 16) * 2, F = (H ?? 16) * 0.5 + 20, K = o.append("g").attr("class", "lineWrapper");
859
+ K.append("line").attr("x1", I).attr("y1", d - V).attr("x2", I).attr("y2", w.y + w.height + F).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"), K.lower(), ft(
860
+ void 0,
861
+ o,
862
+ r.timeline?.padding ?? 50,
863
+ r.timeline?.useMaxWidth ?? !1
864
+ );
865
+ }, "draw"), ut = /* @__PURE__ */ c(function(e, t, n, i, r, h, o, a, f) {
866
+ for (const g of t) {
867
+ const m = {
868
+ descr: g.task,
869
+ section: n,
870
+ number: n,
871
+ width: Q,
872
+ padding: z,
873
+ maxHeight: h
874
+ };
875
+ E.debug("taskNode", m);
876
+ const y = e.append("g").attr("class", "taskWrapper"), k = M.drawNode(y, m, n, o), s = k.height;
877
+ E.debug("taskHeight after draw", s);
878
+ const d = i - Mt - k.width;
879
+ if (y.attr("transform", `translate(${d}, ${r})`), h = Math.max(h, s), g.events && g.events.length > 0) {
880
+ const l = r, p = i + At;
881
+ ce(e, g.events, n, i, p, l, o);
882
+ }
883
+ r = r + a, f && !o.timeline?.disableMulticolor && n++;
884
+ }
885
+ }, "drawTasks"), ce = /* @__PURE__ */ c(function(e, t, n, i, r, h, o) {
886
+ let a = h;
887
+ for (const f of t) {
888
+ const g = {
889
+ descr: f,
890
+ section: n,
891
+ number: n,
892
+ width: at,
893
+ padding: z,
894
+ maxHeight: 0
895
+ };
896
+ E.debug("eventNode", g);
897
+ const m = e.append("g").attr("class", "eventWrapper"), k = M.drawNode(m, g, n, o).height;
898
+ m.attr("transform", `translate(${r}, ${a})`);
899
+ const s = e.append("g").attr("class", "lineWrapper"), d = a + k / 2;
900
+ s.append("line").attr("x1", i).attr("y1", d).attr("x2", r).attr("y2", d).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5"), a = a + k + Lt;
901
+ }
902
+ return a - h;
903
+ }, "drawEvents"), le = {
904
+ setConf: /* @__PURE__ */ c(() => {
905
+ }, "setConf"),
906
+ draw: oe
907
+ }, he = /* @__PURE__ */ c((e) => {
908
+ const { theme: t } = pt(), n = t?.includes("dark"), i = t?.includes("color"), r = e.svgId?.replace(/^#/, "") ?? "", h = r ? `url(#${r}-drop-shadow)` : e.dropShadow ?? "none";
909
+ let o = "";
910
+ for (let a = 0; a < e.THEME_COLOR_LIMIT; a++) {
911
+ const f = `${17 - 3 * a}`, g = i ? e.borderColorArray[a] : e.mainBkg, m = i ? e.borderColorArray[a] : e.nodeBorder;
912
+ o += `
913
+ .section-${a - 1} rect,
914
+ .section-${a - 1} path,
915
+ .section-${a - 1} circle {
916
+ fill: ${n && i ? e.mainBkg : g};
917
+ stroke: ${m};
918
+ stroke-width: ${e.strokeWidth};
919
+ filter: ${h};
920
+ }
921
+
922
+ .section-${a - 1} text {
923
+ fill: ${e.nodeBorder};
924
+ font-weight: ${e.fontWeight}
925
+ }
926
+
927
+ .node-icon-${a - 1} {
928
+ font-size: 40px;
929
+ color: ${e["cScaleLabel" + a]};
930
+ }
931
+
932
+ .section-edge-${a - 1} {
933
+ stroke: ${e["cScale" + a]};
934
+ }
935
+
936
+ .edge-depth-${a - 1} {
937
+ stroke-width: ${f};
938
+ }
939
+
940
+ .section-${a - 1} line {
941
+ stroke: ${e["cScaleInv" + a]};
942
+ stroke-width: 3;
943
+ }
944
+
945
+ .lineWrapper line {
946
+ stroke: ${e.nodeBorder};
947
+ stroke-width:${e.strokeWidth}
948
+ }
949
+
950
+ .disabled,
951
+ .disabled circle,
952
+ .disabled text {
953
+ fill: ${e.tertiaryColor ?? "lightgray"};
954
+ }
955
+
956
+ .disabled text {
957
+ fill: ${e.clusterBorder ?? "#efefef"};
958
+ }
959
+ `;
960
+ }
961
+ return o;
962
+ }, "genReduxSections"), de = /* @__PURE__ */ c((e) => {
963
+ let t = "";
964
+ for (let n = 0; n < e.THEME_COLOR_LIMIT; n++)
965
+ e["lineColor" + n] = e["lineColor" + n] || e["cScaleInv" + n], Rt(e["lineColor" + n]) ? e["lineColor" + n] = Ct(e["lineColor" + n], 20) : e["lineColor" + n] = Wt(e["lineColor" + n], 20);
966
+ for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) {
967
+ const i = "" + (17 - 3 * n);
968
+ t += `
969
+ .section-${n - 1} rect, .section-${n - 1} path, .section-${n - 1} circle, .section-${n - 1} path {
970
+ fill: ${e["cScale" + n]};
971
+ }
972
+ .section-${n - 1} text {
973
+ fill: ${e["cScaleLabel" + n]};
974
+ }
975
+ .node-icon-${n - 1} {
976
+ font-size: 40px;
977
+ color: ${e["cScaleLabel" + n]};
978
+ }
979
+ .section-edge-${n - 1}{
980
+ stroke: ${e["cScale" + n]};
981
+ }
982
+ .edge-depth-${n - 1}{
983
+ stroke-width: ${i};
984
+ }
985
+ .section-${n - 1} line {
986
+ stroke: ${e["cScaleInv" + n]} ;
987
+ stroke-width: 3;
988
+ }
989
+
990
+ .lineWrapper line{
991
+ stroke: ${e["cScaleLabel" + n]} ;
992
+ }
993
+
994
+ .disabled, .disabled circle, .disabled text {
995
+ fill: ${e.tertiaryColor ?? "lightgray"};
996
+ }
997
+ .disabled text {
998
+ fill: ${e.clusterBorder ?? "#efefef"};
999
+ }
1000
+ `;
1001
+ }
1002
+ return t;
1003
+ }, "genSections"), ue = /* @__PURE__ */ c((e) => {
1004
+ const { theme: t } = pt(), n = t?.includes("redux"), i = t === "neutral", r = e.svgId?.replace(/^#/, "") ?? "";
1005
+ let h = "";
1006
+ if (e.useGradient && r && e.THEME_COLOR_LIMIT && !i)
1007
+ for (let o = 0; o < e.THEME_COLOR_LIMIT; o++)
1008
+ h += `
1009
+ .section-${o - 1}[data-look="neo"] rect,
1010
+ .section-${o - 1}[data-look="neo"] path,
1011
+ .section-${o - 1}[data-look="neo"] circle {
1012
+ fill: ${e.mainBkg};
1013
+ stroke: url(#${r}-gradient);
1014
+ stroke-width: 2;
1015
+ }
1016
+ .section-${o - 1}[data-look="neo"] line {
1017
+ stroke: url(#${r}-gradient);
1018
+ stroke-width: 2;
1019
+ }`;
1020
+ return `
1021
+ .edge {
1022
+ stroke-width: 3;
1023
+ }
1024
+ ${n ? he(e) : de(e)}
1025
+ ${h}
1026
+ .section-root rect, .section-root path, .section-root circle {
1027
+ fill: ${e.git0};
1028
+ }
1029
+ .section-root text {
1030
+ fill: ${e.gitBranchLabel0};
1031
+ }
1032
+ .icon-container {
1033
+ height:100%;
1034
+ display: flex;
1035
+ justify-content: center;
1036
+ align-items: center;
1037
+ }
1038
+ .edge {
1039
+ fill: none;
1040
+ }
1041
+ .eventWrapper {
1042
+ filter: brightness(120%);
1043
+ }
1044
+ `;
1045
+ }, "getStyles"), pe = ue, ge = {
1046
+ setConf: /* @__PURE__ */ c(() => {
1047
+ }, "setConf"),
1048
+ draw: /* @__PURE__ */ c((e, t, n, i) => (i?.db?.getDirection?.() ?? "LR") === "TD" ? le.draw(e, t, n, i) : re.draw(e, t, n, i), "draw")
1049
+ }, me = {
1050
+ db: yt,
1051
+ renderer: ge,
1052
+ parser: Ot,
1053
+ styles: pe
1054
+ };
1055
+ export {
1056
+ me as diagram
1057
+ };