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