@layers-app/editor 0.7.44 → 0.7.46

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 (248) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +5 -4
  3. package/dist/index.js +3 -3
  4. package/dist/{layers.Bt5BEQ6h.js → layers.B88sQYuh.js} +1 -1
  5. package/dist/layers.BgMykHnn.js +154 -0
  6. package/dist/{layers.CsTbIH2o.js → layers.BtvuN20E.js} +8988 -9641
  7. package/dist/{layers.8AV9TJ5y.js → layers.Cfvta__C.js} +1 -1
  8. package/dist/{layers.b9B2NY7n.js → layers.CsQlovyR.js} +2191 -1950
  9. package/dist/layers.Ct1ojjl3.js +1 -0
  10. package/dist/{layers.BPwGnx6H.js → layers.Hq0pIRX3.js} +24 -24
  11. package/dist/layers.JT_kEFH5.js +129 -0
  12. package/dist/{layers.D5EnJuSD.js → layers.NW1lST7i.js} +1 -1
  13. package/dist/layers.pwc3O6Es.js +261 -0
  14. package/package.json +1 -1
  15. package/dist/layers.03rOzGz6.js +0 -1
  16. package/dist/layers.2ki87-LU.js +0 -5
  17. package/dist/layers.2o06iRgp.js +0 -504
  18. package/dist/layers.52famHy6.js +0 -1
  19. package/dist/layers.5oOWOsbG.js +0 -39
  20. package/dist/layers.7JqFgE4-.js +0 -15
  21. package/dist/layers.8KaGKAU3.js +0 -271
  22. package/dist/layers.9URcRock.js +0 -1
  23. package/dist/layers.9pNaFvaX.js +0 -1
  24. package/dist/layers.B-dneuft.js +0 -373
  25. package/dist/layers.B19hGmey.js +0 -1
  26. package/dist/layers.B1fchoGW.js +0 -1
  27. package/dist/layers.B2cspFhx.js +0 -1034
  28. package/dist/layers.B3D4g2HH.js +0 -1
  29. package/dist/layers.B6soS223.js +0 -8
  30. package/dist/layers.B780IvgC.js +0 -84
  31. package/dist/layers.B7K7JjK6.js +0 -1510
  32. package/dist/layers.B9UunCzG.js +0 -39
  33. package/dist/layers.B9rQcczY.js +0 -14
  34. package/dist/layers.BAtv1CM7.js +0 -1
  35. package/dist/layers.BBcDfITy.js +0 -40
  36. package/dist/layers.BBhmfZot.js +0 -39
  37. package/dist/layers.BDqHBDOj.js +0 -9
  38. package/dist/layers.BFRbDTjY.js +0 -160
  39. package/dist/layers.BIUiVID4.js +0 -10
  40. package/dist/layers.BIeVwYKL.js +0 -1
  41. package/dist/layers.BJDrjORS.js +0 -244
  42. package/dist/layers.BKamPs3H.js +0 -1
  43. package/dist/layers.BLd2spTm.js +0 -1
  44. package/dist/layers.BMWMvKH-.js +0 -806
  45. package/dist/layers.BMxAun-L.js +0 -6
  46. package/dist/layers.BOMgDmQW.js +0 -1
  47. package/dist/layers.BQX_W7-N.js +0 -41
  48. package/dist/layers.BRBbDnyO.js +0 -32
  49. package/dist/layers.BRU1WOyl.js +0 -65
  50. package/dist/layers.BSTBZrFn.js +0 -1
  51. package/dist/layers.BUP7J0N1.js +0 -198
  52. package/dist/layers.BWYHKKSc.js +0 -9
  53. package/dist/layers.B_5Gf5vh.js +0 -7
  54. package/dist/layers.BbCfEXyj.js +0 -55
  55. package/dist/layers.Be7sKoi1.js +0 -36
  56. package/dist/layers.BewWHVmc.js +0 -10
  57. package/dist/layers.Bhbf4Voy.js +0 -1286
  58. package/dist/layers.BhgyYcry.js +0 -2966
  59. package/dist/layers.BjqXvHbh.js +0 -38
  60. package/dist/layers.Bl153Elb.js +0 -772
  61. package/dist/layers.BlVr0EB6.js +0 -35
  62. package/dist/layers.BmBx-JQP.js +0 -9
  63. package/dist/layers.BnDdlKo4.js +0 -39
  64. package/dist/layers.BnWlIV7l.js +0 -9
  65. package/dist/layers.BpilXLfW.js +0 -6
  66. package/dist/layers.BpxcN2Id.js +0 -118
  67. package/dist/layers.Bva7u9LH.js +0 -41
  68. package/dist/layers.Bw9PyPP3.js +0 -40
  69. package/dist/layers.BxxWjVSm.js +0 -7
  70. package/dist/layers.ByfnxHEU.js +0 -11
  71. package/dist/layers.BzrUktHE.js +0 -40
  72. package/dist/layers.Bzx6XYuC.js +0 -1
  73. package/dist/layers.C-oUoVP8.js +0 -11
  74. package/dist/layers.C-v8184a.js +0 -10
  75. package/dist/layers.C2DLU3k6.js +0 -205
  76. package/dist/layers.C4n-fEss.js +0 -9
  77. package/dist/layers.C8LHt7Vy.js +0 -35
  78. package/dist/layers.C8_lu5UH.js +0 -23
  79. package/dist/layers.C8i9MTMT.js +0 -1089
  80. package/dist/layers.C8sUTigy.js +0 -1
  81. package/dist/layers.C9xAxi33.js +0 -2
  82. package/dist/layers.CBBwxyeE.js +0 -36
  83. package/dist/layers.CD1cqEz5.js +0 -40
  84. package/dist/layers.CDMZWhfy.js +0 -61
  85. package/dist/layers.CEGoZtyz.js +0 -42
  86. package/dist/layers.CF5fav1y.js +0 -42
  87. package/dist/layers.CHZsXQcr.js +0 -1
  88. package/dist/layers.CL2zU9v_.js +0 -8
  89. package/dist/layers.CMF1lFeu.js +0 -2482
  90. package/dist/layers.CN4h4dWv.js +0 -40
  91. package/dist/layers.COskFe6S.js +0 -39
  92. package/dist/layers.CPYfnqn5.js +0 -37
  93. package/dist/layers.CQGa02SB.js +0 -8
  94. package/dist/layers.CS1a09mB.js +0 -2
  95. package/dist/layers.CSABgVEk.js +0 -13
  96. package/dist/layers.CSPqTpuh.js +0 -1
  97. package/dist/layers.CUJquY9u.js +0 -40
  98. package/dist/layers.CVpmcvSk.js +0 -425
  99. package/dist/layers.CXNwKrxy.js +0 -2
  100. package/dist/layers.CXbg7PbM.js +0 -32
  101. package/dist/layers.CXtLmfFd.js +0 -4
  102. package/dist/layers.CYQ-eDkR.js +0 -36
  103. package/dist/layers.CYlMzZJI.js +0 -223
  104. package/dist/layers.C_6t44t9.js +0 -7
  105. package/dist/layers.C_AqJZgj.js +0 -1
  106. package/dist/layers.C_IvrzZ3.js +0 -7
  107. package/dist/layers.C_JAqhrY.js +0 -76
  108. package/dist/layers.C_l6mWJZ.js +0 -3
  109. package/dist/layers.Cbn9kFtP.js +0 -22
  110. package/dist/layers.CdC2YLb3.js +0 -189
  111. package/dist/layers.Ce68IynP.js +0 -8
  112. package/dist/layers.Ced46X3q.js +0 -6
  113. package/dist/layers.CgAndu8u.js +0 -437
  114. package/dist/layers.CgKZ3PQQ.js +0 -1
  115. package/dist/layers.CjF61D9D.js +0 -32
  116. package/dist/layers.Ck_mYNSX.js +0 -38
  117. package/dist/layers.Ckb_FqEw.js +0 -9
  118. package/dist/layers.ClK-YSEj.js +0 -10
  119. package/dist/layers.ClPMD0vL.js +0 -1619
  120. package/dist/layers.Cq3WhnzE.js +0 -41
  121. package/dist/layers.CqVTtuYm.js +0 -6
  122. package/dist/layers.CrM-3BQr.js +0 -4
  123. package/dist/layers.CsJQzt0K.js +0 -805
  124. package/dist/layers.Cux05MKl.js +0 -8
  125. package/dist/layers.CwZFs1PA.js +0 -10
  126. package/dist/layers.Cxlebi7D.js +0 -122
  127. package/dist/layers.Cy9EF2DN.js +0 -8
  128. package/dist/layers.Cyzu9PKQ.js +0 -1
  129. package/dist/layers.D0zn4_Mx.js +0 -1
  130. package/dist/layers.D1hB76Bq.js +0 -11
  131. package/dist/layers.D3RHWYgt.js +0 -8
  132. package/dist/layers.D3qdetie.js +0 -9
  133. package/dist/layers.D3xtqcGm.js +0 -42
  134. package/dist/layers.D4T8fTcj.js +0 -1223
  135. package/dist/layers.D54e-Khu.js +0 -9
  136. package/dist/layers.D661e9Xc.js +0 -1225
  137. package/dist/layers.D7cIx_9y.js +0 -7
  138. package/dist/layers.D7jGxypv.js +0 -8
  139. package/dist/layers.D7v-bI_M.js +0 -796
  140. package/dist/layers.DA37YYAX.js +0 -1
  141. package/dist/layers.DBFtWsLd.js +0 -32
  142. package/dist/layers.DBspJRLt.js +0 -9
  143. package/dist/layers.DCYPhLVi.js +0 -139
  144. package/dist/layers.DCeGyOw0.js +0 -32
  145. package/dist/layers.DDBS2bZp.js +0 -10
  146. package/dist/layers.DEV2RzXF.js +0 -35
  147. package/dist/layers.DFOzrTFb.js +0 -6
  148. package/dist/layers.DGbx9JE5.js +0 -70
  149. package/dist/layers.DH1xK3c2.js +0 -48149
  150. package/dist/layers.DH2Fx227.js +0 -38
  151. package/dist/layers.DH7NXYKd.js +0 -21941
  152. package/dist/layers.DHOsMTqa.js +0 -41
  153. package/dist/layers.DJIT4Yuh.js +0 -1
  154. package/dist/layers.DJteL1WD.js +0 -33
  155. package/dist/layers.DLwuMfdd.js +0 -84
  156. package/dist/layers.DMkBISW1.js +0 -1
  157. package/dist/layers.DN58BT2N.js +0 -129
  158. package/dist/layers.DN9HoVxI.js +0 -18
  159. package/dist/layers.DNRniJ59.js +0 -33
  160. package/dist/layers.DOZhGFQj.js +0 -40
  161. package/dist/layers.DOrgOHBr.js +0 -1
  162. package/dist/layers.DP6Pb86W.js +0 -4
  163. package/dist/layers.DQpfAS9_.js +0 -84
  164. package/dist/layers.DSBfJxui.js +0 -2238
  165. package/dist/layers.DUulRicy.js +0 -213
  166. package/dist/layers.DXLQ2q0o.js +0 -794
  167. package/dist/layers.DXqg60IE.js +0 -1
  168. package/dist/layers.DZkyqPUI.js +0 -41
  169. package/dist/layers.D_MAZnF5.js +0 -11
  170. package/dist/layers.DbMx76Zo.js +0 -1
  171. package/dist/layers.DbaKVP5e.js +0 -1
  172. package/dist/layers.DcYYTMWk.js +0 -5
  173. package/dist/layers.DenHSAM-.js +0 -423
  174. package/dist/layers.Dfg_GwXo.js +0 -41
  175. package/dist/layers.Dfv6IVuG.js +0 -39
  176. package/dist/layers.Di5XQ7RG.js +0 -5
  177. package/dist/layers.DiLG4f1T.js +0 -41
  178. package/dist/layers.DjUOC4st.js +0 -16
  179. package/dist/layers.Dksb8xWL.js +0 -21620
  180. package/dist/layers.DnTHkHku.js +0 -1
  181. package/dist/layers.DnbGJb7n.js +0 -10
  182. package/dist/layers.Dp8hIITu.js +0 -39
  183. package/dist/layers.DrGILrJe.js +0 -1
  184. package/dist/layers.DrPZhd4b.js +0 -8
  185. package/dist/layers.DsCDPcQF.js +0 -52
  186. package/dist/layers.DsLXYKq7.js +0 -139
  187. package/dist/layers.DssLE6Ze.js +0 -42
  188. package/dist/layers.DtK0Svqg.js +0 -36
  189. package/dist/layers.DtNKNbtb.js +0 -1268
  190. package/dist/layers.DuuzgAVb.js +0 -7
  191. package/dist/layers.DuyNXGEO.js +0 -5
  192. package/dist/layers.DvSwjIBG.js +0 -37
  193. package/dist/layers.DwPc2_v9.js +0 -1088
  194. package/dist/layers.DxA6ocdw.js +0 -70
  195. package/dist/layers.Dy1naDTQ.js +0 -14
  196. package/dist/layers.DyK8xvHc.js +0 -1
  197. package/dist/layers.G5fXkV2g.js +0 -40
  198. package/dist/layers.GRwgnZ0K.js +0 -1126
  199. package/dist/layers.H9GbooLl.js +0 -11
  200. package/dist/layers.Ii0kosET.js +0 -10
  201. package/dist/layers.IsBK41F6.js +0 -960
  202. package/dist/layers.JFRyjmr3.js +0 -295
  203. package/dist/layers.JWCLFILJ.js +0 -1
  204. package/dist/layers.L1EEfd1U.js +0 -323
  205. package/dist/layers.LgOKQKa4.js +0 -39
  206. package/dist/layers.NsxwBYck.js +0 -907
  207. package/dist/layers.OqunHjml.js +0 -51
  208. package/dist/layers.OziSx6JY.js +0 -8583
  209. package/dist/layers.PW9J5Jxo.js +0 -37
  210. package/dist/layers.R8mPlCA0.js +0 -261
  211. package/dist/layers.S2akqscS.js +0 -1
  212. package/dist/layers.SGT8YAPE.js +0 -7
  213. package/dist/layers.TD8A7YjM.js +0 -44
  214. package/dist/layers.UtIqQK19.js +0 -276
  215. package/dist/layers.VIZ2Xa30.js +0 -1
  216. package/dist/layers.WAvmJfLV.js +0 -7
  217. package/dist/layers.XQpyNRW5.js +0 -116
  218. package/dist/layers.Xco5GVBh.js +0 -40
  219. package/dist/layers.Y0BjACCI.js +0 -39
  220. package/dist/layers.YTMr1YyH.js +0 -42
  221. package/dist/layers._bAvXI7Q.js +0 -934
  222. package/dist/layers._mqWoKOG.js +0 -1
  223. package/dist/layers.al8Vg6zt.js +0 -6
  224. package/dist/layers.b0h5ZBmD.js +0 -61
  225. package/dist/layers.dyRJvH-s.js +0 -6
  226. package/dist/layers.eB1U5Jl6.js +0 -8
  227. package/dist/layers.euNtZlgm.js +0 -37
  228. package/dist/layers.fChmSQjC.js +0 -1
  229. package/dist/layers.feSI_7Kx.js +0 -1
  230. package/dist/layers.frthGoDK.js +0 -9
  231. package/dist/layers.gqLoI9xW.js +0 -5
  232. package/dist/layers.hpuqkyYN.js +0 -257
  233. package/dist/layers.iN3mYsr5.js +0 -34
  234. package/dist/layers.jjNsAaLS.js +0 -10
  235. package/dist/layers.l6EuAdoo.js +0 -7
  236. package/dist/layers.lCpg7dOn.js +0 -21
  237. package/dist/layers.lXs3RYd3.js +0 -10
  238. package/dist/layers.liB8aZ3C.js +0 -207
  239. package/dist/layers.qffllMmW.js +0 -41
  240. package/dist/layers.r1jKcKBb.js +0 -4
  241. package/dist/layers.rFy6_B28.js +0 -32
  242. package/dist/layers.rq1vUYAs.js +0 -6
  243. package/dist/layers.sIeIPQd4.js +0 -40
  244. package/dist/layers.sdxt2Nuu.js +0 -8
  245. package/dist/layers.t8MaTGN8.js +0 -1
  246. package/dist/layers.wKJ5yZVV.js +0 -96
  247. package/dist/layers.x9brO2TV.js +0 -1
  248. package/dist/layers.xQ1jNHSB.js +0 -1583
