@lostgradient/cinder 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/components.json +82 -4
  3. package/dist/components/access-gate/index.js +381 -239
  4. package/dist/components/chat/builders.d.ts +17 -8
  5. package/dist/components/chat/conversation-model.d.ts +1 -1
  6. package/dist/components/chat/index.d.ts +1 -1
  7. package/dist/components/chat/index.js +300 -17
  8. package/dist/components/chat/utilities/conversation.d.ts +6 -6
  9. package/dist/components/chat-conversation-header/index.js +19 -6
  10. package/dist/components/chat-conversation-list/index.js +19 -6
  11. package/dist/components/connection-indicator/connection-indicator.css +136 -0
  12. package/dist/components/connection-indicator/connection-indicator.css.d.ts +1 -0
  13. package/dist/components/connection-indicator/connection-indicator.schema.d.ts +3 -0
  14. package/dist/components/connection-indicator/connection-indicator.schema.js +89 -0
  15. package/dist/components/connection-indicator/connection-indicator.svelte.d.ts +21 -0
  16. package/dist/components/connection-indicator/connection-indicator.types.d.ts +46 -0
  17. package/dist/components/connection-indicator/connection-indicator.variables.d.ts +2 -0
  18. package/dist/components/connection-indicator/connection-indicator.variables.js +61 -0
  19. package/dist/components/connection-indicator/index.d.ts +5 -0
  20. package/dist/components/connection-indicator/index.js +409 -0
  21. package/dist/components/container/container.schema.js +4 -4
  22. package/dist/components/invocation-rule-builder/index.d.ts +1 -1
  23. package/dist/components/invocation-rule-builder/index.js +305 -150
  24. package/dist/components/invocation-rule-builder/invocation-rule-builder.css +28 -0
  25. package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.js +89 -5
  26. package/dist/components/invocation-rule-builder/invocation-rule-builder.svelte.d.ts +2 -1
  27. package/dist/components/invocation-rule-builder/invocation-rule-builder.types.d.ts +114 -16
  28. package/dist/components/run-step-timeline/index.d.ts +1 -1
  29. package/dist/components/run-step-timeline/index.js +992 -559
  30. package/dist/components/run-step-timeline/run-step-branch-disclosure.svelte.d.ts +17 -0
  31. package/dist/components/run-step-timeline/run-step-timeline.css +124 -0
  32. package/dist/components/run-step-timeline/run-step-timeline.schema.js +873 -350
  33. package/dist/components/run-step-timeline/run-step-timeline.svelte.d.ts +1 -15
  34. package/dist/components/run-step-timeline/run-step-timeline.types.d.ts +182 -5
  35. package/dist/components/run-step-timeline/run-step-timeline.utilities.d.ts +52 -0
  36. package/dist/components/schedule-builder/index.d.ts +5 -0
  37. package/dist/components/schedule-builder/index.js +3176 -0
  38. package/dist/components/schedule-builder/schedule-builder.css +121 -0
  39. package/dist/components/schedule-builder/schedule-builder.css.d.ts +1 -0
  40. package/dist/components/schedule-builder/schedule-builder.schema.d.ts +3 -0
  41. package/dist/components/schedule-builder/schedule-builder.schema.js +141 -0
  42. package/dist/components/schedule-builder/schedule-builder.svelte.d.ts +22 -0
  43. package/dist/components/schedule-builder/schedule-builder.types.d.ts +130 -0
  44. package/dist/components/schedule-builder/schedule-builder.utilities.d.ts +78 -0
  45. package/dist/components/schedule-builder/schedule-builder.variables.d.ts +2 -0
  46. package/dist/components/schedule-builder/schedule-builder.variables.js +61 -0
  47. package/dist/components/tag-input/index.js +22 -4
  48. package/dist/components/tag-input/tag-input.schema.js +5 -1
  49. package/dist/components/tag-input/tag-input.types.d.ts +4 -0
  50. package/dist/index.d.ts +6 -2
  51. package/dist/index.js +22704 -20574
  52. package/dist/server/components/access-gate/index.js +2 -1
  53. package/dist/server/components/chat/index.js +4 -4
  54. package/dist/server/components/chat-conversation-header/index.js +5 -5
  55. package/dist/server/components/chat-conversation-list/index.js +3 -3
  56. package/dist/server/components/connection-indicator/index.js +16 -0
  57. package/dist/server/components/data-table/index.js +3 -3
  58. package/dist/server/components/diff-viewer/index.js +4 -3
  59. package/dist/server/components/invocation-rule-builder/index.js +1 -1
  60. package/dist/server/components/json-schema-editor/index.js +4 -3
  61. package/dist/server/components/review-editor/index.js +4 -3
  62. package/dist/server/components/run-step-timeline/index.js +1 -1
  63. package/dist/server/components/schedule-builder/index.js +30 -0
  64. package/dist/server/components/side-navigation/index.js +2 -2
  65. package/dist/server/components/table/index.js +3 -3
  66. package/dist/server/components/tag-input/index.js +1 -1
  67. package/dist/server/components/time-field/index.js +5 -3
  68. package/dist/server/index.js +100 -87
  69. package/dist/server/index.server-0sx92swg.js +9 -0
  70. package/dist/server/{index.server-mzzb7dnm.js → index.server-2bbwajb2.js} +1 -1
  71. package/dist/server/{index.server-q7w4jw89.js → index.server-2s5h1d05.js} +2 -2
  72. package/dist/server/{index.server-dg83ke3k.js → index.server-2zdbz3rj.js} +1 -1
  73. package/dist/server/{index.server-0jhra85x.js → index.server-3w72dxz7.js} +4 -4
  74. package/dist/server/{index.server-qh9qzd5t.js → index.server-4x4hgvqe.js} +283 -13
  75. package/dist/server/{index.server-c6pe4kaf.js → index.server-5gzyqv78.js} +1 -1
  76. package/dist/server/{index.server-mqt1ngqw.js → index.server-6hnfzc7f.js} +19 -6
  77. package/dist/server/index.server-be9bpqeh.js +93 -0
  78. package/dist/server/{index.server-f3z7tpxr.js → index.server-c42b462p.js} +2 -4
  79. package/dist/server/{index.server-7vyzen5x.js → index.server-c5qv3p61.js} +171 -63
  80. package/dist/server/index.server-cch0eed5.js +144 -0
  81. package/dist/server/index.server-gmh5ar16.js +2 -0
  82. package/dist/server/{index.server-0atyznp7.js → index.server-h89zk5ev.js} +7 -7
  83. package/dist/server/{index.server-jxg42jpz.js → index.server-jdcq5zza.js} +7 -7
  84. package/dist/server/{index.server-2dga5yzr.js → index.server-jfrssta6.js} +1 -1
  85. package/dist/server/{index.server-fy068yne.js → index.server-jj76374p.js} +1 -1
  86. package/dist/server/index.server-qbkxz7r2.js +750 -0
  87. package/dist/server/{index.server-marjz8ps.js → index.server-tcay903b.js} +3 -2
  88. package/dist/server/index.server-z38bxms8.js +734 -0
  89. package/dist/server/{index.server-yz4k36cw.js → index.server-z7hxtqs1.js} +1 -1
  90. package/package.json +66 -3
  91. package/src/components/chat/builders.ts +445 -14
  92. package/src/components/chat/conversation-model.ts +1 -0
  93. package/src/components/chat/index.ts +1 -0
  94. package/src/components/chat/utilities/conversation.ts +33 -15
  95. package/src/components/connection-indicator/connection-indicator.css +136 -0
  96. package/src/components/connection-indicator/connection-indicator.examples.json +31 -0
  97. package/src/components/connection-indicator/connection-indicator.schema.json +29 -0
  98. package/src/components/connection-indicator/connection-indicator.schema.ts +36 -0
  99. package/src/components/connection-indicator/connection-indicator.svelte +63 -0
  100. package/src/components/connection-indicator/connection-indicator.types.ts +58 -0
  101. package/src/components/connection-indicator/connection-indicator.variables.json +1 -0
  102. package/src/components/connection-indicator/connection-indicator.variables.ts +3 -0
  103. package/src/components/connection-indicator/index.ts +10 -0
  104. package/src/components/container/container.schema.json +3 -3
  105. package/src/components/container/container.schema.ts +3 -3
  106. package/src/components/invocation-rule-builder/index.ts +4 -0
  107. package/src/components/invocation-rule-builder/invocation-rule-builder.css +28 -0
  108. package/src/components/invocation-rule-builder/invocation-rule-builder.examples.json +6 -0
  109. package/src/components/invocation-rule-builder/invocation-rule-builder.schema.json +76 -3
  110. package/src/components/invocation-rule-builder/invocation-rule-builder.schema.ts +83 -3
  111. package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +326 -113
  112. package/src/components/invocation-rule-builder/invocation-rule-builder.types.ts +157 -43
  113. package/src/components/run-step-timeline/index.ts +8 -0
  114. package/src/components/run-step-timeline/run-step-branch-disclosure.svelte +16 -0
  115. package/src/components/run-step-timeline/run-step-timeline.css +124 -0
  116. package/src/components/run-step-timeline/run-step-timeline.examples.json +18 -0
  117. package/src/components/run-step-timeline/run-step-timeline.schema.json +872 -349
  118. package/src/components/run-step-timeline/run-step-timeline.schema.ts +931 -349
  119. package/src/components/run-step-timeline/run-step-timeline.svelte +387 -268
  120. package/src/components/run-step-timeline/run-step-timeline.types.ts +192 -5
  121. package/src/components/run-step-timeline/run-step-timeline.utilities.ts +242 -0
  122. package/src/components/schedule-builder/index.ts +14 -0
  123. package/src/components/schedule-builder/schedule-builder.css +121 -0
  124. package/src/components/schedule-builder/schedule-builder.examples.json +31 -0
  125. package/src/components/schedule-builder/schedule-builder.schema.json +78 -0
  126. package/src/components/schedule-builder/schedule-builder.schema.ts +86 -0
  127. package/src/components/schedule-builder/schedule-builder.svelte +629 -0
  128. package/src/components/schedule-builder/schedule-builder.types.ts +137 -0
  129. package/src/components/schedule-builder/schedule-builder.utilities.ts +344 -0
  130. package/src/components/schedule-builder/schedule-builder.variables.json +1 -0
  131. package/src/components/schedule-builder/schedule-builder.variables.ts +3 -0
  132. package/src/components/tag-input/tag-input.schema.json +4 -0
  133. package/src/components/tag-input/tag-input.schema.ts +4 -0
  134. package/src/components/tag-input/tag-input.svelte +20 -3
  135. package/src/components/tag-input/tag-input.types.ts +4 -0
  136. package/src/index.ts +23 -0
  137. package/src/styles/components.css +2 -0
  138. package/dist/server/index.server-qk1h0n02.js +0 -393
