@cardenelabs/dragon 0.42.1 → 0.43.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.
package/dist/export.js CHANGED
@@ -281,6 +281,15 @@ var TYPE = {
281
281
  gitId: text(11, 700),
282
282
  gitHash: text(10.5, 600, "mono"),
283
283
  gitNote: text(10.5, 650),
284
+ /**
285
+ * 木の図 (#3233) の、箱の中の値 (hash) と名札、根の箱の値と名札、葉の下の札の字。
286
+ * 値を持たない箱の名札は箱の名前 (`boxName`) の字で描く
287
+ */
288
+ treeHash: text(13.5, 700, "mono"),
289
+ treeName: text(10.5, 600),
290
+ rootHash: text(15, 700, "mono"),
291
+ rootName: text(11, 700),
292
+ treeCard: text(11.5, 650),
284
293
  /**
285
294
  * 時間軸の図 (#3165)。拡大の帯の列の上の字、印の列の名前、時刻の字、区切りの名前と目盛りの番号の範囲、
286
295
  * 節目の名札と状態、範囲の括弧の字、空きの枠の字、物差しの線の字。和文を含む字は同じ大きさと太さの和文の字で描く
@@ -373,6 +382,36 @@ var LOOK = {
373
382
  labelUnder: 50,
374
383
  colors: ["blue", "violet", "green", "amber", "rose"]
375
384
  },
385
+ /**
386
+ * 木の図 (#3233)。step 2 で本人が選んだ「根を上」の試作 (`.context/propose/merkle-look/`) の寸法を写す。
387
+ * 木の箱は幅の下限 `w`、高さ `h`、字の左右の余白 `padX`、角の丸み `radius`。根の箱は `root` の幅の下限と高さと角の丸みを持ち、
388
+ * 左に絵柄を置いて (`iconX` は箱の左端から絵柄の左端まで)、`textX` から字を左に揃えて並べ、右に `padR` を空ける。
389
+ * `nameY` と `hashY` は根の箱の真ん中から名札と値の基準線まで。ほかの箱の値と名札は `hashY` と `nameY`、1 行の字は `oneY` に置く。
390
+ * 葉は書いた順に横に並べ、隣の葉の箱の間を `slotGap` 空ける。根の上端は図の上の余白から `top` 下げ、深さの段の真ん中どうしは `row` 離す。
391
+ * `card` は値を持つ葉の下の名札の札で、葉の真ん中から札の真ん中まで `drop`、高さ `h`、幅の下限 `minW`、
392
+ * 字の左右の余白 `padX`、絵柄の幅 `icon` と絵柄と字の間 `gap`、絵柄の縮み `glyph`、角の丸み `radius`。
393
+ * `boxGap` は木と木でない箱の列の間、`badgeAlong` は木の線を走る段の番号を、曲がり角から横の線に沿って進める長さ。
394
+ * `faint` は木の線を運ぶ物が通った段から後に、運ぶ物を送りも受けもしていない木の箱を薄く出す濃さ。`color` と `rootColor` は木の箱と根の箱の色
395
+ */
396
+ tree: {
397
+ w: 74,
398
+ h: 44,
399
+ padX: 10,
400
+ radius: 10,
401
+ root: { w: 112, h: 54, radius: 13, iconX: 10, textX: 46, padR: 14, nameY: -4, hashY: 14 },
402
+ hashY: -1,
403
+ nameY: 14,
404
+ oneY: 4.5,
405
+ slotGap: 12,
406
+ top: 16,
407
+ row: 102,
408
+ card: { drop: 78, h: 30, minW: 70, padX: 10, icon: 12, gap: 6, glyph: 0.62, radius: 9 },
409
+ boxGap: 24,
410
+ badgeAlong: 22,
411
+ faint: 0.42,
412
+ color: "violet",
413
+ rootColor: "green"
414
+ },
376
415
  /**
377
416
  * 時間軸の図 (#3165)。見本帳の試作 (`scenes/finality.js`) の寸法を写す。
378
417
  * 図の幅は `width` で、時間軸は左の `axisX` から右の余白 `right` の手前まで。印の列の名前が長い時は、名前の右に `gutterGap` を空けて軸を右へ寄せる。
@@ -473,7 +512,10 @@ var LOOK = {
473
512
  timePoint: 1.75,
474
513
  timeFlag: 1.8,
475
514
  timeNeedle: 1.25,
476
- timeMeter: 1.25
515
+ timeMeter: 1.25,
516
+ tree: 1.5,
517
+ treeTrail: 2.6,
518
+ treeCon: 1.3
477
519
  },
478
520
  shadow: { near: 0.8, far: 4, nearY: 1, farY: 3 },
479
521
  mini: { w: 168, pad: 8, title: 14, inset: 12, radius: 10 },
@@ -1197,7 +1239,7 @@ function arrange(diagram, groups, slots, rooms) {
1197
1239
  };
1198
1240
  const inset = LOOK.edge.inset;
1199
1241
  const gapX = (col, toRight) => toRight ? colLeft[col] + colW[col] + (between[col] ?? A.columnGap) / 2 : colLeft[col] - (between[col - 1] ?? A.columnGap) / 2;
1200
- const route = (from, to) => {
1242
+ const route2 = (from, to) => {
1201
1243
  const a = byId.get(from);
1202
1244
  const b = byId.get(to);
1203
1245
  if (from === to) return loopUnder(a);
@@ -1270,7 +1312,7 @@ function arrange(diagram, groups, slots, rooms) {
1270
1312
  event,
1271
1313
  from: edge2.from,
1272
1314
  to: edge2.to,
1273
- points: route(edge2.from, edge2.to),
1315
+ points: route2(edge2.from, edge2.to),
1274
1316
  color: edgeColor(edge2, colors),
1275
1317
  carry: edge2.carry
1276
1318
  }));
@@ -1569,11 +1611,11 @@ function layoutGit(diagram) {
1569
1611
  col.set(c.id, k);
1570
1612
  laneLast.set(c.branch, k);
1571
1613
  }
1572
- const linesOf = (c) => [
1614
+ const linesOf2 = (c) => [
1573
1615
  ...c.hash !== void 0 ? [{ text: c.hash, style: TYPE.gitHash }] : [],
1574
1616
  ...c.note !== void 0 ? [{ text: c.note, style: TYPE.gitNote }] : []
1575
1617
  ];
1576
- const textW = (c) => Math.max(0, ...linesOf(c).map((line) => textWidth(line.text, line.style)));
1618
+ const textW = (c) => Math.max(0, ...linesOf2(c).map((line) => textWidth(line.text, line.style)));
1577
1619
  const tagW = (ref) => textWidth(ref, hasWide(ref) ? TYPE.carrierJa : TYPE.carrier) + C.tagPadX * 2;
1578
1620
  const refWidth = Math.max(0, ...walked.refs.map((r) => tagW(r.name)));
1579
1621
  const pitch = Math.max(G.pitch, ...walked.made.map((c) => textW(c) + G.textGap), refWidth + G.textGap);
@@ -1588,7 +1630,7 @@ function layoutGit(diagram) {
1588
1630
  })
1589
1631
  );
1590
1632
  const extraRows = (branch) => Math.max(0, ...walked.made.filter((c) => c.branch === branch).map((c) => (walked.rows.get(c.id) ?? 0) - 2)) * G.row;
1591
- const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 && linesOf(c).length > 0);
1633
+ const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 && linesOf2(c).length > 0);
1592
1634
  const lanes = [];
1593
1635
  let y = margin;
1594
1636
  walked.branches.forEach((id, i) => {
@@ -1606,7 +1648,7 @@ function layoutGit(diagram) {
1606
1648
  const isTop = laneIndex.get(c.branch) === 0;
1607
1649
  const cx = x0 + pitch * (col.get(c.id) ?? 0) + (isTop ? 0 : pitch / 2);
1608
1650
  const cy = lane.line;
1609
- const lines = linesOf(c);
1651
+ const lines = linesOf2(c);
1610
1652
  const baselines = lines.map((_, k) => isTop ? cy - G.above - (lines.length - 1 - k) * G.lineStep : cy + G.under + k * G.lineStep);
1611
1653
  const boxes2 = lines.map((line, k) => textBox(line.text, cx, baselines[k], line.style, "middle"));
1612
1654
  const text2 = boxes2.length === 0 ? void 0 : { ...union(boxes2), lines: lines.map((line) => line.text), baselines };
@@ -2166,7 +2208,7 @@ function layoutState(diagram, lang) {
2166
2208
  };
2167
2209
  const exitX = (box) => starts && box === first ? box.cx + T.side.entry : box.cx;
2168
2210
  const finishOf = (id) => ends.find((e) => e.kind === "finish" && e.box === id);
2169
- const route = (from, to) => {
2211
+ const route2 = (from, to) => {
2170
2212
  if (from === "start") {
2171
2213
  const start = ends.find((e) => e.kind === "start");
2172
2214
  const target = byId.get(to);
@@ -2210,7 +2252,7 @@ function layoutState(diagram, lang) {
2210
2252
  event,
2211
2253
  from: edge2.from,
2212
2254
  to: edge2.to,
2213
- points: route(edge2.from, edge2.to),
2255
+ points: route2(edge2.from, edge2.to),
2214
2256
  color: colorOf(edge2, colors),
2215
2257
  carry: edge2.carry,
2216
2258
  ...settle ? { settle } : {},
@@ -2227,7 +2269,7 @@ function layoutState(diagram, lang) {
2227
2269
  e.points = e.points.map(([x, y]) => flat ? [x, y + d] : [x + d, y]);
2228
2270
  outward.set(e, flat ? d > 0 ? "below" : "above" : d > 0 ? "right" : "left");
2229
2271
  }
2230
- const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points: route(p.from, p.to) }));
2272
+ const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points: route2(p.from, p.to) }));
2231
2273
  const badgeAt = (edge2, taken, lines2) => edge2.from === edge2.to ? loopBadge(edge2.points) : badgeOnPath(edge2.points, taken, lines2);
2232
2274
  const labels = [];
2233
2275
  const marks = ends.flatMap((e) => e.text === "" ? [] : [textBox(e.text, ...markText(e), TYPE.regionNote)]);
@@ -2760,6 +2802,321 @@ function labelsOf2(diagram, layout) {
2760
2802
  return labels;
2761
2803
  }
2762
2804
 
2805
+ // src/layout/tree.ts
2806
+ var isTreeLayout = (layout) => layout.kind === "tree";
2807
+ function grow2(diagram) {
2808
+ const boxes = new Set(diagram.boxes.map((b) => b.id));
2809
+ const byId = /* @__PURE__ */ new Set();
2810
+ const parents = /* @__PURE__ */ new Map();
2811
+ const grown = [];
2812
+ diagram.steps.forEach((step, s) => {
2813
+ step.events.forEach((e, k) => {
2814
+ if (e.type !== "leaf" && e.type !== "node" || byId.has(e.id) || boxes.has(e.id)) return;
2815
+ const children = e.type === "node" ? [...new Set(e.children)].filter((c) => byId.has(c) && !parents.has(c)) : [];
2816
+ for (const c of children) parents.set(c, e.id);
2817
+ grown.push({ id: e.id, kind: e.type, children, step: s, event: k, ...e.hash !== void 0 ? { hash: e.hash } : {} });
2818
+ byId.add(e.id);
2819
+ });
2820
+ });
2821
+ return { grown, parents };
2822
+ }
2823
+ function linesOf(g, root) {
2824
+ if (g.hash === void 0) return [{ text: g.id, style: TYPE.boxName }];
2825
+ if (root)
2826
+ return [
2827
+ { text: g.id, style: TYPE.rootName },
2828
+ { text: g.hash, style: TYPE.rootHash }
2829
+ ];
2830
+ if (g.kind === "leaf") return [{ text: g.hash, style: TYPE.treeHash }];
2831
+ return [
2832
+ { text: g.hash, style: TYPE.treeHash },
2833
+ { text: g.id, style: TYPE.treeName }
2834
+ ];
2835
+ }
2836
+ function route(a, b) {
2837
+ const i = LOOK.edge.inset;
2838
+ const top = Math.max(a.y, b.y);
2839
+ const bottom = Math.min(a.y + a.h, b.y + b.h);
2840
+ if (bottom > top) {
2841
+ const y = (top + bottom) / 2;
2842
+ return b.x >= a.x + a.w ? [
2843
+ [a.x + a.w + i, y],
2844
+ [b.x - i, y]
2845
+ ] : [
2846
+ [a.x - i, y],
2847
+ [b.x + b.w + i, y]
2848
+ ];
2849
+ }
2850
+ const left = Math.max(a.x, b.x);
2851
+ const right = Math.min(a.x + a.w, b.x + b.w);
2852
+ if (right > left) {
2853
+ const x = (left + right) / 2;
2854
+ return b.y >= a.y + a.h ? [
2855
+ [x, a.y + a.h + i],
2856
+ [x, b.y - i]
2857
+ ] : [
2858
+ [x, a.y - i],
2859
+ [x, b.y + b.h + i]
2860
+ ];
2861
+ }
2862
+ const ax = a.x + a.w / 2;
2863
+ const ty = b.y + b.h / 2;
2864
+ return [
2865
+ [ax, b.y > a.y ? a.y + a.h + i : a.y - i],
2866
+ [ax, ty],
2867
+ [b.x > ax ? b.x - i : b.x + b.w + i, ty]
2868
+ ];
2869
+ }
2870
+ function layoutTree(diagram) {
2871
+ const { margin, gap, box: B, tree: T, badge: BD } = LOOK;
2872
+ const { grown, parents } = grow2(diagram);
2873
+ const tops = grown.filter((g) => !parents.has(g.id));
2874
+ const rootId = tops[tops.length - 1]?.id;
2875
+ const byId = new Map(grown.map((g) => [g.id, g]));
2876
+ const depth = /* @__PURE__ */ new Map();
2877
+ const walk2 = (id, d) => {
2878
+ depth.set(id, d);
2879
+ for (const c of byId.get(id)?.children ?? []) walk2(c, d + 1);
2880
+ };
2881
+ for (const t of tops) walk2(t.id, 0);
2882
+ const texts = new Map(grown.map((g) => [g.id, linesOf(g, g.id === rootId)]));
2883
+ const widest = (id) => Math.max(0, ...(texts.get(id) ?? []).map((line) => textWidth(line.text, line.style)));
2884
+ const widthOf = (g) => g.id === rootId ? Math.max(T.root.w, T.root.textX + widest(g.id) + T.root.padR) : Math.max(T.w, widest(g.id) + T.padX * 2);
2885
+ const cardW = (g) => Math.max(T.card.minW, T.card.padX * 2 + T.card.icon + T.card.gap + textWidth(g.id, TYPE.treeCard));
2886
+ const hasCard = (g) => g.kind === "leaf" && g.hash !== void 0;
2887
+ const slots = grown.filter((g) => g.children.length === 0);
2888
+ const pitch = Math.max(...grown.filter((g) => g.id !== rootId || g.children.length === 0).map((g) => Math.max(widthOf(g), hasCard(g) ? cardW(g) : 0)), T.w) + T.slotGap;
2889
+ const x0 = margin + BD.r * 2 + BD.inset;
2890
+ const xs = /* @__PURE__ */ new Map();
2891
+ slots.forEach((g, i) => xs.set(g.id, x0 + pitch * (i + 0.5)));
2892
+ const xOf = (id) => {
2893
+ const known = xs.get(id);
2894
+ if (known !== void 0) return known;
2895
+ const kids = byId.get(id)?.children ?? [];
2896
+ const x = (xOf(kids[0]) + xOf(kids[kids.length - 1])) / 2;
2897
+ xs.set(id, x);
2898
+ return x;
2899
+ };
2900
+ const top0 = margin + T.top;
2901
+ const yOf = (d) => top0 + T.root.h / 2 + d * T.row;
2902
+ const colors = boxColors(diagram);
2903
+ const nodes = grown.map((g) => {
2904
+ const root = g.id === rootId;
2905
+ const d = depth.get(g.id) ?? 0;
2906
+ const cx = xOf(g.id);
2907
+ const cy = yOf(d);
2908
+ const w = widthOf(g);
2909
+ const h = root ? T.root.h : T.h;
2910
+ const lines = texts.get(g.id) ?? [];
2911
+ const baselines = lines.length === 1 ? [cy + T.oneY] : root ? [cy + T.root.nameY, cy + T.root.hashY] : [cy + T.hashY, cy + T.nameY];
2912
+ const parent = parents.get(g.id);
2913
+ const color = root ? T.rootColor : T.color;
2914
+ colors.set(g.id, color);
2915
+ const cw = cardW(g);
2916
+ return {
2917
+ id: g.id,
2918
+ kind: g.kind,
2919
+ depth: d,
2920
+ ...parent !== void 0 ? { parent } : {},
2921
+ children: g.children,
2922
+ step: g.step,
2923
+ event: g.event,
2924
+ ...g.hash !== void 0 ? { hash: g.hash } : {},
2925
+ root,
2926
+ x: cx - w / 2,
2927
+ y: cy - h / 2,
2928
+ w,
2929
+ h,
2930
+ cx,
2931
+ cy,
2932
+ color,
2933
+ lines: lines.map((line) => line.text),
2934
+ baselines,
2935
+ styles: lines.map((line) => line.style),
2936
+ ...hasCard(g) ? { card: { x: cx - cw / 2, y: cy + T.card.drop - T.card.h / 2, w: cw, h: T.card.h, text: g.id } } : {}
2937
+ };
2938
+ });
2939
+ const placed = new Map(nodes.map((n) => [n.id, n]));
2940
+ const links = nodes.flatMap(
2941
+ (p) => p.children.flatMap((id) => {
2942
+ const c = placed.get(id);
2943
+ if (!c) return [];
2944
+ const mid = (c.y + p.y + p.h) / 2;
2945
+ const points2 = [
2946
+ [c.cx, c.y - LOOK.edge.inset],
2947
+ [c.cx, mid],
2948
+ [p.cx, mid],
2949
+ [p.cx, p.y + p.h + LOOK.edge.inset]
2950
+ ];
2951
+ return [{ from: c.id, to: p.id, step: p.step, event: p.event, points: points2 }];
2952
+ })
2953
+ );
2954
+ const rooms = slotRooms(diagram);
2955
+ const treeRight = Math.max(x0, ...nodes.flatMap((n) => [n.x + n.w, ...n.card ? [n.card.x + n.card.w] : []]));
2956
+ const rootBox = nodes.find((n) => n.root);
2957
+ const ids = new Set(diagram.boxes.map((b) => b.id));
2958
+ const named = edgesOf(diagram).flatMap(({ edge: edge2 }) => edge2.label !== void 0 && (ids.has(edge2.from) || ids.has(edge2.to)) ? [textWidth(edge2.label, labelStyle(edge2.label)) + LOOK.label.padX * 2] : []);
2959
+ const boxX = Math.max(treeRight + T.boxGap, (rootBox ? rootBox.x + rootBox.w : x0) + Math.max(0, ...named) + gap * 2);
2960
+ let by = rootBox?.y ?? top0;
2961
+ const boxes = diagram.boxes.map((b) => {
2962
+ const w = Math.max(boxWidth(diagram, b.id, true), slotBoxWidth(rooms.get(b.id), b.icon !== void 0, B.padX));
2963
+ const y = by;
2964
+ by += B.h + gap;
2965
+ const box = {
2966
+ id: b.id,
2967
+ name: b.name,
2968
+ ...b.sub !== void 0 ? { sub: b.sub } : {},
2969
+ ...b.icon !== void 0 ? { icon: b.icon } : {},
2970
+ color: colors.get(b.id) ?? "slate",
2971
+ x: boxX,
2972
+ y,
2973
+ w,
2974
+ h: B.h,
2975
+ cx: boxX + w / 2,
2976
+ cy: y + B.h / 2
2977
+ };
2978
+ placeSlot(box, rooms.get(b.id));
2979
+ return box;
2980
+ });
2981
+ const boxById = new Map(boxes.map((b) => [b.id, b]));
2982
+ const runs = [];
2983
+ const edges = diagram.steps.flatMap(
2984
+ (step, s) => step.events.flatMap((e, k) => {
2985
+ if (e.type !== "edge") return [];
2986
+ const a = placed.get(e.from) ?? boxById.get(e.from);
2987
+ const b = placed.get(e.to) ?? boxById.get(e.to);
2988
+ if (!a || !b) return [];
2989
+ const up = links.find((l) => l.from === e.from && l.to === e.to);
2990
+ const down = links.find((l) => l.from === e.to && l.to === e.from);
2991
+ const link = up ?? down;
2992
+ if (link) runs.push({ step: s, event: k, link: link.from });
2993
+ const points2 = up ? up.points : down ? [...down.points].reverse() : e.from === e.to ? loopUnder({ cx: a.x + a.w / 2, y: a.y, h: a.h }) : route(a, b);
2994
+ return [{ step: s, event: k, from: e.from, to: e.to, points: points2, color: edgeColor(e, colors), carry: e.carry }];
2995
+ })
2996
+ );
2997
+ seatCarriers(edges, boxById, rooms);
2998
+ const layout = {
2999
+ kind: "tree",
3000
+ width: 0,
3001
+ height: 0,
3002
+ regions: [],
3003
+ boxes,
3004
+ lifelines: [],
3005
+ edges,
3006
+ labels: [],
3007
+ actions: [],
3008
+ badges: [],
3009
+ paths: [],
3010
+ ends: [],
3011
+ nodes,
3012
+ links,
3013
+ runs
3014
+ };
3015
+ layout.badges = badgesOf3(diagram, layout);
3016
+ layout.labels = labelsOf3(diagram, layout);
3017
+ const cards = nodes.flatMap((n) => n.card ? [n.card] : []);
3018
+ const solids = [...nodes, ...cards, ...boxes, ...layout.labels];
3019
+ const points = edges.flatMap((e) => e.points);
3020
+ const right = Math.max(...solids.map((r) => r.x + r.w), ...points.map(([x]) => x), x0);
3021
+ const bottom = Math.max(...solids.map((r) => r.y + r.h), ...points.map(([, y]) => y), top0);
3022
+ const width = Math.max(right + margin, stripNeed(diagram) + margin * 2);
3023
+ const strip2 = layoutStrip(diagram, margin, bottom + gap, width - margin * 2);
3024
+ layout.width = width;
3025
+ layout.height = (strip2 ? strip2.y + strip2.h : bottom) + margin;
3026
+ if (strip2) layout.strip = strip2;
3027
+ layout.badges = badgesOf3(diagram, layout);
3028
+ return layout;
3029
+ }
3030
+ function badgesOf3(diagram, layout) {
3031
+ const { r, inset } = LOOK.badge;
3032
+ const apart = r * 2 + inset;
3033
+ const taken = [];
3034
+ const out = [];
3035
+ const solids = [...layout.nodes, ...layout.nodes.flatMap((n) => n.card ? [n.card] : []), ...layout.boxes];
3036
+ const free = (p) => taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && solids.every((s) => gapBetween(badgeRect(p), s) >= LOOK.label.touch);
3037
+ const put = (s, p, color) => {
3038
+ taken.push(p);
3039
+ out.push({ step: s, x: p[0], y: p[1], color });
3040
+ };
3041
+ const passed = /* @__PURE__ */ new Map();
3042
+ diagram.steps.forEach((step, s) => {
3043
+ const k = step.events.findIndex((e2) => e2.type === "leaf" || e2.type === "node" || e2.type === "edge");
3044
+ const first = step.events[k];
3045
+ const n = layout.nodes.find((x) => x.step === s && x.event === k);
3046
+ if (first && first.type !== "edge" && n) {
3047
+ const spots = [
3048
+ [n.x - inset - r, n.cy],
3049
+ [n.x, n.y],
3050
+ [n.x + n.w + inset + r, n.cy],
3051
+ [n.x + n.w, n.y]
3052
+ ];
3053
+ put(s, spots.find(free) ?? spots[0], n.color);
3054
+ return;
3055
+ }
3056
+ const e = layout.edges.find((x) => x.step === s && x.event === k);
3057
+ if (first?.type === "edge" && e) {
3058
+ const key = [e.from, e.to].sort().join("\n");
3059
+ const run = layout.runs.some((x) => x.step === s && x.event === k);
3060
+ const lines = layout.edges.filter((x) => x !== e).map((x) => x.points);
3061
+ const point = passed.get(key) ?? (run ? onLink(e.points, free) : midway(e, free)) ?? badgeOnPath(e.points, taken, lines);
3062
+ passed.set(key, point);
3063
+ put(s, point, e.color);
3064
+ return;
3065
+ }
3066
+ const box = step.events.flatMap((ev) => ev.type === "swap" || ev.type === "action" ? [ev.box] : []).flatMap((id) => layout.boxes.filter((b) => b.id === id))[0];
3067
+ if (box) {
3068
+ out.push({ step: s, x: box.x, y: box.y, color: box.color });
3069
+ return;
3070
+ }
3071
+ if (layout.strip && step.events.some((ev) => ev.type === "strip")) {
3072
+ out.push({ step: s, x: layout.strip.x + inset, y: layout.strip.y + inset, color: "slate" });
3073
+ return;
3074
+ }
3075
+ const before = out[out.length - 1];
3076
+ const root = layout.nodes.find((x) => x.root);
3077
+ out.push(before ? { ...before, step: s } : { step: s, x: root?.x ?? LOOK.margin, y: root?.y ?? LOOK.margin, color: root?.color ?? "slate" });
3078
+ });
3079
+ return replaceSameSpot(out);
3080
+ }
3081
+ function onLink(points, free) {
3082
+ const [p0, p1, p2] = points;
3083
+ const flat = Math.abs(p2[0] - p1[0]);
3084
+ const { r, inset } = LOOK.badge;
3085
+ if (flat >= LOOK.tree.badgeAlong + r) {
3086
+ const p = along(points, pathLength([p0, p1]) + LOOK.tree.badgeAlong);
3087
+ if (free(p)) return p;
3088
+ }
3089
+ const side2 = [p1[0] + r + inset, p1[1]];
3090
+ return free(side2) ? side2 : void 0;
3091
+ }
3092
+ function midway(e, free) {
3093
+ const length = pathLength(e.points);
3094
+ const room = carrierHalf(e.carry)[0] + LOOK.badge.r + LOOK.badge.inset;
3095
+ for (let d = 0; d <= length / 2 - room; d += 1) {
3096
+ for (const at2 of [length / 2 - d, length / 2 + d]) {
3097
+ const p = along(e.points, at2);
3098
+ if (free(p)) return p;
3099
+ }
3100
+ }
3101
+ return void 0;
3102
+ }
3103
+ function labelsOf3(diagram, layout) {
3104
+ const labels = [];
3105
+ const cards = layout.nodes.flatMap((n) => n.card ? [n.card] : []);
3106
+ for (const e of layout.edges) {
3107
+ const source = diagram.steps[e.step]?.events[e.event];
3108
+ if (source?.type !== "edge" || source.label === void 0) continue;
3109
+ const seen = layout.badges.filter((b) => b.step <= e.step).map((b) => badgeRect([b.x, b.y]));
3110
+ labels.push(
3111
+ placeLabel(
3112
+ { step: e.step, event: e.event, text: source.label, points: e.points, color: e.color, ...source.labelSide ? { side: source.labelSide } : {}, flip: true },
3113
+ { hard: [...layout.nodes, ...layout.boxes], soft: [...cards, ...labels.filter((l) => l.step === e.step)], touch: seen }
3114
+ )
3115
+ );
3116
+ }
3117
+ return labels;
3118
+ }
3119
+
2763
3120
  // src/field-messages.ts