@@ -1,806 +0,0 @@
1
- import { o as mt, n as kt, s as _t, a as xt, c as vt, b as bt, g as rt, p as wt, d as Y, Y as St, q as Lt, j as Et } from "./layers.OziSx6JY.js";
2
- import "./layers.Dksb8xWL.js";
3
- import "lodash-es/memoize.js";
4
- import "lodash-es/merge.js";
5
- import "lodash-es/isEmpty.js";
6
- import { o as At } from "./layers.b0h5ZBmD.js";
7
- import { s as Tt } from "./layers.D7jGxypv.js";
8
- function ot(t, n) {
9
- let s;
10
- if (n === void 0)
11
- for (const a of t)
12
- a != null && (s < a || s === void 0 && a >= a) && (s = a);
13
- else {
14
- let a = -1;
15
- for (let u of t)
16
- (u = n(u, ++a, t)) != null && (s < u || s === void 0 && u >= u) && (s = u);
17
- }
18
- return s;
19
- }
20
- function yt(t, n) {
21
- let s;
22
- if (n === void 0)
23
- for (const a of t)
24
- a != null && (s > a || s === void 0 && a >= a) && (s = a);
25
- else {
26
- let a = -1;
27
- for (let u of t)
28
- (u = n(u, ++a, t)) != null && (s > u || s === void 0 && u >= u) && (s = u);
29
- }
30
- return s;
31
- }
32
- function Z(t, n) {
33
- let s = 0;
34
- if (n === void 0)
35
- for (let a of t)
36
- (a = +a) && (s += a);
37
- else {
38
- let a = -1;
39
- for (let u of t)
40
- (u = +n(u, ++a, t)) && (s += u);
41
- }
42
- return s;
43
- }
44
- function Mt(t) {
45
- return t.target.depth;
46
- }
47
- function Nt(t) {
48
- return t.depth;
49
- }
50
- function Pt(t, n) {
51
- return n - 1 - t.height;
52
- }
53
- function dt(t, n) {
54
- return t.sourceLinks.length ? t.depth : n - 1;
55
- }
56
- function Ct(t) {
57
- return t.targetLinks.length ? t.depth : t.sourceLinks.length ? yt(t.sourceLinks, Mt) - 1 : 0;
58
- }
59
- function G(t) {
60
- return function() {
61
- return t;
62
- };
63
- }
64
- function lt(t, n) {
65
- return q(t.source, n.source) || t.index - n.index;
66
- }
67
- function at(t, n) {
68
- return q(t.target, n.target) || t.index - n.index;
69
- }
70
- function q(t, n) {
71
- return t.y0 - n.y0;
72
- }
73
- function J(t) {
74
- return t.value;
75
- }
76
- function It(t) {
77
- return t.index;
78
- }
79
- function $t(t) {
80
- return t.nodes;
81
- }
82
- function Ot(t) {
83
- return t.links;
84
- }
85
- function ct(t, n) {
86
- const s = t.get(n);
87
- if (!s) throw new Error("missing: " + n);
88
- return s;
89
- }
90
- function ut({ nodes: t }) {
91
- for (const n of t) {
92
- let s = n.y0, a = s;
93
- for (const u of n.sourceLinks)
94
- u.y0 = s + u.width / 2, s += u.width;
95
- for (const u of n.targetLinks)
96
- u.y1 = a + u.width / 2, a += u.width;
97
- }
98
- }
99
- function jt() {
100
- let t = 0, n = 0, s = 1, a = 1, u = 24, _ = 8, g, p = It, i = dt, o, c, m = $t, b = Ot, y = 6;
101
- function x() {
102
- const e = { nodes: m.apply(null, arguments), links: b.apply(null, arguments) };
103
- return E(e), L(e), A(e), N(e), S(e), ut(e), e;
104
- }
105
- x.update = function(e) {
106
- return ut(e), e;
107
- }, x.nodeId = function(e) {
108
- return arguments.length ? (p = typeof e == "function" ? e : G(e), x) : p;
109
- }, x.nodeAlign = function(e) {
110
- return arguments.length ? (i = typeof e == "function" ? e : G(e), x) : i;
111
- }, x.nodeSort = function(e) {
112
- return arguments.length ? (o = e, x) : o;
113
- }, x.nodeWidth = function(e) {
114
- return arguments.length ? (u = +e, x) : u;
115
- }, x.nodePadding = function(e) {
116
- return arguments.length ? (_ = g = +e, x) : _;
117
- }, x.nodes = function(e) {
118
- return arguments.length ? (m = typeof e == "function" ? e : G(e), x) : m;
119
- }, x.links = function(e) {
120
- return arguments.length ? (b = typeof e == "function" ? e : G(e), x) : b;
121
- }, x.linkSort = function(e) {
122
- return arguments.length ? (c = e, x) : c;
123
- }, x.size = function(e) {
124
- return arguments.length ? (t = n = 0, s = +e[0], a = +e[1], x) : [s - t, a - n];
125
- }, x.extent = function(e) {
126
- return arguments.length ? (t = +e[0][0], s = +e[1][0], n = +e[0][1], a = +e[1][1], x) : [[t, n], [s, a]];
127
- }, x.iterations = function(e) {
128
- return arguments.length ? (y = +e, x) : y;
129
- };
130
- function E({ nodes: e, links: f }) {
131
- for (const [h, r] of e.entries())
132
- r.index = h, r.sourceLinks = [], r.targetLinks = [];
133
- const l = new Map(e.map((h, r) => [p(h, r, e), h]));
134
- for (const [h, r] of f.entries()) {
135
- r.index = h;
136
- let { source: k, target: v } = r;
137
- typeof k != "object" && (k = r.source = ct(l, k)), typeof v != "object" && (v = r.target = ct(l, v)), k.sourceLinks.push(r), v.targetLinks.push(r);
138
- }
139
- if (c != null)
140
- for (const { sourceLinks: h, targetLinks: r } of e)
141
- h.sort(c), r.sort(c);
142
- }
143
- function L({ nodes: e }) {
144
- for (const f of e)
145
- f.value = f.fixedValue === void 0 ? Math.max(Z(f.sourceLinks, J), Z(f.targetLinks, J)) : f.fixedValue;
146
- }
147
- function A({ nodes: e }) {
148
- const f = e.length;
149
- let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
150
- for (; l.size; ) {
151
- for (const k of l) {
152
- k.depth = r;
153
- for (const { target: v } of k.sourceLinks)
154
- h.add(v);
155
- }
156
- if (++r > f) throw new Error("circular link");
157
- l = h, h = /* @__PURE__ */ new Set();
158
- }
159
- }
160
- function N({ nodes: e }) {
161
- const f = e.length;
162
- let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
163
- for (; l.size; ) {
164
- for (const k of l) {
165
- k.height = r;
166
- for (const { source: v } of k.targetLinks)
167
- h.add(v);
168
- }
169
- if (++r > f) throw new Error("circular link");
170
- l = h, h = /* @__PURE__ */ new Set();
171
- }
172
- }
173
- function I({ nodes: e }) {
174
- const f = ot(e, (r) => r.depth) + 1, l = (s - t - u) / (f - 1), h = new Array(f);
175
- for (const r of e) {
176
- const k = Math.max(0, Math.min(f - 1, Math.floor(i.call(null, r, f))));
177
- r.layer = k, r.x0 = t + k * l, r.x1 = r.x0 + u, h[k] ? h[k].push(r) : h[k] = [r];
178
- }
179
- if (o) for (const r of h)
180
- r.sort(o);
181
- return h;
182
- }
183
- function j(e) {
184
- const f = yt(e, (l) => (a - n - (l.length - 1) * g) / Z(l, J));
185
- for (const l of e) {
186
- let h = n;
187
- for (const r of l) {
188
- r.y0 = h, r.y1 = h + r.value * f, h = r.y1 + g;
189
- for (const k of r.sourceLinks)
190
- k.width = k.value * f;
191
- }
192
- h = (a - h + g) / (l.length + 1);
193
- for (let r = 0; r < l.length; ++r) {
194
- const k = l[r];
195
- k.y0 += h * (r + 1), k.y1 += h * (r + 1);
196
- }
197
- $(l);
198
- }
199
- }
200
- function S(e) {
201
- const f = I(e);
202
- g = Math.min(_, (a - n) / (ot(f, (l) => l.length) - 1)), j(f);
203
- for (let l = 0; l < y; ++l) {
204
- const h = Math.pow(0.99, l), r = Math.max(1 - h, (l + 1) / y);
205
- O(f, h, r), M(f, h, r);
206
- }
207
- }
208
- function M(e, f, l) {
209
- for (let h = 1, r = e.length; h < r; ++h) {
210
- const k = e[h];
211
- for (const v of k) {
212
- let R = 0, z = 0;
213
- for (const { source: W, value: K } of v.targetLinks) {
214
- let F = K * (v.layer - W.layer);
215
- R += T(W, v) * F, z += F;
216
- }
217
- if (!(z > 0)) continue;
218
- let U = (R / z - v.y0) * f;
219
- v.y0 += U, v.y1 += U, w(v);
220
- }
221
- o === void 0 && k.sort(q), P(k, l);
222
- }
223
- }
224
- function O(e, f, l) {
225
- for (let h = e.length, r = h - 2; r >= 0; --r) {
226
- const k = e[r];
227
- for (const v of k) {
228
- let R = 0, z = 0;
229
- for (const { target: W, value: K } of v.sourceLinks) {
230
- let F = K * (W.layer - v.layer);
231
- R += V(v, W) * F, z += F;
232
- }
233
- if (!(z > 0)) continue;
234
- let U = (R / z - v.y0) * f;
235
- v.y0 += U, v.y1 += U, w(v);
236
- }
237
- o === void 0 && k.sort(q), P(k, l);
238
- }
239
- }
240
- function P(e, f) {
241
- const l = e.length >> 1, h = e[l];
242
- d(e, h.y0 - g, l - 1, f), C(e, h.y1 + g, l + 1, f), d(e, a, e.length - 1, f), C(e, n, 0, f);
243
- }
244
- function C(e, f, l, h) {
245
- for (; l < e.length; ++l) {
246
- const r = e[l], k = (f - r.y0) * h;
247
- k > 1e-6 && (r.y0 += k, r.y1 += k), f = r.y1 + g;
248
- }
249
- }
250
- function d(e, f, l, h) {
251
- for (; l >= 0; --l) {
252
- const r = e[l], k = (r.y1 - f) * h;
253
- k > 1e-6 && (r.y0 -= k, r.y1 -= k), f = r.y0 - g;
254
- }
255
- }
256
- function w({ sourceLinks: e, targetLinks: f }) {
257
- if (c === void 0) {
258
- for (const { source: { sourceLinks: l } } of f)
259
- l.sort(at);
260
- for (const { target: { targetLinks: l } } of e)
261
- l.sort(lt);
262
- }
263
- }
264
- function $(e) {
265
- if (c === void 0)
266
- for (const { sourceLinks: f, targetLinks: l } of e)
267
- f.sort(at), l.sort(lt);
268
- }
269
- function T(e, f) {
270
- let l = e.y0 - (e.sourceLinks.length - 1) * g / 2;
271
- for (const { target: h, width: r } of e.sourceLinks) {
272
- if (h === f) break;
273
- l += r + g;
274
- }
275
- for (const { source: h, width: r } of f.targetLinks) {
276
- if (h === e) break;
277
- l -= r;
278
- }
279
- return l;
280
- }
281
- function V(e, f) {
282
- let l = f.y0 - (f.targetLinks.length - 1) * g / 2;
283
- for (const { source: h, width: r } of f.targetLinks) {
284
- if (h === e) break;
285
- l += r + g;
286
- }
287
- for (const { target: h, width: r } of e.sourceLinks) {
288
- if (h === f) break;
289
- l -= r;
290
- }
291
- return l;
292
- }
293
- return x;
294
- }
295
- var tt = Math.PI, et = 2 * tt, D = 1e-6, zt = et - D;
296
- function nt() {
297
- this._x0 = this._y0 = // start of current subpath
298
- this._x1 = this._y1 = null, this._ = "";
299
- }
300
- function gt() {
301
- return new nt();
302
- }
303
- nt.prototype = gt.prototype = {
304
- constructor: nt,
305
- moveTo: function(t, n) {
306
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n);
307
- },
308
- closePath: function() {
309
- this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
310
- },
311
- lineTo: function(t, n) {
312
- this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n);
313
- },
314
- quadraticCurveTo: function(t, n, s, a) {
315
- this._ += "Q" + +t + "," + +n + "," + (this._x1 = +s) + "," + (this._y1 = +a);
316
- },
317
- bezierCurveTo: function(t, n, s, a, u, _) {
318
- this._ += "C" + +t + "," + +n + "," + +s + "," + +a + "," + (this._x1 = +u) + "," + (this._y1 = +_);
319
- },
320
- arcTo: function(t, n, s, a, u) {
321
- t = +t, n = +n, s = +s, a = +a, u = +u;
322
- var _ = this._x1, g = this._y1, p = s - t, i = a - n, o = _ - t, c = g - n, m = o * o + c * c;
323
- if (u < 0) throw new Error("negative radius: " + u);
324
- if (this._x1 === null)
325
- this._ += "M" + (this._x1 = t) + "," + (this._y1 = n);
326
- else if (m > D) if (!(Math.abs(c * p - i * o) > D) || !u)
327
- this._ += "L" + (this._x1 = t) + "," + (this._y1 = n);
328
- else {
329
- var b = s - _, y = a - g, x = p * p + i * i, E = b * b + y * y, L = Math.sqrt(x), A = Math.sqrt(m), N = u * Math.tan((tt - Math.acos((x + m - E) / (2 * L * A))) / 2), I = N / A, j = N / L;
330
- Math.abs(I - 1) > D && (this._ += "L" + (t + I * o) + "," + (n + I * c)), this._ += "A" + u + "," + u + ",0,0," + +(c * b > o * y) + "," + (this._x1 = t + j * p) + "," + (this._y1 = n + j * i);
331
- }
332
- },
333
- arc: function(t, n, s, a, u, _) {
334
- t = +t, n = +n, s = +s, _ = !!_;
335
- var g = s * Math.cos(a), p = s * Math.sin(a), i = t + g, o = n + p, c = 1 ^ _, m = _ ? a - u : u - a;
336
- if (s < 0) throw new Error("negative radius: " + s);
337
- this._x1 === null ? this._ += "M" + i + "," + o : (Math.abs(this._x1 - i) > D || Math.abs(this._y1 - o) > D) && (this._ += "L" + i + "," + o), s && (m < 0 && (m = m % et + et), m > zt ? this._ += "A" + s + "," + s + ",0,1," + c + "," + (t - g) + "," + (n - p) + "A" + s + "," + s + ",0,1," + c + "," + (this._x1 = i) + "," + (this._y1 = o) : m > D && (this._ += "A" + s + "," + s + ",0," + +(m >= tt) + "," + c + "," + (this._x1 = t + s * Math.cos(u)) + "," + (this._y1 = n + s * Math.sin(u))));
338
- },
339
- rect: function(t, n, s, a) {
340
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n) + "h" + +s + "v" + +a + "h" + -s + "Z";
341
- },
342
- toString: function() {
343
- return this._;
344
- }
345
- };
346
- function ht(t) {
347
- return function() {
348
- return t;
349
- };
350
- }
351
- function Dt(t) {
352
- return t[0];
353
- }
354
- function Bt(t) {
355
- return t[1];
356
- }
357
- var Vt = Array.prototype.slice;
358
- function Rt(t) {
359
- return t.source;
360
- }
361
- function Ut(t) {
362
- return t.target;
363
- }
364
- function Wt(t) {
365
- var n = Rt, s = Ut, a = Dt, u = Bt, _ = null;
366
- function g() {
367
- var p, i = Vt.call(arguments), o = n.apply(this, i), c = s.apply(this, i);
368
- if (_ || (_ = p = gt()), t(_, +a.apply(this, (i[0] = o, i)), +u.apply(this, i), +a.apply(this, (i[0] = c, i)), +u.apply(this, i)), p) return _ = null, p + "" || null;
369
- }
370
- return g.source = function(p) {
371
- return arguments.length ? (n = p, g) : n;
372
- }, g.target = function(p) {
373
- return arguments.length ? (s = p, g) : s;
374
- }, g.x = function(p) {
375
- return arguments.length ? (a = typeof p == "function" ? p : ht(+p), g) : a;
376
- }, g.y = function(p) {
377
- return arguments.length ? (u = typeof p == "function" ? p : ht(+p), g) : u;
378
- }, g.context = function(p) {
379
- return arguments.length ? (_ = p ?? null, g) : _;
380
- }, g;
381
- }
382
- function Ft(t, n, s, a, u) {
383
- t.moveTo(n, s), t.bezierCurveTo(n = (n + a) / 2, s, n, u, a, u);
384
- }
385
- function Yt() {
386
- return Wt(Ft);
387
- }
388
- function Gt(t) {
389
- return [t.source.x1, t.y0];
390
- }
391
- function qt(t) {
392
- return [t.target.x0, t.y1];
393
- }
394
- function Ht() {
395
- return Yt().source(Gt).target(qt);
396
- }
397
- var it = (function() {
398
- var t = function(p, i, o, c) {
399
- for (o = o || {}, c = p.length; c--; o[p[c]] = i)
400
- ;
401
- return o;
402
- }, n = [1, 9], s = [1, 10], a = [1, 5, 10, 12], u = {
403
- trace: function() {
404
- },
405
- yy: {},
406
- symbols_: { error: 2, start: 3, SANKEY: 4, NEWLINE: 5, csv: 6, opt_eof: 7, record: 8, csv_tail: 9, EOF: 10, "field[source]": 11, COMMA: 12, "field[target]": 13, "field[value]": 14, field: 15, escaped: 16, non_escaped: 17, DQUOTE: 18, ESCAPED_TEXT: 19, NON_ESCAPED_TEXT: 20, $accept: 0, $end: 1 },
407
- terminals_: { 2: "error", 4: "SANKEY", 5: "NEWLINE", 10: "EOF", 11: "field[source]", 12: "COMMA", 13: "field[target]", 14: "field[value]", 18: "DQUOTE", 19: "ESCAPED_TEXT", 20: "NON_ESCAPED_TEXT" },
408
- productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
409
- performAction: function(i, o, c, m, b, y, x) {
410
- var E = y.length - 1;
411
- switch (b) {
412
- case 7:
413
- const L = m.findOrCreateNode(y[E - 4].trim().replaceAll('""', '"')), A = m.findOrCreateNode(y[E - 2].trim().replaceAll('""', '"')), N = parseFloat(y[E].trim());
414
- m.addLink(L, A, N);
415
- break;
416
- case 8:
417
- case 9:
418
- case 11:
419
- this.$ = y[E];
420
- break;
421
- case 10:
422
- this.$ = y[E - 1];
423
- break;
424
- }
425
- },
426
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: s }, { 1: [2, 6], 7: 11, 10: [1, 12] }, t(s, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, t(a, [2, 8]), t(a, [2, 9]), { 19: [1, 16] }, t(a, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, t(s, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: s }, { 15: 18, 16: 7, 17: 8, 18: n, 20: s }, { 18: [1, 19] }, t(s, [2, 3]), { 12: [1, 20] }, t(a, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: n, 20: s }, t([1, 5, 10], [2, 7])],
427
- defaultActions: { 11: [2, 1], 12: [2, 5] },
428
- parseError: function(i, o) {
429
- if (o.recoverable)
430
- this.trace(i);
431
- else {
432
- var c = new Error(i);
433
- throw c.hash = o, c;
434
- }
435
- },
436
- parse: function(i) {
437
- var o = this, c = [0], m = [], b = [null], y = [], x = this.table, E = "", L = 0, A = 0, N = 2, I = 1, j = y.slice.call(arguments, 1), S = Object.create(this.lexer), M = { yy: {} };
438
- for (var O in this.yy)
439
- Object.prototype.hasOwnProperty.call(this.yy, O) && (M.yy[O] = this.yy[O]);
440
- S.setInput(i, M.yy), M.yy.lexer = S, M.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
441
- var P = S.yylloc;
442
- y.push(P);
443
- var C = S.options && S.options.ranges;
444
- typeof M.yy.parseError == "function" ? this.parseError = M.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
445
- function d() {
446
- var v;
447
- return v = m.pop() || S.lex() || I, typeof v != "number" && (v instanceof Array && (m = v, v = m.pop()), v = o.symbols_[v] || v), v;
448
- }
449
- for (var w, $, T, V, e = {}, f, l, h, r; ; ) {
450
- if ($ = c[c.length - 1], this.defaultActions[$] ? T = this.defaultActions[$] : ((w === null || typeof w > "u") && (w = d()), T = x[$] && x[$][w]), typeof T > "u" || !T.length || !T[0]) {
451
- var k = "";
452
- r = [];
453
- for (f in x[$])
454
- this.terminals_[f] && f > N && r.push("'" + this.terminals_[f] + "'");
455
- S.showPosition ? k = "Parse error on line " + (L + 1) + `:
456
- ` + S.showPosition() + `
457
- Expecting ` + r.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : k = "Parse error on line " + (L + 1) + ": Unexpected " + (w == I ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(k, {
458
- text: S.match,
459
- token: this.terminals_[w] || w,
460
- line: S.yylineno,
461
- loc: P,
462
- expected: r
463
- });
464
- }
465
- if (T[0] instanceof Array && T.length > 1)
466
- throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + w);
467
- switch (T[0]) {
468
- case 1:
469
- c.push(w), b.push(S.yytext), y.push(S.yylloc), c.push(T[1]), w = null, A = S.yyleng, E = S.yytext, L = S.yylineno, P = S.yylloc;
470
- break;
471
- case 2:
472
- if (l = this.productions_[T[1]][1], e.$ = b[b.length - l], e._$ = {
473
- first_line: y[y.length - (l || 1)].first_line,
474
- last_line: y[y.length - 1].last_line,
475
- first_column: y[y.length - (l || 1)].first_column,
476
- last_column: y[y.length - 1].last_column
477
- }, C && (e._$.range = [
478
- y[y.length - (l || 1)].range[0],
479
- y[y.length - 1].range[1]
480
- ]), V = this.performAction.apply(e, [
481
- E,
482
- A,
483
- L,
484
- M.yy,
485
- T[1],
486
- b,
487
- y
488
- ].concat(j)), typeof V < "u")
489
- return V;
490
- l && (c = c.slice(0, -1 * l * 2), b = b.slice(0, -1 * l), y = y.slice(0, -1 * l)), c.push(this.productions_[T[1]][0]), b.push(e.$), y.push(e._$), h = x[c[c.length - 2]][c[c.length - 1]], c.push(h);
491
- break;
492
- case 3:
493
- return !0;
494
- }
495
- }
496
- return !0;
497
- }
498
- }, _ = /* @__PURE__ */ (function() {
499
- var p = {
500
- EOF: 1,
501
- parseError: function(o, c) {
502
- if (this.yy.parser)
503
- this.yy.parser.parseError(o, c);
504
- else
505
- throw new Error(o);
506
- },
507
- // resets the lexer, sets new input
508
- setInput: function(i, o) {
509
- return this.yy = o || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
510
- first_line: 1,
511
- first_column: 0,
512
- last_line: 1,
513
- last_column: 0
514
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
515
- },
516
- // consumes and returns one char from the input
517
- input: function() {
518
- var i = this._input[0];
519
- this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
520
- var o = i.match(/(?:\r\n?|\n).*/g);
521
- return o ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
522
- },
523
- // unshifts one char (or a string) into the input
524
- unput: function(i) {
525
- var o = i.length, c = i.split(/(?:\r\n?|\n)/g);
526
- this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o;
527
- var m = this.match.split(/(?:\r\n?|\n)/g);
528
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
529
- var b = this.yylloc.range;
530
- return this.yylloc = {
531
- first_line: this.yylloc.first_line,
532
- last_line: this.yylineno + 1,
533
- first_column: this.yylloc.first_column,
534
- last_column: c ? (c.length === m.length ? this.yylloc.first_column : 0) + m[m.length - c.length].length - c[0].length : this.yylloc.first_column - o
535
- }, this.options.ranges && (this.yylloc.range = [b[0], b[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this;
536
- },
537
- // When called from action, caches matched text and appends it on next action
538
- more: function() {
539
- return this._more = !0, this;
540
- },
541
- // 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.
542
- reject: function() {
543
- if (this.options.backtrack_lexer)
544
- this._backtrack = !0;
545
- else
546
- 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).
547
- ` + this.showPosition(), {
548
- text: "",
549
- token: null,
550
- line: this.yylineno
551
- });
552
- return this;
553
- },
554
- // retain first n characters of the match
555
- less: function(i) {
556
- this.unput(this.match.slice(i));
557
- },
558
- // displays already matched input, i.e. for error messages
559
- pastInput: function() {
560
- var i = this.matched.substr(0, this.matched.length - this.match.length);
561
- return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
562
- },
563
- // displays upcoming input, i.e. for error messages
564
- upcomingInput: function() {
565
- var i = this.match;
566
- return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
567
- },
568
- // displays the character position where the lexing error occurred, i.e. for error messages
569
- showPosition: function() {
570
- var i = this.pastInput(), o = new Array(i.length + 1).join("-");
571
- return i + this.upcomingInput() + `
572
- ` + o + "^";
573
- },
574
- // test the lexed token: return FALSE when not a match, otherwise return token
575
- test_match: function(i, o) {
576
- var c, m, b;
577
- if (this.options.backtrack_lexer && (b = {
578
- yylineno: this.yylineno,
579
- yylloc: {
580
- first_line: this.yylloc.first_line,
581
- last_line: this.last_line,
582
- first_column: this.yylloc.first_column,
583
- last_column: this.yylloc.last_column
584
- },
585
- yytext: this.yytext,
586
- match: this.match,
587
- matches: this.matches,
588
- matched: this.matched,
589
- yyleng: this.yyleng,
590
- offset: this.offset,
591
- _more: this._more,
592
- _input: this._input,
593
- yy: this.yy,
594
- conditionStack: this.conditionStack.slice(0),
595
- done: this.done
596
- }, this.options.ranges && (b.yylloc.range = this.yylloc.range.slice(0))), m = i[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
597
- first_line: this.yylloc.last_line,
598
- last_line: this.yylineno + 1,
599
- first_column: this.yylloc.last_column,
600
- last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
601
- }, this.yytext += i[0], this.match += i[0], this.matches = i, 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(i[0].length), this.matched += i[0], c = this.performAction.call(this, this.yy, this, o, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
602
- return c;
603
- if (this._backtrack) {
604
- for (var y in b)
605
- this[y] = b[y];
606
- return !1;
607
- }
608
- return !1;
609
- },
610
- // return next match in input
611
- next: function() {
612
- if (this.done)
613
- return this.EOF;
614
- this._input || (this.done = !0);
615
- var i, o, c, m;
616
- this._more || (this.yytext = "", this.match = "");
617
- for (var b = this._currentRules(), y = 0; y < b.length; y++)
618
- if (c = this._input.match(this.rules[b[y]]), c && (!o || c[0].length > o[0].length)) {
619
- if (o = c, m = y, this.options.backtrack_lexer) {
620
- if (i = this.test_match(c, b[y]), i !== !1)
621
- return i;
622
- if (this._backtrack) {
623
- o = !1;
624
- continue;
625
- } else
626
- return !1;
627
- } else if (!this.options.flex)
628
- break;
629
- }
630
- return o ? (i = this.test_match(o, b[m]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
631
- ` + this.showPosition(), {
632
- text: "",
633
- token: null,
634
- line: this.yylineno
635
- });
636
- },
637
- // return next match that has a token
638
- lex: function() {
639
- var o = this.next();
640
- return o || this.lex();
641
- },
642
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
643
- begin: function(o) {
644
- this.conditionStack.push(o);
645
- },
646
- // pop the previously active lexer condition state off the condition stack
647
- popState: function() {
648
- var o = this.conditionStack.length - 1;
649
- return o > 0 ? this.conditionStack.pop() : this.conditionStack[0];
650
- },
651
- // produce the lexer rule set which is active for the currently active lexer condition state
652
- _currentRules: function() {
653
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
654
- },
655
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
656
- topState: function(o) {
657
- return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL";
658
- },
659
- // alias for begin(condition)
660
- pushState: function(o) {
661
- this.begin(o);
662
- },
663
- // return the number of states currently on the stack
664
- stateStackSize: function() {
665
- return this.conditionStack.length;
666
- },
667
- options: { "case-insensitive": !0 },
668
- performAction: function(o, c, m, b) {
669
- switch (m) {
670
- case 0:
671
- return this.pushState("csv"), 4;
672
- case 1:
673
- return 10;
674
- case 2:
675
- return 5;
676
- case 3:
677
- return 12;
678
- case 4:
679
- return this.pushState("escaped_text"), 18;
680
- case 5:
681
- return 20;
682
- case 6:
683
- return this.popState("escaped_text"), 18;
684
- case 7:
685
- return 19;
686
- }
687
- },
688
- rules: [/^(?:sankey-beta\b)/i, /^(?:$)/i, /^(?:((\u000D\u000A)|(\u000A)))/i, /^(?:(\u002C))/i, /^(?:(\u0022))/i, /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i, /^(?:(\u0022)(?!(\u0022)))/i, /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],
689
- conditions: { csv: { rules: [1, 2, 3, 4, 5, 6, 7], inclusive: !1 }, escaped_text: { rules: [6, 7], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7], inclusive: !0 } }
690
- };
691
- return p;
692
- })();
693
- u.lexer = _;
694
- function g() {
695
- this.yy = {};
696
- }
697
- return g.prototype = u, u.Parser = g, new g();
698
- })();
699
- it.parser = it;
700
- const H = it;
701
- let X = [], Q = [], B = {};
702
- const Xt = () => {
703
- X = [], Q = [], B = {}, Lt();
704
- };
705
- class Qt {
706
- constructor(n, s, a = 0) {
707
- this.source = n, this.target = s, this.value = a;
708
- }
709
- }
710
- const Kt = (t, n, s) => {
711
- X.push(new Qt(t, n, s));
712
- };
713
- class Zt {
714
- constructor(n) {
715
- this.ID = n;
716
- }
717
- }
718
- const Jt = (t) => (t = Et.sanitizeText(t, rt()), B[t] || (B[t] = new Zt(t), Q.push(B[t])), B[t]), te = () => Q, ee = () => X, ne = () => ({
719
- nodes: Q.map((t) => ({ id: t.ID })),
720
- links: X.map((t) => ({
721
- source: t.source.ID,
722
- target: t.target.ID,
723
- value: t.value
724
- }))
725
- }), ie = {
726
- nodesMap: B,
727
- getConfig: () => rt().sankey,
728
- getNodes: te,
729
- getLinks: ee,
730
- getGraph: ne,
731
- addLink: Kt,
732
- findOrCreateNode: Jt,
733
- getAccTitle: bt,
734
- setAccTitle: vt,
735
- getAccDescription: xt,
736
- setAccDescription: _t,
737
- getDiagramTitle: kt,
738
- setDiagramTitle: mt,
739
- clear: Xt
740
- }, pt = class st {
741
- static next(n) {
742
- return new st(n + ++st.count);
743
- }
744
- constructor(n) {
745
- this.id = n, this.href = `#${n}`;
746
- }
747
- toString() {
748
- return "url(" + this.href + ")";
749
- }
750
- };
751
- pt.count = 0;
752
- let ft = pt;
753
- const se = {
754
- left: Nt,
755
- right: Pt,
756
- center: Ct,
757
- justify: dt
758
- }, re = function(t, n, s, a) {
759
- const { securityLevel: u, sankey: _ } = rt(), g = wt.sankey;
760
- let p;
761
- u === "sandbox" && (p = Y("#i" + n));
762
- const i = u === "sandbox" ? Y(p.nodes()[0].contentDocument.body) : Y("body"), o = u === "sandbox" ? i.select(`[id="${n}"]`) : Y(`[id="${n}"]`), c = (_ == null ? void 0 : _.width) ?? g.width, m = (_ == null ? void 0 : _.height) ?? g.width, b = (_ == null ? void 0 : _.useMaxWidth) ?? g.useMaxWidth, y = (_ == null ? void 0 : _.nodeAlignment) ?? g.nodeAlignment, x = (_ == null ? void 0 : _.prefix) ?? g.prefix, E = (_ == null ? void 0 : _.suffix) ?? g.suffix, L = (_ == null ? void 0 : _.showValues) ?? g.showValues, A = a.db.getGraph(), N = se[y];
763
- jt().nodeId((d) => d.id).nodeWidth(10).nodePadding(10 + (L ? 15 : 0)).nodeAlign(N).extent([
764
- [0, 0],
765
- [c, m]
766
- ])(A);
767
- const S = At(Tt);
768
- o.append("g").attr("class", "nodes").selectAll(".node").data(A.nodes).join("g").attr("class", "node").attr("id", (d) => (d.uid = ft.next("node-")).id).attr("transform", function(d) {
769
- return "translate(" + d.x0 + "," + d.y0 + ")";
770
- }).attr("x", (d) => d.x0).attr("y", (d) => d.y0).append("rect").attr("height", (d) => d.y1 - d.y0).attr("width", (d) => d.x1 - d.x0).attr("fill", (d) => S(d.id));
771
- const M = ({ id: d, value: w }) => L ? `${d}
772
- ${x}${Math.round(w * 100) / 100}${E}` : d;
773
- o.append("g").attr("class", "node-labels").attr("font-family", "sans-serif").attr("font-size", 14).selectAll("text").data(A.nodes).join("text").attr("x", (d) => d.x0 < c / 2 ? d.x1 + 6 : d.x0 - 6).attr("y", (d) => (d.y1 + d.y0) / 2).attr("dy", `${L ? "0" : "0.35"}em`).attr("text-anchor", (d) => d.x0 < c / 2 ? "start" : "end").text(M);
774
- const O = o.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(A.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), P = (_ == null ? void 0 : _.linkColor) || "gradient";
775
- if (P === "gradient") {
776
- const d = O.append("linearGradient").attr("id", (w) => (w.uid = ft.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (w) => w.source.x1).attr("x2", (w) => w.target.x0);
777
- d.append("stop").attr("offset", "0%").attr("stop-color", (w) => S(w.source.id)), d.append("stop").attr("offset", "100%").attr("stop-color", (w) => S(w.target.id));
778
- }
779
- let C;
780
- switch (P) {
781
- case "gradient":
782
- C = (d) => d.uid;
783
- break;
784
- case "source":
785
- C = (d) => S(d.source.id);
786
- break;
787
- case "target":
788
- C = (d) => S(d.target.id);
789
- break;
790
- default:
791
- C = P;
792
- }
793
- O.append("path").attr("d", Ht()).attr("stroke", C).attr("stroke-width", (d) => Math.max(1, d.width)), St(void 0, o, 0, b);
794
- }, oe = {
795
- draw: re
796
- }, le = (t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
797
- `).trim(), ae = H.parse.bind(H);
798
- H.parse = (t) => ae(le(t));
799
- const pe = {
800
- parser: H,
801
- db: ie,
802
- renderer: oe
803
- };
804
- export {
805
- pe as diagram
806
- };