@knowvah/dot-engine 2.3.0 → 2.3.1

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.
package/dist/render.js CHANGED
@@ -25162,56 +25162,63 @@ function setEndTheta(P, e, merge) {
25162
25162
 
25163
25163
  // src/pathplan/solvers.ts
25164
25164
  var EPS2 = 1e-7;
25165
- var Solver = class _Solver {
25166
- static aeq0(x) {
25167
- return x < EPS2 && x > -EPS2;
25168
- }
25169
- static solve1(c, r) {
25170
- if (_Solver.aeq0(c[1])) return _Solver.aeq0(c[0]) ? 4 : 0;
25171
- r[0] = -c[0] / c[1];
25172
- return 1;
25173
- }
25174
- static solve2(c, r) {
25175
- if (_Solver.aeq0(c[2])) return _Solver.solve1(c, r);
25176
- const b2a = c[1] / (2 * c[2]);
25177
- const disc = b2a * b2a - c[0] / c[2];
25178
- if (disc < 0) return 0;
25179
- if (disc > 0) {
25180
- r[0] = -b2a + Math.sqrt(disc);
25181
- r[1] = -2 * b2a - r[0];
25182
- return 2;
25183
- }
25184
- r[0] = -b2a;
25185
- return 1;
25186
- }
25187
- static solve3neg(disc, q, b3a, r) {
25188
- const rr = 0.5 * Math.sqrt(-disc + q * q);
25165
+ function aeq02(x) {
25166
+ return x < EPS2 && x > -EPS2;
25167
+ }
25168
+ function solve3(coeff, roots) {
25169
+ const a = coeff[3], b = coeff[2], c = coeff[1], d = coeff[0];
25170
+ if (aeq02(a)) return solve2(coeff, roots);
25171
+ const bOver3a = b / (3 * a), cOverA = c / a, dOverA = d / a;
25172
+ let p = bOver3a * bOver3a;
25173
+ const q = dOverA + fma(2 * bOver3a, p, -(bOver3a * cOverA));
25174
+ p = cOverA / 3 - p;
25175
+ const disc = fma(q, q, 4 * p * p * p);
25176
+ let rootn;
25177
+ if (disc < 0) {
25178
+ const r = 0.5 * Math.sqrt(fma(q, q, -disc));
25189
25179
  const theta = Math.atan2(Math.sqrt(-disc), -q);
25190
- const temp = 2 * Math.cbrt(rr);
25191
- r[0] = temp * Math.cos(theta / 3) - b3a;
25192
- r[1] = temp * Math.cos((theta + 2 * Math.PI) / 3) - b3a;
25193
- r[2] = temp * Math.cos((theta - 2 * Math.PI) / 3) - b3a;
25194
- return 3;
25180
+ const temp = 2 * Math.cbrt(r);
25181
+ roots[0] = temp * Math.cos(theta / 3);
25182
+ roots[1] = temp * Math.cos((theta + Math.PI + Math.PI) / 3);
25183
+ roots[2] = temp * Math.cos((theta - Math.PI - Math.PI) / 3);
25184
+ rootn = 3;
25185
+ } else {
25186
+ const alpha = 0.5 * (Math.sqrt(disc) - q);
25187
+ const beta = -q - alpha;
25188
+ roots[0] = Math.cbrt(alpha) + Math.cbrt(beta);
25189
+ if (disc > 0) rootn = 1;
25190
+ else {
25191
+ roots[1] = roots[2] = -0.5 * roots[0];
25192
+ rootn = 3;
25193
+ }
25195
25194
  }
25196
- static solve3pos(disc, q, b3a, r) {
25197
- const al = 0.5 * (Math.sqrt(disc) - q);
25198
- r[0] = Math.cbrt(al) + Math.cbrt(-q - al) - b3a;
25199
- if (disc > 0) return 1;
25200
- r[1] = r[2] = -0.5 * (r[0] + b3a) - b3a;
25201
- return 3;
25195
+ for (let i = 0; i < rootn; i++) roots[i] -= bOver3a;
25196
+ return rootn;
25197
+ }
25198
+ function solve2(coeff, roots) {
25199
+ const a = coeff[2], b = coeff[1], c = coeff[0];
25200
+ if (aeq02(a)) return solve1(coeff, roots);
25201
+ const bOver2a = b / (2 * a);
25202
+ const cOverA = c / a;
25203
+ const disc = fma(bOver2a, bOver2a, -cOverA);
25204
+ if (disc < 0) {
25205
+ return 0;
25206
+ } else if (disc > 0) {
25207
+ roots[0] = -bOver2a + Math.sqrt(disc);
25208
+ roots[1] = fma(-2, bOver2a, -roots[0]);
25209
+ return 2;
25202
25210
  }
25203
- static solve3(c, r) {
25204
- const a = c[3], b = c[2], cv = c[1], d = c[0];
25205
- if (_Solver.aeq0(a)) return _Solver.solve2(c, r);
25206
- const b3a = b / (3 * a), p0 = b3a * b3a;
25207
- const q = 2 * b3a * p0 - b3a * cv / a + d / a;
25208
- const p = cv / (3 * a) - p0;
25209
- const disc = q * q + 4 * p * p * p;
25210
- return disc < 0 ? _Solver.solve3neg(disc, q, b3a, r) : _Solver.solve3pos(disc, q, b3a, r);
25211
+ roots[0] = -bOver2a;
25212
+ return 1;
25213
+ }
25214
+ function solve1(coeff, roots) {
25215
+ const a = coeff[1], b = coeff[0];
25216
+ if (aeq02(a)) {
25217
+ if (aeq02(b)) return 4;
25218
+ return 0;
25211
25219
  }
25212
- };
25213
- function solve3(coeff, roots) {
25214
- return Solver.solve3(coeff, roots);
25220
+ roots[0] = -b / a;
25221
+ return 1;
25215
25222
  }
25216
25223
 
25217
25224
  // src/pathplan/route.ts
@@ -25233,16 +25240,19 @@ var RouteHelper = class _RouteHelper {
25233
25240
  static B3(t) {
25234
25241
  return t * t * t;
25235
25242
  }
25243
+ /** @see lib/pathplan/route.c:B01 */
25236
25244
  static B01(t) {
25237
25245
  const u = 1 - t;
25238
- return u * u * (u + 3 * t);
25246
+ return u * u * fma(3, t, u);
25239
25247
  }
25248
+ /** @see lib/pathplan/route.c:B23 */
25240
25249
  static B23(t) {
25241
25250
  const u = 1 - t;
25242
- return t * t * (3 * u + t);
25251
+ return t * t * fma(3, u, t);
25243
25252
  }
25253
+ /** @see lib/pathplan/route.c:normv */
25244
25254
  static normv(v) {
25245
- const d = v.x * v.x + v.y * v.y;
25255
+ const d = fma(v.x, v.x, v.y * v.y);
25246
25256
  if (d > 1e-6) {
25247
25257
  const s = Math.sqrt(d);
25248
25258
  return { x: v.x / s, y: v.y / s };
@@ -25258,20 +25268,28 @@ var RouteHelper = class _RouteHelper {
25258
25268
  static ptScale(p, c) {
25259
25269
  return { x: p.x * c, y: p.y * c };
25260
25270
  }
25271
+ /** @see lib/pathplan/route.c:dot */
25261
25272
  static ptDot(a, b) {
25262
- return a.x * b.x + a.y * b.y;
25273
+ return fma(a.x, b.x, a.y * b.y);
25263
25274
  }
25275
+ /** @see lib/pathplan/route.c:dist (libm hypot, no contraction) */
25264
25276
  static ptDist(a, b) {
25265
- return Math.hypot(a.x - b.x, a.y - b.y);
25277
+ return libmHypot(a.x - b.x, a.y - b.y);
25266
25278
  }
25267
25279
  static distN(pts) {
25268
25280
  let rv = 0;
25269
25281
  for (let i = 1; i < pts.length; i++) rv += _RouteHelper.ptDist(pts[i], pts[i - 1]);
25270
25282
  return rv;
25271
25283
  }
25284
+ /**
25285
+ * The cubic's coefficients come out of catastrophic cancellation when the
25286
+ * spline is tangent to a barrier (tests/2646.dot), so clang's contraction
25287
+ * here decides solve3's root count; mirror it exactly.
25288
+ * @see lib/pathplan/route.c:points2coeff
25289
+ */
25272
25290
  static points2coeff(v0, v1, v2, v3, c) {
25273
- c[3] = v3 + 3 * v1 - (v0 + 3 * v2);
25274
- c[2] = 3 * v0 + 3 * v2 - 6 * v1;
25291
+ c[3] = fma(3, v1, v3) - fma(3, v2, v0);
25292
+ c[2] = fma(-6, v1, fma(3, v0, 3 * v2));
25275
25293
  c[1] = 3 * (v1 - v0);
25276
25294
  c[0] = v0;
25277
25295
  }
@@ -25311,7 +25329,7 @@ var RouteHelper = class _RouteHelper {
25311
25329
  const tv = xr[i];
25312
25330
  if (tv >= 0 && tv <= 1) {
25313
25331
  _RouteHelper.points2coeff(sps[0].y, sps[1].y, sps[2].y, sps[3].y, sc);
25314
- const sv = (sc[0] + tv * (sc[1] + tv * (sc[2] + tv * sc[3])) - lc.yc0) / lc.yc1;
25332
+ const sv = (fma(tv, fma(tv, fma(tv, sc[3], sc[2]), sc[1]), sc[0]) - lc.yc0) / lc.yc1;
25315
25333
  if (sv >= 0 && sv <= 1) _RouteHelper.addRoot(tv, acc);
25316
25334
  }
25317
25335
  }
@@ -25321,25 +25339,26 @@ var RouteHelper = class _RouteHelper {
25321
25339
  const sc = [0, 0, 0, 0], xr = [0, 0, 0];
25322
25340
  const rat = lc.yc1 / lc.xc1;
25323
25341
  _RouteHelper.points2coeff(
25324
- sps[0].y - rat * sps[0].x,
25325
- sps[1].y - rat * sps[1].x,
25326
- sps[2].y - rat * sps[2].x,
25327
- sps[3].y - rat * sps[3].x,
25342
+ fms(rat, sps[0].x, sps[0].y),
25343
+ fms(rat, sps[1].x, sps[1].y),
25344
+ fms(rat, sps[2].x, sps[2].y),
25345
+ fms(rat, sps[3].x, sps[3].y),
25328
25346
  sc
25329
25347
  );
25330
- sc[0] += rat * lc.xc0 - lc.yc0;
25348
+ sc[0] += fma(rat, lc.xc0, -lc.yc0);
25331
25349
  const xn = solve3(sc, xr);
25332
25350
  if (xn === 4) return 4;
25333
25351
  for (let i = 0; i < xn; i++) {
25334
25352
  const tv = xr[i];
25335
25353
  if (tv >= 0 && tv <= 1) {
25336
25354
  _RouteHelper.points2coeff(sps[0].x, sps[1].x, sps[2].x, sps[3].x, sc);
25337
- const sv = (sc[0] + tv * (sc[1] + tv * (sc[2] + tv * sc[3])) - lc.xc0) / lc.xc1;
25355
+ const sv = (fma(tv, fma(tv, fma(tv, sc[3], sc[2]), sc[1]), sc[0]) - lc.xc0) / lc.xc1;
25338
25356
  if (sv >= 0 && sv <= 1) _RouteHelper.addRoot(tv, acc);
25339
25357
  }
25340
25358
  }
25341
25359
  return acc.n;
25342
25360
  }
25361
+ /** @see lib/pathplan/route.c:splineintersectsline */
25343
25362
  static splineIntersectsLine(sps, lps, roots) {
25344
25363
  const lc = {
25345
25364
  xc0: lps[0].x,
@@ -25390,8 +25409,9 @@ var RouteHelper = class _RouteHelper {
25390
25409
  x0 += _RouteHelper.ptDot(tnas[i].a[0], tmp);
25391
25410
  x1 += _RouteHelper.ptDot(tnas[i].a[1], tmp);
25392
25411
  }
25393
- const det01 = c00 * c11 - c01 * c01;
25394
- const detX1 = x0 * c11 - x1 * c01, det0X = c00 * x1 - c01 * x0;
25412
+ const det01 = fma(c00, c11, -(c01 * c01));
25413
+ const det0X = fma(c00, x1, -(c01 * x0));
25414
+ const detX1 = fma(x0, c11, -(x1 * c01));
25395
25415
  if (Math.abs(det01) >= 1e-6) {
25396
25416
  scale0 = detX1 / det01;
25397
25417
  scale3 = det0X / det01;
@@ -25415,6 +25435,27 @@ var RouteHelper = class _RouteHelper {
25415
25435
  }
25416
25436
  return tnas;
25417
25437
  }
25438
+ /**
25439
+ * The max-deviation split of `reallyroutespline` (route.c:130-143): the
25440
+ * interior polyline point farthest from the fitted bezier.
25441
+ *
25442
+ * Faithful contract. On a geometrically symmetric channel two interior
25443
+ * deviations tie to within an ulp, so the split point (and the whole
25444
+ * spline) is decided by C's exact arithmetic, which this mirrors bit for
25445
+ * bit against the native arm64 oracle:
25446
+ * - `dist` is libm `hypot` (route.c:448) -> `libmHypot` via `ptDist`;
25447
+ * - the test is C's strict `(d = dist(p, inps[i])) > maxd` (route.c:139),
25448
+ * so an exact tie keeps the first index;
25449
+ * - clang's default `-ffp-contract=on` fuses the bezier eval at
25450
+ * route.c:137-138 as `fma(B3,p2, fma(B2,cp2, fma(B0,p1, B1*cp1)))`; the
25451
+ * B0..B3 weights and cp1/cp2 (route.c:130-131) are not fused. Fusing the
25452
+ * other product first is NOT equivalent (flips pt-issue-23-w9 and 32).
25453
+ * C is therefore not translation-equivariant on such ties (the winner
25454
+ * depends on absolute-coordinate rounding), and neither is this port.
25455
+ * This supersedes the former tolerant tie-break (accepted divergence A3).
25456
+ * Contraction map: .agent-notes/pathplan-fma-contraction-map.md.
25457
+ * @see lib/pathplan/route.c:reallyroutespline
25458
+ */
25418
25459
  static findMaxDev(inps, tnas, ends) {
25419
25460
  const { p0, v0, p1, v1 } = ends;
25420
25461
  const cp1 = _RouteHelper.ptAdd(p0, _RouteHelper.ptScale(v0, 1 / 3));
@@ -25422,10 +25463,12 @@ var RouteHelper = class _RouteHelper {
25422
25463
  let maxi = -1, maxd = -1;
25423
25464
  for (let i = 1; i < inps.length - 1; i++) {
25424
25465
  const t = tnas[i].t;
25425
- const px = _RouteHelper.B0(t) * p0.x + _RouteHelper.B1(t) * cp1.x + _RouteHelper.B2(t) * cp2.x + _RouteHelper.B3(t) * p1.x;
25426
- const py = _RouteHelper.B0(t) * p0.y + _RouteHelper.B1(t) * cp1.y + _RouteHelper.B2(t) * cp2.y + _RouteHelper.B3(t) * p1.y;
25466
+ const b0 = _RouteHelper.B0(t), b1 = _RouteHelper.B1(t);
25467
+ const b2 = _RouteHelper.B2(t), b3 = _RouteHelper.B3(t);
25468
+ const px = fma(b3, p1.x, fma(b2, cp2.x, fma(b0, p0.x, b1 * cp1.x)));
25469
+ const py = fma(b3, p1.y, fma(b2, cp2.y, fma(b0, p0.y, b1 * cp1.y)));
25427
25470
  const d = _RouteHelper.ptDist({ x: px, y: py }, inps[i]);
25428
- if (d > maxd * (1 + 1e-10) + 1e-10) {
25471
+ if (d > maxd) {
25429
25472
  maxd = d;
25430
25473
  maxi = i;
25431
25474
  }
@@ -29576,8 +29619,9 @@ function normalizeCopiedFlatSpline(orig, auxe) {
29576
29619
  if (orig.info.spl === void 0) return;
29577
29620
  if (swapEndsP(auxe) !== swapEndsP(orig)) swapEdgeSpline(orig);
29578
29621
  }
29579
- function makeFlatAdjEdges(g, edges, cnt, _et) {
29622
+ function makeFlatAdjEdges(g, edges, cnt, et) {
29580
29623
  const aux = buildFlatAux(g, edges, cnt);
29624
+ aux.auxg.info.flags = aux.auxg.info.flags & ~15 | et & 15;
29581
29625
  dotInitNodeEdge(aux.auxg);
29582
29626
  dotRank(aux.auxg);
29583
29627
  if (dotMincross(aux.auxg) !== 0) return 1;
@@ -29688,88 +29732,6 @@ function assembleFlatPath(P, tend, hend, mid) {
29688
29732
  for (let i = hend.boxn - 1; i >= 0; i--) addBox(P, hend.boxes[i]);
29689
29733
  }
29690
29734
 
29691
- // src/layout/dot/splines-flat-multi.ts
29692
- function portEq2(a, b) {
29693
- if (!a.defined && !b.defined) return true;
29694
- if (!a.defined || !b.defined) return false;
29695
- return a.p.x === b.p.x && a.p.y === b.p.y;
29696
- }
29697
- function flatPortKey(e, lo) {
29698
- return e.tail === lo ? { loP: e.info.tail_port, hiP: e.info.head_port } : { loP: e.info.head_port, hiP: e.info.tail_port };
29699
- }
29700
- function isNonAdjGroupable(x, g) {
29701
- return x.info.spl === void 0 && x.tail.info.rank !== void 0 && x.tail.info.rank === x.head.info.rank && !isFlatAdjacent(g, x);
29702
- }
29703
- function samePortsAs(x, lo, key) {
29704
- const k = flatPortKey(x, lo);
29705
- return portEq2(k.loP, key.loP) && portEq2(k.hiP, key.hiP);
29706
- }
29707
- function collectNonAdjacentFlatGroup(e, g) {
29708
- const u = e.tail, v = e.head;
29709
- const lo = (u.info.order ?? 0) <= (v.info.order ?? 0) ? u : v;
29710
- const key = flatPortKey(e, lo);
29711
- const sharesPair = (x) => x.tail === u && x.head === v || x.tail === v && x.head === u;
29712
- const group = g.edges.filter(
29713
- (x) => sharesPair(x) && isNonAdjGroupable(x, g) && samePortsAs(x, lo, key) && x.info.label === e.info.label
29714
- );
29715
- group.sort((a, b) => Number(b.tail === lo) - Number(a.tail === lo) || a.seq - b.seq);
29716
- return group;
29717
- }
29718
- function copyPathEnd(end) {
29719
- return {
29720
- ...end,
29721
- boxes: end.boxes.map((b) => ({ ll: { ...b.ll }, ur: { ...b.ur } }))
29722
- };
29723
- }
29724
- function routeGroupEdge(e, i, c) {
29725
- c.P.nbox = 0;
29726
- const endStepX = (i + 1) * c.stepx;
29727
- const endStepY = (i + 1) * c.stepy;
29728
- const mid = c.bottom ? bottomBoxes(c.tlast, c.hlast, endStepX, endStepY, c.stepy) : topBoxes(c.tlast, c.hlast, endStepX, endStepY, c.stepy);
29729
- assembleFlatPath(c.P, copyPathEnd(c.tend), copyPathEnd(c.hend), mid);
29730
- const pts = routeSplines(c.P);
29731
- if (pts === null || pts.length === 0) return false;
29732
- if (e.tail !== c.leftNode) pts.reverse();
29733
- clipAndInstall(e, e.head, pts, pts.length, { ...buildDotSinfo(), ignoreSwap: true });
29734
- return true;
29735
- }
29736
- function routeFlatEdgeGroupFaithful(g, edges, cnt) {
29737
- const lead = edges[0];
29738
- if (g.info.rank === void 0 || lead.tail.info.rank === void 0 || lead.head.info.rank !== lead.tail.info.rank) return false;
29739
- const tailIsLeft = (lead.tail.info.order ?? 0) <= (lead.head.info.order ?? 0);
29740
- const leftNode = tailIsLeft ? lead.tail : lead.head;
29741
- const rightNode = tailIsLeft ? lead.head : lead.tail;
29742
- const sample = tailIsLeft ? lead : {
29743
- ...lead,
29744
- tail: leftNode,
29745
- head: rightNode,
29746
- info: { ...lead.info, tail_port: lead.info.head_port, head_port: lead.info.tail_port }
29747
- };
29748
- const { bottom, side } = flatSide(sample);
29749
- const ctx = flatBboxCtx(g);
29750
- const ranksep = graphRanksep(g);
29751
- const P = freshFlatPath();
29752
- const tend = makeFlatEndBox({ ctx, P, e: sample, n: leftNode, side, ranksep, isBegin: true });
29753
- const hend = makeFlatEndBox({ ctx, P, e: sample, n: rightNode, side, ranksep, isBegin: false });
29754
- const stepx = (g.info.nodesep ?? 18) / (cnt + 1);
29755
- const stepy = flatVspace(g, leftNode, !bottom) / (cnt + 1);
29756
- const rc = {
29757
- P,
29758
- tend,
29759
- hend,
29760
- tlast: tend.boxes[tend.boxn - 1],
29761
- hlast: hend.boxes[hend.boxn - 1],
29762
- bottom,
29763
- stepx,
29764
- stepy,
29765
- leftNode
29766
- };
29767
- for (let i = 0; i < cnt; i++) {
29768
- if (!routeGroupEdge(edges[i], i, rc)) return false;
29769
- }
29770
- return true;
29771
- }
29772
-
29773
29735
  // src/layout/dot/splines-flat-labeled.ts
29774
29736
  var LBL_SPACE = 6;
29775
29737
  function findLabelNode(e) {
@@ -30024,6 +29986,93 @@ function makeAdjFlatNoPortEdge(g, e) {
30024
29986
  return true;
30025
29987
  }
30026
29988
 
29989
+ // src/layout/dot/splines-flat-multi.ts
29990
+ function portEq2(a, b) {
29991
+ if (!a.defined && !b.defined) return true;
29992
+ if (!a.defined || !b.defined) return false;
29993
+ return a.p.x === b.p.x && a.p.y === b.p.y;
29994
+ }
29995
+ function flatPortKey(e, lo) {
29996
+ return e.tail === lo ? { loP: e.info.tail_port, hiP: e.info.head_port } : { loP: e.info.head_port, hiP: e.info.tail_port };
29997
+ }
29998
+ function isNonAdjGroupable(x, g) {
29999
+ return x.info.spl === void 0 && x.tail.info.rank !== void 0 && x.tail.info.rank === x.head.info.rank && !isFlatAdjacent(g, x);
30000
+ }
30001
+ function samePortsAs(x, lo, key) {
30002
+ const k = flatPortKey(x, lo);
30003
+ return portEq2(k.loP, key.loP) && portEq2(k.hiP, key.hiP);
30004
+ }
30005
+ function collectNonAdjacentFlatGroup(e, g) {
30006
+ const u = e.tail, v = e.head;
30007
+ const lo = (u.info.order ?? 0) <= (v.info.order ?? 0) ? u : v;
30008
+ const key = flatPortKey(e, lo);
30009
+ const sharesPair = (x) => x.tail === u && x.head === v || x.tail === v && x.head === u;
30010
+ const group = g.edges.filter(
30011
+ (x) => sharesPair(x) && isNonAdjGroupable(x, g) && samePortsAs(x, lo, key) && x.info.label === e.info.label
30012
+ );
30013
+ group.sort((a, b) => Number(b.tail === lo) - Number(a.tail === lo) || a.seq - b.seq);
30014
+ return group;
30015
+ }
30016
+ function copyPathEnd(end) {
30017
+ return {
30018
+ ...end,
30019
+ boxes: end.boxes.map((b) => ({ ll: { ...b.ll }, ur: { ...b.ur } }))
30020
+ };
30021
+ }
30022
+ function routeGroupEdge(e, i, c) {
30023
+ c.P.nbox = 0;
30024
+ const endStepX = (i + 1) * c.stepx;
30025
+ const endStepY = (i + 1) * c.stepy;
30026
+ const mid = c.bottom ? bottomBoxes(c.tlast, c.hlast, endStepX, endStepY, c.stepy) : topBoxes(c.tlast, c.hlast, endStepX, endStepY, c.stepy);
30027
+ assembleFlatPath(c.P, copyPathEnd(c.tend), copyPathEnd(c.hend), mid);
30028
+ const pts = c.et === EDGETYPE_SPLINE ? routeSplines(c.P) : routePolylines(c.P);
30029
+ if (pts === null || pts.length === 0) return false;
30030
+ if (e.tail !== c.leftNode) pts.reverse();
30031
+ clipAndInstall(e, e.head, pts, pts.length, { ...buildDotSinfo(), ignoreSwap: true });
30032
+ return true;
30033
+ }
30034
+ function routeFlatEdgeGroupFaithful(g, edges, cnt, et) {
30035
+ const lead = edges[0];
30036
+ if (g.info.rank === void 0 || lead.tail.info.rank === void 0 || lead.head.info.rank !== lead.tail.info.rank) return false;
30037
+ if (et === EDGETYPE_LINE) {
30038
+ makeSimpleFlat(edges, et);
30039
+ return true;
30040
+ }
30041
+ const tailIsLeft = (lead.tail.info.order ?? 0) <= (lead.head.info.order ?? 0);
30042
+ const leftNode = tailIsLeft ? lead.tail : lead.head;
30043
+ const rightNode = tailIsLeft ? lead.head : lead.tail;
30044
+ const sample = tailIsLeft ? lead : {
30045
+ ...lead,
30046
+ tail: leftNode,
30047
+ head: rightNode,
30048
+ info: { ...lead.info, tail_port: lead.info.head_port, head_port: lead.info.tail_port }
30049
+ };
30050
+ const { bottom, side } = flatSide(sample);
30051
+ const ctx = flatBboxCtx(g);
30052
+ const ranksep = graphRanksep(g);
30053
+ const P = freshFlatPath();
30054
+ const tend = makeFlatEndBox({ ctx, P, e: sample, n: leftNode, side, ranksep, isBegin: true });
30055
+ const hend = makeFlatEndBox({ ctx, P, e: sample, n: rightNode, side, ranksep, isBegin: false });
30056
+ const stepx = (g.info.nodesep ?? 18) / (cnt + 1);
30057
+ const stepy = flatVspace(g, leftNode, !bottom) / (cnt + 1);
30058
+ const rc = {
30059
+ P,
30060
+ tend,
30061
+ hend,
30062
+ tlast: tend.boxes[tend.boxn - 1],
30063
+ hlast: hend.boxes[hend.boxn - 1],
30064
+ bottom,
30065
+ et,
30066
+ stepx,
30067
+ stepy,
30068
+ leftNode
30069
+ };
30070
+ for (let i = 0; i < cnt; i++) {
30071
+ if (!routeGroupEdge(edges[i], i, rc)) return false;
30072
+ }
30073
+ return true;
30074
+ }
30075
+
30027
30076
  // src/layout/dot/edge-route-boxes.ts
30028
30077
  var FUDGE2 = 2;
30029
30078
  function makeTailBox(nb, startPy) {
@@ -30323,7 +30372,10 @@ function isAdjacentPortFlat(e, g) {
30323
30372
  return e.tail.info.rank !== void 0 && e.tail.info.rank === e.head.info.rank && isFlatAdjacent(g, e) && hasDefinedPort(e);
30324
30373
  }
30325
30374
  function isGroupableFlat(x, g) {
30326
- return x.info.spl === void 0 && isAdjacentPortFlat(x, g);
30375
+ return x.info.spl === void 0 && x.tail.info.rank !== void 0 && x.tail.info.rank === x.head.info.rank && isFlatAdjacent(g, x);
30376
+ }
30377
+ function joinsPortedFlatGroup(e, g) {
30378
+ return isAdjFlatCandidate(e) && isGroupableFlat(e, g) && collectAdjacentFlatGroup(e, g).some(hasDefinedPort);
30327
30379
  }
30328
30380
  function collectAdjacentFlatGroup(e, g) {
30329
30381
  const u = e.tail, v = e.head;
@@ -30338,11 +30390,11 @@ function routeFaithfulSidePort(e, g) {
30338
30390
  const sameRank = e.tail.info.rank !== void 0 && e.tail.info.rank === e.head.info.rank;
30339
30391
  if (sameRank && isFlatAdjacent(g, e)) {
30340
30392
  const group = collectAdjacentFlatGroup(e, g);
30341
- return makeFlatAdjEdges(g, group, group.length, EDGETYPE_SPLINE) === 0 && e.info.spl !== void 0;
30393
+ return makeFlatAdjEdges(g, group, group.length, edgeType(g)) === 0 && e.info.spl !== void 0;
30342
30394
  }
30343
30395
  if (sameRank) {
30344
30396
  const group = collectNonAdjacentFlatGroup(e, g);
30345
- return routeFlatEdgeGroupFaithful(g, group, group.length) && e.info.spl !== void 0;
30397
+ return routeFlatEdgeGroupFaithful(g, group, group.length, edgeType(g)) && e.info.spl !== void 0;
30346
30398
  }
30347
30399
  const pts = routeRegularEdgeFaithful(g, e);
30348
30400
  if (pts === null) return false;
@@ -30363,11 +30415,12 @@ function isLostFlatAdjRecordEdge(g, e) {
30363
30415
  function routeFlatEdge(e, g) {
30364
30416
  if (isLostFlatAdjRecordEdge(g, e)) return true;
30365
30417
  if (makeFlatLabeledEdge(g, e)) return true;
30418
+ if (joinsPortedFlatGroup(e, g) && routeFaithfulSidePort(e, g)) return true;
30366
30419
  if (makeAdjFlatNoPortEdge(g, e)) return true;
30367
30420
  if ((hasSidePort(e) || isAdjacentPortFlat(e, g)) && routeFaithfulSidePort(e, g)) return true;
30368
30421
  if (e.tail.info.rank !== void 0 && e.tail.info.rank === e.head.info.rank && e.info.label === void 0 && !isFlatAdjacent(g, e)) {
30369
30422
  const group = collectNonAdjacentFlatGroup(e, g);
30370
- if (group.length > 0 && routeFlatEdgeGroupFaithful(g, group, group.length) && e.info.spl !== void 0) return true;
30423
+ if (group.length > 0 && routeFlatEdgeGroupFaithful(g, group, group.length, edgeType(g)) && e.info.spl !== void 0) return true;
30371
30424
  }
30372
30425
  return false;
30373
30426
  }
@@ -32664,7 +32717,6 @@ function buildEdges(g, nodeArr, orthoNodes) {
32664
32717
  const oes = outIndex.get(n);
32665
32718
  if (oes === void 0) continue;
32666
32719
  for (const e of oes) {
32667
- if (e.tail === e.head) continue;
32668
32720
  if (concentrate) {
32669
32721
  const ti = e.tail.id;
32670
32722
  const hi = e.head.id;
@@ -44217,11 +44269,11 @@ function addClusters(g) {
44217
44269
  g.info.clust = clusters;
44218
44270
  g.info.n_cluster = clusters.length;
44219
44271
  }
44220
- function layoutComponents(g, comps, solve2, pinned) {
44272
+ function layoutComponents(g, comps, solve4, pinned) {
44221
44273
  for (const gc of comps) {
44222
44274
  setEdgeTypeFromAttr(gc, EDGETYPE_LINE);
44223
- solveModel2(gc, solve2.mode, solve2.model);
44224
- maybeRemoveOverlap(gc, solve2.am);
44275
+ solveModel2(gc, solve4.mode, solve4.model);
44276
+ maybeRemoveOverlap(gc, solve4.am);
44225
44277
  splineEdgesShifted(gc);
44226
44278
  }
44227
44279
  const pinfo = {
@@ -50571,22 +50623,19 @@ function peg$parse(input, options) {
50571
50623
  function peg$f17(defs, rest) {
50572
50624
  return defs.concat(rest);
50573
50625
  }
50574
- function peg$f18(defs) {
50575
- return defs;
50576
- }
50577
- function peg$f19() {
50626
+ function peg$f18() {
50578
50627
  return [];
50579
50628
  }
50580
- function peg$f20(a) {
50629
+ function peg$f19(a) {
50581
50630
  return a;
50582
50631
  }
50583
- function peg$f21(pairs) {
50632
+ function peg$f20(pairs) {
50584
50633
  return pairs;
50585
50634
  }
50586
- function peg$f22(k, v) {
50635
+ function peg$f21(k, v) {
50587
50636
  return { key: k, value: v };
50588
50637
  }
50589
- function peg$f23(head, chain, attrs) {
50638
+ function peg$f22(head, chain, attrs) {
50590
50639
  if (chain.length > 0) {
50591
50640
  const nodes = [head].concat(chain);
50592
50641
  return { type: "edge", nodes, attrs };
@@ -50597,70 +50646,70 @@ function peg$parse(input, options) {
50597
50646
  return { type: "node", id: head, attrs };
50598
50647
  }
50599
50648
  }
50600
- function peg$f24(s) {
50649
+ function peg$f23(s) {
50601
50650
  return s;
50602
50651
  }
50603
- function peg$f25(n) {
50652
+ function peg$f24(n) {
50604
50653
  return n;
50605
50654
  }
50606
- function peg$f26(id, port, compass) {
50655
+ function peg$f25(id, port, compass) {
50607
50656
  return { id, port, compass };
50608
50657
  }
50609
- function peg$f27(id, port) {
50658
+ function peg$f26(id, port) {
50610
50659
  return { id, port, compass: null };
50611
50660
  }
50612
- function peg$f28(id) {
50661
+ function peg$f27(id) {
50613
50662
  return { id, port: null, compass: null };
50614
50663
  }
50615
- function peg$f29(s, rest) {
50664
+ function peg$f28(s, rest) {
50616
50665
  return [s].concat(rest);
50617
50666
  }
50618
- function peg$f30() {
50667
+ function peg$f29() {
50619
50668
  return [];
50620
50669
  }
50621
- function peg$f31(id, stmts) {
50670
+ function peg$f30(id, stmts) {
50622
50671
  return { type: "subgraph", id, stmts };
50623
50672
  }
50624
- function peg$f32(stmts) {
50673
+ function peg$f31(stmts) {
50625
50674
  return { type: "subgraph", id: null, stmts };
50626
50675
  }
50627
- function peg$f33(stmts) {
50676
+ function peg$f32(stmts) {
50628
50677
  return { type: "subgraph", id: null, stmts };
50629
50678
  }
50630
- function peg$f34(first, s) {
50679
+ function peg$f33(first, s) {
50631
50680
  return s;
50632
50681
  }
50633
- function peg$f35(first, rest) {
50682
+ function peg$f34(first, rest) {
50634
50683
  return rest.length > 0 ? first + rest.join("") : first;
50635
50684
  }
50636
- function peg$f36(chars) {
50685
+ function peg$f35(chars) {
50637
50686
  return chars.join("");
50638
50687
  }
50639
- function peg$f37() {
50688
+ function peg$f36() {
50640
50689
  return '"';
50641
50690
  }
50642
- function peg$f38() {
50691
+ function peg$f37() {
50643
50692
  return "";
50644
50693
  }
50645
- function peg$f39(c) {
50694
+ function peg$f38(c) {
50646
50695
  return "\\" + c;
50647
50696
  }
50648
- function peg$f40(content) {
50697
+ function peg$f39(content) {
50649
50698
  return "" + content;
50650
50699
  }
50651
- function peg$f41(chars) {
50700
+ function peg$f40(chars) {
50652
50701
  return chars.join("");
50653
50702
  }
50654
- function peg$f42(nested2, content) {
50703
+ function peg$f41(nested2, content) {
50655
50704
  return "<" + content + ">";
50656
50705
  }
50657
- function peg$f43(n) {
50706
+ function peg$f42(n) {
50658
50707
  return n;
50659
50708
  }
50660
- function peg$f44(first, rest) {
50709
+ function peg$f43(first, rest) {
50661
50710
  return first + rest.join("");
50662
50711
  }
50663
- function peg$f45(s) {
50712
+ function peg$f44(s) {
50664
50713
  return Array.isArray(s) ? s.flat(Infinity).filter((x) => x !== null && x !== void 0).join("") : String(s);
50665
50714
  }
50666
50715
  let peg$currPos = options.peg$currPos | 0;
@@ -51036,7 +51085,7 @@ function peg$parse(input, options) {
51036
51085
  s12 = peg$parseAttrType();
51037
51086
  if (s12 !== peg$FAILED) {
51038
51087
  s2 = peg$parse_();
51039
- s3 = peg$parseAttrList();
51088
+ s3 = peg$parseAttrListReq();
51040
51089
  if (s3 !== peg$FAILED) {
51041
51090
  peg$savedPos = s0;
51042
51091
  s0 = peg$f12(s12, s3);
@@ -51088,7 +51137,7 @@ function peg$parse(input, options) {
51088
51137
  }
51089
51138
  return s0;
51090
51139
  }
51091
- function peg$parseAttrList() {
51140
+ function peg$parseAttrListReq() {
51092
51141
  let s0, s12, s2, s3, s4, s5, s6, s7;
51093
51142
  s0 = peg$currPos;
51094
51143
  s12 = peg$parse_();
@@ -51131,49 +51180,17 @@ function peg$parse(input, options) {
51131
51180
  peg$currPos = s0;
51132
51181
  s0 = peg$FAILED;
51133
51182
  }
51183
+ return s0;
51184
+ }
51185
+ function peg$parseAttrList() {
51186
+ let s0, s12;
51187
+ s0 = peg$parseAttrListReq();
51134
51188
  if (s0 === peg$FAILED) {
51135
51189
  s0 = peg$currPos;
51136
- s12 = peg$parse_();
51137
- if (input.charCodeAt(peg$currPos) === 91) {
51138
- s2 = peg$c3;
51139
- peg$currPos++;
51140
- } else {
51141
- s2 = peg$FAILED;
51142
- if (peg$silentFails === 0) {
51143
- peg$fail(peg$e3);
51144
- }
51145
- }
51146
- if (s2 !== peg$FAILED) {
51147
- s3 = peg$parse_();
51148
- s4 = peg$parseAttrDefs();
51149
- s5 = peg$parse_();
51150
- if (input.charCodeAt(peg$currPos) === 93) {
51151
- s6 = peg$c4;
51152
- peg$currPos++;
51153
- } else {
51154
- s6 = peg$FAILED;
51155
- if (peg$silentFails === 0) {
51156
- peg$fail(peg$e4);
51157
- }
51158
- }
51159
- if (s6 !== peg$FAILED) {
51160
- peg$savedPos = s0;
51161
- s0 = peg$f18(s4);
51162
- } else {
51163
- peg$currPos = s0;
51164
- s0 = peg$FAILED;
51165
- }
51166
- } else {
51167
- peg$currPos = s0;
51168
- s0 = peg$FAILED;
51169
- }
51170
- if (s0 === peg$FAILED) {
51171
- s0 = peg$currPos;
51172
- s12 = "";
51173
- peg$savedPos = s0;
51174
- s12 = peg$f19();
51175
- s0 = s12;
51176
- }
51190
+ s12 = "";
51191
+ peg$savedPos = s0;
51192
+ s12 = peg$f18();
51193
+ s0 = s12;
51177
51194
  }
51178
51195
  return s0;
51179
51196
  }
@@ -51207,7 +51224,7 @@ function peg$parse(input, options) {
51207
51224
  s5 = null;
51208
51225
  }
51209
51226
  peg$savedPos = s2;
51210
- s2 = peg$f20(s3);
51227
+ s2 = peg$f19(s3);
51211
51228
  } else {
51212
51229
  peg$currPos = s2;
51213
51230
  s2 = peg$FAILED;
@@ -51240,14 +51257,14 @@ function peg$parse(input, options) {
51240
51257
  s5 = null;
51241
51258
  }
51242
51259
  peg$savedPos = s2;
51243
- s2 = peg$f20(s3);
51260
+ s2 = peg$f19(s3);
51244
51261
  } else {
51245
51262
  peg$currPos = s2;
51246
51263
  s2 = peg$FAILED;
51247
51264
  }
51248
51265
  }
51249
51266
  peg$savedPos = s0;
51250
- s12 = peg$f21(s12);
51267
+ s12 = peg$f20(s12);
51251
51268
  s0 = s12;
51252
51269
  return s0;
51253
51270
  }
@@ -51271,7 +51288,7 @@ function peg$parse(input, options) {
51271
51288
  s5 = peg$parseAtom();
51272
51289
  if (s5 !== peg$FAILED) {
51273
51290
  peg$savedPos = s0;
51274
- s0 = peg$f22(s12, s5);
51291
+ s0 = peg$f21(s12, s5);
51275
51292
  } else {
51276
51293
  peg$currPos = s0;
51277
51294
  s0 = peg$FAILED;
@@ -51298,7 +51315,7 @@ function peg$parse(input, options) {
51298
51315
  s5 = peg$parseAttrList();
51299
51316
  if (s5 !== peg$FAILED) {
51300
51317
  peg$savedPos = s0;
51301
- s0 = peg$f23(s12, s3, s5);
51318
+ s0 = peg$f22(s12, s3, s5);
51302
51319
  } else {
51303
51320
  peg$currPos = s0;
51304
51321
  s0 = peg$FAILED;
@@ -51319,7 +51336,7 @@ function peg$parse(input, options) {
51319
51336
  s12 = peg$parseSubgraph();
51320
51337
  if (s12 !== peg$FAILED) {
51321
51338
  peg$savedPos = s0;
51322
- s12 = peg$f24(s12);
51339
+ s12 = peg$f23(s12);
51323
51340
  }
51324
51341
  s0 = s12;
51325
51342
  if (s0 === peg$FAILED) {
@@ -51327,7 +51344,7 @@ function peg$parse(input, options) {
51327
51344
  s12 = peg$parseNode();
51328
51345
  if (s12 !== peg$FAILED) {
51329
51346
  peg$savedPos = s0;
51330
- s12 = peg$f25(s12);
51347
+ s12 = peg$f24(s12);
51331
51348
  }
51332
51349
  s0 = s12;
51333
51350
  }
@@ -51367,7 +51384,7 @@ function peg$parse(input, options) {
51367
51384
  s9 = peg$parseAtom();
51368
51385
  if (s9 !== peg$FAILED) {
51369
51386
  peg$savedPos = s0;
51370
- s0 = peg$f26(s12, s5, s9);
51387
+ s0 = peg$f25(s12, s5, s9);
51371
51388
  } else {
51372
51389
  peg$currPos = s0;
51373
51390
  s0 = peg$FAILED;
@@ -51407,7 +51424,7 @@ function peg$parse(input, options) {
51407
51424
  s5 = peg$parseAtom();
51408
51425
  if (s5 !== peg$FAILED) {
51409
51426
  peg$savedPos = s0;
51410
- s0 = peg$f27(s12, s5);
51427
+ s0 = peg$f26(s12, s5);
51411
51428
  } else {
51412
51429
  peg$currPos = s0;
51413
51430
  s0 = peg$FAILED;
@@ -51425,7 +51442,7 @@ function peg$parse(input, options) {
51425
51442
  s12 = peg$parseAtom();
51426
51443
  if (s12 !== peg$FAILED) {
51427
51444
  peg$savedPos = s0;
51428
- s12 = peg$f28(s12);
51445
+ s12 = peg$f27(s12);
51429
51446
  }
51430
51447
  s0 = s12;
51431
51448
  }
@@ -51444,7 +51461,7 @@ function peg$parse(input, options) {
51444
51461
  s5 = peg$parseEdgeChain();
51445
51462
  if (s5 !== peg$FAILED) {
51446
51463
  peg$savedPos = s0;
51447
- s0 = peg$f29(s3, s5);
51464
+ s0 = peg$f28(s3, s5);
51448
51465
  } else {
51449
51466
  peg$currPos = s0;
51450
51467
  s0 = peg$FAILED;
@@ -51461,7 +51478,7 @@ function peg$parse(input, options) {
51461
51478
  s0 = peg$currPos;
51462
51479
  s12 = "";
51463
51480
  peg$savedPos = s0;
51464
- s12 = peg$f30();
51481
+ s12 = peg$f29();
51465
51482
  s0 = s12;
51466
51483
  }
51467
51484
  return s0;
@@ -51532,7 +51549,7 @@ function peg$parse(input, options) {
51532
51549
  }
51533
51550
  if (s9 !== peg$FAILED) {
51534
51551
  peg$savedPos = s0;
51535
- s0 = peg$f31(s3, s7);
51552
+ s0 = peg$f30(s3, s7);
51536
51553
  } else {
51537
51554
  peg$currPos = s0;
51538
51555
  s0 = peg$FAILED;
@@ -51583,7 +51600,7 @@ function peg$parse(input, options) {
51583
51600
  }
51584
51601
  if (s7 !== peg$FAILED) {
51585
51602
  peg$savedPos = s0;
51586
- s0 = peg$f32(s5);
51603
+ s0 = peg$f31(s5);
51587
51604
  } else {
51588
51605
  peg$currPos = s0;
51589
51606
  s0 = peg$FAILED;
@@ -51627,7 +51644,7 @@ function peg$parse(input, options) {
51627
51644
  }
51628
51645
  if (s5 !== peg$FAILED) {
51629
51646
  peg$savedPos = s0;
51630
- s0 = peg$f33(s3);
51647
+ s0 = peg$f32(s3);
51631
51648
  } else {
51632
51649
  peg$currPos = s0;
51633
51650
  s0 = peg$FAILED;
@@ -51666,7 +51683,7 @@ function peg$parse(input, options) {
51666
51683
  s7 = peg$parseQAtom();
51667
51684
  if (s7 !== peg$FAILED) {
51668
51685
  peg$savedPos = s3;
51669
- s3 = peg$f34(s12, s7);
51686
+ s3 = peg$f33(s12, s7);
51670
51687
  } else {
51671
51688
  peg$currPos = s3;
51672
51689
  s3 = peg$FAILED;
@@ -51693,7 +51710,7 @@ function peg$parse(input, options) {
51693
51710
  s7 = peg$parseQAtom();
51694
51711
  if (s7 !== peg$FAILED) {
51695
51712
  peg$savedPos = s3;
51696
- s3 = peg$f34(s12, s7);
51713
+ s3 = peg$f33(s12, s7);
51697
51714
  } else {
51698
51715
  peg$currPos = s3;
51699
51716
  s3 = peg$FAILED;
@@ -51704,7 +51721,7 @@ function peg$parse(input, options) {
51704
51721
  }
51705
51722
  }
51706
51723
  peg$savedPos = s0;
51707
- s0 = peg$f35(s12, s2);
51724
+ s0 = peg$f34(s12, s2);
51708
51725
  } else {
51709
51726
  peg$currPos = s0;
51710
51727
  s0 = peg$FAILED;
@@ -51752,7 +51769,7 @@ function peg$parse(input, options) {
51752
51769
  }
51753
51770
  if (s3 !== peg$FAILED) {
51754
51771
  peg$savedPos = s0;
51755
- s0 = peg$f36(s2);
51772
+ s0 = peg$f35(s2);
51756
51773
  } else {
51757
51774
  peg$currPos = s0;
51758
51775
  s0 = peg$FAILED;
@@ -51777,7 +51794,7 @@ function peg$parse(input, options) {
51777
51794
  }
51778
51795
  if (s12 !== peg$FAILED) {
51779
51796
  peg$savedPos = s0;
51780
- s12 = peg$f37();
51797
+ s12 = peg$f36();
51781
51798
  }
51782
51799
  s0 = s12;
51783
51800
  if (s0 === peg$FAILED) {
@@ -51793,7 +51810,7 @@ function peg$parse(input, options) {
51793
51810
  }
51794
51811
  if (s12 !== peg$FAILED) {
51795
51812
  peg$savedPos = s0;
51796
- s12 = peg$f38();
51813
+ s12 = peg$f37();
51797
51814
  }
51798
51815
  s0 = s12;
51799
51816
  if (s0 === peg$FAILED) {
@@ -51819,7 +51836,7 @@ function peg$parse(input, options) {
51819
51836
  }
51820
51837
  if (s2 !== peg$FAILED) {
51821
51838
  peg$savedPos = s0;
51822
- s0 = peg$f39(s2);
51839
+ s0 = peg$f38(s2);
51823
51840
  } else {
51824
51841
  peg$currPos = s0;
51825
51842
  s0 = peg$FAILED;
@@ -51868,7 +51885,7 @@ function peg$parse(input, options) {
51868
51885
  }
51869
51886
  if (s3 !== peg$FAILED) {
51870
51887
  peg$savedPos = s0;
51871
- s0 = peg$f40(s2);
51888
+ s0 = peg$f39(s2);
51872
51889
  } else {
51873
51890
  peg$currPos = s0;
51874
51891
  s0 = peg$FAILED;
@@ -51889,7 +51906,7 @@ function peg$parse(input, options) {
51889
51906
  s2 = peg$parseHtmlChar();
51890
51907
  }
51891
51908
  peg$savedPos = s0;
51892
- s12 = peg$f41(s12);
51909
+ s12 = peg$f40(s12);
51893
51910
  s0 = s12;
51894
51911
  return s0;
51895
51912
  }
@@ -51919,7 +51936,7 @@ function peg$parse(input, options) {
51919
51936
  }
51920
51937
  if (s3 !== peg$FAILED) {
51921
51938
  peg$savedPos = s0;
51922
- s0 = peg$f42(s12, s2);
51939
+ s0 = peg$f41(s12, s2);
51923
51940
  } else {
51924
51941
  peg$currPos = s0;
51925
51942
  s0 = peg$FAILED;
@@ -51964,7 +51981,7 @@ function peg$parse(input, options) {
51964
51981
  s2 = peg$parseName();
51965
51982
  if (s2 !== peg$FAILED) {
51966
51983
  peg$savedPos = s0;
51967
- s0 = peg$f43(s2);
51984
+ s0 = peg$f42(s2);
51968
51985
  } else {
51969
51986
  peg$currPos = s0;
51970
51987
  s0 = peg$FAILED;
@@ -52012,7 +52029,7 @@ function peg$parse(input, options) {
52012
52029
  }
52013
52030
  }
52014
52031
  peg$savedPos = s0;
52015
- s0 = peg$f44(s12, s2);
52032
+ s0 = peg$f43(s12, s2);
52016
52033
  } else {
52017
52034
  peg$currPos = s0;
52018
52035
  s0 = peg$FAILED;
@@ -52233,7 +52250,7 @@ function peg$parse(input, options) {
52233
52250
  }
52234
52251
  if (s12 !== peg$FAILED) {
52235
52252
  peg$savedPos = s0;
52236
- s12 = peg$f45(s12);
52253
+ s12 = peg$f44(s12);
52237
52254
  }
52238
52255
  s0 = s12;
52239
52256
  return s0;