2764
3121
  var TYPES_JA = {
2765
3122
  string: "\u6587\u5B57\u5217\u306B\u3059\u308B",
@@ -2833,7 +3190,7 @@ function ucs2length(str) {
2833
3190
  return length;
2834
3191
  }
2835
3192
  var validate_diagram_default = validate10;
2836
- var schema11 = { "properties": { "version": { "description": "\u5F62\u5F0F\u306E\u7248", "type": "integer", "minimum": 1 }, "kind": { "description": "\u56F3\u306E\u7A2E\u985E", "enum": ["sequence", "architecture", "state", "git", "time"] }, "title": { "$ref": "#/definitions/text" }, "view": { "description": "\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059", "enum": ["fixed", "follow"] }, "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } }, "boxes": { "type": "array", "items": { "$ref": "#/definitions/box" } }, "strip": { "$ref": "#/definitions/strip" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } }, "sequence": { "$ref": "#/definitions/sequence" }, "state": { "$ref": "#/definitions/state" }, "git": { "$ref": "#/definitions/git" }, "time": { "$ref": "#/definitions/time" } }};
3193
+ var schema11 = { "properties": { "version": { "description": "\u5F62\u5F0F\u306E\u7248", "type": "integer", "minimum": 1 }, "kind": { "description": "\u56F3\u306E\u7A2E\u985E", "enum": ["sequence", "architecture", "state", "git", "time", "tree"] }, "title": { "$ref": "#/definitions/text" }, "view": { "description": "\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059", "enum": ["fixed", "follow"] }, "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } }, "boxes": { "type": "array", "items": { "$ref": "#/definitions/box" } }, "strip": { "$ref": "#/definitions/strip" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } }, "sequence": { "$ref": "#/definitions/sequence" }, "state": { "$ref": "#/definitions/state" }, "git": { "$ref": "#/definitions/git" }, "time": { "$ref": "#/definitions/time" } }};
2837
3194
  function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
2838
3195
  let vErrors = null;
2839
3196
  let errors = 0;
@@ -2893,34 +3250,79 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
2893
3250
  }
2894
3251
  }
2895
3252
  }
3253
+ const _errs8 = errors;
3254
+ const _errs9 = errors;
3255
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3256
+ if (data2.type === void 0 && ("type")) {
3257
+ const err3 = {};
3258
+ if (vErrors === null) {
3259
+ vErrors = [err3];
3260
+ } else {
3261
+ vErrors.push(err3);
3262
+ }
3263
+ errors++;
3264
+ } else {
3265
+ if (data2.type !== void 0) {
3266
+ let data4 = data2.type;
3267
+ if (!(data4 === "leaf" || data4 === "node")) {
3268
+ const err4 = {};
3269
+ if (vErrors === null) {
3270
+ vErrors = [err4];
3271
+ } else {
3272
+ vErrors.push(err4);
3273
+ }
3274
+ errors++;
3275
+ }
3276
+ }
3277
+ }
3278
+ }
3279
+ var valid9 = _errs9 === errors;
3280
+ if (valid9) {
3281
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
3282
+ if (vErrors === null) {
3283
+ vErrors = [err5];
3284
+ } else {
3285
+ vErrors.push(err5);
3286
+ }
3287
+ errors++;
3288
+ } else {
3289
+ errors = _errs8;
3290
+ if (vErrors !== null) {
3291
+ if (_errs8) {
3292
+ vErrors.length = _errs8;
3293
+ } else {
3294
+ vErrors = null;
3295
+ }
3296
+ }
3297
+ }
2896
3298
  if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
2897
3299
  if (data2.type !== void 0) {
2898
- let data4 = data2.type;
2899
- const _errs8 = errors;
2900
- const _errs9 = errors;
2901
- if (!(data4 === "commit" || data4 === "branch")) {
2902
- const err3 = {};
3300
+ let data5 = data2.type;
3301
+ const _errs13 = errors;
3302
+ const _errs14 = errors;
3303
+ if (!(data5 === "commit" || data5 === "branch")) {
3304
+ const err6 = {};
2903
3305
  if (vErrors === null) {
2904
- vErrors = [err3];
3306
+ vErrors = [err6];
2905
3307
  } else {
2906
- vErrors.push(err3);
3308
+ vErrors.push(err6);
2907
3309
  }
2908
3310
  errors++;
2909
3311
  }
2910
- var valid9 = _errs9 === errors;
2911
- if (valid9) {
2912
- const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
3312
+ var valid13 = _errs14 === errors;
3313
+ if (valid13) {
3314
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
2913
3315
  if (vErrors === null) {
2914
- vErrors = [err4];
3316
+ vErrors = [err7];
2915
3317
  } else {
2916
- vErrors.push(err4);
3318
+ vErrors.push(err7);
2917
3319
  }
2918
3320
  errors++;
2919
3321
  } else {
2920
- errors = _errs8;
3322
+ errors = _errs13;
2921
3323
  if (vErrors !== null) {
2922
- if (_errs8) {
2923
- vErrors.length = _errs8;
3324
+ if (_errs13) {
3325
+ vErrors.length = _errs13;
2924
3326
  } else {
2925
3327
  vErrors = null;
2926
3328
  }
@@ -2928,29 +3330,29 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
2928
3330
  }
2929
3331
  }
2930
3332
  if (data2.at !== void 0) {
2931
- const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3333
+ const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
2932
3334
  if (vErrors === null) {
2933
- vErrors = [err5];
3335
+ vErrors = [err8];
2934
3336
  } else {
2935
- vErrors.push(err5);
3337
+ vErrors.push(err8);
2936
3338
  }
2937
3339
  errors++;
2938
3340
  }
2939
3341
  if (data2.into !== void 0) {
2940
- const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3342
+ const err9 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
2941
3343
  if (vErrors === null) {
2942
- vErrors = [err6];
3344
+ vErrors = [err9];
2943
3345
  } else {
2944
- vErrors.push(err6);
3346
+ vErrors.push(err9);
2945
3347
  }
2946
3348
  errors++;
2947
3349
  }
2948
3350
  if (data2.color !== void 0) {
2949
- const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3351
+ const err10 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
2950
3352
  if (vErrors === null) {
2951
- vErrors = [err7];
3353
+ vErrors = [err10];
2952
3354
  } else {
2953
- vErrors.push(err7);
3355
+ vErrors.push(err10);
2954
3356
  }
2955
3357
  errors++;
2956
3358
  }
@@ -3040,31 +3442,76 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
3040
3442
  }
3041
3443
  }
3042
3444
  }
3445
+ const _errs8 = errors;
3446
+ const _errs9 = errors;
3043
3447
  if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3044
- if (data2.at !== void 0) {
3045
- const err3 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3448
+ if (data2.type === void 0 && ("type")) {
3449
+ const err3 = {};
3046
3450
  if (vErrors === null) {
3047
3451
  vErrors = [err3];
3048
3452
  } else {
3049
3453
  vErrors.push(err3);
3050
3454
  }
3051
3455
  errors++;
3456
+ } else {
3457
+ if (data2.type !== void 0) {
3458
+ let data4 = data2.type;
3459
+ if (!(data4 === "leaf" || data4 === "node")) {
3460
+ const err4 = {};
3461
+ if (vErrors === null) {
3462
+ vErrors = [err4];
3463
+ } else {
3464
+ vErrors.push(err4);
3465
+ }
3466
+ errors++;
3467
+ }
3468
+ }
3469
+ }
3470
+ }
3471
+ var valid9 = _errs9 === errors;
3472
+ if (valid9) {
3473
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
3474
+ if (vErrors === null) {
3475
+ vErrors = [err5];
3476
+ } else {
3477
+ vErrors.push(err5);
3478
+ }
3479
+ errors++;
3480
+ } else {
3481
+ errors = _errs8;
3482
+ if (vErrors !== null) {
3483
+ if (_errs8) {
3484
+ vErrors.length = _errs8;
3485
+ } else {
3486
+ vErrors = null;
3487
+ }
3488
+ }
3489
+ }
3490
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3491
+ if (data2.at !== void 0) {
3492
+ const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3493
+ if (vErrors === null) {
3494
+ vErrors = [err6];
3495
+ } else {
3496
+ vErrors.push(err6);
3497
+ }
3498
+ errors++;
3052
3499
  }
3053
3500
  if (data2.into !== void 0) {
3054
- const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3501
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3055
3502
  if (vErrors === null) {
3056
- vErrors = [err4];
3503
+ vErrors = [err7];
3057
3504
  } else {
3058
- vErrors.push(err4);
3505
+ vErrors.push(err7);
3059
3506
  }
3060
3507
  errors++;
3061
3508
  }
3062
3509
  if (data2.color !== void 0) {
3063
- const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3510
+ const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3064
3511
  if (vErrors === null) {
3065
- vErrors = [err5];
3512
+ vErrors = [err8];
3066
3513
  } else {
3067
- vErrors.push(err5);
3514
+ vErrors.push(err8);
3068
3515
  }
3069
3516
  errors++;
3070
3517
  }
@@ -3078,63 +3525,296 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
3078
3525
  validate17.errors = vErrors;
3079
3526
  return errors === 0;
3080
3527
  }
3081
- var schema45 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
3082
- var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
3083
- var func3 = ucs2length;
3084
- function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3528
+ function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3085
3529
  let vErrors = null;
3086
3530
  let errors = 0;
3087
- if (data && typeof data == "object" && !Array.isArray(data)) {
3088
- if (data.id === void 0) {
3089
- const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
3090
- if (vErrors === null) {
3091
- vErrors = [err0];
3092
- } else {
3093
- vErrors.push(err0);
3094
- }
3095
- errors++;
3096
- }
3097
- if (data.name === void 0) {
3098
- const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
3099
- if (vErrors === null) {
3100
- vErrors = [err1];
3101
- } else {
3102
- vErrors.push(err1);
3103
- }
3104
- errors++;
3105
- }
3106
- for (const key0 in data) {
3107
- if (!(key0 === "id" || key0 === "name" || key0 === "note" || key0 === "color" || key0 === "icon")) {
3108
- const err2 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
3109
- if (vErrors === null) {
3110
- vErrors = [err2];
3111
- } else {
3112
- vErrors.push(err2);
3113
- }
3114
- errors++;
3115
- }
3116
- }
3117
- if (data.id !== void 0) {
3118
- let data0 = data.id;
3119
- if (typeof data0 === "string") {
3120
- if (!pattern0.test(data0)) {
3121
- const err3 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
3122
- if (vErrors === null) {
3123
- vErrors = [err3];
3124
- } else {
3125
- vErrors.push(err3);
3126
- }
3127
- errors++;
3128
- }
3129
- } else {
3130
- const err4 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
3131
- if (vErrors === null) {
3132
- vErrors = [err4];
3133
- } else {
3134
- vErrors.push(err4);
3135
- }
3136
- errors++;
3137
- }
3531
+ if (Array.isArray(data)) {
3532
+ const len0 = data.length;
3533
+ for (let i0 = 0; i0 < len0; i0++) {
3534
+ let data0 = data[i0];
3535
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
3536
+ if (data0.events !== void 0) {
3537
+ let data1 = data0.events;
3538
+ if (Array.isArray(data1)) {
3539
+ const len1 = data1.length;
3540
+ for (let i1 = 0; i1 < len1; i1++) {
3541
+ let data2 = data1[i1];
3542
+ const _errs4 = errors;
3543
+ const _errs5 = errors;
3544
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3545
+ if (data2.type === void 0 && ("type")) {
3546
+ const err0 = {};
3547
+ if (vErrors === null) {
3548
+ vErrors = [err0];
3549
+ } else {
3550
+ vErrors.push(err0);
3551
+ }
3552
+ errors++;
3553
+ } else {
3554
+ if (data2.type !== void 0) {
3555
+ let data3 = data2.type;
3556
+ if (!(data3 === "leaf" || data3 === "node")) {
3557
+ const err1 = {};
3558
+ if (vErrors === null) {
3559
+ vErrors = [err1];
3560
+ } else {
3561
+ vErrors.push(err1);
3562
+ }
3563
+ errors++;
3564
+ }
3565
+ }
3566
+ }
3567
+ }
3568
+ var valid6 = _errs5 === errors;
3569
+ if (valid6) {
3570
+ const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
3571
+ if (vErrors === null) {
3572
+ vErrors = [err2];
3573
+ } else {
3574
+ vErrors.push(err2);
3575
+ }
3576
+ errors++;
3577
+ } else {
3578
+ errors = _errs4;
3579
+ if (vErrors !== null) {
3580
+ if (_errs4) {
3581
+ vErrors.length = _errs4;
3582
+ } else {
3583
+ vErrors = null;
3584
+ }
3585
+ }
3586
+ }
3587
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3588
+ if (data2.type !== void 0) {
3589
+ let data4 = data2.type;
3590
+ const _errs9 = errors;
3591
+ const _errs10 = errors;
3592
+ if (!(data4 === "commit" || data4 === "branch")) {
3593
+ const err3 = {};
3594
+ if (vErrors === null) {
3595
+ vErrors = [err3];
3596
+ } else {
3597
+ vErrors.push(err3);
3598
+ }
3599
+ errors++;
3600
+ }
3601
+ var valid10 = _errs10 === errors;
3602
+ if (valid10) {
3603
+ const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
3604
+ if (vErrors === null) {
3605
+ vErrors = [err4];
3606
+ } else {
3607
+ vErrors.push(err4);
3608
+ }
3609
+ errors++;
3610
+ } else {
3611
+ errors = _errs9;
3612
+ if (vErrors !== null) {
3613
+ if (_errs9) {
3614
+ vErrors.length = _errs9;
3615
+ } else {
3616
+ vErrors = null;
3617
+ }
3618
+ }
3619
+ }
3620
+ }
3621
+ }
3622
+ }
3623
+ }
3624
+ }
3625
+ }
3626
+ }
3627
+ }
3628
+ validate20.errors = vErrors;
3629
+ return errors === 0;
3630
+ }
3631
+ function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3632
+ let vErrors = null;
3633
+ let errors = 0;
3634
+ if (Array.isArray(data)) {
3635
+ const len0 = data.length;
3636
+ for (let i0 = 0; i0 < len0; i0++) {
3637
+ let data0 = data[i0];
3638
+ if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
3639
+ if (data0.events !== void 0) {
3640
+ let data1 = data0.events;
3641
+ if (Array.isArray(data1)) {
3642
+ const len1 = data1.length;
3643
+ for (let i1 = 0; i1 < len1; i1++) {
3644
+ let data2 = data1[i1];
3645
+ const _errs3 = errors;
3646
+ const _errs4 = errors;
3647
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3648
+ if (data2.type === void 0 && ("type")) {
3649
+ const err0 = {};
3650
+ if (vErrors === null) {
3651
+ vErrors = [err0];
3652
+ } else {
3653
+ vErrors.push(err0);
3654
+ }
3655
+ errors++;
3656
+ } else {
3657
+ if (data2.type !== void 0) {
3658
+ let data3 = data2.type;
3659
+ if (!(data3 === "now" || data3 === "mark" || data3 === "span")) {
3660
+ const err1 = {};
3661
+ if (vErrors === null) {
3662
+ vErrors = [err1];
3663
+ } else {
3664
+ vErrors.push(err1);
3665
+ }
3666
+ errors++;
3667
+ }
3668
+ }
3669
+ }
3670
+ }
3671
+ var valid5 = _errs4 === errors;
3672
+ if (valid5) {
3673
+ const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/not", keyword: "not", params: {}, message: "must NOT be valid" };
3674
+ if (vErrors === null) {
3675
+ vErrors = [err2];
3676
+ } else {
3677
+ vErrors.push(err2);
3678
+ }
3679
+ errors++;
3680
+ } else {
3681
+ errors = _errs3;
3682
+ if (vErrors !== null) {
3683
+ if (_errs3) {
3684
+ vErrors.length = _errs3;
3685
+ } else {
3686
+ vErrors = null;
3687
+ }
3688
+ }
3689
+ }
3690
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
3691
+ if (data2.type !== void 0) {
3692
+ let data4 = data2.type;
3693
+ const _errs8 = errors;
3694
+ const _errs9 = errors;
3695
+ if (!(data4 === "commit" || data4 === "branch")) {
3696
+ const err3 = {};
3697
+ if (vErrors === null) {
3698
+ vErrors = [err3];
3699
+ } else {
3700
+ vErrors.push(err3);
3701
+ }
3702
+ errors++;
3703
+ }
3704
+ var valid9 = _errs9 === errors;
3705
+ if (valid9) {
3706
+ const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
3707
+ if (vErrors === null) {
3708
+ vErrors = [err4];
3709
+ } else {
3710
+ vErrors.push(err4);
3711
+ }
3712
+ errors++;
3713
+ } else {
3714
+ errors = _errs8;
3715
+ if (vErrors !== null) {
3716
+ if (_errs8) {
3717
+ vErrors.length = _errs8;
3718
+ } else {
3719
+ vErrors = null;
3720
+ }
3721
+ }
3722
+ }
3723
+ }
3724
+ if (data2.at !== void 0) {
3725
+ const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3726
+ if (vErrors === null) {
3727
+ vErrors = [err5];
3728
+ } else {
3729
+ vErrors.push(err5);
3730
+ }
3731
+ errors++;
3732
+ }
3733
+ if (data2.into !== void 0) {
3734
+ const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3735
+ if (vErrors === null) {
3736
+ vErrors = [err6];
3737
+ } else {
3738
+ vErrors.push(err6);
3739
+ }
3740
+ errors++;
3741
+ }
3742
+ if (data2.color !== void 0) {
3743
+ const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
3744
+ if (vErrors === null) {
3745
+ vErrors = [err7];
3746
+ } else {
3747
+ vErrors.push(err7);
3748
+ }
3749
+ errors++;
3750
+ }
3751
+ }
3752
+ }
3753
+ }
3754
+ }
3755
+ }
3756
+ }
3757
+ }
3758
+ validate22.errors = vErrors;
3759
+ return errors === 0;
3760
+ }
3761
+ var schema57 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
3762
+ var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
3763
+ var func3 = ucs2length;
3764
+ function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3765
+ let vErrors = null;
3766
+ let errors = 0;
3767
+ if (data && typeof data == "object" && !Array.isArray(data)) {
3768
+ if (data.id === void 0) {
3769
+ const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
3770
+ if (vErrors === null) {
3771
+ vErrors = [err0];
3772
+ } else {
3773
+ vErrors.push(err0);
3774
+ }
3775
+ errors++;
3776
+ }
3777
+ if (data.name === void 0) {
3778
+ const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
3779
+ if (vErrors === null) {
3780
+ vErrors = [err1];
3781
+ } else {
3782
+ vErrors.push(err1);
3783
+ }
3784
+ errors++;
3785
+ }
3786
+ for (const key0 in data) {
3787
+ if (!(key0 === "id" || key0 === "name" || key0 === "note" || key0 === "color" || key0 === "icon")) {
3788
+ const err2 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
3789
+ if (vErrors === null) {
3790
+ vErrors = [err2];
3791
+ } else {
3792
+ vErrors.push(err2);
3793
+ }
3794
+ errors++;
3795
+ }
3796
+ }
3797
+ if (data.id !== void 0) {
3798
+ let data0 = data.id;
3799
+ if (typeof data0 === "string") {
3800
+ if (!pattern0.test(data0)) {
3801
+ const err3 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
3802
+ if (vErrors === null) {
3803
+ vErrors = [err3];
3804
+ } else {
3805
+ vErrors.push(err3);
3806
+ }
3807
+ errors++;
3808
+ }
3809
+ } else {
3810
+ const err4 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
3811
+ if (vErrors === null) {
3812
+ vErrors = [err4];
3813
+ } else {
3814
+ vErrors.push(err4);
3815
+ }
3816
+ errors++;
3817
+ }
3138
3818
  }
3139
3819
  if (data.name !== void 0) {
3140
3820
  let data1 = data.name;
@@ -3183,7 +3863,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
3183
3863
  if (data.color !== void 0) {
3184
3864
  let data3 = data.color;
3185
3865
  if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
3186
- const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
3866
+ const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
3187
3867
  if (vErrors === null) {
3188
3868
  vErrors = [err9];
3189
3869
  } else {
@@ -3223,11 +3903,11 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
3223
3903
  }
3224
3904
  errors++;
3225
3905
  }
3226
- validate22.errors = vErrors;
3906
+ validate27.errors = vErrors;
3227
3907
  return errors === 0;
3228
3908
  }
3229
3909
  var pattern3 = new RegExp("^(/|https?://)", "u");
3230
- function validate24(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3910
+ function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3231
3911
  let vErrors = null;
3232
3912
  let errors = 0;
3233
3913
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3329,7 +4009,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
3329
4009
  if (data.color !== void 0) {
3330
4010
  let data3 = data.color;
3331
4011
  if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
3332
- const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
4012
+ const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
3333
4013
  if (vErrors === null) {
3334
4014
  vErrors = [err9];
3335
4015
  } else {
@@ -3413,11 +4093,11 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
3413
4093
  }
3414
4094
  errors++;
3415
4095
  }
3416
- validate24.errors = vErrors;
4096
+ validate29.errors = vErrors;
3417
4097
  return errors === 0;
3418
4098
  }
3419
4099
  var pattern4 = new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$", "u");
3420
- function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4100
+ function validate32(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3421
4101
  let vErrors = null;
3422
4102
  let errors = 0;
3423
4103
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3503,10 +4183,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
3503
4183
  }
3504
4184
  errors++;
3505
4185
  }