@@ -0,0 +1,734 @@
1
+ import {
2
+ Progress
3
+ } from "./index.server-7g2pzksm.js";
4
+ import {
5
+ Link
6
+ } from "./index.server-2ta1a4ze.js";
7
+ import {
8
+ Status_dot
9
+ } from "./index.server-npxtkwjp.js";
10
+ import {
11
+ Collapsible
12
+ } from "./index.server-mvhf8b7g.js";
13
+ import {
14
+ Badge
15
+ } from "./index.server-thedzn9z.js";
16
+ import {
17
+ classNames
18
+ } from "./index.server-z7nvkz8v.js";
19
+
20
+ // src/components/run-step-timeline/run-step-timeline.svelte
21
+ import * as $2 from "svelte/internal/server";
22
+
23
+ // src/components/run-step-timeline/run-step-branch-disclosure.svelte
24
+ import * as $ from "svelte/internal/server";
25
+ function Run_step_branch_disclosure($$renderer, $$props) {
26
+ let {
27
+ initialOpen,
28
+ triggerAriaLabel,
29
+ class: className,
30
+ trigger,
31
+ children
32
+ } = $$props;
33
+ let open = initialOpen;
34
+ let $$settled = true;
35
+ let $$inner_renderer;
36
+ function $$render_inner($$renderer2) {
37
+ Collapsible($$renderer2, {
38
+ trigger,
39
+ triggerAriaLabel,
40
+ class: className,
41
+ get open() {
42
+ return open;
43
+ },
44
+ set open($$value) {
45
+ open = $$value;
46
+ $$settled = false;
47
+ },
48
+ children: ($$renderer3) => {
49
+ children($$renderer3);
50
+ $$renderer3.push(`<!---->`);
51
+ },
52
+ $$slots: { default: true }
53
+ });
54
+ }
55
+ do {
56
+ $$settled = true;
57
+ $$inner_renderer = $$renderer.copy();
58
+ $$render_inner($$inner_renderer);
59
+ } while (!$$settled);
60
+ $$renderer.subsume($$inner_renderer);
61
+ }
62
+
63
+ // src/components/run-step-timeline/run-step-timeline.utilities.ts
64
+ function statusDotStatus(status) {
65
+ switch (status) {
66
+ case "succeeded":
67
+ return "success";
68
+ case "failed":
69
+ return "danger";
70
+ case "running":
71
+ return "online";
72
+ case "retrying":
73
+ return "warning";
74
+ case "waiting_approval":
75
+ return "accent";
76
+ case "cancelled":
77
+ return "offline";
78
+ case "skipped":
79
+ return "neutral";
80
+ case "pending":
81
+ return "pending";
82
+ }
83
+ }
84
+ function statusLabel(status) {
85
+ switch (status) {
86
+ case "pending":
87
+ return "Pending";
88
+ case "running":
89
+ return "Running";
90
+ case "succeeded":
91
+ return "Succeeded";
92
+ case "failed":
93
+ return "Failed";
94
+ case "cancelled":
95
+ return "Cancelled";
96
+ case "skipped":
97
+ return "Skipped";
98
+ case "retrying":
99
+ return "Retrying";
100
+ case "waiting_approval":
101
+ return "Waiting approval";
102
+ }
103
+ }
104
+ function badgeVariant(status) {
105
+ switch (status) {
106
+ case "succeeded":
107
+ return "success";
108
+ case "failed":
109
+ return "danger";
110
+ case "running":
111
+ return "info";
112
+ case "retrying":
113
+ return "warning";
114
+ case "waiting_approval":
115
+ return "accent";
116
+ case "cancelled":
117
+ return "neutral";
118
+ case "skipped":
119
+ return "neutral";
120
+ case "pending":
121
+ return "neutral";
122
+ }
123
+ }
124
+ function isTerminal(status) {
125
+ return status === "succeeded" || status === "failed" || status === "cancelled" || status === "skipped";
126
+ }
127
+ function isCurrent(status) {
128
+ return status === "running" || status === "retrying" || status === "waiting_approval";
129
+ }
130
+ function hasProgress(step) {
131
+ return step.progress !== undefined && isCurrent(step.status);
132
+ }
133
+ function metadataItems(step) {
134
+ const items = [];
135
+ if (step.startTime !== undefined) {
136
+ items.push({ term: "Started", definition: step.startTime });
137
+ }
138
+ if (step.endTime !== undefined) {
139
+ items.push({ term: "Ended", definition: step.endTime });
140
+ }
141
+ if (step.duration !== undefined) {
142
+ items.push({ term: "Duration", definition: step.duration });
143
+ }
144
+ if (step.attemptCount !== undefined && step.attemptCount > 1) {
145
+ items.push({ term: "Attempts", definition: String(step.attemptCount) });
146
+ }
147
+ return items;
148
+ }
149
+ function actionsCountLabel(actionsCount) {
150
+ return actionsCount === 1 ? "1 action" : `${actionsCount} actions`;
151
+ }
152
+ function hiddenNestedStepLabel(hiddenStepCount) {
153
+ return hiddenStepCount === 1 ? "1 nested step hidden" : `${hiddenStepCount} nested steps hidden`;
154
+ }
155
+ function laneOutcomeLabel(outcome) {
156
+ switch (outcome) {
157
+ case "won":
158
+ return "Won";
159
+ case "lost":
160
+ return "Lost";
161
+ case "settled":
162
+ return "Settled";
163
+ }
164
+ }
165
+ function laneOutcomeBadgeVariant(outcome) {
166
+ switch (outcome) {
167
+ case "won":
168
+ return "success";
169
+ case "lost":
170
+ return "neutral";
171
+ case "settled":
172
+ return "info";
173
+ }
174
+ }
175
+ function branchOutcomeSummary(lanes) {
176
+ const counts = { won: 0, lost: 0, settled: 0, pending: 0 };
177
+ for (const lane of lanes) {
178
+ if (lane.outcome === undefined)
179
+ counts.pending += 1;
180
+ else
181
+ counts[lane.outcome] += 1;
182
+ }
183
+ const parts = [];
184
+ if (counts.won > 0)
185
+ parts.push(`${counts.won} won`);
186
+ if (counts.lost > 0)
187
+ parts.push(`${counts.lost} lost`);
188
+ if (counts.settled > 0)
189
+ parts.push(`${counts.settled} settled`);
190
+ if (counts.pending > 0) {
191
+ parts.push(counts.pending === 1 ? "1 lane racing" : `${counts.pending} lanes racing`);
192
+ }
193
+ return parts.length > 0 ? parts.join(", ") : "No lanes";
194
+ }
195
+ function branchGroupHasCurrentStep(group) {
196
+ const stack = group.lanes.flatMap((lane) => lane.steps);
197
+ while (stack.length > 0) {
198
+ const step = stack.pop();
199
+ if (step === undefined)
200
+ continue;
201
+ if (isCurrent(step.status))
202
+ return true;
203
+ if (step.children) {
204
+ for (const child of step.children)
205
+ stack.push(child);
206
+ }
207
+ }
208
+ return false;
209
+ }
210
+ function branchStartsCollapsed(laneCount, collapseThreshold, collapsed) {
211
+ if (collapsed !== undefined)
212
+ return collapsed;
213
+ const threshold = collapseThreshold !== undefined && Number.isInteger(collapseThreshold) && collapseThreshold > 0 ? collapseThreshold : 3;
214
+ return laneCount >= threshold;
215
+ }
216
+ function hasControlCharacter(value) {
217
+ for (let index = 0;index < value.length; index += 1) {
218
+ const code = value.charCodeAt(index);
219
+ if (code <= 31 || code === 127)
220
+ return true;
221
+ }
222
+ return false;
223
+ }
224
+ function safeStepLinkHref(href) {
225
+ const trimmedHref = href.trim();
226
+ if (trimmedHref === "")
227
+ return;
228
+ if (hasControlCharacter(trimmedHref))
229
+ return;
230
+ if (trimmedHref.includes("\\"))
231
+ return;
232
+ const leadingSeparators = trimmedHref.match(/^[\\/]+/)?.[0] ?? "";
233
+ if (leadingSeparators.length > 1)
234
+ return;
235
+ if (/^[A-Za-z][A-Za-z\d+.-]*:/.test(trimmedHref)) {
236
+ try {
237
+ const parsedUrl = new URL(trimmedHref);
238
+ return parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:" ? trimmedHref : undefined;
239
+ } catch {
240
+ return;
241
+ }
242
+ }
243
+ return trimmedHref;
244
+ }
245
+
246
+ // src/components/run-step-timeline/run-step-timeline.svelte
247
+ function depthLimitItem($$renderer, row) {
248
+ $$renderer.push(`<li class="cinder-run-step-timeline__item" data-cinder-status="depth-limit"${$2.attr("data-cinder-depth", row.depth)}${$2.attr("data-cinder-path", row.pathKey)}${$2.attr("data-cinder-connector-after", row.connectorAfter)} data-cinder-depth-limit=""${$2.attr("aria-current", row.ariaCurrent ? "step" : undefined)}${$2.attr_style("", { "--_cinder-rst-depth": row.depth })}><div class="cinder-run-step-timeline__event"><span class="cinder-run-step-timeline__marker" aria-hidden="true" inert="">`);
249
+ Status_dot($$renderer, {
250
+ status: "neutral",
251
+ label: "Nested steps hidden",
252
+ showLabel: false,
253
+ size: "md"
254
+ });
255
+ $$renderer.push(`<!----></span> <div class="cinder-run-step-timeline__content"><div class="cinder-run-step-timeline__header"><span class="cinder-run-step-timeline__label">${$2.escape(hiddenNestedStepLabel(row.hiddenStepCount))}</span> `);
256
+ Badge($$renderer, {
257
+ class: "cinder-run-step-timeline__status",
258
+ variant: "neutral",
259
+ size: "xs",
260
+ "aria-label": "Status: Nested child steps hidden",
261
+ children: ($$renderer2) => {
262
+ $$renderer2.push(`<!---->Depth cap`);
263
+ },
264
+ $$slots: { default: true }
265
+ });
266
+ $$renderer.push(`<!----></div> <p class="cinder-run-step-timeline__body">Additional child-workflow steps are hidden because the timeline depth cap was reached.</p></div></div></li>`);
267
+ }
268
+ function Run_step_timeline($$renderer, $$props) {
269
+ $$renderer.component(($$renderer2) => {
270
+ const MAX_NESTED_STEP_DEPTH = 3;
271
+ let {
272
+ steps,
273
+ label,
274
+ class: className,
275
+ children,
276
+ "aria-label": ariaLabel,
277
+ "aria-labelledby": ariaLabelledby,
278
+ $$slots,
279
+ $$events,
280
+ ...rest
281
+ } = $$props;
282
+ const resolvedAriaLabel = $2.derived(() => ariaLabelledby === undefined && ariaLabel === undefined ? label : ariaLabel);
283
+ const renderedEntries = $2.derived(() => flattenEntries(steps));
284
+ function isBranchGroup(entry) {
285
+ return "kind" in entry && entry.kind === "branch";
286
+ }
287
+ function flattenEntries(entries) {
288
+ const result = [];
289
+ let stepRun = [];
290
+ const flushRun = () => {
291
+ if (stepRun.length === 0)
292
+ return;
293
+ result.push(...flattenSteps(stepRun, ""));
294
+ stepRun = [];
295
+ };
296
+ for (const entry of entries) {
297
+ if (isBranchGroup(entry)) {
298
+ flushRun();
299
+ result.push({
300
+ kind: "branch",
301
+ group: entry,
302
+ pathKey: `%branch/${escapeStepPathSegment(entry.id)}`,
303
+ connectorAfter: "hidden"
304
+ });
305
+ } else {
306
+ stepRun.push(entry);
307
+ }
308
+ }
309
+ flushRun();
310
+ return applyGlobalRailConnectors(applyGlobalTopLevelCompensates(applyGlobalRailAriaCurrent(result)));
311
+ }
312
+ function applyGlobalTopLevelCompensates(rows) {
313
+ const topLevelLabelByPathKey = new Map;
314
+ for (const row of rows) {
315
+ if (row.kind === "step" && row.depth === 0) {
316
+ topLevelLabelByPathKey.set(row.pathKey, row.step.label);
317
+ }
318
+ }
319
+ return rows.map((row) => {
320
+ if (row.kind !== "step" || row.depth !== 0 || row.step.compensates === undefined)
321
+ return row;
322
+ return {
323
+ ...row,
324
+ compensatesLabel: resolveSiblingCompensatesLabel(row, topLevelLabelByPathKey)
325
+ };
326
+ });
327
+ }
328
+ function railRowDepth(row) {
329
+ return row.kind === "branch" ? 0 : row.depth;
330
+ }
331
+ function applyGlobalRailConnectors(rows) {
332
+ return rows.map((row, index) => {
333
+ const next = rows[index + 1];
334
+ const connectorAfter = next === undefined || railRowDepth(next) < railRowDepth(row) ? "hidden" : "visible";
335
+ return { ...row, connectorAfter };
336
+ });
337
+ }
338
+ function rowCurrentDepth(row) {
339
+ if (row.kind === "depth-limit")
340
+ return row.hiddenCurrent ? row.depth + 1 : -1;
341
+ if (row.kind === "step")
342
+ return isCurrent(row.step.status) ? row.depth : -1;
343
+ return -1;
344
+ }
345
+ function applyGlobalRailAriaCurrent(rows) {
346
+ let deepestRow;
347
+ let deepestDepth = -1;
348
+ for (const row of rows) {
349
+ const depth = rowCurrentDepth(row);
350
+ if (depth > deepestDepth) {
351
+ deepestDepth = depth;
352
+ deepestRow = row;
353
+ }
354
+ }
355
+ return rows.map((row) => row.kind === "branch" ? row : { ...row, ariaCurrent: row === deepestRow });
356
+ }
357
+ function flattenSteps(list, pathPrefix) {
358
+ const rows = [];
359
+ appendRunStepRows(rows, list, 0, pathPrefix);
360
+ const currentRowIndex = deepestCurrentStepIndex(rows);
361
+ const labelByPathKey = new Map;
362
+ for (const row of rows) {
363
+ if (row.kind === "step")
364
+ labelByPathKey.set(row.pathKey, row.step.label);
365
+ }
366
+ return rows.map((row, index) => {
367
+ const next = rows[index + 1];
368
+ const connectorAfter = next === undefined || next.depth < row.depth ? "hidden" : "visible";
369
+ const ariaCurrent = index === currentRowIndex;
370
+ if (row.kind === "depth-limit") {
371
+ return { ...row, connectorAfter, ariaCurrent };
372
+ }
373
+ return {
374
+ ...row,
375
+ connectorAfter,
376
+ ariaCurrent,
377
+ compensatesLabel: resolveSiblingCompensatesLabel(row, labelByPathKey)
378
+ };
379
+ });
380
+ }
381
+ function resolveSiblingCompensatesLabel(row, labelByPathKey) {
382
+ if (row.step.compensates === undefined)
383
+ return;
384
+ const lastSeparator = row.pathKey.lastIndexOf("/");
385
+ const parentPrefix = lastSeparator === -1 ? "" : row.pathKey.slice(0, lastSeparator);
386
+ const siblingPathKey = nestedStepPathKey(parentPrefix, row.step.compensates);
387
+ if (siblingPathKey === row.pathKey)
388
+ return;
389
+ return labelByPathKey.get(siblingPathKey);
390
+ }
391
+ function appendRunStepRows(rows, list, depth, pathPrefix) {
392
+ for (const step of list) {
393
+ const pathKey = nestedStepPathKey(pathPrefix, step.id);
394
+ rows.push({ kind: "step", step, depth, pathKey });
395
+ if (step.children && step.children.length > 0) {
396
+ if (depth < MAX_NESTED_STEP_DEPTH) {
397
+ appendRunStepRows(rows, step.children, depth + 1, pathKey);
398
+ } else {
399
+ const hiddenSummary = summarizeNestedRunSteps(step.children);
400
+ rows.push({
401
+ kind: "depth-limit",
402
+ depth,
403
+ pathKey: `${pathKey}/__cinder-depth-limit`,
404
+ hiddenStepCount: hiddenSummary.count,
405
+ hiddenCurrent: hiddenSummary.hasCurrent
406
+ });
407
+ }
408
+ }
409
+ }
410
+ }
411
+ function nestedStepPathKey(pathPrefix, stepId) {
412
+ const encodedStepId = escapeStepPathSegment(stepId);
413
+ return pathPrefix === "" ? encodedStepId : `${pathPrefix}/${encodedStepId}`;
414
+ }
415
+ function escapeStepPathSegment(stepId) {
416
+ return stepId.replaceAll("%", "%25").replaceAll("/", "%2F");
417
+ }
418
+ function summarizeNestedRunSteps(list) {
419
+ let count = 0;
420
+ let hasCurrent = false;
421
+ const stack = [...list];
422
+ while (stack.length > 0) {
423
+ const step = stack.pop();
424
+ if (step === undefined)
425
+ continue;
426
+ count += 1;
427
+ if (isCurrent(step.status))
428
+ hasCurrent = true;
429
+ const stepChildren = step.children;
430
+ if (stepChildren) {
431
+ for (let index = stepChildren.length - 1;index >= 0; index -= 1) {
432
+ const child = stepChildren[index];
433
+ if (child)
434
+ stack.push(child);
435
+ }
436
+ }
437
+ }
438
+ return { count, hasCurrent };
439
+ }
440
+ function deepestCurrentStepIndex(rows) {
441
+ let currentIndex = -1;
442
+ let currentDepth = -1;
443
+ rows.forEach((row, index) => {
444
+ const rowCurrentDepth2 = row.kind === "depth-limit" && row.hiddenCurrent ? row.depth + 1 : row.kind === "step" && isCurrent(row.step.status) ? row.depth : -1;
445
+ if (rowCurrentDepth2 > currentDepth) {
446
+ currentIndex = index;
447
+ currentDepth = rowCurrentDepth2;
448
+ }
449
+ });
450
+ return currentIndex;
451
+ }
452
+ function laneRows(lane) {
453
+ return flattenSteps(lane.steps, "");
454
+ }
455
+ function laneStateLabel(lane) {
456
+ return lane.outcome === undefined ? "racing" : laneOutcomeLabel(lane.outcome).toLowerCase();
457
+ }
458
+ function stepItem($$renderer3, row) {
459
+ const step = row.step;
460
+ const terminal = isTerminal(step.status);
461
+ const metadata = metadataItems(step);
462
+ $$renderer3.push(`<li class="cinder-run-step-timeline__item"${$2.attr("data-cinder-status", step.status)}${$2.attr("data-cinder-depth", row.depth)}${$2.attr("data-cinder-path", row.pathKey)}${$2.attr("data-cinder-terminal", terminal ? "" : undefined)}${$2.attr("data-cinder-rewound", step.rewound ? "" : undefined)}${$2.attr("data-cinder-compensation", row.compensatesLabel !== undefined ? "" : undefined)}${$2.attr("data-cinder-connector-after", row.connectorAfter)}${$2.attr("aria-current", row.ariaCurrent ? "step" : undefined)}${$2.attr_style("", { "--_cinder-rst-depth": row.depth })}><div class="cinder-run-step-timeline__event"><span class="cinder-run-step-timeline__marker" aria-hidden="true" inert="">`);
463
+ Status_dot($$renderer3, {
464
+ status: statusDotStatus(step.status),
465
+ label: statusLabel(step.status),
466
+ showLabel: false,
467
+ size: "md"
468
+ });
469
+ $$renderer3.push(`<!----></span> <div class="cinder-run-step-timeline__content"><div class="cinder-run-step-timeline__header"><span class="cinder-run-step-timeline__label">${$2.escape(step.label)}</span> `);
470
+ if (step.link) {
471
+ $$renderer3.push("<!--[0-->");
472
+ const safeLinkHref = safeStepLinkHref(step.link.href);
473
+ if (safeLinkHref) {
474
+ $$renderer3.push("<!--[0-->");
475
+ Link($$renderer3, {
476
+ href: safeLinkHref,
477
+ class: "cinder-run-step-timeline__link",
478
+ children: ($$renderer4) => {
479
+ $$renderer4.push(`<!---->${$2.escape(step.link.label)}`);
480
+ },
481
+ $$slots: { default: true }
482
+ });
483
+ } else {
484
+ $$renderer3.push("<!--[-1-->");
485
+ $$renderer3.push(`<span class="cinder-run-step-timeline__link cinder-run-step-timeline__link--unsafe">${$2.escape(step.link.label)}</span>`);
486
+ }
487
+ $$renderer3.push(`<!--]-->`);
488
+ } else {
489
+ $$renderer3.push("<!--[-1-->");
490
+ }
491
+ $$renderer3.push(`<!--]--> `);
492
+ Badge($$renderer3, {
493
+ class: "cinder-run-step-timeline__status",
494
+ variant: badgeVariant(step.status),
495
+ size: "xs",
496
+ "aria-label": `Status: ${statusLabel(step.status)}`,
497
+ children: ($$renderer4) => {
498
+ $$renderer4.push(`<!---->${$2.escape(statusLabel(step.status))}`);
499
+ },
500
+ $$slots: { default: true }
501
+ });
502
+ $$renderer3.push(`<!----> `);
503
+ if (step.rewound) {
504
+ $$renderer3.push("<!--[0-->");
505
+ Badge($$renderer3, {
506
+ class: "cinder-run-step-timeline__flag",
507
+ variant: "neutral",
508
+ size: "xs",
509
+ "aria-label": "State: rewound — speculatively executed, then unwound",
510
+ children: ($$renderer4) => {
511
+ $$renderer4.push(`<!---->Rewound`);
512
+ },
513
+ $$slots: { default: true }
514
+ });
515
+ } else {
516
+ $$renderer3.push("<!--[-1-->");
517
+ }
518
+ $$renderer3.push(`<!--]--> `);
519
+ if (row.compensatesLabel !== undefined) {
520
+ $$renderer3.push("<!--[0-->");
521
+ Badge($$renderer3, {
522
+ class: "cinder-run-step-timeline__flag",
523
+ variant: "warning",
524
+ size: "xs",
525
+ "aria-label": `Compensates ${row.compensatesLabel} — reverses the forward step`,
526
+ children: ($$renderer4) => {
527
+ $$renderer4.push(`<!---->Compensates ${$2.escape(row.compensatesLabel)}`);
528
+ },
529
+ $$slots: { default: true }
530
+ });
531
+ } else {
532
+ $$renderer3.push("<!--[-1-->");
533
+ }
534
+ $$renderer3.push(`<!--]--> `);
535
+ if (step.attemptCount !== undefined && step.attemptCount > 1) {
536
+ $$renderer3.push("<!--[0-->");
537
+ Badge($$renderer3, {
538
+ variant: "neutral",
539
+ size: "xs",
540
+ mono: true,
541
+ children: ($$renderer4) => {
542
+ $$renderer4.push(`<!---->attempt ${$2.escape(step.attemptCount)}`);
543
+ },
544
+ $$slots: { default: true }
545
+ });
546
+ } else {
547
+ $$renderer3.push("<!--[-1-->");
548
+ }
549
+ $$renderer3.push(`<!--]--> `);
550
+ if (step.actionsCount !== undefined && step.actionsCount > 0) {
551
+ $$renderer3.push("<!--[0-->");
552
+ Badge($$renderer3, {
553
+ variant: "neutral",
554
+ size: "xs",
555
+ mono: true,
556
+ children: ($$renderer4) => {
557
+ $$renderer4.push(`<!---->${$2.escape(actionsCountLabel(step.actionsCount))}`);
558
+ },
559
+ $$slots: { default: true }
560
+ });
561
+ } else {
562
+ $$renderer3.push("<!--[-1-->");
563
+ }
564
+ $$renderer3.push(`<!--]--></div> `);
565
+ if (hasProgress(step)) {
566
+ $$renderer3.push("<!--[0-->");
567
+ $$renderer3.push(`<div class="cinder-run-step-timeline__progress">`);
568
+ Progress($$renderer3, {
569
+ value: step.progress ?? 0,
570
+ max: step.progressMax ?? 100,
571
+ size: "sm",
572
+ ariaLabel: `${step.label} progress`
573
+ });
574
+ $$renderer3.push(`<!----></div>`);
575
+ } else {
576
+ $$renderer3.push("<!--[-1-->");
577
+ }
578
+ $$renderer3.push(`<!--]--> `);
579
+ if (metadata.length > 0) {
580
+ $$renderer3.push("<!--[0-->");
581
+ $$renderer3.push(`<dl class="cinder-run-step-timeline__meta"><!--[-->`);
582
+ const each_array = $2.ensure_array_like(metadata);
583
+ for (let $$index = 0, $$length = each_array.length;$$index < $$length; $$index++) {
584
+ let item = each_array[$$index];
585
+ $$renderer3.push(`<div class="cinder-run-step-timeline__meta-row"><dt class="cinder-run-step-timeline__meta-term">${$2.escape(item.term)}</dt> <dd class="cinder-run-step-timeline__meta-definition">${$2.escape(item.definition)}</dd></div>`);
586
+ }
587
+ $$renderer3.push(`<!--]--></dl>`);
588
+ } else {
589
+ $$renderer3.push("<!--[-1-->");
590
+ }
591
+ $$renderer3.push(`<!--]--> `);
592
+ if (step.details && step.details.length > 0) {
593
+ $$renderer3.push("<!--[0-->");
594
+ $$renderer3.push(`<div class="cinder-run-step-timeline__details"><!--[-->`);
595
+ const each_array_1 = $2.ensure_array_like(step.details);
596
+ for (let $$index_1 = 0, $$length = each_array_1.length;$$index_1 < $$length; $$index_1++) {
597
+ let detail = each_array_1[$$index_1];
598
+ Collapsible($$renderer3, {
599
+ trigger: detail.label,
600
+ children: ($$renderer4) => {
601
+ $$renderer4.push(`<pre class="cinder-run-step-timeline__detail-content">${$2.escape(detail.content)}</pre>`);
602
+ },
603
+ $$slots: { default: true }
604
+ });
605
+ }
606
+ $$renderer3.push(`<!--]--></div>`);
607
+ } else {
608
+ $$renderer3.push("<!--[-1-->");
609
+ }
610
+ $$renderer3.push(`<!--]--> `);
611
+ if (children) {
612
+ $$renderer3.push("<!--[0-->");
613
+ $$renderer3.push(`<div class="cinder-run-step-timeline__body">`);
614
+ children($$renderer3, step);
615
+ $$renderer3.push(`<!----></div>`);
616
+ } else {
617
+ $$renderer3.push("<!--[-1-->");
618
+ }
619
+ $$renderer3.push(`<!--]--></div></div></li>`);
620
+ }
621
+ function stepRail($$renderer3, rows) {
622
+ $$renderer3.push(`<!--[-->`);
623
+ const each_array_2 = $2.ensure_array_like(rows);
624
+ for (let $$index_2 = 0, $$length = each_array_2.length;$$index_2 < $$length; $$index_2++) {
625
+ let row = each_array_2[$$index_2];
626
+ if (row.kind === "depth-limit") {
627
+ $$renderer3.push("<!--[0-->");
628
+ depthLimitItem($$renderer3, row);
629
+ } else {
630
+ $$renderer3.push("<!--[-1-->");
631
+ stepItem($$renderer3, row);
632
+ }
633
+ $$renderer3.push(`<!--]-->`);
634
+ }
635
+ $$renderer3.push(`<!--]-->`);
636
+ }
637
+ $$renderer2.push(`<ol${$2.attributes({
638
+ ...rest,
639
+ class: $2.clsx(classNames("cinder-run-step-timeline", className)),
640
+ "aria-label": resolvedAriaLabel(),
641
+ "aria-labelledby": ariaLabelledby
642
+ })}><!--[-->`);
643
+ const each_array_3 = $2.ensure_array_like(renderedEntries());
644
+ for (let $$index_4 = 0, $$length = each_array_3.length;$$index_4 < $$length; $$index_4++) {
645
+ let entry = each_array_3[$$index_4];
646
+ if (entry.kind === "branch") {
647
+ $$renderer2.push("<!--[0-->");
648
+ const group = entry.group;
649
+ const summary = branchOutcomeSummary(group.lanes);
650
+ const initialOpen = !branchStartsCollapsed(group.lanes.length, group.collapseThreshold, group.collapsed) || group.collapsed === undefined && branchGroupHasCurrentStep(group);
651
+ $$renderer2.push(`<li class="cinder-run-step-timeline__item cinder-run-step-timeline__item--branch" data-cinder-status="branch" data-cinder-depth="0"${$2.attr("data-cinder-path", entry.pathKey)}${$2.attr("data-cinder-connector-after", entry.connectorAfter)}><div class="cinder-run-step-timeline__event"><span class="cinder-run-step-timeline__marker" aria-hidden="true" inert="">`);
652
+ Status_dot($$renderer2, {
653
+ status: "accent",
654
+ label: "Branch group",
655
+ showLabel: false,
656
+ size: "md"
657
+ });
658
+ $$renderer2.push(`<!----></span> <div class="cinder-run-step-timeline__content cinder-run-step-timeline__branch">`);
659
+ {
660
+ let trigger = function($$renderer3) {
661
+ $$renderer3.push(`<span class="cinder-run-step-timeline__branch-heading"><span class="cinder-run-step-timeline__label">${$2.escape(group.label)}</span> `);
662
+ Badge($$renderer3, {
663
+ variant: "accent",
664
+ size: "xs",
665
+ "aria-label": `Branch group outcome: ${summary}`,
666
+ children: ($$renderer4) => {
667
+ $$renderer4.push(`<!---->${$2.escape(summary)}`);
668
+ },
669
+ $$slots: { default: true }
670
+ });
671
+ $$renderer3.push(`<!----></span>`);
672
+ };
673
+ Run_step_branch_disclosure($$renderer2, {
674
+ initialOpen,
675
+ class: "cinder-run-step-timeline__branch-disclosure",
676
+ triggerAriaLabel: `Branch group: ${group.label}. ${summary}.`,
677
+ trigger,
678
+ children: ($$renderer3) => {
679
+ $$renderer3.push(`<ul class="cinder-run-step-timeline__lanes"${$2.attr("aria-label", `${group.label} branches`)}><!--[-->`);
680
+ const each_array_4 = $2.ensure_array_like(group.lanes);
681
+ for (let $$index_3 = 0, $$length2 = each_array_4.length;$$index_3 < $$length2; $$index_3++) {
682
+ let lane = each_array_4[$$index_3];
683
+ $$renderer3.push(`<li class="cinder-run-step-timeline__lane"${$2.attr("data-cinder-outcome", lane.outcome ?? "racing")}${$2.attr("aria-label", `Branch ${lane.label ?? lane.id}: ${laneStateLabel(lane)}`)}><div class="cinder-run-step-timeline__lane-header"><span class="cinder-run-step-timeline__lane-label">${$2.escape(lane.label ?? lane.id)}</span> `);
684
+ if (lane.outcome !== undefined) {
685
+ $$renderer3.push("<!--[0-->");
686
+ Badge($$renderer3, {
687
+ variant: laneOutcomeBadgeVariant(lane.outcome),
688
+ size: "xs",
689
+ "aria-label": `Outcome: ${laneOutcomeLabel(lane.outcome)}`,
690
+ children: ($$renderer4) => {
691
+ $$renderer4.push(`<!---->${$2.escape(laneOutcomeLabel(lane.outcome))}`);
692
+ },
693
+ $$slots: { default: true }
694
+ });
695
+ } else {
696
+ $$renderer3.push("<!--[-1-->");
697
+ Badge($$renderer3, {
698
+ variant: "info",
699
+ size: "xs",
700
+ "aria-label": "Outcome: still racing",
701
+ children: ($$renderer4) => {
702
+ $$renderer4.push(`<!---->Racing`);
703
+ },
704
+ $$slots: { default: true }
705
+ });
706
+ }
707
+ $$renderer3.push(`<!--]--></div> <ol class="cinder-run-step-timeline cinder-run-step-timeline__lane-steps"${$2.attr("aria-label", `${lane.label ?? lane.id} steps`)}>`);
708
+ stepRail($$renderer3, laneRows(lane));
709
+ $$renderer3.push(`<!----></ol></li>`);
710
+ }
711
+ $$renderer3.push(`<!--]--></ul>`);
712
+ },
713
+ $$slots: { trigger: true, default: true }
714
+ });
715
+ }
716
+ $$renderer2.push(`<!----></div></div></li>`);
717
+ } else if (entry.kind === "depth-limit") {
718
+ $$renderer2.push("<!--[1-->");
719
+ depthLimitItem($$renderer2, entry);
720
+ } else {
721
+ $$renderer2.push("<!--[-1-->");
722
+ stepItem($$renderer2, entry);
723
+ }
724
+ $$renderer2.push(`<!--]-->`);
725
+ }
726
+ $$renderer2.push(`<!--]--></ol>`);
727
+ }, Run_step_timeline);
728
+ }
729
+
730
+ // src/components/run-step-timeline/index.ts
731
+ var run_step_timeline_default = Run_step_timeline;
732
+ export { Run_step_timeline, run_step_timeline_default };
733
+
734
+ //# debugId=C9EF855146F109ED64756E2164756E21