3506
- validate27.errors = vErrors;
4186
+ validate32.errors = vErrors;
3507
4187
  return errors === 0;
3508
4188
  }
3509
- function validate26(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4189
+ function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3510
4190
  let vErrors = null;
3511
4191
  let errors = 0;
3512
4192
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3620,8 +4300,8 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
3620
4300
  }
3621
4301
  const len1 = data3.length;
3622
4302
  for (let i1 = 0; i1 < len1; i1++) {
3623
- if (!validate27(data3[i1], { instancePath: instancePath + "/meters/" + i1, parentData: data3, parentDataProperty: i1, rootData })) {
3624
- vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
4303
+ if (!validate32(data3[i1], { instancePath: instancePath + "/meters/" + i1, parentData: data3, parentDataProperty: i1, rootData })) {
4304
+ vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
3625
4305
  errors = vErrors.length;
3626
4306
  }
3627
4307
  }
@@ -3644,10 +4324,10 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
3644
4324
  }
3645
4325
  errors++;
3646
4326
  }
3647
- validate26.errors = vErrors;
4327
+ validate31.errors = vErrors;
3648
4328
  return errors === 0;
3649
4329
  }
3650
- function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4330
+ function validate36(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3651
4331
  let vErrors = null;
3652
4332
  let errors = 0;
3653
4333
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -3733,13 +4413,13 @@ function validate31(data, { instancePath = "", parentData, parentDataProperty, r
3733
4413
  }
3734
4414
  errors++;
3735
4415
  }
3736
- validate31.errors = vErrors;
4416
+ validate36.errors = vErrors;
3737
4417
  return errors === 0;
3738
4418
  }
3739
- var schema68 = { "oneOf": [{ "description": "\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "carry"], "properties": { "type": { "const": "edge" }, "from": { "$ref": "#/definitions/id" }, "to": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" }, "carry": { "$ref": "#/definitions/carry" }, "labelSide": { "description": "\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)", "enum": ["above", "below", "left", "right"] }, "at": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A", "$ref": "#/definitions/unit" }, "into": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217", "$ref": "#/definitions/unit" } } }, { "description": "\u7BB1\u306E\u4E2D\u306E\u51E6\u7406", "type": "object", "additionalProperties": false, "required": ["type", "box", "label"], "properties": { "type": { "const": "action" }, "box": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" } } }, { "description": "\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048", "type": "object", "additionalProperties": false, "required": ["type", "box", "text"], "properties": { "type": { "const": "swap" }, "box": { "$ref": "#/definitions/id" }, "text": { "$ref": "#/definitions/text" }, "color": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272", "$ref": "#/definitions/color" } } }, { "description": "commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064", "type": "object", "additionalProperties": false, "required": ["type", "id", "branch"], "properties": { "type": { "const": "commit" }, "id": { "$ref": "#/definitions/id" }, "branch": { "$ref": "#/definitions/id" }, "copy": { "$ref": "#/definitions/id" }, "merge": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" }, "note": { "$ref": "#/definitions/text" } } }, { "description": "\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059", "type": "object", "additionalProperties": false, "required": ["type", "branch", "from"], "properties": { "type": { "const": "branch" }, "branch": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/id" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B", "type": "object", "additionalProperties": false, "required": ["type", "to"], "properties": { "type": { "const": "now" }, "to": { "$ref": "#/definitions/unit" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B", "type": "object", "additionalProperties": false, "required": ["type", "row", "from", "to", "color"], "properties": { "type": { "const": "mark" }, "row": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "text"], "properties": { "type": { "const": "span" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "text": { "$ref": "#/definitions/text" }, "shape": { "enum": ["box"] }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D", "type": "object", "additionalProperties": false, "required": ["type", "field"], "anyOf": [{ "required": ["value"] }, { "required": ["tag"] }], "properties": { "type": { "const": "strip" }, "field": { "$ref": "#/definitions/text" }, "value": { "$ref": "#/definitions/text" }, "tag": { "$ref": "#/definitions/text" } } }] };
4419
+ var schema80 = { "oneOf": [{ "description": "\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "carry"], "properties": { "type": { "const": "edge" }, "from": { "$ref": "#/definitions/id" }, "to": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" }, "carry": { "$ref": "#/definitions/carry" }, "labelSide": { "description": "\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)", "enum": ["above", "below", "left", "right"] }, "at": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A", "$ref": "#/definitions/unit" }, "into": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217", "$ref": "#/definitions/unit" } } }, { "description": "\u7BB1\u306E\u4E2D\u306E\u51E6\u7406", "type": "object", "additionalProperties": false, "required": ["type", "box", "label"], "properties": { "type": { "const": "action" }, "box": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" } } }, { "description": "\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048", "type": "object", "additionalProperties": false, "required": ["type", "box", "text"], "properties": { "type": { "const": "swap" }, "box": { "$ref": "#/definitions/id" }, "text": { "$ref": "#/definitions/text" }, "color": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272", "$ref": "#/definitions/color" } } }, { "description": "commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064", "type": "object", "additionalProperties": false, "required": ["type", "id", "branch"], "properties": { "type": { "const": "commit" }, "id": { "$ref": "#/definitions/id" }, "branch": { "$ref": "#/definitions/id" }, "copy": { "$ref": "#/definitions/id" }, "merge": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" }, "note": { "$ref": "#/definitions/text" } } }, { "description": "\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059", "type": "object", "additionalProperties": false, "required": ["type", "branch", "from"], "properties": { "type": { "const": "branch" }, "branch": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/id" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B", "type": "object", "additionalProperties": false, "required": ["type", "to"], "properties": { "type": { "const": "now" }, "to": { "$ref": "#/definitions/unit" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B", "type": "object", "additionalProperties": false, "required": ["type", "row", "from", "to", "color"], "properties": { "type": { "const": "mark" }, "row": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "text"], "properties": { "type": { "const": "span" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "text": { "$ref": "#/definitions/text" }, "shape": { "enum": ["box"] }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u8449\u3092\u51FA\u3059\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u8449\u306E\u7BB1\u304C\u73FE\u308C\u308B\u3002hash \u3092\u66F8\u304F\u3068\u7BB1\u306B\u5024\u3092\u51FA\u3057\u3001\u540D\u672D\u3092\u8449\u306E\u4E0B\u306E\u672D\u306B\u51FA\u3059", "type": "object", "additionalProperties": false, "required": ["type", "id"], "properties": { "type": { "const": "leaf" }, "id": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" } } }, { "description": "1 \u3064\u4EE5\u4E0A\u306E\u5B50\u304B\u3089\u89AA\u3092\u7D44\u3080\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u89AA\u306E\u7BB1\u3068\u3001\u5B50\u304B\u3089\u89AA\u3078\u306E\u6728\u306E\u7DDA\u304C\u73FE\u308C\u308B", "type": "object", "additionalProperties": false, "required": ["type", "id", "children"], "properties": { "type": { "const": "node" }, "id": { "$ref": "#/definitions/id" }, "children": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/id" } }, "hash": { "$ref": "#/definitions/hash" } } }, { "description": "\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D", "type": "object", "additionalProperties": false, "required": ["type", "field"], "anyOf": [{ "required": ["value"] }, { "required": ["tag"] }], "properties": { "type": { "const": "strip" }, "field": { "$ref": "#/definitions/text" }, "value": { "$ref": "#/definitions/text" }, "tag": { "$ref": "#/definitions/text" } } }] };
3740
4420
  var pattern14 = new RegExp("^[0-9a-f]{4,40}$", "u");
3741
- var schema72 = { "properties": { "kind": { "enum": ["envelope", "tag", "coin", "none"] }}};
3742
- function validate34(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4421
+ var schema84 = { "properties": { "kind": { "enum": ["envelope", "tag", "coin", "none"] }}};
4422
+ function validate39(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3743
4423
  let vErrors = null;
3744
4424
  let errors = 0;
3745
4425
  const _errs1 = errors;
@@ -3865,7 +4545,7 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
3865
4545
  if (data.kind !== void 0) {
3866
4546
  let data1 = data.kind;
3867
4547
  if (!(data1 === "envelope" || data1 === "tag" || data1 === "coin" || data1 === "none")) {
3868
- const err8 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema72.properties.kind.enum }, message: "must be equal to one of the allowed values" };
4548
+ const err8 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema84.properties.kind.enum }, message: "must be equal to one of the allowed values" };
3869
4549
  if (vErrors === null) {
3870
4550
  vErrors = [err8];
3871
4551
  } else {
@@ -3905,10 +4585,10 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
3905
4585
  }
3906
4586
  errors++;
3907
4587
  }
3908
- validate34.errors = vErrors;
4588
+ validate39.errors = vErrors;
3909
4589
  return errors === 0;
3910
4590
  }
3911
- function validate33(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4591
+ function validate38(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3912
4592
  let vErrors = null;
3913
4593
  let errors = 0;
3914
4594
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -4050,15 +4730,15 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
4050
4730
  }
4051
4731
  }
4052
4732
  if (data.carry !== void 0) {
4053
- if (!validate34(data.carry, { instancePath: instancePath + "/carry", parentData: data, parentDataProperty: "carry", rootData })) {
4054
- vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);
4733
+ if (!validate39(data.carry, { instancePath: instancePath + "/carry", parentData: data, parentDataProperty: "carry", rootData })) {
4734
+ vErrors = vErrors === null ? validate39.errors : vErrors.concat(validate39.errors);
4055
4735
  errors = vErrors.length;
4056
4736
  }
4057
4737
  }
4058
4738
  if (data.labelSide !== void 0) {
4059
4739
  let data5 = data.labelSide;
4060
4740
  if (!(data5 === "above" || data5 === "below" || data5 === "left" || data5 === "right")) {
4061
- const err13 = { instancePath: instancePath + "/labelSide", schemaPath: "#/oneOf/0/properties/labelSide/enum", keyword: "enum", params: { allowedValues: schema68.oneOf[0].properties.labelSide.enum }, message: "must be equal to one of the allowed values" };
4741
+ const err13 = { instancePath: instancePath + "/labelSide", schemaPath: "#/oneOf/0/properties/labelSide/enum", keyword: "enum", params: { allowedValues: schema80.oneOf[0].properties.labelSide.enum }, message: "must be equal to one of the allowed values" };
4062
4742
  if (vErrors === null) {
4063
4743
  vErrors = [err13];
4064
4744
  } else {
@@ -4324,7 +5004,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
4324
5004
  if (data.color !== void 0) {
4325
5005
  let data14 = data.color;
4326
5006
  if (!(data14 === "blue" || data14 === "amber" || data14 === "green" || data14 === "violet" || data14 === "rose" || data14 === "slate" || data14 === "coin")) {
4327
- const err38 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
5007
+ const err38 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
4328
5008
  if (vErrors === null) {
4329
5009
  vErrors = [err38];
4330
5010
  } else {
@@ -4852,7 +5532,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
4852
5532
  if (data.color !== void 0) {
4853
5533
  let data31 = data.color;
4854
5534
  if (!(data31 === "blue" || data31 === "amber" || data31 === "green" || data31 === "violet" || data31 === "rose" || data31 === "slate" || data31 === "coin")) {
4855
- const err88 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
5535
+ const err88 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
4856
5536
  if (vErrors === null) {
4857
5537
  vErrors = [err88];
4858
5538
  } else {
@@ -4976,106 +5656,350 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
4976
5656
  }
4977
5657
  }
4978
5658
  }
4979
- if (data.text !== void 0) {
4980
- let data35 = data.text;
4981
- if (typeof data35 === "string") {
4982
- if (func3(data35) < 1) {
4983
- const err100 = { instancePath: instancePath + "/text", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5659
+ if (data.text !== void 0) {
5660
+ let data35 = data.text;
5661
+ if (typeof data35 === "string") {
5662
+ if (func3(data35) < 1) {
5663
+ const err100 = { instancePath: instancePath + "/text", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5664
+ if (vErrors === null) {
5665
+ vErrors = [err100];
5666
+ } else {
5667
+ vErrors.push(err100);
5668
+ }
5669
+ errors++;
5670
+ }
5671
+ } else {
5672
+ const err101 = { instancePath: instancePath + "/text", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5673
+ if (vErrors === null) {
5674
+ vErrors = [err101];
5675
+ } else {
5676
+ vErrors.push(err101);
5677
+ }
5678
+ errors++;
5679
+ }
5680
+ }
5681
+ if (data.shape !== void 0) {
5682
+ if (!(data.shape === "box")) {
5683
+ const err102 = { instancePath: instancePath + "/shape", schemaPath: "#/oneOf/7/properties/shape/enum", keyword: "enum", params: { allowedValues: schema80.oneOf[7].properties.shape.enum }, message: "must be equal to one of the allowed values" };
5684
+ if (vErrors === null) {
5685
+ vErrors = [err102];
5686
+ } else {
5687
+ vErrors.push(err102);
5688
+ }
5689
+ errors++;
5690
+ }
5691
+ }
5692
+ if (data.color !== void 0) {
5693
+ let data37 = data.color;
5694
+ if (!(data37 === "blue" || data37 === "amber" || data37 === "green" || data37 === "violet" || data37 === "rose" || data37 === "slate" || data37 === "coin")) {
5695
+ const err103 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
5696
+ if (vErrors === null) {
5697
+ vErrors = [err103];
5698
+ } else {
5699
+ vErrors.push(err103);
5700
+ }
5701
+ errors++;
5702
+ }
5703
+ }
5704
+ } else {
5705
+ const err104 = { instancePath, schemaPath: "#/oneOf/7/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5706
+ if (vErrors === null) {
5707
+ vErrors = [err104];
5708
+ } else {
5709
+ vErrors.push(err104);
5710
+ }
5711
+ errors++;
5712
+ }
5713
+ } else if (tag0 === "leaf") {
5714
+ if (data && typeof data == "object" && !Array.isArray(data)) {
5715
+ if (data.type === void 0) {
5716
+ const err105 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
5717
+ if (vErrors === null) {
5718
+ vErrors = [err105];
5719
+ } else {
5720
+ vErrors.push(err105);
5721
+ }
5722
+ errors++;
5723
+ }
5724
+ if (data.id === void 0) {
5725
+ const err106 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
5726
+ if (vErrors === null) {
5727
+ vErrors = [err106];
5728
+ } else {
5729
+ vErrors.push(err106);
5730
+ }
5731
+ errors++;
5732
+ }
5733
+ for (const key8 in data) {
5734
+ if (!(key8 === "type" || key8 === "id" || key8 === "hash")) {
5735
+ const err107 = { instancePath, schemaPath: "#/oneOf/8/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
5736
+ if (vErrors === null) {
5737
+ vErrors = [err107];
5738
+ } else {
5739
+ vErrors.push(err107);
5740
+ }
5741
+ errors++;
5742
+ }
5743
+ }
5744
+ if (data.type !== void 0) {
5745
+ if ("leaf" !== data.type) {
5746
+ const err108 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/8/properties/type/const", keyword: "const", params: { allowedValue: "leaf" }, message: "must be equal to constant" };
5747
+ if (vErrors === null) {
5748
+ vErrors = [err108];
5749
+ } else {
5750
+ vErrors.push(err108);
5751
+ }
5752
+ errors++;
5753
+ }
5754
+ }
5755
+ if (data.id !== void 0) {
5756
+ let data39 = data.id;
5757
+ if (typeof data39 === "string") {
5758
+ if (!pattern0.test(data39)) {
5759
+ const err109 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
5760
+ if (vErrors === null) {
5761
+ vErrors = [err109];
5762
+ } else {
5763
+ vErrors.push(err109);
5764
+ }
5765
+ errors++;
5766
+ }
5767
+ } else {
5768
+ const err110 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5769
+ if (vErrors === null) {
5770
+ vErrors = [err110];
5771
+ } else {
5772
+ vErrors.push(err110);
5773
+ }
5774
+ errors++;
5775
+ }
5776
+ }
5777
+ if (data.hash !== void 0) {
5778
+ let data40 = data.hash;
5779
+ if (typeof data40 === "string") {
5780
+ if (!pattern14.test(data40)) {
5781
+ const err111 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/pattern", keyword: "pattern", params: { pattern: "^[0-9a-f]{4,40}$" }, message: 'must match pattern "^[0-9a-f]{4,40}$"' };
5782
+ if (vErrors === null) {
5783
+ vErrors = [err111];
5784
+ } else {
5785
+ vErrors.push(err111);
5786
+ }
5787
+ errors++;
5788
+ }
5789
+ } else {
5790
+ const err112 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5791
+ if (vErrors === null) {
5792
+ vErrors = [err112];
5793
+ } else {
5794
+ vErrors.push(err112);
5795
+ }
5796
+ errors++;
5797
+ }
5798
+ }
5799
+ } else {
5800
+ const err113 = { instancePath, schemaPath: "#/oneOf/8/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5801
+ if (vErrors === null) {
5802
+ vErrors = [err113];
5803
+ } else {
5804
+ vErrors.push(err113);
5805
+ }
5806
+ errors++;
5807
+ }
5808
+ } else if (tag0 === "node") {
5809
+ if (data && typeof data == "object" && !Array.isArray(data)) {
5810
+ if (data.type === void 0) {
5811
+ const err114 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
5812
+ if (vErrors === null) {
5813
+ vErrors = [err114];
5814
+ } else {
5815
+ vErrors.push(err114);
5816
+ }
5817
+ errors++;
5818
+ }
5819
+ if (data.id === void 0) {
5820
+ const err115 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
5821
+ if (vErrors === null) {
5822
+ vErrors = [err115];
5823
+ } else {
5824
+ vErrors.push(err115);
5825
+ }
5826
+ errors++;
5827
+ }
5828
+ if (data.children === void 0) {
5829
+ const err116 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "children" }, message: "must have required property 'children'" };
5830
+ if (vErrors === null) {
5831
+ vErrors = [err116];
5832
+ } else {
5833
+ vErrors.push(err116);
5834
+ }
5835
+ errors++;
5836
+ }
5837
+ for (const key9 in data) {
5838
+ if (!(key9 === "type" || key9 === "id" || key9 === "children" || key9 === "hash")) {
5839
+ const err117 = { instancePath, schemaPath: "#/oneOf/9/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key9 }, message: "must NOT have additional properties" };
5840
+ if (vErrors === null) {
5841
+ vErrors = [err117];
5842
+ } else {
5843
+ vErrors.push(err117);
5844
+ }
5845
+ errors++;
5846
+ }
5847
+ }
5848
+ if (data.type !== void 0) {
5849
+ if ("node" !== data.type) {
5850
+ const err118 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/9/properties/type/const", keyword: "const", params: { allowedValue: "node" }, message: "must be equal to constant" };
5851
+ if (vErrors === null) {
5852
+ vErrors = [err118];
5853
+ } else {
5854
+ vErrors.push(err118);
5855
+ }
5856
+ errors++;
5857
+ }
5858
+ }
5859
+ if (data.id !== void 0) {
5860
+ let data42 = data.id;
5861
+ if (typeof data42 === "string") {
5862
+ if (!pattern0.test(data42)) {
5863
+ const err119 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
4984
5864
  if (vErrors === null) {
4985
- vErrors = [err100];
5865
+ vErrors = [err119];
4986
5866
  } else {
4987
- vErrors.push(err100);
5867
+ vErrors.push(err119);
4988
5868
  }
4989
5869
  errors++;
4990
5870
  }
4991
5871
  } else {
4992
- const err101 = { instancePath: instancePath + "/text", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5872
+ const err120 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
4993
5873
  if (vErrors === null) {
4994
- vErrors = [err101];
5874
+ vErrors = [err120];
4995
5875
  } else {
4996
- vErrors.push(err101);
5876
+ vErrors.push(err120);
4997
5877
  }
4998
5878
  errors++;
4999
5879
  }
5000
5880
  }
5001
- if (data.shape !== void 0) {
5002
- if (!(data.shape === "box")) {
5003
- const err102 = { instancePath: instancePath + "/shape", schemaPath: "#/oneOf/7/properties/shape/enum", keyword: "enum", params: { allowedValues: schema68.oneOf[7].properties.shape.enum }, message: "must be equal to one of the allowed values" };
5881
+ if (data.children !== void 0) {
5882
+ let data43 = data.children;
5883
+ if (Array.isArray(data43)) {
5884
+ if (data43.length < 1) {
5885
+ const err121 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
5886
+ if (vErrors === null) {
5887
+ vErrors = [err121];
5888
+ } else {
5889
+ vErrors.push(err121);
5890
+ }
5891
+ errors++;
5892
+ }
5893
+ const len0 = data43.length;
5894
+ for (let i0 = 0; i0 < len0; i0++) {
5895
+ let data44 = data43[i0];
5896
+ if (typeof data44 === "string") {
5897
+ if (!pattern0.test(data44)) {
5898
+ const err122 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
5899
+ if (vErrors === null) {
5900
+ vErrors = [err122];
5901
+ } else {
5902
+ vErrors.push(err122);
5903
+ }
5904
+ errors++;
5905
+ }
5906
+ } else {
5907
+ const err123 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5908
+ if (vErrors === null) {
5909
+ vErrors = [err123];
5910
+ } else {
5911
+ vErrors.push(err123);
5912
+ }
5913
+ errors++;
5914
+ }
5915
+ }
5916
+ } else {
5917
+ const err124 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/type", keyword: "type", params: { type: "array" }, message: "must be array" };
5004
5918
  if (vErrors === null) {
5005
- vErrors = [err102];
5919
+ vErrors = [err124];
5006
5920
  } else {
5007
- vErrors.push(err102);
5921
+ vErrors.push(err124);
5008
5922
  }
5009
5923
  errors++;
5010
5924
  }
5011
5925
  }
5012
- if (data.color !== void 0) {
5013
- let data37 = data.color;
5014
- if (!(data37 === "blue" || data37 === "amber" || data37 === "green" || data37 === "violet" || data37 === "rose" || data37 === "slate" || data37 === "coin")) {
5015
- const err103 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
5926
+ if (data.hash !== void 0) {
5927
+ let data45 = data.hash;
5928
+ if (typeof data45 === "string") {
5929
+ if (!pattern14.test(data45)) {
5930
+ const err125 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/pattern", keyword: "pattern", params: { pattern: "^[0-9a-f]{4,40}$" }, message: 'must match pattern "^[0-9a-f]{4,40}$"' };
5931
+ if (vErrors === null) {
5932
+ vErrors = [err125];
5933
+ } else {
5934
+ vErrors.push(err125);
5935
+ }
5936
+ errors++;
5937
+ }
5938
+ } else {
5939
+ const err126 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5016
5940
  if (vErrors === null) {
5017
- vErrors = [err103];
5941
+ vErrors = [err126];
5018
5942
  } else {
5019
- vErrors.push(err103);
5943
+ vErrors.push(err126);
5020
5944
  }
5021
5945
  errors++;
5022
5946
  }
5023
5947
  }
5024
5948
  } else {
5025
- const err104 = { instancePath, schemaPath: "#/oneOf/7/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5949
+ const err127 = { instancePath, schemaPath: "#/oneOf/9/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5026
5950
  if (vErrors === null) {
5027
- vErrors = [err104];
5951
+ vErrors = [err127];
5028
5952
  } else {
5029
- vErrors.push(err104);
5953
+ vErrors.push(err127);
5030
5954
  }
5031
5955
  errors++;
5032
5956
  }
5033
5957
  } else if (tag0 === "strip") {
5034
- const _errs117 = errors;
5035
- let valid45 = false;
5036
- const _errs118 = errors;
5958
+ const _errs142 = errors;
5959
+ let valid56 = false;
5960
+ const _errs143 = errors;
5037
5961
  if (data && typeof data == "object" && !Array.isArray(data)) {
5038
5962
  if (data.value === void 0) {
5039
- const err105 = { instancePath, schemaPath: "#/oneOf/8/anyOf/0/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
5963
+ const err128 = { instancePath, schemaPath: "#/oneOf/10/anyOf/0/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
5040
5964
  if (vErrors === null) {
5041
- vErrors = [err105];
5965
+ vErrors = [err128];
5042
5966
  } else {
5043
- vErrors.push(err105);
5967
+ vErrors.push(err128);
5044
5968
  }
5045
5969
  errors++;
5046
5970
  }
5047
5971
  }
5048
- var _valid0 = _errs118 === errors;
5049
- valid45 = valid45 || _valid0;
5050
- if (!valid45) {
5051
- const _errs119 = errors;
5972
+ var _valid0 = _errs143 === errors;
5973
+ valid56 = valid56 || _valid0;
5974
+ if (!valid56) {
5975
+ const _errs144 = errors;
5052
5976
  if (data && typeof data == "object" && !Array.isArray(data)) {
5053
5977
  if (data.tag === void 0) {
5054
- const err106 = { instancePath, schemaPath: "#/oneOf/8/anyOf/1/required", keyword: "required", params: { missingProperty: "tag" }, message: "must have required property 'tag'" };
5978
+ const err129 = { instancePath, schemaPath: "#/oneOf/10/anyOf/1/required", keyword: "required", params: { missingProperty: "tag" }, message: "must have required property 'tag'" };
5055
5979
  if (vErrors === null) {
5056
- vErrors = [err106];
5980
+ vErrors = [err129];
5057
5981
  } else {
5058
- vErrors.push(err106);
5982
+ vErrors.push(err129);
5059
5983
  }
5060
5984
  errors++;
5061
5985
  }
5062
5986
  }
5063
- var _valid0 = _errs119 === errors;
5064
- valid45 = valid45 || _valid0;
5987
+ var _valid0 = _errs144 === errors;
5988
+ valid56 = valid56 || _valid0;
5065
5989
  }
5066
- if (!valid45) {
5067
- const err107 = { instancePath, schemaPath: "#/oneOf/8/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
5990
+ if (!valid56) {
5991
+ const err130 = { instancePath, schemaPath: "#/oneOf/10/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
5068
5992
  if (vErrors === null) {
5069
- vErrors = [err107];
5993
+ vErrors = [err130];
5070
5994
  } else {
5071
- vErrors.push(err107);
5995
+ vErrors.push(err130);
5072
5996
  }
5073
5997
  errors++;
5074
5998
  } else {
5075
- errors = _errs117;
5999
+ errors = _errs142;
5076
6000
  if (vErrors !== null) {
5077
- if (_errs117) {
5078
- vErrors.length = _errs117;
6001
+ if (_errs142) {
6002
+ vErrors.length = _errs142;
5079
6003
  } else {
5080
6004
  vErrors = null;
5081
6005
  }
@@ -5083,151 +6007,151 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
5083
6007
  }
5084
6008
  if (data && typeof data == "object" && !Array.isArray(data)) {
5085
6009
  if (data.type === void 0) {
5086
- const err108 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
6010
+ const err131 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
5087
6011
  if (vErrors === null) {
5088
- vErrors = [err108];
6012
+ vErrors = [err131];
5089
6013
  } else {
5090
- vErrors.push(err108);
6014
+ vErrors.push(err131);
5091
6015
  }
5092
6016
  errors++;
5093
6017
  }
5094
6018
  if (data.field === void 0) {
5095
- const err109 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "field" }, message: "must have required property 'field'" };
6019
+ const err132 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "field" }, message: "must have required property 'field'" };
5096
6020
  if (vErrors === null) {
5097
- vErrors = [err109];
6021
+ vErrors = [err132];
5098
6022
  } else {
5099
- vErrors.push(err109);
6023
+ vErrors.push(err132);
5100
6024
  }
5101
6025
  errors++;
5102
6026
  }
5103
- for (const key8 in data) {
5104
- if (!(key8 === "type" || key8 === "field" || key8 === "value" || key8 === "tag")) {
5105
- const err110 = { instancePath, schemaPath: "#/oneOf/8/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
6027
+ for (const key10 in data) {
6028
+ if (!(key10 === "type" || key10 === "field" || key10 === "value" || key10 === "tag")) {
6029
+ const err133 = { instancePath, schemaPath: "#/oneOf/10/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key10 }, message: "must NOT have additional properties" };
5106
6030
  if (vErrors === null) {
5107
- vErrors = [err110];
6031
+ vErrors = [err133];
5108
6032
  } else {
5109
- vErrors.push(err110);
6033
+ vErrors.push(err133);
5110
6034
  }
5111
6035
  errors++;
5112
6036
  }
5113
6037
  }
5114
6038
  if (data.type !== void 0) {
5115
6039
  if ("strip" !== data.type) {
5116
- const err111 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/8/properties/type/const", keyword: "const", params: { allowedValue: "strip" }, message: "must be equal to constant" };
6040
+ const err134 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/10/properties/type/const", keyword: "const", params: { allowedValue: "strip" }, message: "must be equal to constant" };
5117
6041
  if (vErrors === null) {
5118
- vErrors = [err111];
6042
+ vErrors = [err134];
5119
6043
  } else {
5120
- vErrors.push(err111);
6044
+ vErrors.push(err134);
5121
6045
  }
5122
6046
  errors++;
5123
6047
  }
5124
6048
  }
5125
6049
  if (data.field !== void 0) {
5126
- let data39 = data.field;
5127
- if (typeof data39 === "string") {
5128
- if (func3(data39) < 1) {
5129
- const err112 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
6050
+ let data47 = data.field;
6051
+ if (typeof data47 === "string") {
6052
+ if (func3(data47) < 1) {
6053
+ const err135 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5130
6054
  if (vErrors === null) {
5131
- vErrors = [err112];
6055
+ vErrors = [err135];
5132
6056
  } else {
5133
- vErrors.push(err112);
6057
+ vErrors.push(err135);
5134
6058
  }
5135
6059
  errors++;
5136
6060
  }
5137
6061
  } else {
5138
- const err113 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
6062
+ const err136 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5139
6063
  if (vErrors === null) {
5140
- vErrors = [err113];
6064
+ vErrors = [err136];
5141
6065
  } else {
5142
- vErrors.push(err113);
6066
+ vErrors.push(err136);
5143
6067
  }
5144
6068
  errors++;
5145
6069
  }
5146
6070
  }
5147
6071
  if (data.value !== void 0) {
5148
- let data40 = data.value;
5149
- if (typeof data40 === "string") {
5150
- if (func3(data40) < 1) {
5151
- const err114 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
6072
+ let data48 = data.value;
6073
+ if (typeof data48 === "string") {
6074
+ if (func3(data48) < 1) {
6075
+ const err137 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5152
6076
  if (vErrors === null) {
5153
- vErrors = [err114];
6077
+ vErrors = [err137];
5154
6078
  } else {
5155
- vErrors.push(err114);
6079
+ vErrors.push(err137);
5156
6080
  }
5157
6081
  errors++;
5158
6082
  }
5159
6083
  } else {
5160
- const err115 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
6084
+ const err138 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5161
6085
  if (vErrors === null) {
5162
- vErrors = [err115];
6086
+ vErrors = [err138];
5163
6087
  } else {
5164
- vErrors.push(err115);
6088
+ vErrors.push(err138);
5165
6089
  }
5166
6090
  errors++;
5167
6091
  }
5168
6092
  }
5169
6093
  if (data.tag !== void 0) {
5170
- let data41 = data.tag;
5171
- if (typeof data41 === "string") {
5172
- if (func3(data41) < 1) {
5173
- const err116 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
6094
+ let data49 = data.tag;
6095
+ if (typeof data49 === "string") {
6096
+ if (func3(data49) < 1) {
6097
+ const err139 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5174
6098
  if (vErrors === null) {
5175
- vErrors = [err116];
6099
+ vErrors = [err139];
5176
6100
  } else {
5177
- vErrors.push(err116);
6101
+ vErrors.push(err139);
5178
6102
  }
5179
6103
  errors++;
5180
6104
  }
5181
6105
  } else {
5182
- const err117 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
6106
+ const err140 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5183
6107
  if (vErrors === null) {
5184
- vErrors = [err117];
6108
+ vErrors = [err140];
5185
6109
  } else {
5186
- vErrors.push(err117);
6110
+ vErrors.push(err140);
5187
6111
  }
5188
6112
  errors++;
5189
6113
  }
5190
6114
  }
5191
6115
  } else {
5192
- const err118 = { instancePath, schemaPath: "#/oneOf/8/type", keyword: "type", params: { type: "object" }, message: "must be object" };
6116
+ const err141 = { instancePath, schemaPath: "#/oneOf/10/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5193
6117
  if (vErrors === null) {
5194
- vErrors = [err118];
6118
+ vErrors = [err141];
5195
6119
  } else {
5196
- vErrors.push(err118);
6120
+ vErrors.push(err141);
5197
6121
  }
5198
6122
  errors++;
5199
6123
  }
5200
6124
  } else {
5201
- const err119 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "mapping", tag: "type", tagValue: tag0 }, message: 'value of tag "type" must be in oneOf' };
6125
+ const err142 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "mapping", tag: "type", tagValue: tag0 }, message: 'value of tag "type" must be in oneOf' };
5202
6126
  if (vErrors === null) {
5203
- vErrors = [err119];
6127
+ vErrors = [err142];
5204
6128
  } else {
5205
- vErrors.push(err119);
6129
+ vErrors.push(err142);
5206
6130
  }
5207
6131
  errors++;
5208
6132
  }
5209
6133
  } else {
5210
- const err120 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "tag", tag: "type", tagValue: tag0 }, message: 'tag "type" must be string' };
6134
+ const err143 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "tag", tag: "type", tagValue: tag0 }, message: 'tag "type" must be string' };
5211
6135
  if (vErrors === null) {
5212
- vErrors = [err120];
6136
+ vErrors = [err143];
5213
6137
  } else {
5214
- vErrors.push(err120);
6138
+ vErrors.push(err143);
5215
6139
  }
5216
6140
  errors++;
5217
6141
  }
5218
6142
  } else {
5219
- const err121 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
6143
+ const err144 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5220
6144
  if (vErrors === null) {
5221
- vErrors = [err121];
6145
+ vErrors = [err144];
5222
6146
  } else {
5223
- vErrors.push(err121);
6147
+ vErrors.push(err144);
5224
6148
  }
5225
6149
  errors++;
5226
6150
  }
5227
- validate33.errors = vErrors;
6151
+ validate38.errors = vErrors;
5228
6152
  return errors === 0;
5229
6153
  }
5230
- function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6154
+ function validate35(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5231
6155
  let vErrors = null;
5232
6156
  let errors = 0;
5233
6157
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5349,8 +6273,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
5349
6273
  }
5350
6274
  const len0 = data3.length;
5351
6275
  for (let i0 = 0; i0 < len0; i0++) {
5352
- if (!validate31(data3[i0], { instancePath: instancePath + "/sources/" + i0, parentData: data3, parentDataProperty: i0, rootData })) {
5353
- vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
6276
+ if (!validate36(data3[i0], { instancePath: instancePath + "/sources/" + i0, parentData: data3, parentDataProperty: i0, rootData })) {
6277
+ vErrors = vErrors === null ? validate36.errors : vErrors.concat(validate36.errors);
5354
6278
  errors = vErrors.length;
5355
6279
  }
5356
6280
  }
@@ -5369,8 +6293,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
5369
6293
  if (Array.isArray(data5)) {
5370
6294
  const len1 = data5.length;
5371
6295
  for (let i1 = 0; i1 < len1; i1++) {
5372
- if (!validate33(data5[i1], { instancePath: instancePath + "/events/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
5373
- vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
6296
+ if (!validate38(data5[i1], { instancePath: instancePath + "/events/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
6297
+ vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);
5374
6298
  errors = vErrors.length;
5375
6299
  }
5376
6300
  }
@@ -5393,10 +6317,10 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
5393
6317
  }
5394
6318
  errors++;
5395
6319
  }
5396
- validate30.errors = vErrors;
6320
+ validate35.errors = vErrors;
5397
6321
  return errors === 0;
5398
6322
  }
5399
- function validate38(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6323
+ function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5400
6324
  let vErrors = null;
5401
6325
  let errors = 0;
5402
6326
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5474,10 +6398,10 @@ function validate38(data, { instancePath = "", parentData, parentDataProperty, r
5474
6398
  }
5475
6399
  errors++;
5476
6400
  }
5477
- validate38.errors = vErrors;
6401
+ validate43.errors = vErrors;
5478
6402
  return errors === 0;
5479
6403
  }
5480
- function validate41(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6404
+ function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5481
6405
  let vErrors = null;
5482
6406
  let errors = 0;
5483
6407
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5585,10 +6509,10 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
5585
6509
  }
5586
6510
  errors++;
5587
6511
  }
5588
- validate41.errors = vErrors;
6512
+ validate46.errors = vErrors;
5589
6513
  return errors === 0;
5590
6514
  }
5591
- function validate40(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6515
+ function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5592
6516
  let vErrors = null;
5593
6517
  let errors = 0;
5594
6518
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5626,8 +6550,8 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
5626
6550
  }
5627
6551
  const len0 = data0.length;
5628
6552
  for (let i0 = 0; i0 < len0; i0++) {
5629
- if (!validate41(data0[i0], { instancePath: instancePath + "/paths/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
5630
- vErrors = vErrors === null ? validate41.errors : vErrors.concat(validate41.errors);
6553
+ if (!validate46(data0[i0], { instancePath: instancePath + "/paths/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
6554
+ vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors);
5631
6555
  errors = vErrors.length;
5632
6556
  }
5633
6557
  }
@@ -5650,10 +6574,10 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
5650
6574
  }
5651
6575
  errors++;
5652
6576
  }
5653
- validate40.errors = vErrors;
6577
+ validate45.errors = vErrors;
5654
6578
  return errors === 0;
5655
6579
  }
5656
- function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6580
+ function validate50(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5657
6581
  let vErrors = null;
5658
6582
  let errors = 0;
5659
6583
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5730,10 +6654,10 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
5730
6654
  }
5731
6655
  errors++;
5732
6656
  }
5733
- validate45.errors = vErrors;
6657
+ validate50.errors = vErrors;
5734
6658
  return errors === 0;
5735
6659
  }
5736
- function validate44(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6660
+ function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5737
6661
  let vErrors = null;
5738
6662
  let errors = 0;
5739
6663
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5771,8 +6695,8 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
5771
6695
  }
5772
6696
  const len0 = data0.length;
5773
6697
  for (let i0 = 0; i0 < len0; i0++) {
5774
- if (!validate45(data0[i0], { instancePath: instancePath + "/branches/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
5775
- vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);
6698
+ if (!validate50(data0[i0], { instancePath: instancePath + "/branches/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
6699
+ vErrors = vErrors === null ? validate50.errors : vErrors.concat(validate50.errors);
5776
6700
  errors = vErrors.length;
5777
6701
  }
5778
6702
  }
@@ -5795,11 +6719,11 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
5795
6719
  }
5796
6720
  errors++;
5797
6721
  }
5798
- validate44.errors = vErrors;
6722
+ validate49.errors = vErrors;
5799
6723
  return errors === 0;
5800
6724
  }
5801
- var pattern22 = new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$", "u");
5802
- function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6725
+ var pattern27 = new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$", "u");
6726
+ function validate54(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5803
6727
  let vErrors = null;
5804
6728
  let errors = 0;
5805
6729
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -5866,7 +6790,7 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
5866
6790
  if (data.length !== void 0) {
5867
6791
  let data1 = data.length;
5868
6792
  if (typeof data1 === "string") {
5869
- if (!pattern22.test(data1)) {
6793
+ if (!pattern27.test(data1)) {
5870
6794
  const err6 = { instancePath: instancePath + "/length", schemaPath: "#/definitions/duration/pattern", keyword: "pattern", params: { pattern: "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$" }, message: 'must match pattern "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"' };
5871
6795
  if (vErrors === null) {
5872
6796
  vErrors = [err6];
@@ -5940,10 +6864,10 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
5940
6864
  }
5941
6865
  errors++;
5942
6866
  }
5943
- validate49.errors = vErrors;
6867
+ validate54.errors = vErrors;
5944
6868
  return errors === 0;
5945
6869
  }
5946
- function validate51(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6870
+ function validate56(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
5947
6871
  let vErrors = null;
5948
6872
  let errors = 0;
5949
6873
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6053,10 +6977,10 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
6053
6977
  }
6054
6978
  errors++;
6055
6979
  }
6056
- validate51.errors = vErrors;
6980
+ validate56.errors = vErrors;
6057
6981
  return errors === 0;
6058
6982
  }
6059
- function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6983
+ function validate58(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6060
6984
  let vErrors = null;
6061
6985
  let errors = 0;
6062
6986
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6136,7 +7060,7 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
6136
7060
  if (data.color !== void 0) {
6137
7061
  let data2 = data.color;
6138
7062
  if (!(data2 === "blue" || data2 === "amber" || data2 === "green" || data2 === "violet" || data2 === "rose" || data2 === "slate" || data2 === "coin")) {
6139
- const err7 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema45.enum }, message: "must be equal to one of the allowed values" };
7063
+ const err7 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
6140
7064
  if (vErrors === null) {
6141
7065
  vErrors = [err7];
6142
7066
  } else {
@@ -6191,10 +7115,10 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
6191
7115
  }
6192
7116
  errors++;
6193
7117
  }
6194
- validate53.errors = vErrors;
7118
+ validate58.errors = vErrors;
6195
7119
  return errors === 0;
6196
7120
  }
6197
- function validate55(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
7121
+ function validate60(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6198
7122
  let vErrors = null;
6199
7123
  let errors = 0;
6200
7124
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6281,10 +7205,10 @@ function validate55(data, { instancePath = "", parentData, parentDataProperty, r
6281
7205
  }
6282
7206
  errors++;
6283
7207
  }
6284
- validate55.errors = vErrors;
7208
+ validate60.errors = vErrors;
6285
7209
  return errors === 0;
6286
7210
  }
6287
- function validate57(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
7211
+ function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6288
7212
  let vErrors = null;
6289
7213
  let errors = 0;
6290
7214
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6372,10 +7296,10 @@ function validate57(data, { instancePath = "", parentData, parentDataProperty, r
6372
7296
  }
6373
7297
  errors++;
6374
7298
  }
6375
- validate57.errors = vErrors;
7299
+ validate62.errors = vErrors;
6376
7300
  return errors === 0;
6377
7301
  }
6378
- function validate48(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
7302
+ function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6379
7303
  let vErrors = null;
6380
7304
  let errors = 0;
6381
7305
  if (data && typeof data == "object" && !Array.isArray(data)) {
@@ -6409,14 +7333,14 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6409
7333
  }
6410
7334
  }
6411
7335
  if (data.scale !== void 0) {
6412
- if (!validate49(data.scale, { instancePath: instancePath + "/scale", parentData: data, parentDataProperty: "scale", rootData })) {
6413
- vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);
7336
+ if (!validate54(data.scale, { instancePath: instancePath + "/scale", parentData: data, parentDataProperty: "scale", rootData })) {
7337
+ vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
6414
7338
  errors = vErrors.length;
6415
7339
  }
6416
7340
  }
6417
7341
  if (data.period !== void 0) {
6418
- if (!validate51(data.period, { instancePath: instancePath + "/period", parentData: data, parentDataProperty: "period", rootData })) {
6419
- vErrors = vErrors === null ? validate51.errors : vErrors.concat(validate51.errors);
7342
+ if (!validate56(data.period, { instancePath: instancePath + "/period", parentData: data, parentDataProperty: "period", rootData })) {
7343
+ vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);
6420
7344
  errors = vErrors.length;
6421
7345
  }
6422
7346
  }
@@ -6434,8 +7358,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6434
7358
  }
6435
7359
  const len0 = data2.length;
6436
7360
  for (let i0 = 0; i0 < len0; i0++) {
6437
- if (!validate53(data2[i0], { instancePath: instancePath + "/rows/" + i0, parentData: data2, parentDataProperty: i0, rootData })) {
6438
- vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
7361
+ if (!validate58(data2[i0], { instancePath: instancePath + "/rows/" + i0, parentData: data2, parentDataProperty: i0, rootData })) {
7362
+ vErrors = vErrors === null ? validate58.errors : vErrors.concat(validate58.errors);
6439
7363
  errors = vErrors.length;
6440
7364
  }
6441
7365
  }
@@ -6454,8 +7378,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6454
7378
  if (Array.isArray(data4)) {
6455
7379
  const len1 = data4.length;
6456
7380
  for (let i1 = 0; i1 < len1; i1++) {
6457
- if (!validate55(data4[i1], { instancePath: instancePath + "/points/" + i1, parentData: data4, parentDataProperty: i1, rootData })) {
6458
- vErrors = vErrors === null ? validate55.errors : vErrors.concat(validate55.errors);
7381
+ if (!validate60(data4[i1], { instancePath: instancePath + "/points/" + i1, parentData: data4, parentDataProperty: i1, rootData })) {
7382
+ vErrors = vErrors === null ? validate60.errors : vErrors.concat(validate60.errors);
6459
7383
  errors = vErrors.length;
6460
7384
  }
6461
7385
  }
@@ -6470,8 +7394,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6470
7394
  }
6471
7395
  }
6472
7396
  if (data.zoom !== void 0) {
6473
- if (!validate57(data.zoom, { instancePath: instancePath + "/zoom", parentData: data, parentDataProperty: "zoom", rootData })) {
6474
- vErrors = vErrors === null ? validate57.errors : vErrors.concat(validate57.errors);
7397
+ if (!validate62(data.zoom, { instancePath: instancePath + "/zoom", parentData: data, parentDataProperty: "zoom", rootData })) {
7398
+ vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
6475
7399
  errors = vErrors.length;
6476
7400
  }
6477
7401
  }
@@ -6484,7 +7408,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
6484
7408
  }
6485
7409
  errors++;
6486
7410
  }
6487
- validate48.errors = vErrors;
7411
+ validate53.errors = vErrors;
6488
7412
  return errors === 0;
6489
7413
  }
6490
7414
  var func2 = Object.prototype.hasOwnProperty;
@@ -6868,84 +7792,35 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
6868
7792
  errors++;
6869
7793
  }
6870
7794
  if (data.steps !== void 0) {
6871
- let data22 = data.steps;
6872
- if (Array.isArray(data22)) {
6873
- const len1 = data22.length;
6874
- for (let i1 = 0; i1 < len1; i1++) {
6875
- let data23 = data22[i1];
6876
- if (data23 && typeof data23 == "object" && !Array.isArray(data23)) {
6877
- if (data23.events !== void 0) {
6878
- let data24 = data23.events;
6879
- if (Array.isArray(data24)) {
6880
- const len2 = data24.length;
6881
- for (let i2 = 0; i2 < len2; i2++) {
6882
- let data25 = data24[i2];
6883
- if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
6884
- if (data25.type !== void 0) {
6885
- let data26 = data25.type;
6886
- const _errs62 = errors;
6887
- const _errs63 = errors;
6888
- if (!(data26 === "commit" || data26 === "branch")) {
6889
- const err23 = {};
6890
- if (vErrors === null) {
6891
- vErrors = [err23];
6892
- } else {
6893
- vErrors.push(err23);
6894
- }
6895
- errors++;
6896
- }
6897
- var valid31 = _errs63 === errors;
6898
- if (valid31) {
6899
- const err24 = { instancePath: instancePath + "/steps/" + i1 + "/events/" + i2 + "/type", schemaPath: "#/definitions/timeSteps/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
6900
- if (vErrors === null) {
6901
- vErrors = [err24];
6902
- } else {
6903
- vErrors.push(err24);
6904
- }
6905
- errors++;
6906
- } else {
6907
- errors = _errs62;
6908
- if (vErrors !== null) {
6909
- if (_errs62) {
6910
- vErrors.length = _errs62;
6911
- } else {
6912
- vErrors = null;
6913
- }
6914
- }
6915
- }
6916
- }
6917
- }
6918
- }
6919
- }
6920
- }
6921
- }
6922
- }
7795
+ if (!validate20(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
7796
+ vErrors = vErrors === null ? validate20.errors : vErrors.concat(validate20.errors);
7797
+ errors = vErrors.length;
6923
7798
  }
6924
7799
  }
6925
7800
  if (data.state !== void 0) {
6926
- const err25 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7801
+ const err23 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
6927
7802
  if (vErrors === null) {
6928
- vErrors = [err25];
7803
+ vErrors = [err23];
6929
7804
  } else {
6930
- vErrors.push(err25);
7805
+ vErrors.push(err23);
6931
7806
  }
6932
7807
  errors++;
6933
7808
  }
6934
7809
  if (data.git !== void 0) {
6935
- const err26 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7810
+ const err24 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
6936
7811
  if (vErrors === null) {
6937
- vErrors = [err26];
7812
+ vErrors = [err24];
6938
7813
  } else {
6939
- vErrors.push(err26);
7814
+ vErrors.push(err24);
6940
7815
  }
6941
7816
  errors++;
6942
7817
  }
6943
7818
  if (data.regions !== void 0) {
6944
- const err27 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7819
+ const err25 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
6945
7820
  if (vErrors === null) {
6946
- vErrors = [err27];
7821
+ vErrors = [err25];
6947
7822
  } else {
6948
- vErrors.push(err27);
7823
+ vErrors.push(err25);
6949
7824
  }
6950
7825
  errors++;
6951
7826
  }
@@ -6954,72 +7829,178 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
6954
7829
  valid21 = _valid3;
6955
7830
  ifClause3 = "then";
6956
7831
  } else {
6957
- const _errs73 = errors;
7832
+ const _errs66 = errors;
7833
+ const _errs67 = errors;
7834
+ let valid27 = true;
7835
+ const _errs68 = errors;
6958
7836
  if (data && typeof data == "object" && !Array.isArray(data)) {
6959
- if (data.boxes !== void 0) {
6960
- let data30 = data.boxes;
6961
- if (Array.isArray(data30)) {
6962
- if (data30.length < 1) {
6963
- const err28 = { instancePath: instancePath + "/boxes", schemaPath: "#/else/else/else/else/properties/boxes/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
7837
+ if (data.kind === void 0 && ("kind")) {
7838
+ const err26 = {};
7839
+ if (vErrors === null) {
7840
+ vErrors = [err26];
7841
+ } else {
7842
+ vErrors.push(err26);
7843
+ }
7844
+ errors++;
7845
+ } else {
7846
+ if (data.kind !== void 0) {
7847
+ if ("tree" !== data.kind) {
7848
+ const err27 = {};
6964
7849
  if (vErrors === null) {
6965
- vErrors = [err28];
7850
+ vErrors = [err27];
6966
7851
  } else {
6967
- vErrors.push(err28);
7852
+ vErrors.push(err27);
6968
7853
  }
6969
7854
  errors++;
6970
7855
  }
6971
7856
  }
6972
7857
  }
6973
- if (data.steps !== void 0) {
6974
- if (!validate11(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
6975
- vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
6976
- errors = vErrors.length;
6977
- }
7858
+ }
7859
+ var _valid4 = _errs68 === errors;
7860
+ errors = _errs67;
7861
+ if (vErrors !== null) {
7862
+ if (_errs67) {
7863
+ vErrors.length = _errs67;
7864
+ } else {
7865
+ vErrors = null;
6978
7866
  }
6979
- if (data.strip !== void 0) {
6980
- if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
6981
- vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
6982
- errors = vErrors.length;
7867
+ }
7868
+ let ifClause4;
7869
+ if (_valid4) {
7870
+ const _errs70 = errors;
7871
+ if (data && typeof data == "object" && !Array.isArray(data)) {
7872
+ if (data.steps !== void 0) {
7873
+ if (!validate22(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
7874
+ vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
7875
+ errors = vErrors.length;
7876
+ }
6983
7877
  }
6984
- }
6985
- if (data.state !== void 0) {
6986
- const err29 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
6987
- if (vErrors === null) {
6988
- vErrors = [err29];
6989
- } else {
6990
- vErrors.push(err29);
7878
+ if (data.strip !== void 0) {
7879
+ if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
7880
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
7881
+ errors = vErrors.length;
7882
+ }
6991
7883
  }
6992
- errors++;
6993
- }
6994
- if (data.git !== void 0) {
6995
- const err30 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
6996
- if (vErrors === null) {
6997
- vErrors = [err30];
6998
- } else {
6999
- vErrors.push(err30);
7884
+ if (data.state !== void 0) {
7885
+ const err28 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7886
+ if (vErrors === null) {
7887
+ vErrors = [err28];
7888
+ } else {
7889
+ vErrors.push(err28);
7890
+ }
7891
+ errors++;
7892
+ }
7893
+ if (data.git !== void 0) {
7894
+ const err29 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7895
+ if (vErrors === null) {
7896
+ vErrors = [err29];
7897
+ } else {
7898
+ vErrors.push(err29);
7899
+ }
7900
+ errors++;
7901
+ }
7902
+ if (data.time !== void 0) {
7903
+ const err30 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7904
+ if (vErrors === null) {
7905
+ vErrors = [err30];
7906
+ } else {
7907
+ vErrors.push(err30);
7908
+ }
7909
+ errors++;
7910
+ }
7911
+ if (data.regions !== void 0) {
7912
+ const err31 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7913
+ if (vErrors === null) {
7914
+ vErrors = [err31];
7915
+ } else {
7916
+ vErrors.push(err31);
7917
+ }
7918
+ errors++;
7000
7919
  }
7001
- errors++;
7002
7920
  }
7003
- if (data.time !== void 0) {
7004
- const err31 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7005
- if (vErrors === null) {
7006
- vErrors = [err31];
7007
- } else {
7008
- vErrors.push(err31);
7921
+ var _valid4 = _errs70 === errors;
7922
+ valid27 = _valid4;
7923
+ ifClause4 = "then";
7924
+ } else {
7925
+ const _errs85 = errors;
7926
+ if (data && typeof data == "object" && !Array.isArray(data)) {
7927
+ if (data.boxes !== void 0) {
7928
+ let data33 = data.boxes;
7929
+ if (Array.isArray(data33)) {
7930
+ if (data33.length < 1) {
7931
+ const err32 = { instancePath: instancePath + "/boxes", schemaPath: "#/else/else/else/else/else/properties/boxes/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
7932
+ if (vErrors === null) {
7933
+ vErrors = [err32];
7934
+ } else {
7935
+ vErrors.push(err32);
7936
+ }
7937
+ errors++;
7938
+ }
7939
+ }
7009
7940
  }
7010
- errors++;
7941
+ if (data.steps !== void 0) {
7942
+ if (!validate11(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
7943
+ vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
7944
+ errors = vErrors.length;
7945
+ }
7946
+ }
7947
+ if (data.strip !== void 0) {
7948
+ if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
7949
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
7950
+ errors = vErrors.length;
7951
+ }
7952
+ }
7953
+ if (data.state !== void 0) {
7954
+ const err33 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7955
+ if (vErrors === null) {
7956
+ vErrors = [err33];
7957
+ } else {
7958
+ vErrors.push(err33);
7959
+ }
7960
+ errors++;
7961
+ }
7962
+ if (data.git !== void 0) {
7963
+ const err34 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7964
+ if (vErrors === null) {
7965
+ vErrors = [err34];
7966
+ } else {
7967
+ vErrors.push(err34);
7968
+ }
7969
+ errors++;
7970
+ }
7971
+ if (data.time !== void 0) {
7972
+ const err35 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7973
+ if (vErrors === null) {
7974
+ vErrors = [err35];
7975
+ } else {
7976
+ vErrors.push(err35);
7977
+ }
7978
+ errors++;
7979
+ }
7980
+ }
7981
+ var _valid4 = _errs85 === errors;
7982
+ valid27 = _valid4;
7983
+ ifClause4 = "else";
7984
+ }
7985
+ if (!valid27) {
7986
+ const err36 = { instancePath, schemaPath: "#/else/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause4 }, message: 'must match "' + ifClause4 + '" schema' };
7987
+ if (vErrors === null) {
7988
+ vErrors = [err36];
7989
+ } else {
7990
+ vErrors.push(err36);
7011
7991
  }
7992
+ errors++;
7012
7993
  }
7013
- var _valid3 = _errs73 === errors;
7994
+ var _valid3 = _errs66 === errors;
7014
7995
  valid21 = _valid3;
7015
7996
  ifClause3 = "else";
7016
7997
  }
7017
7998
  if (!valid21) {
7018
- const err32 = { instancePath, schemaPath: "#/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause3 }, message: 'must match "' + ifClause3 + '" schema' };
7999
+ const err37 = { instancePath, schemaPath: "#/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause3 }, message: 'must match "' + ifClause3 + '" schema' };
7019
8000
  if (vErrors === null) {
7020
- vErrors = [err32];
8001
+ vErrors = [err37];
7021
8002
  } else {
7022
- vErrors.push(err32);
8003
+ vErrors.push(err37);
7023
8004
  }
7024
8005
  errors++;
7025
8006
  }
@@ -7028,11 +8009,11 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
7028
8009
  ifClause2 = "else";
7029
8010
  }
7030
8011
  if (!valid15) {
7031
- const err33 = { instancePath, schemaPath: "#/else/else/if", keyword: "if", params: { failingKeyword: ifClause2 }, message: 'must match "' + ifClause2 + '" schema' };
8012
+ const err38 = { instancePath, schemaPath: "#/else/else/if", keyword: "if", params: { failingKeyword: ifClause2 }, message: 'must match "' + ifClause2 + '" schema' };
7032
8013
  if (vErrors === null) {
7033
- vErrors = [err33];
8014
+ vErrors = [err38];
7034
8015
  } else {
7035
- vErrors.push(err33);
8016
+ vErrors.push(err38);
7036
8017
  }
7037
8018
  errors++;
7038
8019
  }
@@ -7041,21 +8022,21 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
7041
8022
  ifClause1 = "else";
7042
8023
  }
7043
8024
  if (!valid6) {
7044
- const err34 = { instancePath, schemaPath: "#/else/if", keyword: "if", params: { failingKeyword: ifClause1 }, message: 'must match "' + ifClause1 + '" schema' };
8025
+ const err39 = { instancePath, schemaPath: "#/else/if", keyword: "if", params: { failingKeyword: ifClause1 }, message: 'must match "' + ifClause1 + '" schema' };
7045
8026
  if (vErrors === null) {
7046
- vErrors = [err34];
8027
+ vErrors = [err39];
7047
8028
  } else {
7048
- vErrors.push(err34);
8029
+ vErrors.push(err39);
7049
8030
  }
7050
8031
  errors++;
7051
8032
  }
7052
8033
  if (data && typeof data == "object" && !Array.isArray(data)) {
7053
8034
  if (data.sequence !== void 0) {
7054
- const err35 = { instancePath: instancePath + "/sequence", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
8035
+ const err40 = { instancePath: instancePath + "/sequence", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
7055
8036
  if (vErrors === null) {
7056
- vErrors = [err35];
8037
+ vErrors = [err40];
7057
8038
  } else {
7058
- vErrors.push(err35);
8039
+ vErrors.push(err40);
7059
8040
  }
7060
8041
  errors++;
7061
8042
  }
@@ -7065,245 +8046,245 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
7065
8046
  ifClause0 = "else";
7066
8047
  }
7067
8048
  if (!valid0) {
7068
- const err36 = { instancePath, schemaPath: "#/if", keyword: "if", params: { failingKeyword: ifClause0 }, message: 'must match "' + ifClause0 + '" schema' };
8049
+ const err41 = { instancePath, schemaPath: "#/if", keyword: "if", params: { failingKeyword: ifClause0 }, message: 'must match "' + ifClause0 + '" schema' };
7069
8050
  if (vErrors === null) {
7070
- vErrors = [err36];
8051
+ vErrors = [err41];
7071
8052
  } else {
7072
- vErrors.push(err36);
8053
+ vErrors.push(err41);
7073
8054
  }
7074
8055
  errors++;
7075
8056
  }
7076
8057
  if (data && typeof data == "object" && !Array.isArray(data)) {
7077
8058
  if (data.version === void 0) {
7078
- const err37 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "version" }, message: "must have required property 'version'" };
8059
+ const err42 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "version" }, message: "must have required property 'version'" };
7079
8060
  if (vErrors === null) {
7080
- vErrors = [err37];
8061
+ vErrors = [err42];
7081
8062
  } else {
7082
- vErrors.push(err37);
8063
+ vErrors.push(err42);
7083
8064
  }
7084
8065
  errors++;
7085
8066
  }
7086
8067
  if (data.kind === void 0) {
7087
- const err38 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "kind" }, message: "must have required property 'kind'" };
8068
+ const err43 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "kind" }, message: "must have required property 'kind'" };
7088
8069
  if (vErrors === null) {
7089
- vErrors = [err38];
8070
+ vErrors = [err43];
7090
8071
  } else {
7091
- vErrors.push(err38);
8072
+ vErrors.push(err43);
7092
8073
  }
7093
8074
  errors++;
7094
8075
  }
7095
8076
  if (data.title === void 0) {
7096
- const err39 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
8077
+ const err44 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
7097
8078
  if (vErrors === null) {
7098
- vErrors = [err39];
8079
+ vErrors = [err44];
7099
8080
  } else {
7100
- vErrors.push(err39);
8081
+ vErrors.push(err44);
7101
8082
  }
7102
8083
  errors++;
7103
8084
  }
7104
8085
  if (data.boxes === void 0) {
7105
- const err40 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "boxes" }, message: "must have required property 'boxes'" };
8086
+ const err45 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "boxes" }, message: "must have required property 'boxes'" };
7106
8087
  if (vErrors === null) {
7107
- vErrors = [err40];
8088
+ vErrors = [err45];
7108
8089
  } else {
7109
- vErrors.push(err40);
8090
+ vErrors.push(err45);
7110
8091
  }
7111
8092
  errors++;
7112
8093
  }
7113
8094
  if (data.steps === void 0) {
7114
- const err41 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "steps" }, message: "must have required property 'steps'" };
8095
+ const err46 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "steps" }, message: "must have required property 'steps'" };
7115
8096
  if (vErrors === null) {
7116
- vErrors = [err41];
8097
+ vErrors = [err46];
7117
8098
  } else {
7118
- vErrors.push(err41);
8099
+ vErrors.push(err46);
7119
8100
  }
7120
8101
  errors++;
7121
8102
  }
7122
8103
  for (const key0 in data) {
7123
8104
  if (!func2.call(schema11.properties, key0)) {
7124
- const err42 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
8105
+ const err47 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
7125
8106
  if (vErrors === null) {
7126
- vErrors = [err42];
8107
+ vErrors = [err47];
7127
8108
  } else {
7128
- vErrors.push(err42);
8109
+ vErrors.push(err47);
7129
8110
  }
7130
8111
  errors++;
7131
8112
  }
7132
8113
  }
7133
8114
  if (data.version !== void 0) {
7134
- let data37 = data.version;
7135
- if (!(typeof data37 == "number" && (!(data37 % 1) && !isNaN(data37)) && isFinite(data37))) {
7136
- const err43 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
8115
+ let data40 = data.version;
8116
+ if (!(typeof data40 == "number" && (!(data40 % 1) && !isNaN(data40)) && isFinite(data40))) {
8117
+ const err48 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
7137
8118
  if (vErrors === null) {
7138
- vErrors = [err43];
8119
+ vErrors = [err48];
7139
8120
  } else {
7140
- vErrors.push(err43);
8121
+ vErrors.push(err48);
7141
8122
  }
7142
8123
  errors++;
7143
8124
  }
7144
- if (typeof data37 == "number" && isFinite(data37)) {
7145
- if (data37 < 1 || isNaN(data37)) {
7146
- const err44 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
8125
+ if (typeof data40 == "number" && isFinite(data40)) {
8126
+ if (data40 < 1 || isNaN(data40)) {
8127
+ const err49 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
7147
8128
  if (vErrors === null) {
7148
- vErrors = [err44];
8129
+ vErrors = [err49];
7149
8130
  } else {
7150
- vErrors.push(err44);
8131
+ vErrors.push(err49);
7151
8132
  }
7152
8133
  errors++;
7153
8134
  }
7154
8135
  }
7155
8136
  }
7156
8137
  if (data.kind !== void 0) {
7157
- let data38 = data.kind;
7158
- if (!(data38 === "sequence" || data38 === "architecture" || data38 === "state" || data38 === "git" || data38 === "time")) {
7159
- const err45 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema11.properties.kind.enum }, message: "must be equal to one of the allowed values" };
8138
+ let data41 = data.kind;
8139
+ if (!(data41 === "sequence" || data41 === "architecture" || data41 === "state" || data41 === "git" || data41 === "time" || data41 === "tree")) {
8140
+ const err50 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema11.properties.kind.enum }, message: "must be equal to one of the allowed values" };
7160
8141
  if (vErrors === null) {
7161
- vErrors = [err45];
8142
+ vErrors = [err50];
7162
8143
  } else {
7163
- vErrors.push(err45);
8144
+ vErrors.push(err50);
7164
8145
  }
7165
8146
  errors++;
7166
8147
  }
7167
8148
  }
7168
8149
  if (data.title !== void 0) {
7169
- let data39 = data.title;
7170
- if (typeof data39 === "string") {
7171
- if (func3(data39) < 1) {
7172
- const err46 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
8150
+ let data42 = data.title;
8151
+ if (typeof data42 === "string") {
8152
+ if (func3(data42) < 1) {
8153
+ const err51 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
7173
8154
  if (vErrors === null) {
7174
- vErrors = [err46];
8155
+ vErrors = [err51];
7175
8156
  } else {
7176
- vErrors.push(err46);
8157
+ vErrors.push(err51);
7177
8158
  }
7178
8159
  errors++;
7179
8160
  }
7180
8161
  } else {
7181
- const err47 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
8162
+ const err52 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7182
8163
  if (vErrors === null) {
7183
- vErrors = [err47];
8164
+ vErrors = [err52];
7184
8165
  } else {
7185
- vErrors.push(err47);
8166
+ vErrors.push(err52);
7186
8167
  }
7187
8168
  errors++;
7188
8169
  }
7189
8170
  }
7190
8171
  if (data.view !== void 0) {
7191
- let data40 = data.view;
7192
- if (!(data40 === "fixed" || data40 === "follow")) {
7193
- const err48 = { instancePath: instancePath + "/view", schemaPath: "#/properties/view/enum", keyword: "enum", params: { allowedValues: schema11.properties.view.enum }, message: "must be equal to one of the allowed values" };
8172
+ let data43 = data.view;
8173
+ if (!(data43 === "fixed" || data43 === "follow")) {
8174
+ const err53 = { instancePath: instancePath + "/view", schemaPath: "#/properties/view/enum", keyword: "enum", params: { allowedValues: schema11.properties.view.enum }, message: "must be equal to one of the allowed values" };
7194
8175
  if (vErrors === null) {
7195
- vErrors = [err48];
8176
+ vErrors = [err53];
7196
8177
  } else {
7197
- vErrors.push(err48);
8178
+ vErrors.push(err53);
7198
8179
  }
7199
8180
  errors++;
7200
8181
  }
7201
8182
  }
7202
8183
  if (data.regions !== void 0) {
7203
- let data41 = data.regions;
7204
- if (Array.isArray(data41)) {
7205
- const len3 = data41.length;
7206
- for (let i3 = 0; i3 < len3; i3++) {
7207
- if (!validate22(data41[i3], { instancePath: instancePath + "/regions/" + i3, parentData: data41, parentDataProperty: i3, rootData })) {
7208
- vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
8184
+ let data44 = data.regions;
8185
+ if (Array.isArray(data44)) {
8186
+ const len1 = data44.length;
8187
+ for (let i1 = 0; i1 < len1; i1++) {
8188
+ if (!validate27(data44[i1], { instancePath: instancePath + "/regions/" + i1, parentData: data44, parentDataProperty: i1, rootData })) {
8189
+ vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
7209
8190
  errors = vErrors.length;
7210
8191
  }
7211
8192
  }
7212
8193
  } else {
7213
- const err49 = { instancePath: instancePath + "/regions", schemaPath: "#/properties/regions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
8194
+ const err54 = { instancePath: instancePath + "/regions", schemaPath: "#/properties/regions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7214
8195
  if (vErrors === null) {
7215
- vErrors = [err49];
8196
+ vErrors = [err54];
7216
8197
  } else {
7217
- vErrors.push(err49);
8198
+ vErrors.push(err54);
7218
8199
  }
7219
8200
  errors++;
7220
8201
  }
7221
8202
  }
7222
8203
  if (data.boxes !== void 0) {
7223
- let data43 = data.boxes;
7224
- if (Array.isArray(data43)) {
7225
- const len4 = data43.length;
7226
- for (let i4 = 0; i4 < len4; i4++) {
7227
- if (!validate24(data43[i4], { instancePath: instancePath + "/boxes/" + i4, parentData: data43, parentDataProperty: i4, rootData })) {
7228
- vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);
8204
+ let data46 = data.boxes;
8205
+ if (Array.isArray(data46)) {
8206
+ const len2 = data46.length;
8207
+ for (let i2 = 0; i2 < len2; i2++) {
8208
+ if (!validate29(data46[i2], { instancePath: instancePath + "/boxes/" + i2, parentData: data46, parentDataProperty: i2, rootData })) {
8209
+ vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);
7229
8210
  errors = vErrors.length;
7230
8211
  }
7231
8212
  }
7232
8213
  } else {
7233
- const err50 = { instancePath: instancePath + "/boxes", schemaPath: "#/properties/boxes/type", keyword: "type", params: { type: "array" }, message: "must be array" };
8214
+ const err55 = { instancePath: instancePath + "/boxes", schemaPath: "#/properties/boxes/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7234
8215
  if (vErrors === null) {
7235
- vErrors = [err50];
8216
+ vErrors = [err55];
7236
8217
  } else {
7237
- vErrors.push(err50);
8218
+ vErrors.push(err55);
7238
8219
  }
7239
8220
  errors++;
7240
8221
  }
7241
8222
  }
7242
8223
  if (data.strip !== void 0) {
7243
- if (!validate26(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
7244
- vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);
8224
+ if (!validate31(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
8225
+ vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
7245
8226
  errors = vErrors.length;
7246
8227
  }
7247
8228
  }
7248
8229
  if (data.steps !== void 0) {
7249
- let data46 = data.steps;
7250
- if (Array.isArray(data46)) {
7251
- if (data46.length < 1) {
7252
- const err51 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
8230
+ let data49 = data.steps;
8231
+ if (Array.isArray(data49)) {
8232
+ if (data49.length < 1) {
8233
+ const err56 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
7253
8234
  if (vErrors === null) {
7254
- vErrors = [err51];
8235
+ vErrors = [err56];
7255
8236
  } else {
7256
- vErrors.push(err51);
8237
+ vErrors.push(err56);
7257
8238
  }
7258
8239
  errors++;
7259
8240
  }
7260
- const len5 = data46.length;
7261
- for (let i5 = 0; i5 < len5; i5++) {
7262
- if (!validate30(data46[i5], { instancePath: instancePath + "/steps/" + i5, parentData: data46, parentDataProperty: i5, rootData })) {
7263
- vErrors = vErrors === null ? validate30.errors : vErrors.concat(validate30.errors);
8241
+ const len3 = data49.length;
8242
+ for (let i3 = 0; i3 < len3; i3++) {
8243
+ if (!validate35(data49[i3], { instancePath: instancePath + "/steps/" + i3, parentData: data49, parentDataProperty: i3, rootData })) {
8244
+ vErrors = vErrors === null ? validate35.errors : vErrors.concat(validate35.errors);
7264
8245
  errors = vErrors.length;
7265
8246
  }
7266
8247
  }
7267
8248
  } else {
7268
- const err52 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/type", keyword: "type", params: { type: "array" }, message: "must be array" };
8249
+ const err57 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7269
8250
  if (vErrors === null) {
7270
- vErrors = [err52];
8251
+ vErrors = [err57];
7271
8252
  } else {
7272
- vErrors.push(err52);
8253
+ vErrors.push(err57);
7273
8254
  }
7274
8255
  errors++;
7275
8256
  }
7276
8257
  }
7277
8258
  if (data.sequence !== void 0) {
7278
- if (!validate38(data.sequence, { instancePath: instancePath + "/sequence", parentData: data, parentDataProperty: "sequence", rootData })) {
7279
- vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);
8259
+ if (!validate43(data.sequence, { instancePath: instancePath + "/sequence", parentData: data, parentDataProperty: "sequence", rootData })) {
8260
+ vErrors = vErrors === null ? validate43.errors : vErrors.concat(validate43.errors);
7280
8261
  errors = vErrors.length;
7281
8262
  }
7282
8263
  }
7283
8264
  if (data.state !== void 0) {
7284
- if (!validate40(data.state, { instancePath: instancePath + "/state", parentData: data, parentDataProperty: "state", rootData })) {
7285
- vErrors = vErrors === null ? validate40.errors : vErrors.concat(validate40.errors);
8265
+ if (!validate45(data.state, { instancePath: instancePath + "/state", parentData: data, parentDataProperty: "state", rootData })) {
8266
+ vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);
7286
8267
  errors = vErrors.length;
7287
8268
  }
7288
8269
  }
7289
8270
  if (data.git !== void 0) {
7290
- if (!validate44(data.git, { instancePath: instancePath + "/git", parentData: data, parentDataProperty: "git", rootData })) {
7291
- vErrors = vErrors === null ? validate44.errors : vErrors.concat(validate44.errors);
8271
+ if (!validate49(data.git, { instancePath: instancePath + "/git", parentData: data, parentDataProperty: "git", rootData })) {
8272
+ vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);
7292
8273
  errors = vErrors.length;
7293
8274
  }
7294
8275
  }
7295
8276
  if (data.time !== void 0) {
7296
- if (!validate48(data.time, { instancePath: instancePath + "/time", parentData: data, parentDataProperty: "time", rootData })) {
7297
- vErrors = vErrors === null ? validate48.errors : vErrors.concat(validate48.errors);
8277
+ if (!validate53(data.time, { instancePath: instancePath + "/time", parentData: data, parentDataProperty: "time", rootData })) {
8278
+ vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
7298
8279
  errors = vErrors.length;
7299
8280
  }
7300
8281
  }
7301
8282
  } else {
7302
- const err53 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
8283
+ const err58 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7303
8284
  if (vErrors === null) {
7304
- vErrors = [err53];
8285
+ vErrors = [err58];
7305
8286
  } else {
7306
- vErrors.push(err53);
8287
+ vErrors.push(err58);
7307
8288
  }
7308
8289
  errors++;
7309
8290
  }
@@ -7312,7 +8293,7 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
7312
8293
  }
7313
8294
 
7314
8295
  // src/schema.ts
7315
- var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span"];
8296
+ var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node"];
7316
8297
  var ABSENT = "#/definitions/absent/not";
7317
8298
  var ABSENT_KINDS = { regions: "sequence / architecture / state", at: "time", into: "time", color: "time", meters: "time" };
7318
8299
  var NOT_ALLOWED = {
@@ -7323,6 +8304,8 @@ var GIT_EVENT = /\/events\/items\/properties\/type\/not$/u;
7323
8304
  var GIT_EVENTS = ["commit", "branch"];
7324
8305
  var TIME_EVENT = /\/events\/items\/not$/u;
7325
8306
  var TIME_EVENTS = ["now", "mark", "span"];
8307
+ var TREE_EVENT = /\/events\/items\/allOf\/0\/not$/u;
8308
+ var TREE_EVENTS = ["leaf", "node"];
7326
8309
  var DURATION = /^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u;
7327
8310
  var RATIO = /%\)\$$/u;
7328
8311
  var escape = (key) => key.replaceAll("~", "~0").replaceAll("/", "~1");
@@ -7353,6 +8336,7 @@ function toFieldError(error, errors, m) {
7353
8336
  if (RESERVED_ID.test(error.schemaPath)) return { pointer: at2, message: m.reserved(STATE_ENDS) };
7354
8337
  if (GIT_EVENT.test(error.schemaPath)) return { pointer: at2, message: m.kindOnly(GIT_EVENTS, "git") };
7355
8338
  if (TIME_EVENT.test(error.schemaPath)) return { pointer: `${at2}/type`, message: m.kindOnly(TIME_EVENTS, "time") };
8339
+ if (TREE_EVENT.test(error.schemaPath)) return { pointer: `${at2}/type`, message: m.kindOnly(TREE_EVENTS, "tree") };
7356
8340
  const last = at2.slice(at2.lastIndexOf("/") + 1);
7357
8341
  if (error.schemaPath === ABSENT) return { pointer: at2, message: m.not({ field: last, kind: ABSENT_KINDS[last] ?? last }) };
7358
8342
  const allowed = NOT_ALLOWED[last];
@@ -7464,7 +8448,7 @@ function plan(step, needle) {
7464
8448
  return;
7465
8449
  }
7466
8450
  if (event.type === "now" || needle && pulled(event)) return;
7467
- if (event.type === "commit" || event.type === "branch") {
8451
+ if (event.type === "commit" || event.type === "branch" || event.type === "leaf" || event.type === "node") {
7468
8452
  const a = cursor;
7469
8453
  const b = a + MOTION.draw;
7470
8454
  out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });
@@ -7690,6 +8674,7 @@ var ICONS = {
7690
8674
  layers: "M 0 -8 l9 4.5 l-9 4.5 l-9 -4.5 z M -9 2.5 l9 4.5 l9 -4.5",
7691
8675
  code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
7692
8676
  paint: "M -8 8 c 0 -3 2 -5 4.5 -5 l 9 -9 l 3.5 3.5 l -9 9 c 0 2.5 -2 4.5 -5 4.5 z",
8677
+ tree: "M 0 -5 v4 M -6 -1 h12 M -6 -1 v3 M 6 -1 v3 M -9 2 h6 v6 h-6 z M 3 2 h6 v6 h-6 z M -3 -10 h6 v5 h-6 z",
7693
8678
  block: "M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2.5 h22 M -6 2.5 h8"
7694
8679
  };
7695
8680
 
@@ -7935,12 +8920,12 @@ var easeInOut = (t) => t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
7935
8920
  function carrier(e, time, ctx) {
7936
8921
  const { m } = ctx;
7937
8922
  const n = LOOK.carrier.samples;
7938
- const route = e.wait ? [e.wait, ...e.points] : e.points;
7939
- const length = pathLength(route);
8923
+ const route2 = e.wait ? [e.wait, ...e.points] : e.points;
8924
+ const length = pathLength(route2);
7940
8925
  const { depart: a, arrive: b, start: from, end: gone } = time;
7941
8926
  const path2 = [];
7942
8927
  for (let k = 0; k <= n; k++) {
7943
- const [x, y] = along(route, easeInOut(k / n) * length);
8928
+ const [x, y] = along(route2, easeInOut(k / n) * length);
7944
8929
  path2.push([a + (b - a) * k / n, x, y]);
7945
8930
  }
7946
8931
  const first = path2[0];
@@ -8417,6 +9402,128 @@ function timeFocus(layout, timeline, step, parts, vw, vh) {
8417
9402
  return held;
8418
9403
  }
8419
9404
 
9405
+ // src/render/tree.ts
9406
+ var r14 = (v) => Math.round(v * 100) / 100;
9407
+ function drawTree(layout, diagram, timeline, ctx) {
9408
+ const { m } = ctx;
9409
+ const T = LOOK.tree;
9410
+ const B = LOOK.box;
9411
+ const timeOf = (step, event) => timeline.edges.find((t) => t.step === step && t.event === event);
9412
+ const active = /* @__PURE__ */ new Map();
9413
+ const touched = /* @__PURE__ */ new Map();
9414
+ diagram.steps.forEach((step, s) => {
9415
+ for (const e of step.events) {
9416
+ if (e.type !== "edge") continue;
9417
+ for (const id of [e.from, e.to]) {
9418
+ active.set(id, (active.get(id) ?? /* @__PURE__ */ new Set()).add(s));
9419
+ if (e.carry.kind !== "none" && !touched.has(id)) touched.set(id, s);
9420
+ }
9421
+ }
9422
+ });
9423
+ const carries = (step, event) => {
9424
+ const e = diagram.steps[step]?.events[event];
9425
+ return e?.type === "edge" && e.carry.kind !== "none";
9426
+ };
9427
+ const fadeStep = layout.runs.filter((run) => carries(run.step, run.event)).reduce((s, run) => s === void 0 ? run.step : Math.min(s, run.step), void 0);
9428
+ const fadeAt = fadeStep === void 0 ? void 0 : timeline.steps[fadeStep]?.start;
9429
+ const fadeOf = (id) => {
9430
+ if (fadeStep === void 0 || fadeAt === void 0) return void 0;
9431
+ const t = touched.get(id);
9432
+ if (t !== void 0 && t <= fadeStep) return void 0;
9433
+ const back = t === void 0 ? void 0 : timeline.steps[t]?.start;
9434
+ const frames = [
9435
+ [0, { opacity: 1 }],
9436
+ [fadeAt, { opacity: 1 }, EASE.inOut],
9437
+ [fadeAt + MOTION.fade, { opacity: T.faint }]
9438
+ ];
9439
+ if (back !== void 0) frames.push([back, { opacity: T.faint }, EASE.inOut], [back + MOTION.fade, { opacity: 1 }]);
9440
+ frames.push([m.last, { opacity: back === void 0 ? T.faint : 1 }, EASE.inOut], [m.total, { opacity: 1 }]);
9441
+ return m.kf(frames);
9442
+ };
9443
+ const faded = (id, markup, attrs = "") => {
9444
+ const fade = fadeOf(id);
9445
+ return fade ? `<g class="dg-a"${attrs} style="${fade}">${markup}</g>` : attrs === "" ? markup : `<g${attrs}>${markup}</g>`;
9446
+ };
9447
+ const drawnAt = new Map(layout.nodes.map((n) => [n.id, timeOf(n.step, n.event)?.drawn ?? 0]));
9448
+ const links = layout.links.map((l) => {
9449
+ const time = timeOf(l.step, l.event);
9450
+ if (!time) return "";
9451
+ ctx.traces.push({ from: l.from, to: l.to, points: l.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
9452
+ const kf = m.kf([
9453
+ [0, { opacity: 0, "stroke-dashoffset": 1 }],
9454
+ [time.start, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
9455
+ [time.start + 0.05, { opacity: 1 }],
9456
+ [time.drawn, { "stroke-dashoffset": 0 }],
9457
+ [m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
9458
+ [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
9459
+ ]);
9460
+ return faded(l.from, `<path class="dg-tree-l dg-a" data-tree-link="${esc(l.from)}" pathLength="1" d="${pathOf(l.points)}" style="${kf}"/>`);
9461
+ }).join("");
9462
+ const ties = layout.nodes.flatMap((n) => {
9463
+ if (!n.card) return [];
9464
+ const at2 = drawnAt.get(n.id) ?? 0;
9465
+ const d = `M ${r14(n.cx)} ${r14(n.y + n.h + LOOK.edge.inset)} V ${r14(n.card.y - LOOK.edge.inset)}`;
9466
+ return [faded(n.id, `<path class="dg-tree-con dg-a" d="${d}" style="${m.vis(at2)}"/>`)];
9467
+ }).join("");
9468
+ const traced = /* @__PURE__ */ new Set();
9469
+ const trails = layout.runs.flatMap((run) => {
9470
+ const e = layout.edges.find((x) => x.step === run.step && x.event === run.event);
9471
+ if (!e || traced.has(run.link)) return [];
9472
+ const carried = timeline.carriers.find((c) => c.step === run.step && c.event === run.event);
9473
+ const time = timeOf(run.step, run.event);
9474
+ const a = carried?.depart ?? time?.start;
9475
+ const b = carried?.arrive ?? time?.drawn;
9476
+ if (a === void 0 || b === void 0) return [];
9477
+ traced.add(run.link);
9478
+ const kf = m.kf([
9479
+ [0, { opacity: 0, "stroke-dashoffset": 1 }],
9480
+ [a, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
9481
+ [a + 0.05, { opacity: 1 }],
9482
+ [b, { "stroke-dashoffset": 0 }],
9483
+ [m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
9484
+ [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
9485
+ ]);
9486
+ const d = pathOf(e.points);
9487
+ return [
9488
+ `<g style="${cs(e.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${esc(run.link)}" pathLength="1" d="${d}" style="${kf}"/><path class="dg-tree-h dg-a" d="${arrowHead(e.points)}" style="${m.vis(b)}"/></g>`
9489
+ ];
9490
+ }).join("");
9491
+ const cards = layout.nodes.flatMap((n) => {
9492
+ const c = n.card;
9493
+ if (!c) return [];
9494
+ const gx = c.x + T.card.padX + T.card.icon / 2;
9495
+ const cy = c.y + c.h / 2;
9496
+ const text2 = write(ctx.ink, "dg-tree-ct", c.x + T.card.padX + T.card.icon + T.card.gap, cy + LOOK.baseline.label, c.text, TYPE.treeCard, ALWAYS);
9497
+ return [
9498
+ faded(
9499
+ n.id,
9500
+ `<rect class="dg-tree-card" x="${r14(c.x)}" y="${r14(c.y)}" width="${r14(c.w)}" height="${c.h}" rx="${T.card.radius}"/>${glyph("doc", gx, cy, T.card.glyph, "dg-tree-cg")}${text2}`,
9501
+ ` data-tree-card="${esc(n.id)}"`
9502
+ )
9503
+ ];
9504
+ }).join("");
9505
+ const nodes = layout.nodes.map((n) => {
9506
+ const at2 = drawnAt.get(n.id) ?? 0;
9507
+ const on = [...active.get(n.id) ?? []].sort((x, y) => x - y);
9508
+ const act = on.length > 0 ? activeKf(ctx, on) : void 0;
9509
+ const radius = n.root ? T.root.radius : T.radius;
9510
+ const rect = (cls, extra = "") => `<rect class="${cls}" x="${r14(n.x)}" y="${r14(n.y)}" width="${r14(n.w)}" height="${n.h}" rx="${radius}"${extra}/>`;
9511
+ const frame = `${act ? `<g class="dg-a" style="${act}">${rect("dg-halo")}</g>` : ""}${rect("dg-st", ` ${ctx.sh}`)}${act ? `<g class="dg-a" style="${act}">${rect("dg-on")}</g>` : ""}`;
9512
+ const ix = n.x + T.root.iconX + B.icon / 2;
9513
+ const mark = n.root ? `<rect class="dg-ic" x="${r14(ix - B.icon / 2)}" y="${r14(n.cy - B.icon / 2)}" width="${B.icon}" height="${B.icon}" rx="${B.iconRadius}"/>${glyph("tree", ix, n.cy, B.iconScale)}` : "";
9514
+ const shown = [[at2, Number.POSITIVE_INFINITY]];
9515
+ const texts = n.lines.map((line, k) => {
9516
+ const style = n.styles[k] ?? TYPE.boxName;
9517
+ const cls = style === TYPE.treeHash ? "dg-tree-hash" : style === TYPE.treeName ? "dg-tree-name" : style === TYPE.rootHash ? "dg-tree-rh" : style === TYPE.rootName ? "dg-tree-rn" : "dg-tree-one";
9518
+ const baseline = n.baselines[k] ?? n.cy;
9519
+ return n.root ? write(ctx.ink, cls, n.x + T.root.textX, baseline, line, style, shown) : write(ctx.ink, cls, n.cx, baseline, line, style, shown, "middle");
9520
+ }).join("");
9521
+ const inner = faded(n.id, `${frame}${mark}${texts}`, ` data-tree-node="${esc(n.id)}"${n.root ? ` data-tree-root="${esc(n.id)}"` : ""}`);
9522
+ return `<g class="dg-popc dg-a" style="${cs(n.color)};${m.pop(at2)}">${inner}</g>`;
9523
+ }).join("");
9524
+ return { links: links + ties, trails, nodes: cards + nodes };
9525
+ }
9526
+
8420
9527
  // src/render/motion.ts
8421
9528
  var r2 = (v) => Math.round(v * 100) / 100;
8422
9529
  var Motion = class {
@@ -8468,8 +9575,8 @@ var Motion = class {
8468
9575
  ]);
8469
9576
  }
8470
9577
  /** 少し下から浮いて出る。 */
8471
- rise(a, b = this.last, within = false) {
8472
- return this.vis(a, b, { on: { transform: "translateY(0)" }, off: { transform: `translateY(${LOOK.rise}px)` }, within });
9578
+ rise(a, b = this.last, within2 = false) {
9579
+ return this.vis(a, b, { on: { transform: "translateY(0)" }, off: { transform: `translateY(${LOOK.rise}px)` }, within: within2 });
8473
9580
  }
8474
9581
  /** 小さな所から弾んで出る。 */
8475
9582
  pop(a, b = this.last) {
@@ -8595,6 +9702,19 @@ var PART_CSS = [
8595
9702
  `.dg-git-n{${font(TYPE.gitNote)};fill:var(--ink2)}`,
8596
9703
  `.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${S.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,
8597
9704
  `.dg-git-oldl{${font(TYPE.gitId)};fill:var(--ct);opacity:.55}`,
9705
+ // 木の図 (#3233)。木の線は線の灰で、運ぶ物が通った跡は運ぶ物の色で引く
9706
+ `.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${S.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
9707
+ `.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
9708
+ `.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,
9709
+ `.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${S.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,
9710
+ `.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${S.hair}}`,
9711
+ `.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,
9712
+ `.dg-tree-ct{${font(TYPE.treeCard)};fill:var(--ink)}`,
9713
+ `.dg-tree-hash{${font(TYPE.treeHash)};fill:var(--ink)}`,
9714
+ `.dg-tree-name{${font(TYPE.treeName)};fill:var(--mute)}`,
9715
+ `.dg-tree-one{${font(TYPE.boxName)};fill:var(--ink)}`,
9716
+ `.dg-tree-rh{${font(TYPE.rootHash)};fill:var(--ink)}`,
9717
+ `.dg-tree-rn{${font(TYPE.rootName)};fill:var(--mute)}`,
8598
9718
  // 時間軸の図 (#3165)。和文を含む字は、末尾に j を付けた class で同じ大きさと太さの和文の字にする
8599
9719
  `.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${X.timeShade}%,transparent)}`,
8600
9720
  `.dg-tm-sep{stroke:var(--hair);stroke-width:${S.hair};stroke-dasharray:2 4}`,
@@ -8756,6 +9876,14 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
8756
9876
  L.node.push(git.commits);
8757
9877
  L.top.push(git.tags);
8758
9878
  }
9879
+ const treeLayout = isTreeLayout(layout) ? layout : void 0;
9880
+ if (treeLayout) {
9881
+ const tree = drawTree(treeLayout, diagram, timeline, ctx);
9882
+ L.base.push(tree.links);
9883
+ L.lit.push(tree.trails);
9884
+ L.node.push(tree.nodes);
9885
+ }
9886
+ const runs = new Set((treeLayout?.runs ?? []).map((r) => `${r.step}/${r.event}`));
8759
9887
  const timeLayout = isTimeLayout(layout) ? layout : void 0;
8760
9888
  if (timeLayout) {
8761
9889
  const drawn = drawTime(timeLayout, diagram, timeline, ctx, subs);
@@ -8767,7 +9895,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
8767
9895
  const wired = new Set((timeLayout?.wires ?? []).map((w) => `${w.step}/${w.event}`));
8768
9896
  for (const e of layout.edges) {
8769
9897
  const time = timeline.edges.find((t) => t.step === e.step && t.event === e.event);
8770
- if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`)) continue;
9898
+ if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`) || runs.has(`${e.step}/${e.event}`)) continue;
8771
9899
  const drawn = edge(e, time, ctx, isState);
8772
9900
  L.base.push(drawn.base);
8773
9901
  L.lit.push(drawn.lit);
@@ -8798,7 +9926,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
8798
9926
  }
8799
9927
  for (const time of timeline.carriers) {
8800
9928
  const e = layout.edges.find((x) => x.step === time.step && x.event === time.event);
8801
- if (e) L.top.push(carrier(e, time, ctx));
9929
+ if (e) L.top.push(carrier(e, treeLayout ? { ...time, start: time.depart, end: time.arrive + MOTION.fade } : time, ctx));
8802
9930
  }
8803
9931
  const content = Object.values(L).map((parts) => parts.join("")).join("");
8804
9932
  const { near, far, nearY, farY } = LOOK.shadow;
@@ -8836,6 +9964,15 @@ function focusParts(layout, diagram, step) {
8836
9964
  rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
8837
9965
  }
8838
9966
  rects.push(...layout.labels.filter((l) => l.step === step), ...layout.actions.filter((a) => a.step === step));
9967
+ if (isTreeLayout(layout)) {
9968
+ const ends = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => e.type === "edge" ? [e.from, e.to] : []));
9969
+ rects.push(...layout.nodes.filter((n) => n.step === step || ends.has(n.id)));
9970
+ for (const l of layout.links.filter((x) => x.step === step)) {
9971
+ const xs = l.points.map((p) => p[0]);
9972
+ const ys = l.points.map((p) => p[1]);
9973
+ rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
9974
+ }
9975
+ }
8839
9976
  for (const event of diagram.steps[step]?.events ?? []) {
8840
9977
  const ids = event.type === "edge" ? [event.from, event.to] : event.type === "action" || event.type === "swap" ? [event.box] : [];
8841
9978
  for (const id of ids) {
@@ -8908,7 +10045,8 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
8908
10045
  const overview = () => {
8909
10046
  const shapes = [
8910
10047
  ...layout.regions.map((r3) => `<rect class="dg-mm-band" style="${cs(r3.color)}" x="${mx + r3.x * k}" y="${my + r3.y * k}" width="${r3.w * k}" height="${r3.h * k}" rx="3"/>`),
8911
- ...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${cs(b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`)
10048
+ ...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${cs(b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`),
10049
+ ...(isTreeLayout(layout) ? layout.nodes : []).map((n) => `<rect class="dg-mm-card" style="${cs(n.color)}" x="${mx + n.x * k}" y="${my + n.y * k}" width="${n.w * k}" height="${n.h * k}" rx="1.5"/>`)
8912
10050
  ].join("");
8913
10051
  const vp = m.move(cam.map(([t, cx, cy, , e]) => [t, mx + (cx - vw / 2) * k, my + (cy - vh / 2) * k, 1, e]));
8914
10052
  return {
@@ -8934,7 +10072,7 @@ function renderDiagram(input, options = {}) {
8934
10072
  const read = readDiagram(input, { lang });
8935
10073
  if (!read.ok) throw new Error(FIGURE_TEXT[lang].cannotDraw(read.errors.map((e) => `${e.pointer} ${e.message}`).join(" / ")));
8936
10074
  const diagram = read.diagram;
8937
- const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? layoutState(diagram, lang) : diagram.kind === "git" ? layoutGit(diagram) : diagram.kind === "time" ? layoutTime(diagram, lang) : layoutArchitecture(diagram);
10075
+ const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? layoutState(diagram, lang) : diagram.kind === "git" ? layoutGit(diagram) : diagram.kind === "time" ? layoutTime(diagram, lang) : diagram.kind === "tree" ? layoutTree(diagram) : layoutArchitecture(diagram);
8938
10076
  return renderLayout(diagram, layout, buildTimeline(diagram, options.still === true), options);
8939
10077
  }
8940
10078
  function renderLayout(diagram, layout, timeline, options = {}) {
@@ -9016,11 +10154,11 @@ async function stage(browser, svg, fontCss, body, lang) {
9016
10154
  const page = await browser.newPage({ viewport: { width, height }, deviceScaleFactor: SCALE });
9017
10155
  const paused = svg.replace(/^<svg\b/, '<svg style="--play:paused;--at:0"');
9018
10156
  const html = `<!doctype html><html><head><meta charset="utf-8"><style>${fontCss}html,body{margin:0}body{${body}}svg{display:block}</style><script type="module">import * as mb from "/mediabunny.js";import * as gif from "/gifenc.js";window.__tools={mb,gif};</script></head><body>${paused}</body></html>`;
9019
- await page.route("http://localhost/**", async (route) => {
9020
- const path2 = new URL(route.request().url()).pathname;
9021
- if (path2 === "/") return route.fulfill({ contentType: "text/html; charset=utf-8", body: html });
10157
+ await page.route("http://localhost/**", async (route2) => {
10158
+ const path2 = new URL(route2.request().url()).pathname;
10159
+ if (path2 === "/") return route2.fulfill({ contentType: "text/html; charset=utf-8", body: html });
9022
10160
  const script = SCRIPTS[path2];
9023
- return script ? route.fulfill({ contentType: "text/javascript", body: readFileSync(script) }) : route.fulfill({ status: 404 });
10161
+ return script ? route2.fulfill({ contentType: "text/javascript", body: readFileSync(script) }) : route2.fulfill({ status: 404 });
9024
10162
  });
9025
10163
  await page.goto("http://localhost/");
9026
10164
  await page.waitForFunction(() => "__tools" in window);
@@ -9195,6 +10333,10 @@ function ranges(list) {
9195
10333
  });
9196
10334
  }
9197
10335
  var hex = (code) => `U+${code.toString(16).toUpperCase()}`;
10336
+ function within(span, char) {
10337
+ const code = char.codePointAt(0) ?? -1;
10338
+ return span.some(([from, to]) => code >= from && code <= to);
10339
+ }
9198
10340
  var shapeless = (char) => /^[\s\p{Cf}\p{Cc}]$/u.test(char);
9199
10341
  function shapedIn(span) {
9200
10342
  for (const [from, to] of span) {
@@ -9213,12 +10355,9 @@ async function fontFaces(chars) {
9213
10355
  PACKAGES.flatMap(({ family, name }) => {
9214
10356
  const base = dirname(require_2.resolve(`@fontsource-variable/${name}/unicode.json`));
9215
10357
  const table = JSON.parse(readFileSync(join$1(base, "unicode.json"), "utf8"));
9216
- return Object.entries(table).map(async ([key, list]) => {
9217
- const span = ranges(list);
9218
- const own = chars.filter((char) => {
9219
- const code = char.codePointAt(0) ?? -1;
9220
- return span.some(([from, to]) => code >= from && code <= to);
9221
- });
10358
+ const spans = Object.entries(table).map(([key, list]) => ({ key, span: ranges(list) }));
10359
+ return spans.map(async ({ key, span }, index) => {
10360
+ const own = chars.filter((char) => within(span, char) && !spans.slice(index + 1).some((later) => within(later.span, char)));
9222
10361
  if (!own.length) return "";
9223
10362
  const filler = own.every(shapeless) ? shapedIn(span) ?? "" : "";
9224
10363
  const file = join$1(base, "files", `${name}-${key.replace(/[[\]]/g, "")}-wght-normal.woff2`);