@design.estate/dees-catalog 21.32.3 → 21.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist_bundle/bundle.js +1733 -368
  2. package/dist_bundle/bundle.js.map +1 -1
  3. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-ZRD47DC6.js → chunk-B3NM6BL3.js} +3 -3
  4. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-EL3KNDIB.js → chunk-BDUZ7I23.js} +2 -2
  5. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-LDC2GECY.js → chunk-IK5OF7M4.js} +33 -2
  6. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-LDC2GECY.js.map → chunk-IK5OF7M4.js.map} +1 -1
  7. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-YOX3NS2W.js → de-PTMMQ5DA.js} +33 -2
  8. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-PTMMQ5DA.js.map +1 -0
  9. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-7LJGK5SK.js → dees-modal-BZIJFVRI.js} +3 -3
  10. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-O3NEQ4DO.js → dees-workspace-terminal-EU377EZY.js} +4 -4
  11. package/dist_ts_web/00_commitinfo_data.js +1 -1
  12. package/dist_ts_web/elements/00group-chart/dees-chart-area/component.d.ts +18 -0
  13. package/dist_ts_web/elements/00group-chart/dees-chart-area/component.js +60 -2
  14. package/dist_ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.d.ts +24 -0
  15. package/dist_ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.js +80 -0
  16. package/dist_ts_web/elements/00group-feedback/dees-hint/dees-hint.d.ts +1 -0
  17. package/dist_ts_web/elements/00group-feedback/dees-hint/dees-hint.js +13 -3
  18. package/dist_ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.js +7 -5
  19. package/dist_ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.d.ts +0 -3
  20. package/dist_ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.js +10 -182
  21. package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.d.ts +64 -1
  22. package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.demo.js +221 -22
  23. package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.js +544 -66
  24. package/dist_ts_web/elements/00group-harness/harness.helpers.d.ts +16 -1
  25. package/dist_ts_web/elements/00group-harness/harness.helpers.js +25 -1
  26. package/dist_ts_web/elements/00group-harness/harness.records.d.ts +27 -0
  27. package/dist_ts_web/elements/00group-harness/harness.records.js +193 -0
  28. package/dist_ts_web/elements/00group-harness/interfaces.d.ts +93 -4
  29. package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.d.ts +39 -0
  30. package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.js +27 -10
  31. package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.js +276 -26
  32. package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.d.ts +10 -0
  33. package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.js +144 -44
  34. package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.d.ts +16 -1
  35. package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.js +188 -5
  36. package/dist_ts_web/elements/00group-kanban/interfaces.d.ts +47 -2
  37. package/dist_ts_web/elements/00group-kanban/kanban.demodata.d.ts +11 -1
  38. package/dist_ts_web/elements/00group-kanban/kanban.demodata.js +141 -7
  39. package/dist_ts_web/elements/00group-kanban/kanban.dragcontroller.js +23 -1
  40. package/dist_ts_web/elements/00group-kanban/kanban.helpers.d.ts +15 -1
  41. package/dist_ts_web/elements/00group-kanban/kanban.helpers.js +31 -1
  42. package/dist_ts_web/i18n/de.d.ts +124 -0
  43. package/dist_ts_web/i18n/de.js +32 -1
  44. package/dist_ts_web/i18n/messages.d.ts +124 -0
  45. package/dist_ts_web/i18n/messages.js +32 -1
  46. package/package.json +2 -2
  47. package/readme.md +88 -15
  48. package/ts_web/00_commitinfo_data.ts +1 -1
  49. package/ts_web/elements/00group-chart/dees-chart-area/component.ts +59 -1
  50. package/ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.ts +97 -0
  51. package/ts_web/elements/00group-feedback/dees-hint/dees-hint.ts +16 -3
  52. package/ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.ts +6 -4
  53. package/ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.ts +16 -186
  54. package/ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.demo.ts +261 -55
  55. package/ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.ts +575 -88
  56. package/ts_web/elements/00group-harness/harness.helpers.ts +39 -0
  57. package/ts_web/elements/00group-harness/harness.records.ts +210 -0
  58. package/ts_web/elements/00group-harness/interfaces.ts +99 -4
  59. package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.ts +26 -8
  60. package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts +267 -25
  61. package/ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.ts +162 -57
  62. package/ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.ts +202 -1
  63. package/ts_web/elements/00group-kanban/interfaces.ts +55 -3
  64. package/ts_web/elements/00group-kanban/kanban.demodata.ts +166 -6
  65. package/ts_web/elements/00group-kanban/kanban.dragcontroller.ts +21 -0
  66. package/ts_web/elements/00group-kanban/kanban.helpers.ts +53 -0
  67. package/ts_web/i18n/de.ts +31 -0
  68. package/ts_web/i18n/messages.ts +31 -0
  69. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-YOX3NS2W.js.map +0 -1
  70. /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-ZRD47DC6.js.map → chunk-B3NM6BL3.js.map} +0 -0
  71. /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-EL3KNDIB.js.map → chunk-BDUZ7I23.js.map} +0 -0
  72. /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-7LJGK5SK.js.map → dees-modal-BZIJFVRI.js.map} +0 -0
  73. /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-O3NEQ4DO.js.map → dees-workspace-terminal-EU377EZY.js.map} +0 -0
@@ -26,7 +26,7 @@ import {
26
26
  ownAppuiLabels,
27
27
  resolveAppuiLabels,
28
28
  xtermStyles
29
- } from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-ZRD47DC6.js";
29
+ } from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-B3NM6BL3.js";
30
30
  import {
31
31
  ActionRunController,
32
32
  BarInfoController,
@@ -123,7 +123,7 @@ import {
123
123
  workspaceVisibility,
124
124
  zIndexLayers,
125
125
  zIndexRegistry
126
- } from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-EL3KNDIB.js";
126
+ } from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-BDUZ7I23.js";
127
127
  import {
128
128
  dcMessages,
129
129
  dcSourceI18n,
@@ -133,7 +133,7 @@ import {
133
133
  firstDayOfWeek,
134
134
  iso_exports,
135
135
  momentFormat
136
- } from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-LDC2GECY.js";
136
+ } from "./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-IK5OF7M4.js";
137
137
  import {
138
138
  __decorateElement,
139
139
  __decoratorMetadata,
@@ -759,6 +759,7 @@ var hintTypeIcons = {
759
759
  warning: "lucide:TriangleAlert",
760
760
  error: "lucide:CircleAlert"
761
761
  };
762
+ var hasHintContent = /* @__PURE__ */ __name((nodes) => nodes.some((node) => node.nodeType === Node.ELEMENT_NODE || (node.textContent ?? "").trim().length > 0), "hasHintContent");
762
763
  _DeesHint_decorators = [customElement("dees-hint")];
763
764
  var _DeesHint = class _DeesHint extends (_a2 = DeesElement, _type_dec = [n({ type: String, reflect: true })], _text_dec = [n({ type: String, reflect: true })], _hasSlottedContent_dec = [r2()], _a2) {
764
765
  constructor() {
@@ -767,11 +768,15 @@ var _DeesHint = class _DeesHint extends (_a2 = DeesElement, _type_dec = [n({ typ
767
768
  __privateAdd(this, _text, __runInitializers(_init3, 12, this, "")), __runInitializers(_init3, 15, this);
768
769
  __privateAdd(this, _hasSlottedContent, __runInitializers(_init3, 16, this, false)), __runInitializers(_init3, 19, this);
769
770
  __publicField(this, "handleSlotChange", /* @__PURE__ */ __name((eventArg) => {
770
- const assigned = eventArg.target.assignedNodes({ flatten: true });
771
- this.hasSlottedContent = assigned.some((node) => node.nodeType === Node.ELEMENT_NODE || (node.textContent ?? "").trim().length > 0);
771
+ this.hasSlottedContent = hasHintContent(eventArg.target.assignedNodes({ flatten: true }));
772
772
  }, "handleSlotChange"));
773
773
  domtools_elementbasic_exports.setup();
774
774
  }
775
+ willUpdate(changedProperties) {
776
+ super.willUpdate(changedProperties);
777
+ if (!this.hasUpdated)
778
+ this.hasSlottedContent = hasHintContent([...this.childNodes].flatMap((node) => node instanceof HTMLSlotElement ? node.assignedNodes({ flatten: true }) : [node]));
779
+ }
775
780
  render() {
776
781
  const isEmpty = !this.text && !this.hasSlottedContent;
777
782
  return b`
@@ -833,7 +838,9 @@ __publicField(_DeesHint, "styles", [themeDefaultStyles, cssManager.defaultStyles
833
838
  margin-top: 1px;
834
839
  }
835
840
 
841
+ /* Spans the hint, so slotted rows reach its padding rather than their longest line. */
836
842
  .content {
843
+ flex: 1 1 auto;
837
844
  min-width: 0;
838
845
  color: var(--dees-color-text-secondary);
839
846
  }
@@ -19328,6 +19335,54 @@ var createZonedTimeScale = /* @__PURE__ */ __name((lcBundleArg, formatsArg) => {
19328
19335
  return new ZonedTimeScale();
19329
19336
  }, "createZonedTimeScale");
19330
19337
 
19338
+ // ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.ts
19339
+ var priceAxisLabelHeight = /* @__PURE__ */ __name((fontSizeArg) => fontSizeArg + 2 * 2.5 * fontSizeArg / 12, "priceAxisLabelHeight");
19340
+ var placedAt = /* @__PURE__ */ __name((labelArg) => labelArg.placed ?? labelArg.coordinate, "placedAt");
19341
+ var moveApart = /* @__PURE__ */ __name((labelsArg, directionArg, labelHeightArg, scaleHeightArg) => {
19342
+ if (labelsArg.length === 0) return;
19343
+ let runStart = 0;
19344
+ let roomBeforeRun = Math.max(0, directionArg === 1 ? scaleHeightArg / 2 - (placedAt(labelsArg[0]) - labelHeightArg / 2) : placedAt(labelsArg[0]) - labelHeightArg / 2 - scaleHeightArg / 2);
19345
+ for (let index = 1; index < labelsArg.length; index++) {
19346
+ const coordinate = placedAt(labelsArg[index]);
19347
+ const previous = placedAt(labelsArg[index - 1]);
19348
+ const overlaps2 = directionArg === 1 ? coordinate > previous - labelHeightArg : coordinate < previous + labelHeightArg;
19349
+ if (!overlaps2) {
19350
+ runStart = index;
19351
+ roomBeforeRun = directionArg === 1 ? previous - labelHeightArg - coordinate : coordinate - (previous + labelHeightArg);
19352
+ continue;
19353
+ }
19354
+ const placed = previous - labelHeightArg * directionArg;
19355
+ labelsArg[index].placed = placed;
19356
+ const edge = placed - directionArg * labelHeightArg / 2;
19357
+ const outside = directionArg === 1 ? edge < 0 : edge > scaleHeightArg;
19358
+ if (outside && roomBeforeRun > 0) {
19359
+ const shift = Math.min(directionArg === 1 ? -1 - edge : edge - scaleHeightArg, roomBeforeRun);
19360
+ for (let later = runStart; later < labelsArg.length; later++) {
19361
+ labelsArg[later].placed = placedAt(labelsArg[later]) + directionArg * shift;
19362
+ }
19363
+ roomBeforeRun -= shift;
19364
+ }
19365
+ }
19366
+ }, "moveApart");
19367
+ var placePriceAxisLabels = /* @__PURE__ */ __name((coordinatesArg, centerArg, labelHeightArg, scaleHeightArg) => {
19368
+ const labels = coordinatesArg.map((coordinate) => ({ coordinate, placed: null }));
19369
+ const above = labels.filter((label) => label.coordinate <= centerArg).sort((a, b2) => b2.coordinate - a.coordinate);
19370
+ const below = labels.filter((label) => label.coordinate > centerArg);
19371
+ if (above.length > 0 && below.length > 0) below.push(above[0]);
19372
+ below.sort((a, b2) => a.coordinate - b2.coordinate);
19373
+ const halfHeight = Math.floor(labelHeightArg / 2);
19374
+ for (const label of labels) {
19375
+ if (label.coordinate > -halfHeight && label.coordinate < halfHeight) label.placed = halfHeight;
19376
+ if (label.coordinate > scaleHeightArg - halfHeight && label.coordinate < scaleHeightArg + halfHeight) {
19377
+ label.placed = scaleHeightArg - halfHeight;
19378
+ }
19379
+ }
19380
+ moveApart(above, 1, labelHeightArg, scaleHeightArg);
19381
+ moveApart(below, -1, labelHeightArg, scaleHeightArg);
19382
+ return labels.map(placedAt);
19383
+ }, "placePriceAxisLabels");
19384
+ var labelCoversTick = /* @__PURE__ */ __name((labelCoordinatesArg, tickArg, labelHeightArg, fontSizeArg) => labelCoordinatesArg.some((label) => Math.abs(tickArg - label) < (labelHeightArg + fontSizeArg) / 2), "labelCoversTick");
19385
+
19331
19386
  // ts_web/elements/00group-chart/dees-chart-area/component.ts
19332
19387
  var _selectedRange_dec, _rangeSelectionEnabled_dec, _chartLines_dec, _frameless_dec6, _compact_dec2, _hideLegend_dec, _legendStats_dec, _autoScrollInterval_dec, _yAxisMax_dec, _yAxisScaling_dec, _realtimeMode_dec, _rollingWindow_dec, _summary_dec, _yAxisFormatter_dec, _series_dec, _meta_dec, _label_dec4, _isFullPage_dec, _seriesStats_dec, _chart_dec, _a30, _DeesChartArea_decorators, _init32, _chart, _seriesStats, _isFullPage, _label4, _meta, _series, _yAxisFormatter, _summary, _rollingWindow, _realtimeMode, _yAxisScaling, _yAxisMax, _autoScrollInterval, _legendStats, _hideLegend, _compact2, _frameless6, _chartLines, _rangeSelectionEnabled, _selectedRange;
19333
19388
  var readSeries = /* @__PURE__ */ __name((data) => {
@@ -19474,6 +19529,22 @@ var _DeesChartArea = class _DeesChartArea extends (_a30 = DeesElement, _chart_de
19474
19529
  __publicField(this, "tooltipScrollTargets", []);
19475
19530
  /** Lightweight Charts formats the axis through this one function, which writes with the current `yAxisFormatter`. */
19476
19531
  __publicField(this, "priceFormatter", /* @__PURE__ */ __name((priceArg) => this.yAxisFormatter(priceArg), "priceFormatter"));
19532
+ /**
19533
+ * The price axis's tick labels. The axis draws the reference lines' labels over its tick labels
19534
+ * and leaves a tick label under one in place, so that a tick next to a reference line showed
19535
+ * through between two labels as a cut off value of its own; a tick label a label covers is
19536
+ * left out, its grid line stays.
19537
+ */
19538
+ __publicField(this, "tickmarksPriceFormatter", /* @__PURE__ */ __name((pricesArg) => {
19539
+ const fontSize = this.chart?.options().layout.fontSize ?? 12;
19540
+ const labelHeight = priceAxisLabelHeight(fontSize);
19541
+ const labels = this.priceAxisLabelCoordinates(labelHeight);
19542
+ const first = this.seriesApis.values().next().value;
19543
+ return pricesArg.map((price) => {
19544
+ const coordinate = labels.length > 0 && first ? first.priceToCoordinate(price) : null;
19545
+ return coordinate !== null && labelCoversTick(labels, coordinate, labelHeight, fontSize) ? "" : this.yAxisFormatter(price);
19546
+ });
19547
+ }, "tickmarksPriceFormatter"));
19477
19548
  /**
19478
19549
  * The crosshair's time label, in the time zone and with the 24-hour clock of the time scale
19479
19550
  * (`createZonedTimeScale`): the time alone while the plot shows a single day, with the date
@@ -19869,6 +19940,7 @@ var _DeesChartArea = class _DeesChartArea extends (_a30 = DeesElement, _chart_de
19869
19940
  this.applyYAxisScale(chartSeries);
19870
19941
  this.computeStats(chartSeries);
19871
19942
  this.pendingRealtimePrune = false;
19943
+ this.relabelPriceTicks();
19872
19944
  this.fitTimeAxis();
19873
19945
  }
19874
19946
  /**
@@ -19934,6 +20006,7 @@ var _DeesChartArea = class _DeesChartArea extends (_a30 = DeesElement, _chart_de
19934
20006
  });
19935
20007
  this.computeStats(chartSeries);
19936
20008
  this.applyYAxisScale(chartSeries);
20009
+ this.relabelPriceTicks();
19937
20010
  }
19938
20011
  applyYAxisScale(series) {
19939
20012
  let minValue = 0;
@@ -20044,6 +20117,36 @@ var _DeesChartArea = class _DeesChartArea extends (_a30 = DeesElement, _chart_de
20044
20117
  }
20045
20118
  }
20046
20119
  }
20120
+ /**
20121
+ * Where the price axis draws the reference lines' labels. The axis moves overlapping labels
20122
+ * apart from the first series' last visible value, the way `placePriceAxisLabels` works out.
20123
+ */
20124
+ priceAxisLabelCoordinates(labelHeightArg) {
20125
+ const first = this.seriesApis.values().next().value;
20126
+ if (!this.chart || !first) return [];
20127
+ const coordinates = [];
20128
+ for (const [key, lines] of this.priceLines) {
20129
+ const api = this.seriesApis.get(key);
20130
+ if (!api) continue;
20131
+ for (const line of Object.values(lines)) {
20132
+ const coordinate = api.priceToCoordinate(line.options().price);
20133
+ if (coordinate !== null) coordinates.push(coordinate);
20134
+ }
20135
+ }
20136
+ if (coordinates.length === 0) return [];
20137
+ const range = this.chart.timeScale().getVisibleLogicalRange();
20138
+ const last = range ? first.dataByIndex(Math.ceil(range.to), -1) : null;
20139
+ const center = last && "value" in last ? first.priceToCoordinate(last.value) ?? 0 : 0;
20140
+ return placePriceAxisLabels(coordinates, center, labelHeightArg, this.chart.paneSize().height);
20141
+ }
20142
+ /**
20143
+ * Has the price axis write its tick labels anew, for reference lines that moved or changed:
20144
+ * Lightweight Charts keeps the tick labels it wrote while its price range and height stay,
20145
+ * and writes them anew once its price scale is given options.
20146
+ */
20147
+ relabelPriceTicks() {
20148
+ this.chart?.priceScale("right").applyOptions({});
20149
+ }
20047
20150
  /**
20048
20151
  * Whether a new `yAxisFormatter` writes other text than the one it replaces, for the values the
20049
20152
  * chart writes with it: across the price axis's visible range and the series' statistics. A
@@ -20171,7 +20274,11 @@ var _DeesChartArea = class _DeesChartArea extends (_a30 = DeesElement, _chart_de
20171
20274
  this.timeLabelsIn = this.currentTimeLabels();
20172
20275
  this.chart = this.lcBundle.createChartEx(chartContainer, createZonedTimeScale(this.lcBundle, () => this.t.format), {
20173
20276
  autoSize: true,
20174
- localization: { priceFormatter: this.priceFormatter, timeFormatter: this.crosshairTimeFormatter },
20277
+ localization: {
20278
+ priceFormatter: this.priceFormatter,
20279
+ tickmarksPriceFormatter: this.tickmarksPriceFormatter,
20280
+ timeFormatter: this.crosshairTimeFormatter
20281
+ },
20175
20282
  layout: {
20176
20283
  background: { type: this.lcBundle.ColorType.Solid, color: "transparent" },
20177
20284
  textColor: getThemeColors(this.goBright).textSecondary,
@@ -20394,6 +20501,7 @@ var _DeesChartArea = class _DeesChartArea extends (_a30 = DeesElement, _chart_de
20394
20501
  if (!api) return;
20395
20502
  this.updatePriceLines(seriesKey, api, s.data, this.resolveSeriesColor(s, index, isDark));
20396
20503
  });
20504
+ this.relabelPriceTicks();
20397
20505
  }
20398
20506
  startAutoScroll() {
20399
20507
  if (this.autoScrollTimer !== null) return;
@@ -43649,6 +43757,18 @@ var harnessSidebarStyles = i`
43649
43757
  // ts_web/elements/00group-harness/harness.helpers.ts
43650
43758
  var harnessMaxAttachmentBytes = 10 * 1024 * 1024;
43651
43759
  var harnessMaxTotalAttachmentBytes = 30 * 1024 * 1024;
43760
+ var harnessProposalState = /* @__PURE__ */ __name((requestArg, responseArg = requestArg.response) => {
43761
+ if (requestArg.state && requestArg.state !== "pending") return requestArg.state;
43762
+ if (responseArg === void 0) return requestArg.outcome?.tone === "running" ? "confirmed" : "pending";
43763
+ return responseArg[0] === "confirm" ? "confirmed" : "declined";
43764
+ }, "harnessProposalState");
43765
+ var harnessQuestionPending = /* @__PURE__ */ __name((requestArg) => requestArg.kind === "proposal" ? harnessProposalState(requestArg) === "pending" : requestArg.response === void 0, "harnessQuestionPending");
43766
+ var SEVERITY_RANK = { info: 0, warning: 1, danger: 2 };
43767
+ var harnessQuestionSeverity = /* @__PURE__ */ __name((requestArg) => (requestArg.items ?? []).reduce(
43768
+ (highest, item) => SEVERITY_RANK[item.severity ?? "info"] > SEVERITY_RANK[highest] ? item.severity : highest,
43769
+ requestArg.severity ?? "info"
43770
+ ), "harnessQuestionSeverity");
43771
+ var harnessWithoutCredentials = /* @__PURE__ */ __name((requestArg) => requestArg.items?.some((item) => item.credential !== void 0) ? { ...requestArg, items: requestArg.items.map(({ credential: _credential, ...item }) => item) } : requestArg, "harnessWithoutCredentials");
43652
43772
  var harnessCanWithdrawPending = /* @__PURE__ */ __name((messageArg) => messageArg.role === "user" && (messageArg.pending === "queued" || messageArg.pending === "held") && messageArg.pendingActionAvailable === true, "harnessCanWithdrawPending");
43653
43773
  var harnessSupportedImageTypes = /* @__PURE__ */ new Set([
43654
43774
  "image/png",
@@ -48473,6 +48593,174 @@ var demoFunc42 = /* @__PURE__ */ __name(() => demoPage("Permissions", "Review th
48473
48593
  </div>
48474
48594
  `), "demoFunc");
48475
48595
 
48596
+ // ts_web/elements/00group-harness/harness.records.ts
48597
+ var harnessRecordsShown = 5;
48598
+ var OUTCOME_ICON = {
48599
+ running: "lucide:LoaderCircle",
48600
+ success: "lucide:CircleCheck",
48601
+ warning: "lucide:TriangleAlert",
48602
+ error: "lucide:CircleX",
48603
+ neutral: "lucide:Info"
48604
+ };
48605
+ var harnessRecordStyles = i`
48606
+ .items {
48607
+ list-style: none;
48608
+ margin: 12px 0;
48609
+ padding: 0;
48610
+ border: var(--dees-line-width-hairline) solid var(--dees-color-control-border);
48611
+ border-radius: var(--dees-radius-lg);
48612
+ background: var(--dees-color-control-bg);
48613
+ font-size: 12px;
48614
+ }
48615
+
48616
+ .item {
48617
+ display: grid;
48618
+ gap: 4px;
48619
+ padding: 8px 12px;
48620
+ min-width: 0;
48621
+ }
48622
+
48623
+ .item + .item {
48624
+ border-top: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
48625
+ }
48626
+
48627
+ .itemHead {
48628
+ display: flex;
48629
+ align-items: center;
48630
+ gap: var(--dees-spacing-sm);
48631
+ min-width: 0;
48632
+ }
48633
+
48634
+ .itemLabel {
48635
+ flex: 1;
48636
+ min-width: 0;
48637
+ color: var(--dees-color-text-primary);
48638
+ font-weight: 500;
48639
+ overflow-wrap: anywhere;
48640
+ }
48641
+
48642
+ a.itemLabel {
48643
+ color: var(--dees-color-accent-primary);
48644
+ text-decoration: none;
48645
+ border-radius: var(--dees-radius-xs);
48646
+ }
48647
+
48648
+ a.itemLabel:hover {
48649
+ text-decoration: underline;
48650
+ }
48651
+
48652
+ a.itemLabel:focus-visible {
48653
+ outline: var(--dees-line-width-focus-ring) solid var(--dees-color-focus-ring);
48654
+ outline-offset: 2px;
48655
+ }
48656
+
48657
+ .changes {
48658
+ display: grid;
48659
+ grid-template-columns: auto minmax(0, 1fr);
48660
+ gap: var(--dees-spacing-2xs) var(--dees-spacing-md);
48661
+ margin: 0;
48662
+ }
48663
+
48664
+ .changes dt {
48665
+ color: var(--dees-color-text-secondary);
48666
+ white-space: nowrap;
48667
+ }
48668
+
48669
+ .changes dd {
48670
+ margin: 0;
48671
+ color: var(--dees-color-text-primary);
48672
+ overflow-wrap: anywhere;
48673
+ }
48674
+
48675
+ .before {
48676
+ color: var(--dees-color-text-secondary);
48677
+ text-decoration: line-through;
48678
+ }
48679
+
48680
+ .arrow {
48681
+ margin: 0 4px;
48682
+ color: var(--dees-color-text-secondary);
48683
+ }
48684
+
48685
+ .moreItems {
48686
+ margin: -4px 0 12px;
48687
+ padding: 0;
48688
+ border: none;
48689
+ background: none;
48690
+ color: var(--dees-color-accent-primary);
48691
+ font: inherit;
48692
+ font-size: var(--dees-font-caption1-size, 11px);
48693
+ cursor: pointer;
48694
+ border-radius: var(--dees-radius-xs);
48695
+ }
48696
+
48697
+ .moreItems:hover {
48698
+ text-decoration: underline;
48699
+ }
48700
+
48701
+ .outcome {
48702
+ display: inline-flex;
48703
+ align-items: center;
48704
+ gap: 6px;
48705
+ min-width: 0;
48706
+ color: var(--dees-color-text-secondary);
48707
+ font-size: var(--dees-font-caption1-size, 11px);
48708
+ overflow-wrap: anywhere;
48709
+ }
48710
+
48711
+ .item .outcome {
48712
+ flex: 0 1 auto;
48713
+ }
48714
+
48715
+ .outcome dees-icon {
48716
+ flex: 0 0 auto;
48717
+ }
48718
+
48719
+ .outcome.tone-running dees-icon { color: var(--dees-color-accent-primary); }
48720
+ .outcome.tone-success dees-icon { color: var(--dees-color-accent-success); }
48721
+ .outcome.tone-warning dees-icon { color: var(--dees-color-accent-warning); }
48722
+ .outcome.tone-error dees-icon { color: var(--dees-color-accent-error); }
48723
+ .outcome.tone-error { color: var(--dees-color-text-primary); }
48724
+
48725
+ .srOnly { ${visuallyHidden} }
48726
+ `;
48727
+ var harnessShownRecords = /* @__PURE__ */ __name((recordsArg, expandedArg) => expandedArg || recordsArg.length <= harnessRecordsShown ? recordsArg : recordsArg.slice(0, harnessRecordsShown), "harnessShownRecords");
48728
+ var renderHarnessMoreRecords = /* @__PURE__ */ __name((tArg, countArg, expandedArg, toggleArg) => {
48729
+ const hidden = countArg - harnessRecordsShown;
48730
+ if (hidden <= 0) return "";
48731
+ return b`
48732
+ <button class="moreItems" type="button" aria-expanded=${expandedArg ? "true" : "false"} @click=${toggleArg}>
48733
+ ${expandedArg ? tArg("permission.fewerItems") : tArg("permission.moreItems", { count: hidden })}
48734
+ </button>
48735
+ `;
48736
+ }, "renderHarnessMoreRecords");
48737
+ var renderHarnessChanges = /* @__PURE__ */ __name((tArg, changesArg) => b`
48738
+ <dl class="changes">
48739
+ ${changesArg.map((change) => b`
48740
+ <dt>${change.label}</dt>
48741
+ <dd>
48742
+ <span aria-hidden="true">${change.before !== void 0 ? b`<span class="before">${change.before}</span><span class="arrow">→</span>` : ""}<span class="after">${change.after}</span></span>
48743
+ <span class="srOnly">${change.before !== void 0 ? tArg("permission.change", { label: change.label, before: change.before, after: change.after }) : tArg("permission.changeNew", { label: change.label, after: change.after })}</span>
48744
+ </dd>
48745
+ `)}
48746
+ </dl>
48747
+ `, "renderHarnessChanges");
48748
+ var renderHarnessOutcome = /* @__PURE__ */ __name((outcomeArg) => b`
48749
+ <span class="outcome tone-${outcomeArg.tone}" role="status">
48750
+ <dees-icon
48751
+ class=${outcomeArg.tone === "running" ? "harnessActivity" : ""}
48752
+ icon=${OUTCOME_ICON[outcomeArg.tone]}
48753
+ iconSize="13"
48754
+ aria-hidden="true"
48755
+ ></dees-icon>
48756
+ <span>${outcomeArg.text}</span>
48757
+ </span>
48758
+ `, "renderHarnessOutcome");
48759
+ var routeHarnessRecordLink = /* @__PURE__ */ __name((eventArg, dispatchArg) => {
48760
+ if (eventArg.button !== 0 || eventArg.metaKey || eventArg.ctrlKey || eventArg.shiftKey || eventArg.altKey) return;
48761
+ if (!dispatchArg()) eventArg.preventDefault();
48762
+ }, "routeHarnessRecordLink");
48763
+
48476
48764
  // ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.ts
48477
48765
  var _itemsExpanded_dec, _answered_dec, _remember_dec, _viewState_dec5, _busy_dec, _request_dec, _a62, _DeesHarnessPermissionCard_decorators, _init64, _request, _busy, _viewState5, _remember, _answered, _itemsExpanded;
48478
48766
  var badgeTypeForPermission = /* @__PURE__ */ __name((permissionType) => {
@@ -48491,14 +48779,6 @@ var DEFAULT_EMPHASIS = {
48491
48779
  reject: "destructive"
48492
48780
  };
48493
48781
  var BUTTON_TYPE = { accent: "accent", plain: "default", destructive: "destructive" };
48494
- var OUTCOME_ICON = {
48495
- running: "lucide:LoaderCircle",
48496
- success: "lucide:CircleCheck",
48497
- warning: "lucide:TriangleAlert",
48498
- error: "lucide:CircleX",
48499
- neutral: "lucide:Info"
48500
- };
48501
- var ITEMS_SHOWN = 5;
48502
48782
  _DeesHarnessPermissionCard_decorators = [customElement("dees-harness-permission-card")];
48503
48783
  var _DeesHarnessPermissionCard = class _DeesHarnessPermissionCard extends (_a62 = DeesElement, _request_dec = [n({ attribute: false })], _busy_dec = [n({ type: Boolean, reflect: true })], _viewState_dec5 = [n({ attribute: false })], _remember_dec = [r2()], _answered_dec = [r2()], _itemsExpanded_dec = [r2()], _a62) {
48504
48784
  constructor() {
@@ -48553,7 +48833,7 @@ var _DeesHarnessPermissionCard = class _DeesHarnessPermissionCard extends (_a62
48553
48833
  </div>
48554
48834
  ` : ""}
48555
48835
  <div class="actions">
48556
- ${this.effectiveResponse ? request.outcome ? this.renderOutcome(request.outcome) : b`<span class="answeredNote">${this.t(this.rememberable && this.effectiveRemember ? "permission.answeredRemembered" : "permission.answered", {
48836
+ ${this.effectiveResponse ? request.outcome ? renderHarnessOutcome(request.outcome) : b`<span class="answeredNote">${this.t(this.rememberable && this.effectiveRemember ? "permission.answeredRemembered" : "permission.answered", {
48557
48837
  response: this.responseWords(this.effectiveResponse)
48558
48838
  })}</span>` : b`
48559
48839
  ${this.actions.map((action) => b`
@@ -48589,52 +48869,19 @@ var _DeesHarnessPermissionCard = class _DeesHarnessPermissionCard extends (_a62
48589
48869
  renderItems(itemsArg) {
48590
48870
  if (itemsArg.length === 0) return "";
48591
48871
  const expanded = this.effectiveItemsExpanded;
48592
- const shown = expanded || itemsArg.length <= ITEMS_SHOWN ? itemsArg : itemsArg.slice(0, ITEMS_SHOWN);
48593
- const hidden = itemsArg.length - ITEMS_SHOWN;
48594
48872
  return b`
48595
48873
  <ul class="items" aria-label=${this.t("permission.items")}>
48596
- ${shown.map((item) => b`
48874
+ ${harnessShownRecords(itemsArg, expanded).map((item) => b`
48597
48875
  <li class="item">
48598
48876
  <div class="itemHead">
48599
48877
  ${item.href ? b`<a class="itemLabel" href=${item.href} @click=${(event) => this.openItem(event, item)}>${item.label}</a>` : b`<span class="itemLabel">${item.label}</span>`}
48600
- ${item.outcome ? this.renderOutcome(item.outcome) : ""}
48878
+ ${item.outcome ? renderHarnessOutcome(item.outcome) : ""}
48601
48879
  </div>
48602
- ${item.changes?.length ? this.renderChanges(item.changes) : ""}
48880
+ ${item.changes?.length ? renderHarnessChanges(this.t, item.changes) : ""}
48603
48881
  </li>
48604
48882
  `)}
48605
48883
  </ul>
48606
- ${hidden > 0 ? b`
48607
- <button class="moreItems" type="button" aria-expanded=${expanded ? "true" : "false"} @click=${this.toggleItems}>
48608
- ${expanded ? this.t("permission.fewerItems") : this.t("permission.moreItems", { count: hidden })}
48609
- </button>
48610
- ` : ""}
48611
- `;
48612
- }
48613
- /** What changes in a record: each field, its value before struck through, and after. */
48614
- renderChanges(changesArg) {
48615
- return b`
48616
- <dl class="changes">
48617
- ${changesArg.map((change) => b`
48618
- <dt>${change.label}</dt>
48619
- <dd>
48620
- <span aria-hidden="true">${change.before !== void 0 ? b`<span class="before">${change.before}</span><span class="arrow">→</span>` : ""}<span class="after">${change.after}</span></span>
48621
- <span class="srOnly">${change.before !== void 0 ? this.t("permission.change", { label: change.label, before: change.before, after: change.after }) : this.t("permission.changeNew", { label: change.label, after: change.after })}</span>
48622
- </dd>
48623
- `)}
48624
- </dl>
48625
- `;
48626
- }
48627
- renderOutcome(outcomeArg) {
48628
- return b`
48629
- <span class="outcome tone-${outcomeArg.tone}" role="status">
48630
- <dees-icon
48631
- class=${outcomeArg.tone === "running" ? "harnessActivity" : ""}
48632
- icon=${OUTCOME_ICON[outcomeArg.tone]}
48633
- iconSize="13"
48634
- aria-hidden="true"
48635
- ></dees-icon>
48636
- <span>${outcomeArg.text}</span>
48637
- </span>
48884
+ ${renderHarnessMoreRecords(this.t, itemsArg.length, expanded, this.toggleItems)}
48638
48885
  `;
48639
48886
  }
48640
48887
  /** An answer as the answered note names it: the host's words for it where it gave them. */
@@ -48644,14 +48891,12 @@ var _DeesHarnessPermissionCard = class _DeesHarnessPermissionCard extends (_a62
48644
48891
  }
48645
48892
  /** A record's link: the host may route it itself (it cancels the event); a plain or modified click otherwise follows it. */
48646
48893
  openItem(eventArg, itemArg) {
48647
- if (eventArg.button !== 0 || eventArg.metaKey || eventArg.ctrlKey || eventArg.shiftKey || eventArg.altKey) return;
48648
- const proceed = this.dispatchEvent(new CustomEvent("harness-permission-link", {
48894
+ routeHarnessRecordLink(eventArg, () => this.dispatchEvent(new CustomEvent("harness-permission-link", {
48649
48895
  detail: { requestId: this.request.id, item: itemArg, request: this.request },
48650
48896
  bubbles: true,
48651
48897
  composed: true,
48652
48898
  cancelable: true
48653
- }));
48654
- if (!proceed) eventArg.preventDefault();
48899
+ })));
48655
48900
  }
48656
48901
  respond(response) {
48657
48902
  if (this.busy || this.effectiveResponse !== void 0) return;
@@ -48707,6 +48952,7 @@ __publicField(_DeesHarnessPermissionCard, "styles", [
48707
48952
  cssManager.defaultStyles,
48708
48953
  harnessControlStyles,
48709
48954
  harnessActivityStyles,
48955
+ harnessRecordStyles,
48710
48956
  i`
48711
48957
  :host {
48712
48958
  display: block;
@@ -48799,127 +49045,6 @@ __publicField(_DeesHarnessPermissionCard, "styles", [
48799
49045
  line-height: 1.5;
48800
49046
  overflow-wrap: anywhere;
48801
49047
  }
48802
-
48803
- .items {
48804
- list-style: none;
48805
- margin: 12px 0;
48806
- padding: 0;
48807
- border: var(--dees-line-width-hairline) solid var(--dees-color-control-border);
48808
- border-radius: var(--dees-radius-lg);
48809
- background: var(--dees-color-control-bg);
48810
- font-size: 12px;
48811
- }
48812
-
48813
- .item {
48814
- display: grid;
48815
- gap: 4px;
48816
- padding: 8px 12px;
48817
- min-width: 0;
48818
- }
48819
-
48820
- .item + .item {
48821
- border-top: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
48822
- }
48823
-
48824
- .itemHead {
48825
- display: flex;
48826
- align-items: center;
48827
- gap: var(--dees-spacing-sm);
48828
- min-width: 0;
48829
- }
48830
-
48831
- .itemLabel {
48832
- flex: 1;
48833
- min-width: 0;
48834
- color: var(--dees-color-text-primary);
48835
- font-weight: 500;
48836
- overflow-wrap: anywhere;
48837
- }
48838
-
48839
- a.itemLabel {
48840
- color: var(--dees-color-accent-primary);
48841
- text-decoration: none;
48842
- border-radius: var(--dees-radius-xs);
48843
- }
48844
-
48845
- a.itemLabel:hover {
48846
- text-decoration: underline;
48847
- }
48848
-
48849
- a.itemLabel:focus-visible {
48850
- outline: var(--dees-line-width-focus-ring) solid var(--dees-color-focus-ring);
48851
- outline-offset: 2px;
48852
- }
48853
-
48854
- .changes {
48855
- display: grid;
48856
- grid-template-columns: auto minmax(0, 1fr);
48857
- gap: var(--dees-spacing-2xs) var(--dees-spacing-md);
48858
- margin: 0;
48859
- }
48860
-
48861
- .changes dt {
48862
- color: var(--dees-color-text-secondary);
48863
- white-space: nowrap;
48864
- }
48865
-
48866
- .changes dd {
48867
- margin: 0;
48868
- color: var(--dees-color-text-primary);
48869
- overflow-wrap: anywhere;
48870
- }
48871
-
48872
- .before {
48873
- color: var(--dees-color-text-secondary);
48874
- text-decoration: line-through;
48875
- }
48876
-
48877
- .arrow {
48878
- margin: 0 4px;
48879
- color: var(--dees-color-text-secondary);
48880
- }
48881
-
48882
- .moreItems {
48883
- margin: -4px 0 12px;
48884
- padding: 0;
48885
- border: none;
48886
- background: none;
48887
- color: var(--dees-color-accent-primary);
48888
- font: inherit;
48889
- font-size: var(--dees-font-caption1-size, 11px);
48890
- cursor: pointer;
48891
- border-radius: var(--dees-radius-xs);
48892
- }
48893
-
48894
- .moreItems:hover {
48895
- text-decoration: underline;
48896
- }
48897
-
48898
- .outcome {
48899
- display: inline-flex;
48900
- align-items: center;
48901
- gap: 6px;
48902
- min-width: 0;
48903
- color: var(--dees-color-text-secondary);
48904
- font-size: var(--dees-font-caption1-size, 11px);
48905
- overflow-wrap: anywhere;
48906
- }
48907
-
48908
- .item .outcome {
48909
- flex: 0 1 auto;
48910
- }
48911
-
48912
- .outcome dees-icon {
48913
- flex: 0 0 auto;
48914
- }
48915
-
48916
- .outcome.tone-running dees-icon { color: var(--dees-color-accent-primary); }
48917
- .outcome.tone-success dees-icon { color: var(--dees-color-accent-success); }
48918
- .outcome.tone-warning dees-icon { color: var(--dees-color-accent-warning); }
48919
- .outcome.tone-error dees-icon { color: var(--dees-color-accent-error); }
48920
- .outcome.tone-error { color: var(--dees-color-text-primary); }
48921
-
48922
- .srOnly { ${visuallyHidden} }
48923
49048
  `
48924
49049
  ]);
48925
49050
  __runInitializers(_init64, 1, _DeesHarnessPermissionCard);
@@ -49582,13 +49707,182 @@ var DeesHarnessStatus = _DeesHarnessStatus;
49582
49707
  // ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.demo.ts
49583
49708
  var logResponse2 = /* @__PURE__ */ __name((event) => {
49584
49709
  const card = event.target;
49585
- card.request = { ...card.request, response: event.detail.answers, respondedAt: Date.now() };
49710
+ card.request = {
49711
+ ...card.request,
49712
+ response: event.detail.answers,
49713
+ respondedAt: Date.now(),
49714
+ declinedItemIds: event.detail.declinedItemIds
49715
+ };
49586
49716
  showDemoResult(event.currentTarget, event.detail);
49587
49717
  }, "logResponse");
49588
- var demoFunc44 = /* @__PURE__ */ __name(() => demoPage("Questions", "Single choices, multiple choices and written answers.", b`
49589
- <div class="questionDemo dees-demo-stack" @harness-question-response=${logResponse2}>
49590
- <dees-harness-question-card
49591
- .request=${{
49718
+ var runProposal = /* @__PURE__ */ __name((event) => {
49719
+ logResponse2(event);
49720
+ const card = event.target;
49721
+ if (event.detail.answers[0] !== "confirm") return;
49722
+ card.request = { ...card.request, outcome: { tone: "running", text: "Making the changes\u2026" } };
49723
+ setTimeout(() => {
49724
+ card.request = { ...card.request, outcome: { tone: "success", text: "Changes made" } };
49725
+ }, 1500);
49726
+ }, "runProposal");
49727
+ var routeLink = /* @__PURE__ */ __name((event) => {
49728
+ event.preventDefault();
49729
+ showDemoResult(event.currentTarget, { link: event.detail.item.label, requestId: event.detail.requestId });
49730
+ }, "routeLink");
49731
+ var invoices2 = /* @__PURE__ */ __name((countArg) => Array.from({ length: countArg }, (_, index) => {
49732
+ const number = `R-2026-01${String(40 + index).padStart(2, "0")}`;
49733
+ return {
49734
+ id: `invoice-${number}`,
49735
+ summary: "Books it to 8400 Revenue",
49736
+ label: `Invoice ${number}`,
49737
+ href: "#",
49738
+ changes: [{ label: "Status", before: "Draft", after: "Booked" }]
49739
+ };
49740
+ }), "invoices");
49741
+ var proposals = [
49742
+ {
49743
+ id: "p-single",
49744
+ kind: "proposal",
49745
+ question: "Create this customer?",
49746
+ items: [{
49747
+ id: "customer",
49748
+ summary: "Creates the customer, ready for invoices",
49749
+ changes: [{ label: "Name", after: "Lindqvist Design AB" }, { label: "Country", after: "Sweden" }]
49750
+ }]
49751
+ },
49752
+ {
49753
+ id: "p-warning",
49754
+ kind: "proposal",
49755
+ severity: "warning",
49756
+ question: "Archive the project Q3 Campaign?",
49757
+ items: [{ id: "project", summary: "Archives the project and its 14 tasks; it can be restored for 30 days", label: "Q3 Campaign", href: "#" }]
49758
+ },
49759
+ {
49760
+ id: "p-danger",
49761
+ kind: "proposal",
49762
+ severity: "danger",
49763
+ question: "Change the account every future payout goes to?",
49764
+ confirmLabel: "Change account",
49765
+ items: [{
49766
+ id: "payout-account",
49767
+ summary: "Sends every future payout to the new account",
49768
+ label: "Payout settings",
49769
+ href: "#",
49770
+ changes: [
49771
+ { label: "IBAN", before: "DE89 3704 0044 0532 0130 00", after: "DE02 1203 0000 0000 2020 51" },
49772
+ { label: "Account holder", before: "Acme GmbH", after: "Acme Holding GmbH" }
49773
+ ]
49774
+ }]
49775
+ },
49776
+ {
49777
+ id: "p-mixed",
49778
+ kind: "proposal",
49779
+ question: "Tidy up the customer Nordwind GmbH?",
49780
+ items: [
49781
+ {
49782
+ id: "contact",
49783
+ summary: "Merges the duplicate contact into the customer",
49784
+ label: "Contact Nordwind GmbH (2)",
49785
+ href: "#"
49786
+ },
49787
+ {
49788
+ id: "terms",
49789
+ severity: "warning",
49790
+ summary: "Shortens the payment terms; open invoices keep theirs",
49791
+ label: "Customer Nordwind GmbH",
49792
+ href: "#",
49793
+ changes: [{ label: "Payment terms", before: "30 days", after: "14 days" }]
49794
+ },
49795
+ {
49796
+ id: "draft",
49797
+ severity: "danger",
49798
+ summary: "Deletes the unsent draft invoice",
49799
+ label: "Invoice R-2026-0098",
49800
+ href: "#"
49801
+ }
49802
+ ]
49803
+ },
49804
+ {
49805
+ id: "p-several",
49806
+ kind: "proposal",
49807
+ question: "Book these six invoices?",
49808
+ itemsDeclinable: true,
49809
+ items: invoices2(6)
49810
+ }
49811
+ ];
49812
+ var decided = [
49813
+ {
49814
+ id: "p-running",
49815
+ kind: "proposal",
49816
+ question: "Send a payment reminder to three customers?",
49817
+ items: [{ id: "reminders", summary: "Sends the reminder by e-mail to Lindqvist Design AB, Nordwind GmbH and Kaya Studio" }],
49818
+ response: ["confirm"],
49819
+ outcome: { tone: "running", text: "Sending 3 reminders\u2026" }
49820
+ },
49821
+ {
49822
+ id: "p-confirmed",
49823
+ kind: "proposal",
49824
+ question: "Book these three invoices?",
49825
+ itemsDeclinable: true,
49826
+ items: invoices2(3).map((item) => item.id === "invoice-R-2026-0141" ? item : { ...item, outcome: { tone: "success", text: "Booked" } }),
49827
+ response: ["confirm"],
49828
+ declinedItemIds: ["invoice-R-2026-0141"],
49829
+ outcome: { tone: "success", text: "2 invoices booked, 1 left out" }
49830
+ },
49831
+ {
49832
+ id: "p-credential",
49833
+ kind: "proposal",
49834
+ severity: "warning",
49835
+ question: "Issue an API key for the accounting export?",
49836
+ items: [{
49837
+ id: "api-key",
49838
+ summary: "Issues a key that reads invoices and bookings, valid for a year",
49839
+ label: "Accounting export",
49840
+ href: "#",
49841
+ outcome: { tone: "success", text: "Issued" },
49842
+ credential: { label: "API key", value: "demo_key_7Hq2-x9Lw-4Rt8-Kd3m-Vb6n", note: "Shown once: store it now. Only you can see it; the agent is not shown it." }
49843
+ }],
49844
+ response: ["confirm"],
49845
+ outcome: { tone: "success", text: "API key issued" }
49846
+ },
49847
+ {
49848
+ id: "p-declined",
49849
+ kind: "proposal",
49850
+ severity: "danger",
49851
+ question: "Delete the draft offer A-2026-0031?",
49852
+ items: [{ id: "offer", summary: "Deletes the draft and its 3 attachments", label: "Offer A-2026-0031", href: "#" }],
49853
+ response: ["decline"]
49854
+ },
49855
+ {
49856
+ id: "p-expired",
49857
+ kind: "proposal",
49858
+ severity: "warning",
49859
+ question: "Pay the supplier invoice E-4471 today?",
49860
+ items: [{ id: "payment", summary: "Transfers 2,480.00 \u20AC to Nordwind GmbH", label: "Invoice E-4471", href: "#" }],
49861
+ state: "expired",
49862
+ outcome: { tone: "neutral", text: "The conversation ended before an answer." }
49863
+ },
49864
+ {
49865
+ id: "p-failed",
49866
+ kind: "proposal",
49867
+ question: "Rename the account 1200?",
49868
+ items: [{
49869
+ id: "account",
49870
+ summary: "Renames the account in the chart of accounts",
49871
+ label: "Account 1200",
49872
+ href: "#",
49873
+ changes: [{ label: "Name", before: "Bank", after: "Bank \u2014 Sparkasse" }],
49874
+ outcome: { tone: "error", text: "Not changed" }
49875
+ }],
49876
+ response: ["confirm"],
49877
+ state: "failed",
49878
+ outcome: { tone: "error", text: "The ledger refused the change: account 1200 is locked for the closed year 2025." }
49879
+ }
49880
+ ];
49881
+ var demoFunc44 = /* @__PURE__ */ __name(() => demoPage("Questions", "Questions the agent asks, and changes it proposes that wait for a confirmation.", b`
49882
+ ${demoSection("Questions", "Single choices, multiple choices and written answers.", b`
49883
+ <div class="questionDemo dees-demo-stack" @harness-question-response=${logResponse2}>
49884
+ <dees-harness-question-card
49885
+ .request=${{
49592
49886
  id: "q1",
49593
49887
  question: "Which database should the new service use?",
49594
49888
  createdAt: Date.now(),
@@ -49598,9 +49892,9 @@ var demoFunc44 = /* @__PURE__ */ __name(() => demoPage("Questions", "Single choi
49598
49892
  { label: "SQLite", description: "Embedded, zero ops" }
49599
49893
  ]
49600
49894
  }}
49601
- ></dees-harness-question-card>
49602
- <dees-harness-question-card
49603
- .request=${{
49895
+ ></dees-harness-question-card>
49896
+ <dees-harness-question-card
49897
+ .request=${{
49604
49898
  id: "q2",
49605
49899
  question: "Which environments should the rollout include?",
49606
49900
  multiSelect: true,
@@ -49611,39 +49905,76 @@ var demoFunc44 = /* @__PURE__ */ __name(() => demoPage("Questions", "Single choi
49611
49905
  { label: "production-us" }
49612
49906
  ]
49613
49907
  }}
49614
- ></dees-harness-question-card>
49615
- <dees-harness-question-card
49616
- .request=${{
49908
+ ></dees-harness-question-card>
49909
+ <dees-harness-question-card
49910
+ .request=${{
49911
+ id: "q-warning",
49912
+ severity: "warning",
49913
+ question: "The import brings its own tax settings. Replace the current ones?",
49914
+ allowCustom: false,
49915
+ options: [
49916
+ { label: "Replace them", description: "The imported rates apply from the next booking on" },
49917
+ { label: "Keep the current ones" }
49918
+ ]
49919
+ }}
49920
+ ></dees-harness-question-card>
49921
+ <dees-harness-question-card
49922
+ .request=${{
49617
49923
  id: "q3",
49618
49924
  question: "Anything else I should know before migrating?",
49619
49925
  options: []
49620
49926
  }}
49621
- ></dees-harness-question-card>
49622
- <dees-harness-question-card
49623
- busy
49624
- .request=${{
49927
+ ></dees-harness-question-card>
49928
+ <dees-harness-question-card
49929
+ busy
49930
+ .request=${{
49625
49931
  id: "q-busy",
49626
49932
  question: "Waiting for the runtime \u2014 which region?",
49627
49933
  options: [{ label: "eu-central" }, { label: "us-east" }]
49628
49934
  }}
49629
- ></dees-harness-question-card>
49630
- <dees-harness-question-card
49631
- .request=${{
49935
+ ></dees-harness-question-card>
49936
+ <dees-harness-question-card
49937
+ .request=${{
49632
49938
  id: "q4",
49633
49939
  question: "Which framework for the admin UI?",
49634
49940
  options: [{ label: "Lit" }, { label: "React" }],
49635
49941
  response: ["Lit"],
49636
49942
  respondedAt: Date.now() - 6e4
49637
49943
  }}
49638
- ></dees-harness-question-card>
49944
+ ></dees-harness-question-card>
49945
+ </div>
49639
49946
  ${demoOutput()}
49640
- </div>
49947
+ `)}
49948
+ ${demoSection("Proposals", "A change the agent makes once confirmed: a single one, one that asks for care, one that cannot be taken back, several collected into one decision (the most serious change sets the card's colour), and several the reader may leave single ones out of.", b`
49949
+ <div class="dees-demo-stack" @harness-question-response=${runProposal} @harness-question-link=${routeLink}>
49950
+ ${proposals.map((request) => b`<dees-harness-question-card .request=${request}></dees-harness-question-card>`)}
49951
+ </div>
49952
+ ${demoOutput()}
49953
+ `)}
49954
+ ${demoSection("Decided proposals", "Read-only once decided: confirmed and under way, confirmed with a change left out, confirmed with a secret only the reader sees, declined, expired, failed.", b`
49955
+ <div class="dees-demo-stack" @harness-question-link=${routeLink}>
49956
+ ${decided.map((request) => b`<dees-harness-question-card .request=${request}></dees-harness-question-card>`)}
49957
+ </div>
49958
+ ${demoOutput()}
49959
+ `)}
49641
49960
  `), "demoFunc");
49642
49961
 
49643
49962
  // ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.ts
49644
- var _customText_dec, _selected_dec, _answered_dec2, _viewState_dec6, _busy_dec2, _request_dec2, _a64, _DeesHarnessQuestionCard_decorators, _init66, _request2, _busy2, _viewState6, _answered2, _selected, _customText;
49963
+ var _copyFeedback_dec2, _credentialsShown_dec, _leftOut_dec, _itemsExpanded_dec2, _customText_dec, _selected_dec, _answered_dec2, _viewState_dec6, _busy_dec2, _request_dec2, _a64, _DeesHarnessQuestionCard_decorators, _init66, _request2, _busy2, _viewState6, _answered2, _selected, _customText, _itemsExpanded2, _leftOut, _credentialsShown, _copyFeedback2;
49964
+ var titleIcon = /* @__PURE__ */ __name((kindArg, severityArg) => severityArg === "danger" ? "lucide:OctagonAlert" : severityArg === "warning" ? "lucide:TriangleAlert" : kindArg === "proposal" ? "lucide:ListChecks" : "lucide:MessageCircleQuestionMark", "titleIcon");
49965
+ var ITEM_ICON = {
49966
+ warning: "lucide:TriangleAlert",
49967
+ danger: "lucide:OctagonAlert"
49968
+ };
49969
+ var CREDENTIAL_MASK = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
49970
+ var STATE_BADGE = {
49971
+ confirmed: "success",
49972
+ declined: "default",
49973
+ expired: "default",
49974
+ failed: "error"
49975
+ };
49645
49976
  _DeesHarnessQuestionCard_decorators = [customElement("dees-harness-question-card")];
49646
- var _DeesHarnessQuestionCard = class _DeesHarnessQuestionCard extends (_a64 = DeesElement, _request_dec2 = [n({ attribute: false })], _busy_dec2 = [n({ type: Boolean, reflect: true })], _viewState_dec6 = [n({ attribute: false })], _answered_dec2 = [r2()], _selected_dec = [r2()], _customText_dec = [r2()], _a64) {
49977
+ var _DeesHarnessQuestionCard = class _DeesHarnessQuestionCard extends (_a64 = DeesElement, _request_dec2 = [n({ attribute: false })], _busy_dec2 = [n({ type: Boolean, reflect: true })], _viewState_dec6 = [n({ attribute: false })], _answered_dec2 = [r2()], _selected_dec = [r2()], _customText_dec = [r2()], _itemsExpanded_dec2 = [r2()], _leftOut_dec = [r2()], _credentialsShown_dec = [r2()], _copyFeedback_dec2 = [r2()], _a64) {
49647
49978
  constructor() {
49648
49979
  super(...arguments);
49649
49980
  __publicField(this, "t", dcLocalize(this));
@@ -49653,90 +49984,282 @@ var _DeesHarnessQuestionCard = class _DeesHarnessQuestionCard extends (_a64 = De
49653
49984
  __privateAdd(this, _answered2, __runInitializers(_init66, 20, this)), __runInitializers(_init66, 23, this);
49654
49985
  __privateAdd(this, _selected, __runInitializers(_init66, 24, this, /* @__PURE__ */ new Set())), __runInitializers(_init66, 27, this);
49655
49986
  __privateAdd(this, _customText, __runInitializers(_init66, 28, this, "")), __runInitializers(_init66, 31, this);
49987
+ __privateAdd(this, _itemsExpanded2, __runInitializers(_init66, 32, this)), __runInitializers(_init66, 35, this);
49988
+ __privateAdd(this, _leftOut, __runInitializers(_init66, 36, this)), __runInitializers(_init66, 39, this);
49989
+ __privateAdd(this, _credentialsShown, __runInitializers(_init66, 40, this, /* @__PURE__ */ new Set())), __runInitializers(_init66, 43, this);
49990
+ __privateAdd(this, _copyFeedback2, __runInitializers(_init66, 44, this)), __runInitializers(_init66, 47, this);
49991
+ __publicField(this, "copyRequest", 0);
49992
+ __publicField(this, "copyResetTimeout");
49993
+ __publicField(this, "footerActions");
49994
+ __publicField(this, "toggleItems", /* @__PURE__ */ __name(() => {
49995
+ this.itemsExpanded = !this.effectiveItemsExpanded;
49996
+ if (this.viewState) this.viewState.itemsExpanded = this.itemsExpanded;
49997
+ }, "toggleItems"));
49656
49998
  }
49657
49999
  get effectiveResponse() {
49658
50000
  return this.request.response ?? this.answered ?? this.viewState?.answered;
49659
50001
  }
50002
+ /** Where a proposal stands, the reader's answer counted before the host echoes it; a question is never more than `pending`. */
50003
+ get proposalState() {
50004
+ return this.request.kind === "proposal" ? harnessProposalState(this.request, this.effectiveResponse) : "pending";
50005
+ }
49660
50006
  get effectiveSelected() {
49661
50007
  return this.selected.size > 0 ? this.selected : new Set(this.viewState?.selected ?? []);
49662
50008
  }
49663
50009
  get effectiveCustomText() {
49664
50010
  return this.customText || this.viewState?.customText || "";
49665
50011
  }
50012
+ get effectiveItemsExpanded() {
50013
+ return this.itemsExpanded ?? this.viewState?.itemsExpanded ?? false;
50014
+ }
50015
+ /** Whether the reader may leave single changes out: a declinable proposal of two or more. */
50016
+ get itemsDeclinable() {
50017
+ return this.request.kind === "proposal" && this.request.itemsDeclinable === true && (this.request.items?.length ?? 0) >= 2;
50018
+ }
50019
+ /**
50020
+ * The changes left out, by item id, of those the proposal still has: while it waits, the
50021
+ * reader's choice; once confirmed, the host's echo of the answer, else the reader's choice.
50022
+ */
50023
+ get effectiveLeftOut() {
50024
+ if (!this.itemsDeclinable) return /* @__PURE__ */ new Set();
50025
+ const ids = this.proposalState === "pending" ? this.leftOut ?? this.viewState?.declinedItemIds ?? [] : this.request.declinedItemIds ?? this.leftOut ?? this.viewState?.declinedItemIds ?? [];
50026
+ const chosen = new Set(ids);
50027
+ return new Set((this.request.items ?? []).filter((item) => chosen.has(item.id)).map((item) => item.id));
50028
+ }
50029
+ /** Whether the card takes no answer: answered, waiting for the host (`busy`), or its changes under way or decided. */
50030
+ get locked() {
50031
+ return this.busy || this.effectiveResponse !== void 0 || this.proposalState !== "pending";
50032
+ }
49666
50033
  render() {
49667
50034
  const request = this.request;
49668
- const response = this.effectiveResponse;
49669
- const disabled = this.busy || response !== void 0;
50035
+ const severity = harnessQuestionSeverity(request);
50036
+ const waiting = request.kind === "proposal" ? this.proposalState === "pending" : this.effectiveResponse === void 0;
49670
50037
  return b`
49671
- <div class="card">
49672
- <div class="titleRow">
49673
- <dees-icon icon="lucide:MessageCircleQuestionMark" iconSize="15"></dees-icon>
49674
- <span class="questionText">${request.question}</span>
50038
+ <div class="card severity-${severity} ${waiting ? "waiting" : ""}">
50039
+ <div class="body">
50040
+ <div class="titleRow">
50041
+ <dees-icon icon=${titleIcon(request.kind, severity)} iconSize="15" aria-hidden="true"></dees-icon>
50042
+ <span class="questionText">${severity === "info" ? "" : b`<span class="srOnly">${this.t(severity === "danger" ? "question.danger" : "question.warning")} </span>`}${request.question}</span>
50043
+ </div>
50044
+ ${request.kind === "proposal" ? this.renderProposal() : this.renderQuestion()}
49675
50045
  </div>
49676
- ${response ? b`
49677
- <div class="answeredNote">
49678
- ${this.t("question.answered")}
49679
- <span class="answerText">${this.t.format.list(response, "unit") || "\u2014"}</span>
49680
- </div>
49681
- ` : b`
49682
- ${request.options?.length ? b`
49683
- <div class="options" role=${request.multiSelect ? "group" : "radiogroup"}>
49684
- ${request.options.map((option) => b`
49685
- <button
49686
- class="option ${this.effectiveSelected.has(option.label) ? "selected" : ""}"
49687
- type="button"
49688
- ?disabled=${disabled}
49689
- @click=${() => this.handleOptionClick(option.label)}
49690
- >
49691
- <div class="optionLabel">${option.label}</div>
49692
- ${option.description ? b`<div class="optionDescription">${option.description}</div>` : ""}
49693
- </button>
49694
- `)}
49695
- </div>
49696
- ` : ""}
49697
- ${request.allowCustom !== false ? b`
49698
- <div class="customRow">
49699
- <input
49700
- placeholder=${this.t("question.custom")}
49701
- .value=${this.effectiveCustomText}
49702
- ?disabled=${disabled}
49703
- @input=${(event) => {
50046
+ ${request.kind === "proposal" && waiting ? b`
50047
+ <dees-actionfooter
50048
+ source="harness-question-card"
50049
+ .actions=${this.proposalActions}
50050
+ .primaryActionType=${severity === "danger" ? "destructive" : "accent"}
50051
+ .disabled=${this.busy}
50052
+ ></dees-actionfooter>
50053
+ ` : ""}
50054
+ </div>
50055
+ `;
50056
+ }
50057
+ renderQuestion() {
50058
+ const request = this.request;
50059
+ const response = this.effectiveResponse;
50060
+ const disabled = this.busy || response !== void 0;
50061
+ return response ? b`
50062
+ <div class="answeredNote">
50063
+ ${this.t("question.answered")}
50064
+ <span class="answerText">${this.t.format.list(response, "unit") || "\u2014"}</span>
50065
+ </div>
50066
+ ` : b`
50067
+ ${request.options?.length ? b`
50068
+ <div class="options" role=${request.multiSelect ? "group" : "radiogroup"}>
50069
+ ${request.options.map((option) => b`
50070
+ <button
50071
+ class="option ${this.effectiveSelected.has(option.label) ? "selected" : ""}"
50072
+ type="button"
50073
+ ?disabled=${disabled}
50074
+ @click=${() => this.handleOptionClick(option.label)}
50075
+ >
50076
+ <div class="optionLabel">${option.label}</div>
50077
+ ${option.description ? b`<div class="optionDescription">${option.description}</div>` : ""}
50078
+ </button>
50079
+ `)}
50080
+ </div>
50081
+ ` : ""}
50082
+ ${request.allowCustom !== false ? b`
50083
+ <div class="customRow">
50084
+ <input
50085
+ placeholder=${this.t("question.custom")}
50086
+ .value=${this.effectiveCustomText}
50087
+ ?disabled=${disabled}
50088
+ @input=${(event) => {
49704
50089
  this.customText = event.currentTarget.value;
49705
50090
  if (this.viewState) this.viewState.customText = this.customText;
49706
50091
  }}
49707
- @keydown=${(event) => {
50092
+ @keydown=${(event) => {
49708
50093
  if (event.key === "Enter" && this.effectiveCustomText.trim()) {
49709
50094
  this.respond([...this.effectiveSelected, this.effectiveCustomText.trim()]);
49710
50095
  }
49711
50096
  }}
49712
- />
49713
- <dees-button
49714
- size="sm"
49715
- ?disabled=${disabled || !this.effectiveCustomText.trim() && !this.effectiveSelected.size}
49716
- @clicked=${() => {
50097
+ />
50098
+ <dees-button
50099
+ size="sm"
50100
+ ?disabled=${disabled || !this.effectiveCustomText.trim() && !this.effectiveSelected.size}
50101
+ @clicked=${() => {
49717
50102
  const answers = [...this.effectiveSelected];
49718
50103
  if (this.effectiveCustomText.trim()) answers.push(this.effectiveCustomText.trim());
49719
50104
  this.respond(answers);
49720
50105
  }}
49721
- >${this.t("question.send")}</dees-button>
49722
- </div>
49723
- ` : ""}
49724
- ${request.multiSelect && request.allowCustom === false ? b`
49725
- <div class="confirmRow">
49726
- <dees-button
49727
- type="accent"
49728
- size="sm"
49729
- ?disabled=${disabled || !this.effectiveSelected.size}
49730
- @clicked=${() => this.respond([...this.effectiveSelected])}
49731
- >${this.t("question.confirm")}</dees-button>
50106
+ >${this.t("question.send")}</dees-button>
50107
+ </div>
50108
+ ` : ""}
50109
+ ${request.multiSelect && request.allowCustom === false ? b`
50110
+ <div class="confirmRow">
50111
+ <dees-button
50112
+ type="accent"
50113
+ size="sm"
50114
+ ?disabled=${disabled || !this.effectiveSelected.size}
50115
+ @clicked=${() => this.respond([...this.effectiveSelected])}
50116
+ >${this.t("question.confirm")}</dees-button>
50117
+ </div>
50118
+ ` : ""}
50119
+ `;
50120
+ }
50121
+ /** The proposed changes and, once decided, the state and what came of it. */
50122
+ renderProposal() {
50123
+ const items = this.request.items ?? [];
50124
+ const expanded = this.effectiveItemsExpanded;
50125
+ const proposalState = this.proposalState;
50126
+ const choosing = this.itemsDeclinable && proposalState === "pending";
50127
+ const leftOut = choosing || proposalState === "confirmed" || proposalState === "failed" ? this.effectiveLeftOut : /* @__PURE__ */ new Set();
50128
+ return b`
50129
+ ${items.length ? b`
50130
+ <ul class="items" aria-label=${this.t("question.items")}>
50131
+ ${harnessShownRecords(items, expanded).map((item) => {
50132
+ const severity = item.severity ?? "info";
50133
+ const isLeftOut = leftOut.has(item.id);
50134
+ return b`
50135
+ <li class="item ${isLeftOut ? "leftOut" : ""}">
50136
+ <div class="itemHead">
50137
+ ${choosing ? b`
50138
+ <input
50139
+ class="include"
50140
+ type="checkbox"
50141
+ aria-label=${this.t("question.includeItem", { summary: item.summary })}
50142
+ .checked=${!isLeftOut}
50143
+ ?disabled=${this.locked}
50144
+ @change=${(event) => this.setIncluded(item.id, event.currentTarget.checked)}
50145
+ />
50146
+ ` : ""}
50147
+ ${severity === "info" ? "" : b`<dees-icon class="itemMarker severity-${severity}" icon=${ITEM_ICON[severity]} iconSize="13" aria-hidden="true"></dees-icon>`}
50148
+ <span class="itemSummary">${severity === "info" ? "" : b`<span class="srOnly">${this.t(severity === "danger" ? "question.danger" : "question.warning")} </span>`}${item.summary}</span>
50149
+ ${isLeftOut ? b`<span class="leftOutNote">${this.t("question.leftOut")}</span>` : ""}
50150
+ ${item.outcome ? renderHarnessOutcome(item.outcome) : ""}
49732
50151
  </div>
49733
- ` : ""}
49734
- `}
50152
+ ${item.label ? item.href ? b`<a class="itemLabel" href=${item.href} @click=${(event) => this.openItem(event, item)}>${item.label}</a>` : b`<span class="itemLabel">${item.label}</span>` : ""}
50153
+ ${item.changes?.length ? renderHarnessChanges(this.t, item.changes) : ""}
50154
+ ${item.credential ? this.renderCredential(item) : ""}
50155
+ </li>
50156
+ `;
50157
+ })}
50158
+ </ul>
50159
+ ${renderHarnessMoreRecords(this.t, items.length, expanded, this.toggleItems)}
50160
+ ` : ""}
50161
+ ${proposalState === "pending" ? "" : b`
50162
+ <div class="decision" tabindex="-1">
50163
+ <dees-badge type=${STATE_BADGE[proposalState]} .text=${this.t(`question.${proposalState}`)} rounded></dees-badge>
50164
+ ${this.request.outcome ? renderHarnessOutcome(this.request.outcome) : ""}
50165
+ </div>
50166
+ `}
50167
+ `;
50168
+ }
50169
+ /**
50170
+ * A secret a change issued, for the reader's eyes: masked (its value not in the page) until
50171
+ * shown, and copied on request with a word on how that went.
50172
+ */
50173
+ renderCredential(itemArg) {
50174
+ const credential = itemArg.credential;
50175
+ const shown = this.credentialsShown.has(itemArg.id);
50176
+ const feedback = this.copyFeedback?.itemId === itemArg.id ? this.copyFeedback : void 0;
50177
+ return b`
50178
+ <div class="credential">
50179
+ <div class="credentialRow">
50180
+ <span class="credentialLabel">${credential.label}</span>
50181
+ <code class="credentialValue">${shown ? credential.value : b`<span aria-hidden="true">${CREDENTIAL_MASK}</span><span class="srOnly">${this.t("question.credentialHidden")}</span>`}</code>
50182
+ <button
50183
+ class="credentialAction"
50184
+ type="button"
50185
+ aria-label=${this.t(shown ? "question.credentialHide" : "question.credentialShow", { label: credential.label })}
50186
+ @click=${() => this.toggleCredential(itemArg.id)}
50187
+ >${this.t(shown ? "question.credentialHideShort" : "question.credentialShowShort")}</button>
50188
+ <button
50189
+ class="credentialAction"
50190
+ type="button"
50191
+ aria-label=${this.t("question.credentialCopy", { label: credential.label })}
50192
+ @click=${() => this.copyCredential(itemArg)}
50193
+ >${this.t("common.copy")}</button>
50194
+ <span class="credentialFeedback ${feedback?.failed ? "failed" : ""}" role="status" aria-live="polite">${feedback?.text ?? ""}</span>
50195
+ </div>
50196
+ <p class="credentialNote">${credential.note ?? this.t("question.credentialNote")}</p>
49735
50197
  </div>
49736
50198
  `;
49737
50199
  }
50200
+ /** Decline, and Confirm as the primary; kept while their words and Confirm's availability stay, so the footer knows a running one by its object. */
50201
+ get proposalActions() {
50202
+ const confirm2 = this.request.confirmLabel ?? this.t("question.proposalConfirm");
50203
+ const decline = this.request.declineLabel ?? this.t("question.proposalDecline");
50204
+ const nothingIncluded = this.itemsDeclinable && this.effectiveLeftOut.size === (this.request.items?.length ?? 0);
50205
+ if (this.footerActions?.confirm !== confirm2 || this.footerActions.decline !== decline || this.footerActions.nothingIncluded !== nothingIncluded) {
50206
+ this.footerActions = {
50207
+ confirm: confirm2,
50208
+ decline,
50209
+ nothingIncluded,
50210
+ actions: [
50211
+ { name: decline, action: /* @__PURE__ */ __name(async () => this.respond(["decline"]), "action") },
50212
+ { name: confirm2, primary: true, disabled: nothingIncluded, action: /* @__PURE__ */ __name(async () => this.respond(["confirm"]), "action") }
50213
+ ]
50214
+ };
50215
+ }
50216
+ return this.footerActions.actions;
50217
+ }
50218
+ /** The reader includes a change in the proposal, or leaves it out. */
50219
+ setIncluded(itemIdArg, includedArg) {
50220
+ if (this.locked) return;
50221
+ const next = new Set(this.effectiveLeftOut);
50222
+ if (includedArg) next.delete(itemIdArg);
50223
+ else next.add(itemIdArg);
50224
+ this.leftOut = next;
50225
+ if (this.viewState) this.viewState.declinedItemIds = [...next];
50226
+ }
50227
+ toggleCredential(itemIdArg) {
50228
+ const next = new Set(this.credentialsShown);
50229
+ if (next.has(itemIdArg)) next.delete(itemIdArg);
50230
+ else next.add(itemIdArg);
50231
+ this.credentialsShown = next;
50232
+ }
50233
+ async copyCredential(itemArg) {
50234
+ const credential = itemArg.credential;
50235
+ const request = ++this.copyRequest;
50236
+ clearTimeout(this.copyResetTimeout);
50237
+ this.copyFeedback = void 0;
50238
+ try {
50239
+ await navigator.clipboard.writeText(credential.value);
50240
+ if (!this.isConnected || request !== this.copyRequest) return;
50241
+ this.copyFeedback = { itemId: itemArg.id, text: this.t("question.credentialCopied", { label: credential.label }), failed: false };
50242
+ } catch {
50243
+ if (!this.isConnected || request !== this.copyRequest) return;
50244
+ this.copyFeedback = { itemId: itemArg.id, text: this.t("question.credentialCopyFailed"), failed: true };
50245
+ }
50246
+ this.copyResetTimeout = setTimeout(() => {
50247
+ this.copyFeedback = void 0;
50248
+ this.copyResetTimeout = void 0;
50249
+ }, 3e3);
50250
+ }
50251
+ /** A proposed change's link: the host may route it itself (it cancels the event); a plain or modified click otherwise follows it. */
50252
+ openItem(eventArg, itemArg) {
50253
+ const { credential: _credential, ...item } = itemArg;
50254
+ routeHarnessRecordLink(eventArg, () => this.dispatchEvent(new CustomEvent("harness-question-link", {
50255
+ detail: { requestId: this.request.id, item, request: harnessWithoutCredentials(this.request) },
50256
+ bubbles: true,
50257
+ composed: true,
50258
+ cancelable: true
50259
+ })));
50260
+ }
49738
50261
  handleOptionClick(label) {
49739
- if (this.busy || this.effectiveResponse !== void 0) return;
50262
+ if (this.locked) return;
49740
50263
  if (this.request.multiSelect) {
49741
50264
  const next = new Set(this.effectiveSelected);
49742
50265
  if (next.has(label)) next.delete(label);
@@ -49748,20 +50271,35 @@ var _DeesHarnessQuestionCard = class _DeesHarnessQuestionCard extends (_a64 = De
49748
50271
  this.respond([label]);
49749
50272
  }
49750
50273
  respond(answers) {
49751
- if (this.busy || this.effectiveResponse !== void 0 || !answers.length) return;
50274
+ if (this.locked || !answers.length) return;
50275
+ const items = this.request.items ?? [];
50276
+ const leftOut = answers[0] === "confirm" && this.itemsDeclinable ? this.effectiveLeftOut : /* @__PURE__ */ new Set();
50277
+ if (leftOut.size > 0 && leftOut.size === items.length) return;
50278
+ const footerFocused = this.shadowRoot?.activeElement?.localName === "dees-actionfooter";
49752
50279
  this.answered = answers;
49753
50280
  if (this.viewState) this.viewState.answered = answers;
49754
- this.dispatchEvent(
49755
- new CustomEvent("harness-question-response", {
49756
- detail: {
49757
- requestId: this.request.id,
49758
- answers,
49759
- request: this.request
49760
- },
49761
- bubbles: true,
49762
- composed: true
49763
- })
49764
- );
50281
+ if (footerFocused) {
50282
+ void this.updateComplete.then(() => this.shadowRoot?.querySelector(".decision")?.focus());
50283
+ }
50284
+ const detail = {
50285
+ requestId: this.request.id,
50286
+ answers,
50287
+ request: harnessWithoutCredentials(this.request)
50288
+ };
50289
+ if (leftOut.size > 0) detail.declinedItemIds = items.filter((item) => leftOut.has(item.id)).map((item) => item.id);
50290
+ this.dispatchEvent(new CustomEvent("harness-question-response", {
50291
+ detail,
50292
+ bubbles: true,
50293
+ composed: true
50294
+ }));
50295
+ }
50296
+ async disconnectedCallback() {
50297
+ ++this.copyRequest;
50298
+ clearTimeout(this.copyResetTimeout);
50299
+ this.copyResetTimeout = void 0;
50300
+ this.copyFeedback = void 0;
50301
+ this.credentialsShown = /* @__PURE__ */ new Set();
50302
+ await super.disconnectedCallback();
49765
50303
  }
49766
50304
  };
49767
50305
  _init66 = __decoratorStart(_a64);
@@ -49771,12 +50309,20 @@ _viewState6 = new WeakMap();
49771
50309
  _answered2 = new WeakMap();
49772
50310
  _selected = new WeakMap();
49773
50311
  _customText = new WeakMap();
50312
+ _itemsExpanded2 = new WeakMap();
50313
+ _leftOut = new WeakMap();
50314
+ _credentialsShown = new WeakMap();
50315
+ _copyFeedback2 = new WeakMap();
49774
50316
  __decorateElement(_init66, 4, "request", _request_dec2, _DeesHarnessQuestionCard, _request2);
49775
50317
  __decorateElement(_init66, 4, "busy", _busy_dec2, _DeesHarnessQuestionCard, _busy2);
49776
50318
  __decorateElement(_init66, 4, "viewState", _viewState_dec6, _DeesHarnessQuestionCard, _viewState6);
49777
50319
  __decorateElement(_init66, 4, "answered", _answered_dec2, _DeesHarnessQuestionCard, _answered2);
49778
50320
  __decorateElement(_init66, 4, "selected", _selected_dec, _DeesHarnessQuestionCard, _selected);
49779
50321
  __decorateElement(_init66, 4, "customText", _customText_dec, _DeesHarnessQuestionCard, _customText);
50322
+ __decorateElement(_init66, 4, "itemsExpanded", _itemsExpanded_dec2, _DeesHarnessQuestionCard, _itemsExpanded2);
50323
+ __decorateElement(_init66, 4, "leftOut", _leftOut_dec, _DeesHarnessQuestionCard, _leftOut);
50324
+ __decorateElement(_init66, 4, "credentialsShown", _credentialsShown_dec, _DeesHarnessQuestionCard, _credentialsShown);
50325
+ __decorateElement(_init66, 4, "copyFeedback", _copyFeedback_dec2, _DeesHarnessQuestionCard, _copyFeedback2);
49780
50326
  _DeesHarnessQuestionCard = __decorateElement(_init66, 0, "DeesHarnessQuestionCard", _DeesHarnessQuestionCard_decorators, _DeesHarnessQuestionCard);
49781
50327
  __name(_DeesHarnessQuestionCard, "DeesHarnessQuestionCard");
49782
50328
  __publicField(_DeesHarnessQuestionCard, "demo", demoFunc44);
@@ -49785,6 +50331,8 @@ __publicField(_DeesHarnessQuestionCard, "styles", [
49785
50331
  themeDefaultStyles,
49786
50332
  cssManager.defaultStyles,
49787
50333
  harnessControlStyles,
50334
+ harnessActivityStyles,
50335
+ harnessRecordStyles,
49788
50336
  i`
49789
50337
  :host {
49790
50338
  display: block;
@@ -49793,13 +50341,34 @@ __publicField(_DeesHarnessQuestionCard, "styles", [
49793
50341
  }
49794
50342
 
49795
50343
  .card {
49796
- padding: 16px;
50344
+ overflow: clip;
49797
50345
  border: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
49798
50346
  border-radius: var(--dees-radius-xl);
49799
50347
  corner-shape: var(--dees-corner-shape);
49800
50348
  background: var(--dees-color-bg-secondary);
49801
50349
  }
49802
50350
 
50351
+ /* the border asks for attention while the card waits; a decided card keeps only its icon */
50352
+ .card.waiting.severity-warning {
50353
+ border-color: var(--dees-color-accent-warning);
50354
+ }
50355
+
50356
+ .card.waiting.severity-danger {
50357
+ border-color: var(--dees-color-accent-error);
50358
+ }
50359
+
50360
+ .body {
50361
+ padding: 16px;
50362
+ }
50363
+
50364
+ .body > :last-child {
50365
+ margin-bottom: 0;
50366
+ }
50367
+
50368
+ dees-actionfooter {
50369
+ --dees-actionfooter-inset: 16px;
50370
+ }
50371
+
49803
50372
  .titleRow {
49804
50373
  display: flex;
49805
50374
  align-items: flex-start;
@@ -49815,6 +50384,16 @@ __publicField(_DeesHarnessQuestionCard, "styles", [
49815
50384
  color: var(--dees-color-accent-primary);
49816
50385
  }
49817
50386
 
50387
+ .severity-warning .titleRow dees-icon {
50388
+ background: var(--dees-color-badge-warning-bg);
50389
+ color: var(--dees-color-badge-warning-fg);
50390
+ }
50391
+
50392
+ .severity-danger .titleRow dees-icon {
50393
+ background: var(--dees-color-badge-error-bg);
50394
+ color: var(--dees-color-badge-error-fg);
50395
+ }
50396
+
49818
50397
  .questionText {
49819
50398
  min-width: 0;
49820
50399
  color: var(--dees-color-text-primary);
@@ -49920,6 +50499,134 @@ __publicField(_DeesHarnessQuestionCard, "styles", [
49920
50499
  font-weight: 500;
49921
50500
  overflow-wrap: anywhere;
49922
50501
  }
50502
+
50503
+ .itemSummary {
50504
+ flex: 1;
50505
+ min-width: 0;
50506
+ color: var(--dees-color-text-primary);
50507
+ overflow-wrap: anywhere;
50508
+ }
50509
+
50510
+ .item .itemLabel {
50511
+ flex: none;
50512
+ justify-self: start;
50513
+ font-size: var(--dees-font-caption1-size, 11px);
50514
+ }
50515
+
50516
+ .decision {
50517
+ display: flex;
50518
+ flex-wrap: wrap;
50519
+ align-items: center;
50520
+ gap: var(--dees-spacing-sm);
50521
+ border-radius: var(--dees-radius-xs);
50522
+ }
50523
+
50524
+ .decision:focus {
50525
+ outline: none;
50526
+ }
50527
+
50528
+ .decision:focus-visible {
50529
+ outline: var(--dees-line-width-focus-ring) solid var(--dees-color-focus-ring);
50530
+ outline-offset: 2px;
50531
+ }
50532
+
50533
+ .include {
50534
+ flex: none;
50535
+ width: 16px;
50536
+ height: 16px;
50537
+ margin: 0;
50538
+ accent-color: var(--dees-color-accent-primary);
50539
+ cursor: pointer;
50540
+ }
50541
+
50542
+ .itemMarker {
50543
+ flex: none;
50544
+ }
50545
+
50546
+ .itemMarker.severity-warning {
50547
+ color: var(--dees-color-badge-warning-fg);
50548
+ }
50549
+
50550
+ .itemMarker.severity-danger {
50551
+ color: var(--dees-color-badge-error-fg);
50552
+ }
50553
+
50554
+ .item.leftOut .itemSummary {
50555
+ color: var(--dees-color-text-secondary);
50556
+ }
50557
+
50558
+ .leftOutNote {
50559
+ flex: none;
50560
+ color: var(--dees-color-text-secondary);
50561
+ font-size: var(--dees-font-caption1-size, 11px);
50562
+ }
50563
+
50564
+ .credential {
50565
+ display: grid;
50566
+ gap: 4px;
50567
+ margin-top: 4px;
50568
+ padding: 8px 10px;
50569
+ border: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
50570
+ border-radius: var(--dees-radius-md);
50571
+ corner-shape: var(--dees-corner-shape);
50572
+ background: var(--dees-color-bg-secondary);
50573
+ }
50574
+
50575
+ .credentialRow {
50576
+ display: flex;
50577
+ flex-wrap: wrap;
50578
+ align-items: baseline;
50579
+ gap: 4px var(--dees-spacing-sm);
50580
+ min-width: 0;
50581
+ }
50582
+
50583
+ .credentialLabel {
50584
+ color: var(--dees-color-text-secondary);
50585
+ }
50586
+
50587
+ .credentialValue {
50588
+ flex: 1 1 12em;
50589
+ min-width: 0;
50590
+ color: var(--dees-color-text-primary);
50591
+ font-family: var(--dees-font-family-mono);
50592
+ overflow-wrap: anywhere;
50593
+ user-select: all;
50594
+ }
50595
+
50596
+ .credentialAction {
50597
+ padding: 0;
50598
+ border: none;
50599
+ background: none;
50600
+ color: var(--dees-color-accent-primary);
50601
+ font: inherit;
50602
+ font-size: var(--dees-font-caption1-size, 11px);
50603
+ cursor: pointer;
50604
+ border-radius: var(--dees-radius-xs);
50605
+ }
50606
+
50607
+ .credentialAction:hover {
50608
+ text-decoration: underline;
50609
+ }
50610
+
50611
+ .credentialAction:focus-visible {
50612
+ outline: var(--dees-line-width-focus-ring) solid var(--dees-color-focus-ring);
50613
+ outline-offset: 2px;
50614
+ }
50615
+
50616
+ .credentialFeedback {
50617
+ color: var(--dees-color-text-secondary);
50618
+ font-size: var(--dees-font-caption1-size, 11px);
50619
+ }
50620
+
50621
+ .credentialFeedback.failed {
50622
+ color: var(--dees-color-text-error);
50623
+ }
50624
+
50625
+ .credentialNote {
50626
+ margin: 0;
50627
+ color: var(--dees-color-text-secondary);
50628
+ font-size: var(--dees-font-caption1-size, 11px);
50629
+ }
49923
50630
  `
49924
50631
  ]);
49925
50632
  __runInitializers(_init66, 1, _DeesHarnessQuestionCard);
@@ -50278,7 +50985,9 @@ var _DeesHarnessMessageList = class _DeesHarnessMessageList extends (_a65 = Dees
50278
50985
  for (const question of this.questions) {
50279
50986
  items.push({
50280
50987
  kind: "question",
50281
- time: question.response ? question.respondedAt ?? question.createdAt ?? 0 : pinnedRequestTime,
50988
+ // a pending question or proposal pins to the end; an answered,
50989
+ // expired or failed one keeps its place in the flow
50990
+ time: harnessQuestionPending(question) ? pinnedRequestTime : question.respondedAt ?? question.createdAt ?? 0,
50282
50991
  insertionIndex: items.length,
50283
50992
  key: `question:${question.id}`,
50284
50993
  question
@@ -70735,7 +71444,7 @@ var _DeesHarnessConversationPicker = class _DeesHarnessConversationPicker extend
70735
71444
  * cancelled. Focus returns to whatever had it when the picker opened.
70736
71445
  */
70737
71446
  static async pick(optionsArg = {}) {
70738
- const { DeesModal: DeesModal2 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-modal-7LJGK5SK.js");
71447
+ const { DeesModal: DeesModal2 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-modal-BZIJFVRI.js");
70739
71448
  const picker = new _DeesHarnessConversationPicker();
70740
71449
  picker.sessions = optionsArg.sessions ?? [];
70741
71450
  picker.groups = optionsArg.groups ?? [];
@@ -71196,7 +71905,7 @@ var handleResourceContext = /* @__PURE__ */ __name(async (event) => {
71196
71905
  list.selectedResourceId = event.detail.resource.id;
71197
71906
  }, "handleResourceContext");
71198
71907
  var openModal = /* @__PURE__ */ __name(async (sessions, groups) => {
71199
- const { DeesModal: DeesModal2 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-modal-7LJGK5SK.js");
71908
+ const { DeesModal: DeesModal2 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-modal-BZIJFVRI.js");
71200
71909
  const content = document.createElement("dees-harness-session-list");
71201
71910
  content.sessions = sessions;
71202
71911
  content.groups = groups;
@@ -74191,8 +74900,24 @@ var ticketDraft = /* @__PURE__ */ __name((ticket) => ({
74191
74900
  assigneeId: ticket.assignee?.id ?? "",
74192
74901
  parentId: ticket.parentId ?? "",
74193
74902
  labels: [...ticket.labels ?? []],
74194
- project: ticket.project ?? ""
74903
+ project: ticket.project ?? "",
74904
+ ...ticket.revision === void 0 ? {} : { revision: ticket.revision }
74195
74905
  }), "ticketDraft");
74906
+ var kanbanTicketVersion = /* @__PURE__ */ __name((ticket) => ticket?.revision !== void 0 ? `revision:${ticket.revision}` : ticket?.updatedAt, "kanbanTicketVersion");
74907
+ var kanbanDraftFields = [
74908
+ "title",
74909
+ "description",
74910
+ "project",
74911
+ "priority",
74912
+ "assigneeId",
74913
+ "parentId",
74914
+ "labels"
74915
+ ];
74916
+ var sameDraftField = /* @__PURE__ */ __name((field, a, b2) => field === "labels" ? sameKanbanLabels(a.labels ?? [], b2.labels ?? []) : (a[field] ?? "") === (b2[field] ?? ""), "sameDraftField");
74917
+ var kanbanDraftChanges = /* @__PURE__ */ __name((base, draft, latest) => Object.fromEntries(
74918
+ kanbanDraftFields.filter((field) => draft[field] !== void 0 && !sameDraftField(field, draft, base) && !sameDraftField(field, draft, latest)).map((field) => [field, draft[field]])
74919
+ ), "kanbanDraftChanges");
74920
+ var isKanbanRevisionConflict = /* @__PURE__ */ __name((error) => error instanceof Error && error.code === "revision_conflict", "isKanbanRevisionConflict");
74196
74921
  var kanbanProjectName = /* @__PURE__ */ __name((projects, id) => projects.find((project2) => project2.id === id)?.name ?? id, "kanbanProjectName");
74197
74922
  var kanbanProjects = /* @__PURE__ */ __name((projects, tickets) => {
74198
74923
  const known = new Set(projects.map((project2) => project2.id));
@@ -74586,9 +75311,9 @@ __runInitializers(_init104, 1, _DeesKanbanActivity);
74586
75311
  var DeesKanbanActivity = _DeesKanbanActivity;
74587
75312
 
74588
75313
  // ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.ts
74589
- var _feed_dec, _editing_dec3, _showTicketKey_dec, _canGoBack_dec, _saving_dec2, _error_dec6, _projects_dec2, _activityError_dec, _loadingActivity_dec, _activity_dec2, _commentsError_dec, _loadingComments_dec, _searchTickets_dec2, _comments_dec2, _commentDraft_dec, _draft_dec4, _provider_dec3, _people_dec, _columns_dec4, _tickets_dec2, _ticket_dec, _a104, _DeesKanbanTicketDetail_decorators, _init105, _ticket, _tickets2, _columns4, _people, _provider3, _draft4, _commentDraft, _comments2, _searchTickets2, _loadingComments, _commentsError, _activity2, _loadingActivity, _activityError, _projects2, _error6, _saving2, _canGoBack, _showTicketKey, _editing3, _feed;
75314
+ var _feed_dec, _editing_dec3, _conflict_dec, _showTicketKey_dec, _canGoBack_dec, _saving_dec2, _error_dec6, _projects_dec2, _activityError_dec, _loadingActivity_dec, _activity_dec2, _commentsError_dec, _loadingComments_dec, _searchTickets_dec2, _comments_dec2, _commentDraft_dec, _draft_dec4, _provider_dec3, _people_dec, _columns_dec4, _tickets_dec2, _ticket_dec, _a104, _DeesKanbanTicketDetail_decorators, _init105, _ticket, _tickets2, _columns4, _people, _provider3, _draft4, _commentDraft, _comments2, _searchTickets2, _loadingComments, _commentsError, _activity2, _loadingActivity, _activityError, _projects2, _error6, _saving2, _canGoBack, _showTicketKey, _conflict, _editing3, _feed;
74590
75315
  _DeesKanbanTicketDetail_decorators = [customElement("dees-kanban-ticket-detail")];
74591
- var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a104 = DeesElement, _ticket_dec = [n({ attribute: false })], _tickets_dec2 = [n({ attribute: false })], _columns_dec4 = [n({ attribute: false })], _people_dec = [n({ attribute: false })], _provider_dec3 = [n({ attribute: false })], _draft_dec4 = [n({ attribute: false })], _commentDraft_dec = [n({ attribute: false })], _comments_dec2 = [n({ attribute: false })], _searchTickets_dec2 = [n({ attribute: false })], _loadingComments_dec = [n({ type: Boolean, reflect: true })], _commentsError_dec = [n({ type: String, reflect: true })], _activity_dec2 = [n({ attribute: false })], _loadingActivity_dec = [n({ type: Boolean, reflect: true })], _activityError_dec = [n({ type: String, reflect: true })], _projects_dec2 = [n({ attribute: false })], _error_dec6 = [n({ type: String, reflect: true })], _saving_dec2 = [n({ type: Boolean, reflect: true })], _canGoBack_dec = [n({ type: Boolean, reflect: true })], _showTicketKey_dec = [n({ type: Boolean, reflect: true })], _editing_dec3 = [r2()], _feed_dec = [r2()], _a104) {
75316
+ var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a104 = DeesElement, _ticket_dec = [n({ attribute: false })], _tickets_dec2 = [n({ attribute: false })], _columns_dec4 = [n({ attribute: false })], _people_dec = [n({ attribute: false })], _provider_dec3 = [n({ attribute: false })], _draft_dec4 = [n({ attribute: false })], _commentDraft_dec = [n({ attribute: false })], _comments_dec2 = [n({ attribute: false })], _searchTickets_dec2 = [n({ attribute: false })], _loadingComments_dec = [n({ type: Boolean, reflect: true })], _commentsError_dec = [n({ type: String, reflect: true })], _activity_dec2 = [n({ attribute: false })], _loadingActivity_dec = [n({ type: Boolean, reflect: true })], _activityError_dec = [n({ type: String, reflect: true })], _projects_dec2 = [n({ attribute: false })], _error_dec6 = [n({ type: String, reflect: true })], _saving_dec2 = [n({ type: Boolean, reflect: true })], _canGoBack_dec = [n({ type: Boolean, reflect: true })], _showTicketKey_dec = [n({ type: Boolean, reflect: true })], _conflict_dec = [n({ attribute: false })], _editing_dec3 = [r2()], _feed_dec = [r2()], _a104) {
74592
75317
  constructor() {
74593
75318
  super(...arguments);
74594
75319
  __publicField(this, "t", dcLocalize(this));
@@ -74611,14 +75336,127 @@ var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a104 = Dee
74611
75336
  __privateAdd(this, _saving2, __runInitializers(_init105, 72, this, false)), __runInitializers(_init105, 75, this);
74612
75337
  __privateAdd(this, _canGoBack, __runInitializers(_init105, 76, this, false)), __runInitializers(_init105, 79, this);
74613
75338
  __privateAdd(this, _showTicketKey, __runInitializers(_init105, 80, this, true)), __runInitializers(_init105, 83, this);
74614
- __privateAdd(this, _editing3, __runInitializers(_init105, 84, this, false)), __runInitializers(_init105, 87, this);
74615
- __privateAdd(this, _feed, __runInitializers(_init105, 88, this, "comments")), __runInitializers(_init105, 91, this);
75339
+ __privateAdd(this, _conflict, __runInitializers(_init105, 84, this)), __runInitializers(_init105, 87, this);
75340
+ __privateAdd(this, _editing3, __runInitializers(_init105, 88, this, false)), __runInitializers(_init105, 91, this);
75341
+ /** The reader pressed a button of the refusal, which leaves with its answer: the focus follows. */
75342
+ __publicField(this, "conflictFocus", false);
75343
+ __privateAdd(this, _feed, __runInitializers(_init105, 92, this, "comments")), __runInitializers(_init105, 95, this);
74616
75344
  __publicField(this, "addComment", /* @__PURE__ */ __name((input) => this.provider.addComment(input), "addComment"));
74617
75345
  }
74618
75346
  updated(changed3) {
74619
75347
  const previous = changed3.get("ticket");
74620
75348
  if (changed3.has("ticket") && previous?.id !== this.ticket?.id)
74621
75349
  this.editing = Boolean(this.draft);
75350
+ if (this.conflictFocus && changed3.has("conflict") && this.conflict?.state !== "reloading") {
75351
+ this.conflictFocus = false;
75352
+ const root = this.shadowRoot;
75353
+ const target = root.querySelector(".conflict dees-button") ?? root.querySelector(".edit dees-input-text");
75354
+ void target?.updateComplete.then(() => target.focus());
75355
+ }
75356
+ }
75357
+ /**
75358
+ * A save the provider refused as stale, at the top of the edit: the server's reason and the
75359
+ * reload, then what the person changed that the latest version does not hold, each change to
75360
+ * apply on its own.
75361
+ */
75362
+ renderConflict(ticket, conflict, parents, projects) {
75363
+ const press = /* @__PURE__ */ __name((type) => () => {
75364
+ this.conflictFocus = true;
75365
+ kanbanEvent(this, type, { ticketId: ticket.id });
75366
+ }, "press");
75367
+ if (conflict.state !== "reloaded") {
75368
+ const reloading = conflict.state === "reloading";
75369
+ return b`<div class="conflict" role="alert">
75370
+ <dees-hint type="warning">
75371
+ <p class="conflict-reason">${conflict.message}</p>
75372
+ <p>${this.t("kanban.conflictHint")}</p>
75373
+ <dees-button
75374
+ size="sm"
75375
+ type="accent"
75376
+ icon="lucide:RefreshCw"
75377
+ text=${this.t("kanban.reloadTicket")}
75378
+ .status=${reloading ? "pending" : "normal"}
75379
+ .disabled=${reloading}
75380
+ @clicked=${press("kanban-ticket-reload")}
75381
+ ></dees-button>
75382
+ </dees-hint>
75383
+ </div>`;
75384
+ }
75385
+ const fields = kanbanDraftFields.filter((field) => field in conflict.edit);
75386
+ return b`<section class="conflict" aria-labelledby="conflict-heading">
75387
+ <dees-hint type="info">
75388
+ <h3 id="conflict-heading">${this.t("kanban.yourEdit")}</h3>
75389
+ <p>${this.t("kanban.yourEditHint")}</p>
75390
+ <dl>${fields.map((field) => {
75391
+ const name = this.fieldName(ticket, field);
75392
+ return b`<div class="kept" data-field=${field}>
75393
+ <dt>${name}</dt>
75394
+ <dd class=${field === "title" || field === "description" ? "text" : ""}>${this.keptValue(
75395
+ field,
75396
+ conflict.edit,
75397
+ parents,
75398
+ projects
75399
+ )}</dd>
75400
+ <dees-button
75401
+ size="sm"
75402
+ type="secondary"
75403
+ text=${this.t("kanban.applyEdit")}
75404
+ aria-label=${this.t("kanban.applyField", { field: name })}
75405
+ @clicked=${() => {
75406
+ this.conflictFocus = true;
75407
+ kanbanEvent(this, "kanban-conflict-apply", { ticketId: ticket.id, field });
75408
+ }}
75409
+ ></dees-button>
75410
+ </div>`;
75411
+ })}</dl>
75412
+ <div class="conflict-actions">
75413
+ <dees-button
75414
+ size="sm"
75415
+ type="secondary"
75416
+ text=${this.t("kanban.discardEdit")}
75417
+ @clicked=${press("kanban-conflict-dismiss")}
75418
+ ></dees-button>
75419
+ </div>
75420
+ </dees-hint>
75421
+ </section>`;
75422
+ }
75423
+ /** A draft field's name, as its control is labelled. */
75424
+ fieldName(ticket, field) {
75425
+ switch (field) {
75426
+ case "title":
75427
+ return this.t("kanban.ticketTitle");
75428
+ case "description":
75429
+ return this.t("kanban.description");
75430
+ case "project":
75431
+ return this.t("kanban.project");
75432
+ case "priority":
75433
+ return this.t("kanban.priorityLabel");
75434
+ case "assigneeId":
75435
+ return this.t("kanban.assignee");
75436
+ case "parentId":
75437
+ return this.t(ticket.kind === "task" ? "kanban.epic" : "kanban.parentTask");
75438
+ case "labels":
75439
+ return this.t("kanban.labels");
75440
+ }
75441
+ }
75442
+ /** A kept change's value, as its control shows it. */
75443
+ keptValue(field, edit, parents, projects) {
75444
+ switch (field) {
75445
+ case "title":
75446
+ return edit.title ?? "";
75447
+ case "description":
75448
+ return edit.description || this.t("kanban.noDescription");
75449
+ case "project":
75450
+ return edit.project ? kanbanProjectName(projects, edit.project) : this.t("kanban.noProject");
75451
+ case "priority":
75452
+ return this.t("kanban.priority", { priority: edit.priority ?? "none" });
75453
+ case "assigneeId":
75454
+ return edit.assigneeId ? this.people.find((person) => person.id === edit.assigneeId)?.name ?? edit.assigneeId : this.t("kanban.unassigned");
75455
+ case "parentId":
75456
+ return parents.find((item) => item.id === edit.parentId)?.title ?? this.t("kanban.none");
75457
+ case "labels":
75458
+ return edit.labels?.length ? b`${edit.labels.map((label) => b`<span class="badge">${label}</span>`)}` : this.t("kanban.none");
75459
+ }
74622
75460
  }
74623
75461
  changeDraft(change) {
74624
75462
  this.draft = { ...this.draft ?? ticketDraft(this.ticket), ...change };
@@ -74671,6 +75509,7 @@ var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a104 = Dee
74671
75509
  <div class="layout">
74672
75510
  <section class="lead">
74673
75511
  ${this.editing && editable ? b`<div class="edit">
75512
+ ${this.conflict ? this.renderConflict(ticket, this.conflict, parents, projects) : ""}
74674
75513
  <dees-input-text
74675
75514
  label=${this.t("kanban.ticketTitle")}
74676
75515
  .value=${draft.title}
@@ -74691,7 +75530,7 @@ var _DeesKanbanTicketDetail = class _DeesKanbanTicketDetail extends (_a104 = Dee
74691
75530
  size="sm"
74692
75531
  type="accent"
74693
75532
  text=${this.t("kanban.saveChanges")}
74694
- .disabled=${this.saving || !draft.title.trim()}
75533
+ .disabled=${this.saving || !draft.title.trim() || this.conflict !== void 0 && this.conflict.state !== "reloaded"}
74695
75534
  .status=${this.saving ? "pending" : "normal"}
74696
75535
  @clicked=${() => kanbanEvent(this, "kanban-ticket-save", { ticketId: ticket.id, draft })}
74697
75536
  ></dees-button>
@@ -75033,6 +75872,7 @@ _error6 = new WeakMap();
75033
75872
  _saving2 = new WeakMap();
75034
75873
  _canGoBack = new WeakMap();
75035
75874
  _showTicketKey = new WeakMap();
75875
+ _conflict = new WeakMap();
75036
75876
  _editing3 = new WeakMap();
75037
75877
  _feed = new WeakMap();
75038
75878
  __decorateElement(_init105, 4, "ticket", _ticket_dec, _DeesKanbanTicketDetail, _ticket);
@@ -75054,6 +75894,7 @@ __decorateElement(_init105, 4, "error", _error_dec6, _DeesKanbanTicketDetail, _e
75054
75894
  __decorateElement(_init105, 4, "saving", _saving_dec2, _DeesKanbanTicketDetail, _saving2);
75055
75895
  __decorateElement(_init105, 4, "canGoBack", _canGoBack_dec, _DeesKanbanTicketDetail, _canGoBack);
75056
75896
  __decorateElement(_init105, 4, "showTicketKey", _showTicketKey_dec, _DeesKanbanTicketDetail, _showTicketKey);
75897
+ __decorateElement(_init105, 4, "conflict", _conflict_dec, _DeesKanbanTicketDetail, _conflict);
75057
75898
  __decorateElement(_init105, 4, "editing", _editing_dec3, _DeesKanbanTicketDetail, _editing3);
75058
75899
  __decorateElement(_init105, 4, "feed", _feed_dec, _DeesKanbanTicketDetail, _feed);
75059
75900
  _DeesKanbanTicketDetail = __decorateElement(_init105, 0, "DeesKanbanTicketDetail", _DeesKanbanTicketDetail_decorators, _DeesKanbanTicketDetail);
@@ -75435,6 +76276,72 @@ __publicField(_DeesKanbanTicketDetail, "styles", [
75435
76276
  gap: 14px;
75436
76277
  }
75437
76278
 
76279
+ .conflict p + p,
76280
+ .conflict p + dees-button {
76281
+ margin-top: 8px;
76282
+ }
76283
+
76284
+ .conflict-reason,
76285
+ .conflict h3 {
76286
+ color: var(--dees-color-text-primary);
76287
+ font-weight: 600;
76288
+ }
76289
+
76290
+ .conflict h3 {
76291
+ font-size: inherit;
76292
+ }
76293
+
76294
+ .conflict dl {
76295
+ display: grid;
76296
+ gap: 8px;
76297
+ margin: 10px 0 0;
76298
+ }
76299
+
76300
+ .kept,
76301
+ .conflict-actions {
76302
+ padding-top: 8px;
76303
+ border-top: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
76304
+ }
76305
+
76306
+ .conflict-actions {
76307
+ margin-top: 8px;
76308
+ }
76309
+
76310
+ .kept {
76311
+ display: grid;
76312
+ grid-template-columns: minmax(0, 1fr) auto;
76313
+ grid-template-areas: 'name apply' 'value apply';
76314
+ align-items: center;
76315
+ gap: var(--dees-spacing-2xs) 12px;
76316
+ }
76317
+
76318
+ .kept dt {
76319
+ grid-area: name;
76320
+ font-size: var(--dees-font-caption1-size);
76321
+ }
76322
+
76323
+ .kept dd {
76324
+ grid-area: value;
76325
+ margin: 0;
76326
+ min-width: 0;
76327
+ color: var(--dees-color-text-primary);
76328
+ overflow-wrap: anywhere;
76329
+ }
76330
+
76331
+ .kept dd.text {
76332
+ white-space: pre-wrap;
76333
+ max-height: 9lh;
76334
+ overflow-y: auto;
76335
+ }
76336
+
76337
+ .kept dd .badge + .badge {
76338
+ margin-left: 4px;
76339
+ }
76340
+
76341
+ .kept dees-button {
76342
+ grid-area: apply;
76343
+ }
76344
+
75438
76345
  @media (max-width: 700px) {
75439
76346
  :host {
75440
76347
  padding: 16px;
@@ -75472,13 +76379,130 @@ var kanbanDemoColumns = [
75472
76379
  { id: "review", title: "In review" },
75473
76380
  { id: "done", title: "Done", done: true }
75474
76381
  ];
76382
+ var kanbanDemoReleasedColumn = {
76383
+ id: "released",
76384
+ title: "Released",
76385
+ done: true,
76386
+ collapsible: "collapsed"
76387
+ };
76388
+ var kanbanDemoWorkflowColumns = [
76389
+ { id: "backlog", title: "Backlog" },
76390
+ { id: "ready", title: "Ready" },
76391
+ { id: "progress", title: "In progress" },
76392
+ { id: "input", title: "Needs input" },
76393
+ { id: "review", title: "Review" },
76394
+ { id: "done", title: "Landed", done: true },
76395
+ kanbanDemoReleasedColumn
76396
+ ];
75475
76397
  var kanbanDemoProjects = [
75476
76398
  { id: "app", name: "Workspace app" },
75477
76399
  { id: "catalog", name: "Design catalog" }
75478
76400
  ];
75479
76401
  var [mara2, jonas2, alex] = kanbanDemoPeople;
75480
- var createKanbanDemo = /* @__PURE__ */ __name(() => {
75481
- let tickets = [
76402
+ var releasedTickets = /* @__PURE__ */ __name(() => [
76403
+ ["Remember the last board filters", "app", "2.0.0"],
76404
+ ["Show who is viewing a ticket", "app", "2.1.0"],
76405
+ ["Add the compact card density", "catalog", "21.1.0"],
76406
+ ["Search tickets by key", "app", "2.2.0"],
76407
+ ["Load the board in one request", "app", "2.3.0"]
76408
+ ].map(([title, project2, version2], order) => ({
76409
+ id: `released-${order + 1}`,
76410
+ key: `CAT-${110 + order}`,
76411
+ kind: "task",
76412
+ title,
76413
+ columnId: "released",
76414
+ order,
76415
+ assignee: kanbanDemoPeople[order % kanbanDemoPeople.length],
76416
+ project: project2,
76417
+ links: [
76418
+ { kind: "release", package: project2 === "app" ? "@acme/workspace" : "@acme/catalog", version: version2 }
76419
+ ],
76420
+ createdAt: `2026-09-0${order + 1}T09:00:00Z`,
76421
+ createdBy: mara2,
76422
+ updatedAt: `2026-09-1${order}T15:00:00Z`,
76423
+ updatedBy: mara2
76424
+ })), "releasedTickets");
76425
+ var workflowTickets = /* @__PURE__ */ __name(() => {
76426
+ const tasks = [
76427
+ { columnId: "backlog", title: "Archive finished projects", parentId: "epic-1", priority: "low", assignee: mara2, labels: ["Design"], project: "app" },
76428
+ { columnId: "backlog", title: "Keep comment drafts while offline", parentId: "epic-2", priority: "normal", labels: ["Collaboration"], project: "app" },
76429
+ { columnId: "backlog", title: "Move several tickets at once", parentId: "epic-3", priority: "normal", assignee: jonas2, labels: ["Productivity"], project: "app", subtasks: [["Select several cards", "backlog"], ["Move them in one request", "backlog"]] },
76430
+ { columnId: "backlog", title: "Explain each empty state with a next step", parentId: "epic-1", priority: "low", labels: ["Design", "Content"], project: "app" },
76431
+ { columnId: "backlog", title: "Import tickets from a spreadsheet", parentId: "epic-3", assignee: mara2, labels: ["Integrations"], project: "app" },
76432
+ { columnId: "backlog", title: "Measure board load time in the field", parentId: "epic-3", priority: "normal", assignee: alex, labels: ["Performance"], project: "catalog" },
76433
+ { columnId: "ready", title: "Pin a ticket to the top of its column", parentId: "epic-1", priority: "normal", assignee: jonas2, labels: ["Design"], project: "app" },
76434
+ { columnId: "ready", title: "Notify watchers when a ticket moves", parentId: "epic-2", priority: "high", assignee: mara2, labels: ["Collaboration"], project: "app", subtasks: [["Choose who is notified", "ready"], ["Write the notification text", "ready"]] },
76435
+ { columnId: "ready", title: "Render only the visible cards of long columns", parentId: "epic-3", priority: "high", assignee: alex, labels: ["Performance"], project: "catalog" },
76436
+ { columnId: "ready", title: "Lay the board out right to left", parentId: "epic-1", priority: "normal", labels: ["Accessibility"], project: "catalog" },
76437
+ { columnId: "ready", title: "List the keyboard shortcuts", parentId: "epic-1", priority: "low", assignee: alex, labels: ["Accessibility"], project: "catalog" },
76438
+ { columnId: "ready", title: "Share a filtered board by link", parentId: "epic-2", priority: "normal", assignee: jonas2, labels: ["Collaboration"], project: "app" },
76439
+ { columnId: "progress", title: "Show who is typing in the discussion", parentId: "epic-2", priority: "normal", assignee: jonas2, labels: ["Collaboration"], project: "app" },
76440
+ { columnId: "progress", title: "Keep unchanged cards on refresh", parentId: "epic-3", priority: "urgent", assignee: alex, labels: ["Performance", "Bug"], project: "catalog", subtasks: [["Profile a board of 500 tickets", "done"], ["Reuse the cards that did not change", "progress"]] },
76441
+ { columnId: "progress", title: "Preview attachments in the ticket", parentId: "epic-2", priority: "normal", assignee: mara2, labels: ["Design"], project: "app" },
76442
+ { columnId: "progress", title: "Larger drag targets on touch screens", parentId: "epic-1", priority: "high", assignee: alex, labels: ["Mobile", "Accessibility"], project: "catalog" },
76443
+ { columnId: "progress", title: "Keep the filters in step across tabs", parentId: "epic-3", priority: "low", assignee: jonas2, labels: ["Bug"], project: "app" },
76444
+ { columnId: "input", title: "Decide the default column limits", parentId: "epic-3", priority: "normal", assignee: mara2, labels: ["Product"], project: "app" },
76445
+ { columnId: "input", title: "Confirm the export format with finance", priority: "high", assignee: jonas2, labels: ["Integrations"], project: "app" },
76446
+ { columnId: "input", title: "Which fields should a template copy?", parentId: "epic-2", priority: "low", labels: ["Product"], project: "app" },
76447
+ { columnId: "review", title: "Return focus after closing a ticket", parentId: "epic-1", priority: "urgent", assignee: alex, labels: ["Bug", "Accessibility"], project: "catalog" },
76448
+ { columnId: "review", title: "Suggest people when mentioning", parentId: "epic-2", priority: "high", assignee: jonas2, labels: ["Collaboration"], project: "app", subtasks: [["Rank recent people first", "review"], ["Insert the mention as a chip", "done"]] },
76449
+ { columnId: "review", title: "Cache avatars across boards", parentId: "epic-3", priority: "normal", assignee: alex, labels: ["Performance"], project: "catalog" },
76450
+ { columnId: "review", title: "Write the onboarding tour", parentId: "epic-1", priority: "low", assignee: mara2, labels: ["Content"], project: "app" },
76451
+ { columnId: "done", title: "Keep column headers in view", parentId: "epic-1", priority: "normal", assignee: alex, labels: ["Design"], project: "catalog" },
76452
+ { columnId: "done", title: "Find a ticket by its key", parentId: "epic-3", priority: "normal", assignee: jonas2, labels: ["Productivity"], project: "app" },
76453
+ { columnId: "done", title: "Show the assignee on every card", parentId: "epic-2", priority: "low", assignee: mara2, labels: ["Design"], project: "catalog" },
76454
+ { columnId: "done", title: "Retry a move that failed", parentId: "epic-3", priority: "high", assignee: jonas2, labels: ["Bug"], project: "app" },
76455
+ { columnId: "done", title: "Respect reduced motion while dragging", parentId: "epic-1", priority: "normal", assignee: alex, labels: ["Accessibility"], project: "catalog" },
76456
+ { columnId: "done", title: "Paste images into comments", parentId: "epic-2", priority: "normal", assignee: mara2, labels: ["Collaboration"], project: "app" }
76457
+ ];
76458
+ let key = 120;
76459
+ const orders = /* @__PURE__ */ new Map();
76460
+ const order = /* @__PURE__ */ __name((columnId) => {
76461
+ const next = orders.get(columnId) ?? 2;
76462
+ orders.set(columnId, next + 1);
76463
+ return next;
76464
+ }, "order");
76465
+ const history = /* @__PURE__ */ __name((day) => ({
76466
+ createdAt: `2026-09-${String(day).padStart(2, "0")}T09:00:00Z`,
76467
+ createdBy: mara2,
76468
+ updatedAt: `2026-09-${String(day + 2).padStart(2, "0")}T15:00:00Z`,
76469
+ updatedBy: mara2
76470
+ }), "history");
76471
+ const epic = {
76472
+ id: "epic-3",
76473
+ key: "CAT-160",
76474
+ kind: "epic",
76475
+ title: "Fast at any size",
76476
+ description: "Keep large boards quick to load, search and change.",
76477
+ columnId: "progress",
76478
+ order: 2,
76479
+ project: "app",
76480
+ ...history(14)
76481
+ };
76482
+ return [epic, ...tasks.flatMap(({ subtasks = [], ...task }, index) => {
76483
+ const id = `flow-${index + 1}`;
76484
+ return [
76485
+ { ...task, id, key: `CAT-${key++}`, kind: "task", order: order(task.columnId), ...history(1 + index % 25) },
76486
+ ...subtasks.map(([title, columnId], position) => ({
76487
+ id: `${id}-${position + 1}`,
76488
+ key: `CAT-${key++}`,
76489
+ kind: "subtask",
76490
+ title,
76491
+ parentId: id,
76492
+ columnId,
76493
+ order: position,
76494
+ assignee: task.assignee,
76495
+ project: task.project
76496
+ }))
76497
+ ];
76498
+ })];
76499
+ }, "workflowTickets");
76500
+ var revised = /* @__PURE__ */ __name((ticket) => ({
76501
+ ...ticket,
76502
+ revision: (ticket.revision ?? 0) + 1
76503
+ }), "revised");
76504
+ var createKanbanDemo = /* @__PURE__ */ __name((options = {}) => {
76505
+ const seeded = [
75482
76506
  {
75483
76507
  id: "epic-1",
75484
76508
  key: "CAT-100",
@@ -75665,8 +76689,11 @@ var createKanbanDemo = /* @__PURE__ */ __name(() => {
75665
76689
  order: 0,
75666
76690
  assignee: alex,
75667
76691
  project: "catalog"
75668
- }
76692
+ },
76693
+ ...options.released ? releasedTickets() : [],
76694
+ ...options.workflow ? workflowTickets() : []
75669
76695
  ];
76696
+ let tickets = seeded.map(revised);
75670
76697
  let comments = [
75671
76698
  {
75672
76699
  id: "comment-1",
@@ -75789,8 +76816,13 @@ var createKanbanDemo = /* @__PURE__ */ __name(() => {
75789
76816
  record(input.ticketId, "commented");
75790
76817
  return comment;
75791
76818
  }, "addComment"),
75792
- updateTicket: /* @__PURE__ */ __name(async ({ ticketId, changes }) => {
76819
+ updateTicket: /* @__PURE__ */ __name(async ({ ticketId, changes, expectedRevision }) => {
75793
76820
  const previous = tickets.find((ticket2) => ticket2.id === ticketId);
76821
+ if (expectedRevision !== void 0 && expectedRevision !== previous.revision)
76822
+ throw Object.assign(
76823
+ new Error(`${previous.updatedBy?.name ?? "A teammate"} changed ${previous.key} while you were editing it.`),
76824
+ { code: "revision_conflict" }
76825
+ );
75794
76826
  const next = {
75795
76827
  ...previous,
75796
76828
  ...changes,
@@ -75809,11 +76841,11 @@ var createKanbanDemo = /* @__PURE__ */ __name(() => {
75809
76841
  ])
75810
76842
  );
75811
76843
  if (!Object.keys(changed3).length) return previous;
75812
- const ticket = {
76844
+ const ticket = revised({
75813
76845
  ...next,
75814
76846
  updatedAt: record(ticketId, "updated", changed3),
75815
76847
  updatedBy: actor
75816
- };
76848
+ });
75817
76849
  tickets = tickets.map((item) => item.id === ticketId ? ticket : item);
75818
76850
  return ticket;
75819
76851
  }, "updateTicket"),
@@ -75830,7 +76862,9 @@ var createKanbanDemo = /* @__PURE__ */ __name(() => {
75830
76862
  updatedAt,
75831
76863
  updatedBy: actor
75832
76864
  });
75833
- const changed3 = destination.map((item, order) => ({ ...item, order }));
76865
+ const changed3 = destination.map(
76866
+ (item, order) => item.id === ticketId || item.order !== order ? revised({ ...item, order }) : item
76867
+ );
75834
76868
  tickets = tickets.map((item) => changed3.find((moved) => moved.id === item.id) ?? item);
75835
76869
  return changed3;
75836
76870
  }, "moveTicket"),
@@ -75845,7 +76879,8 @@ var createKanbanDemo = /* @__PURE__ */ __name(() => {
75845
76879
  createdAt,
75846
76880
  createdBy: actor,
75847
76881
  updatedAt: createdAt,
75848
- updatedBy: actor
76882
+ updatedBy: actor,
76883
+ revision: 1
75849
76884
  };
75850
76885
  tickets = [...tickets, ticket];
75851
76886
  return ticket;
@@ -75863,7 +76898,7 @@ var createKanbanDemo = /* @__PURE__ */ __name(() => {
75863
76898
 
75864
76899
  // ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.ts
75865
76900
  var demoFunc71 = /* @__PURE__ */ __name(() => {
75866
- const demo11 = createKanbanDemo();
76901
+ const demo11 = createKanbanDemo({ released: true, workflow: true });
75867
76902
  const [mara3, jonas3, alex2] = kanbanDemoPeople;
75868
76903
  const teammate = [
75869
76904
  () => demo11.provider.moveTicket({ ticketId: "task-1", columnId: "progress" }),
@@ -75875,27 +76910,42 @@ var demoFunc71 = /* @__PURE__ */ __name(() => {
75875
76910
  () => demo11.provider.moveTicket({ ticketId: "task-2", columnId: "review" })
75876
76911
  ];
75877
76912
  let step = 0;
76913
+ const boardOf = /* @__PURE__ */ __name((event) => event.currentTarget.closest(".dees-demo-app").querySelector("dees-kanban"), "boardOf");
75878
76914
  const simulate2 = /* @__PURE__ */ __name(async (event) => {
75879
- const board = event.currentTarget.closest(".dees-demo-app").querySelector("dees-kanban");
76915
+ const board = boardOf(event);
75880
76916
  demo11.actAs(step % 2 ? alex2 : jonas3);
75881
76917
  await teammate[step++ % teammate.length]();
75882
76918
  demo11.actAs(mara3);
75883
76919
  await board.refresh();
75884
76920
  }, "simulate");
75885
- return demoApp(b`<div class="dees-demo-row" style="padding: 0 24px 4px">
75886
- <p class="dees-demo-caption">Signed in as Mara Chen. Jonas and Alex work on the same board.</p>
76921
+ let renames = 0;
76922
+ const rename = /* @__PURE__ */ __name(async (event) => {
76923
+ const board = boardOf(event);
76924
+ demo11.actAs(jonas3);
76925
+ await demo11.provider.updateTicket({
76926
+ ticketId: "task-2",
76927
+ changes: { title: `Connect related tickets (${++renames})` }
76928
+ });
76929
+ demo11.actAs(mara3);
76930
+ await board.refresh();
76931
+ }, "rename");
76932
+ return demoApp(b`<div style="display: flex; flex-direction: column; height: 100%">
76933
+ <div class="dees-demo-row" style="flex: none; padding: 0 24px 4px">
76934
+ <p class="dees-demo-caption">Signed in as Mara Chen. Jonas and Alex work on the same board. To see a refused stale edit, start editing CAT-102, close it, let Jonas rename it and save.</p>
75887
76935
  <dees-button type="outline" size="sm" text="Simulate a teammate's change" @clicked=${simulate2}></dees-button>
76936
+ <dees-button type="outline" size="sm" text="Jonas renames CAT-102" @clicked=${rename}></dees-button>
75888
76937
  </div>
75889
76938
  <dees-kanban
75890
76939
  heading="Product workspace"
75891
76940
  currentPersonId=${mara3.id}
75892
76941
  .tickets=${demo11.tickets}
75893
- .columns=${kanbanDemoColumns}
76942
+ .columns=${kanbanDemoWorkflowColumns}
75894
76943
  .people=${kanbanDemoPeople}
75895
76944
  .projects=${kanbanDemoProjects}
75896
76945
  .revision=${demo11.revision}
75897
76946
  .provider=${demo11.provider}
75898
- ></dees-kanban>`);
76947
+ ></dees-kanban>
76948
+ </div>`);
75899
76949
  }, "demoFunc");
75900
76950
 
75901
76951
  // ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.ts
@@ -76474,6 +77524,8 @@ var KanbanDragController = class {
76474
77524
  }
76475
77525
  const columnId = column.column?.id;
76476
77526
  if (!columnId) return;
77527
+ if (column.collapsed)
77528
+ return column.tickets.some((ticket) => ticket.id === gesture.motion.ticket.id) ? this.authoritativeMove(gesture.motion.ticket.id) : { ticketId: gesture.motion.ticket.id, columnId, beforeTicketId: void 0 };
76477
77529
  const tickets = sortKanbanTickets(column.tickets).filter(
76478
77530
  (ticket) => ticket.id !== gesture.motion.ticket.id
76479
77531
  );
@@ -76778,6 +77830,21 @@ var KanbanDragController = class {
76778
77830
  autoScroll(gesture, elapsed) {
76779
77831
  const velocity = /* @__PURE__ */ __name((point, start2, end2, edge) => point < start2 + edge ? -Math.min(1, Math.max(0, (start2 + edge - point) / edge)) * 14 * elapsed : point > end2 - edge ? Math.min(1, Math.max(0, (point - end2 + edge) / edge)) * 14 * elapsed : 0, "velocity");
76780
77832
  let movedX = false, movedY = false;
77833
+ const lane = this.columns.find((column) => {
77834
+ const rect = column.getBoundingClientRect();
77835
+ return gesture.x >= rect.left && gesture.x <= rect.right;
77836
+ });
77837
+ const cards = lane?.cardScroller;
77838
+ if (lane && cards) {
77839
+ const rect = cards.getBoundingClientRect();
77840
+ const top = Math.max(0, rect.top), bottom = Math.min(innerHeight, rect.bottom);
77841
+ if (gesture.y >= top - 56 && gesture.y <= bottom + 56) {
77842
+ const y = cards.scrollTop;
77843
+ cards.scrollTop += velocity(gesture.y, top, bottom, 56);
77844
+ movedY = cards.scrollTop !== y;
77845
+ if (movedY) lane.syncScrollEdges();
77846
+ }
77847
+ }
76781
77848
  for (const parent of this.scrollParents) {
76782
77849
  const rect = parent === document.scrollingElement ? { left: 0, top: 0, right: innerWidth, bottom: innerHeight } : parent.getBoundingClientRect();
76783
77850
  const left = Math.max(0, rect.left), top = Math.max(0, rect.top), right = Math.min(innerWidth, rect.right), bottom = Math.min(innerHeight, rect.bottom);
@@ -76880,9 +77947,10 @@ var KanbanDragController = class {
76880
77947
  };
76881
77948
 
76882
77949
  // ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.ts
76883
- var _motion_dec, _nativeOver_dec, _nativeDropBefore_dec, _pointerManaged_dec2, _draggingTicketId_dec, _pendingTicketId_dec, _canCreate_dec, _movesDisabled_dec, _movable_dec2, _showProjects_dec, _projects_dec3, _columns_dec6, _allTickets_dec, _tickets_dec3, _column_dec, _a106, _DeesKanbanColumn_decorators, _init107, _column, _tickets3, _allTickets, _columns6, _projects3, _showProjects, _movable2, _movesDisabled, _canCreate, _pendingTicketId, _draggingTicketId, _pointerManaged2, _nativeDropBefore, _nativeOver, _motion;
77950
+ var _motion_dec, _nativeOver_dec, _nativeDropBefore_dec, _pointerManaged_dec2, _draggingTicketId_dec, _pendingTicketId_dec, _collapsed_dec3, _canCreate_dec, _movesDisabled_dec, _movable_dec2, _showProjects_dec, _projects_dec3, _columns_dec6, _allTickets_dec, _tickets_dec3, _column_dec, _a106, _DeesKanbanColumn_decorators, _init107, _column, _tickets3, _allTickets, _columns6, _projects3, _showProjects, _movable2, _movesDisabled, _canCreate, _collapsed3, _pendingTicketId, _draggingTicketId, _pointerManaged2, _nativeDropBefore, _nativeOver, _motion;
77951
+ var collapsedCards = 3;
76884
77952
  _DeesKanbanColumn_decorators = [customElement("dees-kanban-column")];
76885
- var _DeesKanbanColumn = class _DeesKanbanColumn extends (_a106 = DeesElement, _column_dec = [n({ attribute: false })], _tickets_dec3 = [n({ attribute: false })], _allTickets_dec = [n({ attribute: false })], _columns_dec6 = [n({ attribute: false })], _projects_dec3 = [n({ attribute: false })], _showProjects_dec = [n({ type: Boolean, reflect: true })], _movable_dec2 = [n({ type: Boolean, reflect: true })], _movesDisabled_dec = [n({ type: Boolean, reflect: true })], _canCreate_dec = [n({ type: Boolean, reflect: true })], _pendingTicketId_dec = [n({ type: String, reflect: true })], _draggingTicketId_dec = [n({ type: String, reflect: true })], _pointerManaged_dec2 = [n({ attribute: false })], _nativeDropBefore_dec = [r2()], _nativeOver_dec = [r2()], _motion_dec = [n({ attribute: false })], _a106) {
77953
+ var _DeesKanbanColumn = class _DeesKanbanColumn extends (_a106 = DeesElement, _column_dec = [n({ attribute: false })], _tickets_dec3 = [n({ attribute: false })], _allTickets_dec = [n({ attribute: false })], _columns_dec6 = [n({ attribute: false })], _projects_dec3 = [n({ attribute: false })], _showProjects_dec = [n({ type: Boolean, reflect: true })], _movable_dec2 = [n({ type: Boolean, reflect: true })], _movesDisabled_dec = [n({ type: Boolean, reflect: true })], _canCreate_dec = [n({ type: Boolean, reflect: true })], _collapsed_dec3 = [n({ type: Boolean, reflect: true })], _pendingTicketId_dec = [n({ type: String, reflect: true })], _draggingTicketId_dec = [n({ type: String, reflect: true })], _pointerManaged_dec2 = [n({ attribute: false })], _nativeDropBefore_dec = [r2()], _nativeOver_dec = [r2()], _motion_dec = [n({ attribute: false })], _a106) {
76886
77954
  constructor() {
76887
77955
  super(...arguments);
76888
77956
  __publicField(this, "t", dcLocalize(this));
@@ -76895,27 +77963,46 @@ var _DeesKanbanColumn = class _DeesKanbanColumn extends (_a106 = DeesElement, _c
76895
77963
  __privateAdd(this, _movable2, __runInitializers(_init107, 32, this, false)), __runInitializers(_init107, 35, this);
76896
77964
  __privateAdd(this, _movesDisabled, __runInitializers(_init107, 36, this, false)), __runInitializers(_init107, 39, this);
76897
77965
  __privateAdd(this, _canCreate, __runInitializers(_init107, 40, this, false)), __runInitializers(_init107, 43, this);
76898
- __privateAdd(this, _pendingTicketId, __runInitializers(_init107, 44, this, "")), __runInitializers(_init107, 47, this);
76899
- __privateAdd(this, _draggingTicketId, __runInitializers(_init107, 48, this, "")), __runInitializers(_init107, 51, this);
76900
- __privateAdd(this, _pointerManaged2, __runInitializers(_init107, 52, this, false)), __runInitializers(_init107, 55, this);
76901
- __privateAdd(this, _nativeDropBefore, __runInitializers(_init107, 56, this)), __runInitializers(_init107, 59, this);
76902
- __privateAdd(this, _nativeOver, __runInitializers(_init107, 60, this, false)), __runInitializers(_init107, 63, this);
76903
- __privateAdd(this, _motion, __runInitializers(_init107, 64, this)), __runInitializers(_init107, 67, this);
77966
+ __privateAdd(this, _collapsed3, __runInitializers(_init107, 44, this, false)), __runInitializers(_init107, 47, this);
77967
+ __privateAdd(this, _pendingTicketId, __runInitializers(_init107, 48, this, "")), __runInitializers(_init107, 51, this);
77968
+ __privateAdd(this, _draggingTicketId, __runInitializers(_init107, 52, this, "")), __runInitializers(_init107, 55, this);
77969
+ __privateAdd(this, _pointerManaged2, __runInitializers(_init107, 56, this, false)), __runInitializers(_init107, 59, this);
77970
+ __privateAdd(this, _nativeDropBefore, __runInitializers(_init107, 60, this)), __runInitializers(_init107, 63, this);
77971
+ __privateAdd(this, _nativeOver, __runInitializers(_init107, 64, this, false)), __runInitializers(_init107, 67, this);
77972
+ __privateAdd(this, _motion, __runInitializers(_init107, 68, this)), __runInitializers(_init107, 71, this);
77973
+ /** "Show all" unfolded the column and went away with it: focus moves to the header's toggle. */
77974
+ __publicField(this, "focusToggle", false);
77975
+ __publicField(this, "scrollEdges", new ScrollEdgeShadowController(this, () => this.cardScroller));
77976
+ }
77977
+ /** The scroller of the column's cards, which a drag scrolls near its edges. */
77978
+ get cardScroller() {
77979
+ return this.shadowRoot?.querySelector(".body") ?? null;
77980
+ }
77981
+ /** Shows the edges of the cards' scroller in the frame a drag scrolled it. */
77982
+ syncScrollEdges() {
77983
+ this.scrollEdges.sync();
76904
77984
  }
76905
77985
  updated() {
76906
77986
  if (!this.draggingTicketId) this.nativeOver = false;
77987
+ if (this.focusToggle) {
77988
+ this.focusToggle = false;
77989
+ this.shadowRoot?.querySelector("header .toggle")?.focus();
77990
+ }
76907
77991
  }
76908
77992
  render() {
76909
77993
  if (!this.column) return b``;
76910
77994
  const motion = this.motion;
76911
- const tickets = sortKanbanTickets(this.tickets).filter(
77995
+ const ordered = sortKanbanTickets(this.tickets).filter(
76912
77996
  (ticket) => ticket.id !== motion?.move.ticketId
76913
77997
  );
76914
77998
  const active = motion?.move.columnId === this.column.id;
76915
77999
  if (motion && active) {
76916
- const index = tickets.findIndex((ticket) => ticket.id === motion.move.beforeTicketId);
76917
- tickets.splice(index < 0 ? tickets.length : index, 0, motion.ticket);
78000
+ const index = ordered.findIndex((ticket) => ticket.id === motion.move.beforeTicketId);
78001
+ ordered.splice(index < 0 ? ordered.length : index, 0, motion.ticket);
76918
78002
  }
78003
+ const tickets = this.collapsed ? [...ordered].reverse().slice(0, collapsedCards) : ordered;
78004
+ const hidden = ordered.length - tickets.length;
78005
+ const collapsible = !!this.column.collapsible;
76919
78006
  return b`<section
76920
78007
  class=${active && motion?.placeholder || this.nativeOver ? "over" : ""}
76921
78008
  aria-label=${this.column.title}
@@ -76945,8 +78032,18 @@ var _DeesKanbanColumn = class _DeesKanbanColumn extends (_a106 = DeesElement, _c
76945
78032
  <header>
76946
78033
  <span class="status ${this.column.done ? "done" : ""}" aria-hidden="true"></span>
76947
78034
  <h3>${this.column.title}</h3>
76948
- <span class="count">${tickets.length}</span>
78035
+ <span class="count">${ordered.length}</span>
76949
78036
  <span class="spacer"></span>
78037
+ ${collapsible ? b`<dees-button
78038
+ class="toggle"
78039
+ type="ghost"
78040
+ size="icon"
78041
+ icon=${this.collapsed ? "lucide:ChevronsLeftRight" : "lucide:ChevronsRightLeft"}
78042
+ text=${this.t(this.collapsed ? "kanban.expandColumn" : "kanban.collapseColumn", {
78043
+ column: this.column.title
78044
+ })}
78045
+ @clicked=${() => this.toggle()}
78046
+ ></dees-button>` : ""}
76950
78047
  ${this.canCreate ? b`<dees-button
76951
78048
  type="ghost"
76952
78049
  size="icon"
@@ -76958,52 +78055,72 @@ var _DeesKanbanColumn = class _DeesKanbanColumn extends (_a106 = DeesElement, _c
76958
78055
  })}
76959
78056
  ></dees-button>` : ""}
76960
78057
  </header>
76961
- <div class="stack">${directives_exports.repeat(tickets, (ticket) => ticket.id, (ticket) => b`
76962
- <div
76963
- class="target ${this.nativeOver && this.nativeDropBefore === ticket.id ? "native-before" : ""}"
76964
- data-ticket-id=${ticket.id}
76965
- @dragover=${() => {
76966
- if (!this.pointerManaged) this.nativeDropBefore = ticket.id;
78058
+ <div class="bodyFrame">
78059
+ <div class="body">
78060
+ <div class="stack">${directives_exports.repeat(tickets, (ticket) => ticket.id, (ticket) => b`
78061
+ <div
78062
+ class="target ${this.nativeOver && this.nativeDropBefore === ticket.id ? "native-before" : ""}"
78063
+ data-ticket-id=${ticket.id}
78064
+ @dragover=${() => {
78065
+ if (!this.pointerManaged) this.nativeDropBefore = this.collapsed ? void 0 : ticket.id;
76967
78066
  }}
76968
- >
76969
- ${motion?.move.ticketId === ticket.id && motion.placeholder ? b`<div
76970
- class="placeholder"
76971
- style=${`height: ${motion.height}px`}
76972
- aria-label=${this.t("kanban.dropHere")}
76973
- ></div>` : b`<dees-kanban-card
76974
- .ticket=${ticket}
76975
- .columns=${this.columns}
76976
- .projectName=${this.showProjects && ticket.project ? kanbanProjectName(this.projects, ticket.project) : ""}
76977
- .epic=${this.allTickets.find(
78067
+ >
78068
+ ${motion?.move.ticketId === ticket.id && motion.placeholder ? b`<div
78069
+ class="placeholder"
78070
+ style=${`height: ${motion.height}px`}
78071
+ aria-label=${this.t("kanban.dropHere")}
78072
+ ></div>` : b`<dees-kanban-card
78073
+ .ticket=${ticket}
78074
+ .columns=${this.columns}
78075
+ .projectName=${this.showProjects && ticket.project ? kanbanProjectName(this.projects, ticket.project) : ""}
78076
+ .epic=${this.allTickets.find(
76978
78077
  (item) => item.id === ticket.parentId && item.kind === "epic"
76979
78078
  )}
76980
- .subtasks=${sortKanbanTickets(
78079
+ .subtasks=${sortKanbanTickets(
76981
78080
  this.allTickets.filter(
76982
78081
  (item) => item.parentId === ticket.id && item.kind === "subtask"
76983
78082
  )
76984
78083
  )}
76985
- .movable=${this.movable && ticket.permissions?.move !== false}
76986
- .pending=${motion?.move.ticketId === ticket.id ? motion.dimmed : this.pendingTicketId === ticket.id}
76987
- .moveDisabled=${this.movesDisabled}
76988
- .saving=${motion?.move.ticketId === ticket.id && motion.saving}
76989
- .pointerManaged=${this.pointerManaged}
76990
- ></dees-kanban-card>`}
76991
- </div>`)}
76992
- ${!tickets.length ? b`<div
76993
- class="empty"
76994
- @dragover=${() => {
78084
+ .movable=${this.movable && ticket.permissions?.move !== false}
78085
+ .pending=${motion?.move.ticketId === ticket.id ? motion.dimmed : this.pendingTicketId === ticket.id}
78086
+ .moveDisabled=${this.movesDisabled}
78087
+ .saving=${motion?.move.ticketId === ticket.id && motion.saving}
78088
+ .pointerManaged=${this.pointerManaged}
78089
+ ></dees-kanban-card>`}
78090
+ </div>`)}
78091
+ ${!tickets.length ? b`<div
78092
+ class="empty"
78093
+ @dragover=${() => {
76995
78094
  this.nativeDropBefore = void 0;
76996
78095
  }}
76997
- >${this.t("kanban.noTasks")}</div>` : ""}
76998
- </div>
76999
- <div
77000
- class="end-target ${this.nativeOver && !this.nativeDropBefore ? "native-before" : ""}"
77001
- @dragover=${() => {
78096
+ >${this.t("kanban.noTasks")}</div>` : ""}
78097
+ </div>
78098
+ ${hidden > 0 ? b`<div class="show-all">
78099
+ <dees-button
78100
+ type="ghost"
78101
+ size="sm"
78102
+ icon="lucide:ChevronDown"
78103
+ text=${this.t("kanban.showAll", { count: ordered.length })}
78104
+ @clicked=${() => {
78105
+ this.focusToggle = true;
78106
+ this.toggle();
78107
+ }}
78108
+ ></dees-button>
78109
+ </div>` : ""}
78110
+ <div
78111
+ class="end-target ${this.nativeOver && !this.nativeDropBefore && !this.collapsed ? "native-before" : ""}"
78112
+ @dragover=${() => {
77002
78113
  this.nativeDropBefore = void 0;
77003
78114
  }}
77004
- ></div>
78115
+ ></div>
78116
+ </div>
78117
+ ${this.scrollEdges.renderShadows()}
78118
+ </div>
77005
78119
  </section>`;
77006
78120
  }
78121
+ toggle() {
78122
+ kanbanEvent(this, "kanban-column-toggle", { columnId: this.column.id });
78123
+ }
77007
78124
  };
77008
78125
  _init107 = __decoratorStart(_a106);
77009
78126
  _column = new WeakMap();
@@ -77015,6 +78132,7 @@ _showProjects = new WeakMap();
77015
78132
  _movable2 = new WeakMap();
77016
78133
  _movesDisabled = new WeakMap();
77017
78134
  _canCreate = new WeakMap();
78135
+ _collapsed3 = new WeakMap();
77018
78136
  _pendingTicketId = new WeakMap();
77019
78137
  _draggingTicketId = new WeakMap();
77020
78138
  _pointerManaged2 = new WeakMap();
@@ -77030,6 +78148,7 @@ __decorateElement(_init107, 4, "showProjects", _showProjects_dec, _DeesKanbanCol
77030
78148
  __decorateElement(_init107, 4, "movable", _movable_dec2, _DeesKanbanColumn, _movable2);
77031
78149
  __decorateElement(_init107, 4, "movesDisabled", _movesDisabled_dec, _DeesKanbanColumn, _movesDisabled);
77032
78150
  __decorateElement(_init107, 4, "canCreate", _canCreate_dec, _DeesKanbanColumn, _canCreate);
78151
+ __decorateElement(_init107, 4, "collapsed", _collapsed_dec3, _DeesKanbanColumn, _collapsed3);
77033
78152
  __decorateElement(_init107, 4, "pendingTicketId", _pendingTicketId_dec, _DeesKanbanColumn, _pendingTicketId);
77034
78153
  __decorateElement(_init107, 4, "draggingTicketId", _draggingTicketId_dec, _DeesKanbanColumn, _draggingTicketId);
77035
78154
  __decorateElement(_init107, 4, "pointerManaged", _pointerManaged_dec2, _DeesKanbanColumn, _pointerManaged2);
@@ -77040,6 +78159,7 @@ _DeesKanbanColumn = __decorateElement(_init107, 0, "DeesKanbanColumn", _DeesKanb
77040
78159
  __name(_DeesKanbanColumn, "DeesKanbanColumn");
77041
78160
  __publicField(_DeesKanbanColumn, "styles", [
77042
78161
  ...kanbanStyles,
78162
+ scrollEdgeShadowStyles,
77043
78163
  i`
77044
78164
  :host {
77045
78165
  display: flex;
@@ -77049,19 +78169,27 @@ __publicField(_DeesKanbanColumn, "styles", [
77049
78169
  flex: 1 0 272px;
77050
78170
  }
77051
78171
 
78172
+ :host([collapsed]) {
78173
+ flex: 0 0 224px;
78174
+ min-width: 224px;
78175
+ max-width: 224px;
78176
+ }
78177
+
77052
78178
  section {
78179
+ flex: 1 1 auto;
78180
+ display: flex;
78181
+ flex-direction: column;
77053
78182
  min-height: 220px;
77054
- height: 100%;
77055
78183
  border-radius: var(--dees-radius-xl);
77056
78184
  transition: background var(--dees-transition-default) var(--dees-ease-out);
77057
78185
  }
77058
78186
 
77059
78187
  header {
78188
+ flex: none;
77060
78189
  display: flex;
77061
78190
  align-items: center;
77062
78191
  gap: 8px;
77063
78192
  min-height: 40px;
77064
- margin-bottom: 10px;
77065
78193
  padding: 0 var(--dees-spacing-2xs) var(--dees-spacing-sm);
77066
78194
  border-bottom: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
77067
78195
  }
@@ -77090,6 +78218,29 @@ __publicField(_DeesKanbanColumn, "styles", [
77090
78218
  border-color: var(--dees-color-accent-success);
77091
78219
  }
77092
78220
 
78221
+ /*
78222
+ * The column's cards scroll below its header once the board's height runs out, and the edges
78223
+ * past which cards lie cast their shadows, the top one from the header's line. The scroller
78224
+ * reaches past the column by an inset that keeps card shadows and the drop line in view; the
78225
+ * cards stay exactly the column wide.
78226
+ */
78227
+ .bodyFrame {
78228
+ position: relative;
78229
+ flex: 1 1 auto;
78230
+ min-height: 0;
78231
+ display: flex;
78232
+ flex-direction: column;
78233
+ }
78234
+
78235
+ .body {
78236
+ flex: 1 1 auto;
78237
+ min-height: 0;
78238
+ overflow-x: hidden;
78239
+ overflow-y: auto;
78240
+ padding: 10px var(--dees-spacing-2xs) 0;
78241
+ margin: 0 calc(var(--dees-spacing-2xs) * -1);
78242
+ }
78243
+
77093
78244
  /* One track exactly the column wide: a card never takes its content's width. */
77094
78245
  .stack {
77095
78246
  display: grid;
@@ -77130,6 +78281,11 @@ __publicField(_DeesKanbanColumn, "styles", [
77130
78281
  background: var(--dees-color-row-hover);
77131
78282
  }
77132
78283
 
78284
+ .show-all {
78285
+ display: flex;
78286
+ margin-top: 8px;
78287
+ }
78288
+
77133
78289
  @media (prefers-reduced-motion: reduce) {
77134
78290
  section {
77135
78291
  transition: none;
@@ -77149,7 +78305,7 @@ __runInitializers(_init107, 1, _DeesKanbanColumn);
77149
78305
  var DeesKanbanColumn = _DeesKanbanColumn;
77150
78306
 
77151
78307
  // ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts
77152
- var _openingTicket_dec, _pendingTicketId_dec2, _filterAnnouncement_dec, _filtersOpen_dec, _operationError_dec, _revision_dec, _filterValues_dec2, _currentPersonId_dec, _projects_dec4, _error_dec7, _loading_dec11, _provider_dec4, _people_dec2, _columns_dec7, _tickets_dec4, _heading_dec10, _a107, _DeesKanban_decorators, _init108, _heading10, _tickets4, _columns7, _people2, _provider4, _loading11, _error7, _projects4, _currentPersonId, _filterValues2, _revision, _operationError, _filtersOpen, _filterAnnouncement, _pendingTicketId2, _openingTicket;
78308
+ var _columnsCollapsed_dec, _openingTicket_dec, _pendingTicketId_dec2, _filterAnnouncement_dec, _filtersOpen_dec, _operationError_dec, _revision_dec, _filterValues_dec2, _currentPersonId_dec, _projects_dec4, _error_dec7, _loading_dec11, _provider_dec4, _people_dec2, _columns_dec7, _tickets_dec4, _heading_dec10, _a107, _DeesKanban_decorators, _init108, _heading10, _tickets4, _columns7, _people2, _provider4, _loading11, _error7, _projects4, _currentPersonId, _filterValues2, _revision, _operationError, _filtersOpen, _filterAnnouncement, _pendingTicketId2, _openingTicket, _columnsCollapsed;
77153
78309
  var interactionEvents = [
77154
78310
  "kanban-ticket-open",
77155
78311
  "kanban-ticket-move",
@@ -77161,10 +78317,14 @@ var interactionEvents = [
77161
78317
  "kanban-comment-added",
77162
78318
  "kanban-comments-refresh",
77163
78319
  "kanban-activity-refresh",
77164
- "kanban-detail-back"
78320
+ "kanban-detail-back",
78321
+ "kanban-ticket-reload",
78322
+ "kanban-conflict-apply",
78323
+ "kanban-conflict-dismiss",
78324
+ "kanban-column-toggle"
77165
78325
  ];
77166
78326
  _DeesKanban_decorators = [customElement("dees-kanban")];
77167
- var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10 = [n({ type: String, reflect: true })], _tickets_dec4 = [n({ attribute: false })], _columns_dec7 = [n({ attribute: false })], _people_dec2 = [n({ attribute: false })], _provider_dec4 = [n({ attribute: false })], _loading_dec11 = [n({ type: Boolean, reflect: true })], _error_dec7 = [n({ type: String, reflect: true })], _projects_dec4 = [n({ attribute: false })], _currentPersonId_dec = [n({ type: String, reflect: true })], _filterValues_dec2 = [n({ attribute: false })], _revision_dec = [n({ attribute: false })], _operationError_dec = [r2()], _filtersOpen_dec = [r2()], _filterAnnouncement_dec = [r2()], _pendingTicketId_dec2 = [r2()], _openingTicket_dec = [r2()], _a107) {
78327
+ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10 = [n({ type: String, reflect: true })], _tickets_dec4 = [n({ attribute: false })], _columns_dec7 = [n({ attribute: false })], _people_dec2 = [n({ attribute: false })], _provider_dec4 = [n({ attribute: false })], _loading_dec11 = [n({ type: Boolean, reflect: true })], _error_dec7 = [n({ type: String, reflect: true })], _projects_dec4 = [n({ attribute: false })], _currentPersonId_dec = [n({ type: String, reflect: true })], _filterValues_dec2 = [n({ attribute: false })], _revision_dec = [n({ attribute: false })], _operationError_dec = [r2()], _filtersOpen_dec = [r2()], _filterAnnouncement_dec = [r2()], _pendingTicketId_dec2 = [r2()], _openingTicket_dec = [r2()], _columnsCollapsed_dec = [r2()], _a107) {
77168
78328
  constructor() {
77169
78329
  super(...arguments);
77170
78330
  __publicField(this, "t", dcLocalize(this));
@@ -77184,6 +78344,7 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77184
78344
  __privateAdd(this, _filterAnnouncement, __runInitializers(_init108, 60, this, "")), __runInitializers(_init108, 63, this);
77185
78345
  __privateAdd(this, _pendingTicketId2, __runInitializers(_init108, 64, this, "")), __runInitializers(_init108, 67, this);
77186
78346
  __privateAdd(this, _openingTicket, __runInitializers(_init108, 68, this, false)), __runInitializers(_init108, 71, this);
78347
+ __privateAdd(this, _columnsCollapsed, __runInitializers(_init108, 72, this, {})), __runInitializers(_init108, 75, this);
77187
78348
  __publicField(this, "modal");
77188
78349
  __publicField(this, "modalOpening");
77189
78350
  __publicField(this, "detail");
@@ -77204,6 +78365,17 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77204
78365
  __publicField(this, "commentRevisions", /* @__PURE__ */ new Map());
77205
78366
  __publicField(this, "commentDrafts", /* @__PURE__ */ new Map());
77206
78367
  __publicField(this, "ticketDrafts", /* @__PURE__ */ new Map());
78368
+ /** Each unsaved edit's ticket as the edit started, by ticket id: what differs from it is the person's change. */
78369
+ __publicField(this, "draftBases", /* @__PURE__ */ new Map());
78370
+ /** Saves the provider refused as stale, by ticket id, until saved, cancelled or discarded. */
78371
+ __publicField(this, "conflicts", /* @__PURE__ */ new Map());
78372
+ /**
78373
+ * The ticket whose move or save the provider refused, and the state of it the refusal answered;
78374
+ * the refusal's words leave once the board holds another state of the ticket.
78375
+ */
78376
+ __publicField(this, "refusal");
78377
+ /** Each ticket's running reload after a refused save, by ticket id. */
78378
+ __publicField(this, "reloadAborts", /* @__PURE__ */ new Map());
77207
78379
  __publicField(this, "resolvedTickets", /* @__PURE__ */ new Map());
77208
78380
  __publicField(this, "activeMove");
77209
78381
  __publicField(this, "dragController", new KanbanDragController(
@@ -77256,10 +78428,46 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77256
78428
  void this.saveTicket(detail.ticketId, detail.draft);
77257
78429
  break;
77258
78430
  case "kanban-ticket-draft":
77259
- if (detail.draft) this.ticketDrafts.set(detail.ticketId, detail.draft);
77260
- else this.ticketDrafts.delete(detail.ticketId);
78431
+ if (detail.draft) {
78432
+ if (!this.ticketDrafts.has(detail.ticketId)) {
78433
+ const ticket = this.findTicket(detail.ticketId);
78434
+ if (ticket) this.draftBases.set(detail.ticketId, ticketDraft(ticket));
78435
+ }
78436
+ this.ticketDrafts.set(detail.ticketId, detail.draft);
78437
+ } else {
78438
+ this.ticketDrafts.delete(detail.ticketId);
78439
+ this.draftBases.delete(detail.ticketId);
78440
+ this.conflicts.delete(detail.ticketId);
78441
+ this.reloadAborts.get(detail.ticketId)?.abort();
78442
+ this.reloadAborts.delete(detail.ticketId);
78443
+ }
78444
+ this.syncDetail();
78445
+ break;
78446
+ case "kanban-ticket-reload":
78447
+ void this.reloadTicket(detail.ticketId);
78448
+ break;
78449
+ case "kanban-conflict-apply": {
78450
+ const conflict = this.conflicts.get(detail.ticketId);
78451
+ const draft = this.ticketDrafts.get(detail.ticketId);
78452
+ if (conflict?.state !== "reloaded" || !draft || !(detail.field in conflict.edit)) break;
78453
+ const edit = { ...conflict.edit };
78454
+ this.ticketDrafts.set(detail.ticketId, { ...draft, [detail.field]: edit[detail.field] });
78455
+ delete edit[detail.field];
78456
+ if (Object.keys(edit).length) this.conflicts.set(detail.ticketId, { ...conflict, edit });
78457
+ else this.conflicts.delete(detail.ticketId);
77261
78458
  this.syncDetail();
77262
78459
  break;
78460
+ }
78461
+ case "kanban-conflict-dismiss":
78462
+ this.conflicts.delete(detail.ticketId);
78463
+ this.syncDetail();
78464
+ break;
78465
+ case "kanban-column-toggle": {
78466
+ const column = this.columns.find((item) => item.id === detail.columnId);
78467
+ if (column?.collapsible)
78468
+ this.columnsCollapsed = { ...this.columnsCollapsed, [column.id]: !this.isCollapsed(column) };
78469
+ break;
78470
+ }
77263
78471
  case "kanban-comment-draft":
77264
78472
  this.commentDrafts.set(detail.ticketId, detail.body);
77265
78473
  break;
@@ -77297,6 +78505,12 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77297
78505
  this.dragController.connect();
77298
78506
  await connection;
77299
78507
  }
78508
+ willUpdate(changed3) {
78509
+ super.willUpdate(changed3);
78510
+ const refusal = this.refusal;
78511
+ if (refusal && changed3.has("tickets") && kanbanTicketVersion(this.findTicket(refusal.ticketId)) !== refusal.version)
78512
+ this.clearOperationError();
78513
+ }
77300
78514
  updated() {
77301
78515
  this.syncDetail();
77302
78516
  this.dragController.sync();
@@ -77411,6 +78625,7 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77411
78625
  .canCreate=${Boolean(this.provider.createTicket)}
77412
78626
  .movesDisabled=${Boolean(this.pendingTicketId)}
77413
78627
  .pendingTicketId=${this.pendingTicketId}
78628
+ .collapsed=${this.isCollapsed(column)}
77414
78629
  ></dees-kanban-column>`)}
77415
78630
  </div>`}`;
77416
78631
  }
@@ -77438,6 +78653,10 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77438
78653
  >${this.t("kanban.clearAll")}</button>
77439
78654
  </div>`;
77440
78655
  }
78656
+ /** Whether a collapsible column is folded: as the reader left it, else as it starts. */
78657
+ isCollapsed(column) {
78658
+ return column.collapsible ? this.columnsCollapsed[column.id] ?? column.collapsible === "collapsed" : false;
78659
+ }
77441
78660
  /** Whether a ticket belongs to a project: its own, or for an epic, one of its tasks'. */
77442
78661
  inProject(ticket, project2) {
77443
78662
  return ticket.project === project2 || ticket.kind === "epic" && this.tickets.some((task) => task.parentId === ticket.id && task.project === project2);
@@ -77596,7 +78815,7 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77596
78815
  this.openAbort?.abort();
77597
78816
  const controller = this.openAbort = new AbortController();
77598
78817
  this.openingTicket = true;
77599
- this.operationError = "";
78818
+ this.clearOperationError();
77600
78819
  try {
77601
78820
  const ticket = this.provider.getTicket ? await this.provider.getTicket(id, controller.signal) : this.findTicket(id);
77602
78821
  if (controller.signal.aborted || !this.isConnected) return;
@@ -77673,6 +78892,7 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77673
78892
  this.detail.activity = this.activityCache.get(this.selectedId) ?? [];
77674
78893
  this.detail.commentDraft = this.commentDrafts.get(this.selectedId) ?? [];
77675
78894
  this.detail.draft = this.ticketDrafts.get(this.selectedId);
78895
+ this.detail.conflict = this.conflicts.get(this.selectedId);
77676
78896
  this.detail.canGoBack = this.history.length > 0;
77677
78897
  this.detail.saving = this.pendingTicketId === this.selectedId;
77678
78898
  if (this.modal) this.modal.heading = this.detail.ticket.key;
@@ -77837,7 +79057,7 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77837
79057
  }
77838
79058
  const operation = this.activeMove = /* @__PURE__ */ Symbol();
77839
79059
  this.pendingTicketId = ticket.id;
77840
- this.operationError = "";
79060
+ this.clearOperationError();
77841
79061
  try {
77842
79062
  const changed3 = await this.provider.moveTicket(input);
77843
79063
  if (this.activeMove !== operation) return false;
@@ -77851,7 +79071,7 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77851
79071
  }
77852
79072
  return true;
77853
79073
  } catch (error) {
77854
- if (this.activeMove === operation) this.reportError(error);
79074
+ if (this.activeMove === operation) this.reportError(error, ticket.id);
77855
79075
  return false;
77856
79076
  } finally {
77857
79077
  if (this.activeMove === operation) {
@@ -77861,9 +79081,15 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77861
79081
  }
77862
79082
  }
77863
79083
  }
79084
+ /**
79085
+ * Saves an edit through the provider's `updateTicket`, with the revision it started from. A save
79086
+ * the provider refuses as stale (`IKanbanRevisionConflict`) keeps the edit and holds the refusal
79087
+ * in the detail, which offers to reload the ticket; another save waits for the reload.
79088
+ */
77864
79089
  async saveTicket(ticketId, draft) {
77865
79090
  const ticket = this.findTicket(ticketId);
77866
- if (!ticket || !this.provider.updateTicket || ticket.permissions?.edit === false || this.pendingTicketId || !draft.title.trim())
79091
+ const conflict = this.conflicts.get(ticketId);
79092
+ if (!ticket || !this.provider.updateTicket || ticket.permissions?.edit === false || this.pendingTicketId || !draft.title.trim() || conflict && conflict.state !== "reloaded")
77867
79093
  return;
77868
79094
  const parent = draft.parentId ? this.findTicket(draft.parentId) : void 0;
77869
79095
  if (ticket.kind === "subtask" && parent?.kind !== "task" || ticket.kind === "task" && draft.parentId && parent?.kind !== "epic") {
@@ -77876,7 +79102,7 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77876
79102
  return;
77877
79103
  }
77878
79104
  this.pendingTicketId = ticketId;
77879
- this.operationError = "";
79105
+ this.clearOperationError();
77880
79106
  if (this.detail) this.detail.error = "";
77881
79107
  try {
77882
79108
  const saved = await this.provider.updateTicket({
@@ -77889,20 +79115,78 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77889
79115
  parentId: ticket.kind === "epic" ? null : draft.parentId || null,
77890
79116
  ...draft.labels && !sameKanbanLabels(draft.labels, ticket.labels ?? []) ? { labels: [...draft.labels] } : {},
77891
79117
  ...draft.project && draft.project !== (ticket.project ?? "") ? { project: draft.project } : {}
77892
- }
79118
+ },
79119
+ ...draft.revision === void 0 ? {} : { expectedRevision: draft.revision }
77893
79120
  });
77894
79121
  if (saved.id !== ticketId)
77895
79122
  throw new Error(this.t("kanban.updateMismatch"));
77896
79123
  this.ticketDrafts.delete(ticketId);
79124
+ this.draftBases.delete(ticketId);
79125
+ this.conflicts.delete(ticketId);
77897
79126
  this.mergeTickets([saved]);
77898
79127
  if (this.selectedId === ticketId) this.detail?.finishEditing();
77899
79128
  } catch (error) {
77900
- this.reportError(error);
79129
+ if (isKanbanRevisionConflict(error)) {
79130
+ const message = kanbanError(error);
79131
+ this.conflicts.set(ticketId, { message, edit: {}, state: "stale" });
79132
+ kanbanEvent(this, "kanban-error", { error, message });
79133
+ } else this.reportError(error, ticketId);
77901
79134
  } finally {
77902
79135
  this.pendingTicketId = "";
77903
79136
  this.syncDetail();
77904
79137
  }
77905
79138
  }
79139
+ /**
79140
+ * Loads a ticket whose save the provider refused as stale and starts its edit again from the
79141
+ * latest version. What the person changed that the latest version does not hold stays in the
79142
+ * refusal, to apply field by field.
79143
+ */
79144
+ async reloadTicket(ticketId) {
79145
+ const conflict = this.conflicts.get(ticketId);
79146
+ if (!conflict || conflict.state === "reloading") return;
79147
+ const controller = new AbortController();
79148
+ this.reloadAborts.set(ticketId, controller);
79149
+ const held = this.findTicket(ticketId);
79150
+ this.conflicts.set(ticketId, { ...conflict, state: "reloading" });
79151
+ this.syncDetail();
79152
+ try {
79153
+ let fresh;
79154
+ if (this.provider.getTicket) fresh = await this.provider.getTicket(ticketId, controller.signal);
79155
+ else {
79156
+ await this.refresh();
79157
+ fresh = this.findTicket(ticketId);
79158
+ }
79159
+ if (controller.signal.aborted || !this.isConnected) return;
79160
+ if (!fresh || fresh.id !== ticketId) throw new Error(this.t("kanban.ticketUnavailable"));
79161
+ const latest = fresh;
79162
+ this.resolvedTickets.set(latest.id, latest);
79163
+ this.tickets = this.tickets.map((item) => item.id === latest.id ? latest : item);
79164
+ if (this.conflicts.get(ticketId)?.state !== "reloading") return;
79165
+ const draft = this.ticketDrafts.get(ticketId);
79166
+ const restart = ticketDraft(latest);
79167
+ const base = this.draftBases.get(ticketId) ?? (held ? ticketDraft(held) : restart);
79168
+ const edit = draft ? kanbanDraftChanges(base, draft, restart) : {};
79169
+ this.ticketDrafts.set(ticketId, restart);
79170
+ this.draftBases.set(ticketId, restart);
79171
+ if (Object.keys(edit).length)
79172
+ this.conflicts.set(ticketId, { ...conflict, edit, state: "reloaded" });
79173
+ else this.conflicts.delete(ticketId);
79174
+ } catch (error) {
79175
+ if (!controller.signal.aborted) this.reportError(error, ticketId);
79176
+ } finally {
79177
+ if (this.reloadAborts.get(ticketId) === controller) {
79178
+ this.reloadAborts.delete(ticketId);
79179
+ const left = this.conflicts.get(ticketId);
79180
+ if (left?.state === "reloading") this.conflicts.set(ticketId, { ...left, state: "stale" });
79181
+ }
79182
+ this.syncDetail();
79183
+ }
79184
+ }
79185
+ /**
79186
+ * Asks for a new ticket's title and, for a task or an epic while the board knows projects, its
79187
+ * project, then has the provider create it. The project starts at the board's project filter,
79188
+ * else the parent's; a subtask takes its parent's.
79189
+ */
77906
79190
  async createTicket(input) {
77907
79191
  if (!this.provider.createTicket || !this.columns.some((column) => column.id === input.columnId))
77908
79192
  return;
@@ -77911,21 +79195,73 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77911
79195
  if (input.kind === "subtask" && parent?.kind !== "task" || input.kind === "task" && parent && parent.kind !== "epic")
77912
79196
  return;
77913
79197
  const parentId = input.parentId ?? (input.kind === "task" ? this.filterValues.epic || void 0 : void 0);
77914
- const project2 = input.project || this.filterValues.project || (parentId ? this.findTicket(parentId)?.project : void 0);
77915
- await DeesModal.prompt({
77916
- heading: this.t("kanban.newTicket", { kind: input.kind }),
77917
- label: this.t("kanban.ticketTitle"),
77918
- i18n: this.t.i18n,
77919
- onConfirm: /* @__PURE__ */ __name(async (title) => {
79198
+ const parentProject = parentId ? this.findTicket(parentId)?.project : void 0;
79199
+ const project2 = (input.kind === "subtask" ? parentProject || input.project : input.project || this.filterValues.project || parentProject) || "";
79200
+ const projects = kanbanProjects(this.projects, this.tickets);
79201
+ let choice;
79202
+ if (input.kind !== "subtask" && projects.length) {
79203
+ choice = new DeesInputDropdown();
79204
+ choice.label = this.t("kanban.project");
79205
+ choice.options = [
79206
+ ...project2 ? [] : [{ key: "", option: this.t("kanban.noProject") }],
79207
+ ...projects.map((item) => ({ key: item.id, option: item.name })),
79208
+ ...project2 && !projects.some((item) => item.id === project2) ? [{ key: project2, option: project2 }] : []
79209
+ ];
79210
+ choice.selectedOption = choice.options.find((option) => option.key === project2) ?? null;
79211
+ }
79212
+ const title = new DeesInputText();
79213
+ title.label = this.t("kanban.ticketTitle");
79214
+ title.required = true;
79215
+ let modal;
79216
+ let creating = false;
79217
+ const create2 = /* @__PURE__ */ __name(async () => {
79218
+ const value = String(title.value ?? "").trim();
79219
+ if (!value) {
79220
+ title.validationState = "invalid";
79221
+ title.validationText = this.t("kanban.titleRequired");
79222
+ await title.focus();
79223
+ return;
79224
+ }
79225
+ const chosen = choice ? choice.getValue()?.key ?? "" : project2;
79226
+ creating = true;
79227
+ title.disabled = true;
79228
+ if (choice) choice.disabled = true;
79229
+ try {
77920
79230
  const ticket = await this.provider.createTicket({
77921
- ...input,
77922
- parentId,
77923
- title,
77924
- ...project2 ? { project: project2 } : {}
79231
+ kind: input.kind,
79232
+ columnId: input.columnId,
79233
+ title: value,
79234
+ ...parentId ? { parentId } : {},
79235
+ ...chosen ? { project: chosen } : {}
77925
79236
  });
79237
+ creating = false;
77926
79238
  this.mergeTickets([ticket], true);
77927
- }, "onConfirm")
79239
+ await modal?.destroy();
79240
+ } catch (error) {
79241
+ creating = false;
79242
+ title.disabled = false;
79243
+ if (choice) choice.disabled = false;
79244
+ title.validationState = "invalid";
79245
+ title.validationText = kanbanError(error);
79246
+ await title.updateComplete;
79247
+ await title.focus();
79248
+ }
79249
+ }, "create");
79250
+ modal = await DeesModal.createAndShow({
79251
+ heading: this.t("kanban.newTicket", { kind: input.kind }),
79252
+ width: "small",
79253
+ content: b`<dees-form>${choice ?? ""}${title}</dees-form>`,
79254
+ menuOptions: [
79255
+ catalogAction("common.cancel", async () => {
79256
+ await modal?.destroy();
79257
+ }),
79258
+ catalogAction("common.create", create2)
79259
+ ],
79260
+ beforeClose: /* @__PURE__ */ __name(() => !creating, "beforeClose"),
79261
+ i18n: this.t.i18n
77928
79262
  });
79263
+ await title.updateComplete;
79264
+ await title.focus();
77929
79265
  }
77930
79266
  async openMoveMenu(ticketId, anchor) {
77931
79267
  const ticket = this.findTicket(ticketId);
@@ -77974,11 +79310,23 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77974
79310
  { ownerElement: anchor, i18n: this.t.i18n }
77975
79311
  );
77976
79312
  }
77977
- reportError(error) {
79313
+ /**
79314
+ * Shows a failure on the board and in the open detail, and tells the host. A failure that answered
79315
+ * a ticket's move or save stays until the board holds another state of that ticket.
79316
+ */
79317
+ reportError(error, ticketId) {
77978
79318
  this.operationError = kanbanError(error);
79319
+ const version2 = ticketId ? kanbanTicketVersion(this.findTicket(ticketId)) : void 0;
79320
+ this.refusal = ticketId && version2 !== void 0 ? { ticketId, version: version2 } : void 0;
77979
79321
  if (this.detail && this.modal) this.detail.error = this.operationError;
77980
79322
  kanbanEvent(this, "kanban-error", { error, message: this.operationError });
77981
79323
  }
79324
+ /** Takes the last failure's words off the board and out of the detail that shows them. */
79325
+ clearOperationError() {
79326
+ if (this.detail?.error && this.detail.error === this.operationError) this.detail.error = "";
79327
+ this.operationError = "";
79328
+ this.refusal = void 0;
79329
+ }
77982
79330
  async disconnectedCallback() {
77983
79331
  for (const name of interactionEvents) this.removeEventListener(name, this.handleInteraction);
77984
79332
  this.dragController.disconnect();
@@ -77990,6 +79338,7 @@ var _DeesKanban = class _DeesKanban extends (_a107 = DeesElement, _heading_dec10
77990
79338
  this.commentsAbort?.abort();
77991
79339
  this.activityAbort?.abort();
77992
79340
  this.boardAbort?.abort();
79341
+ for (const controller of this.reloadAborts.values()) controller.abort();
77993
79342
  void this.modal?.destroy();
77994
79343
  await super.disconnectedCallback();
77995
79344
  }
@@ -78011,6 +79360,7 @@ _filtersOpen = new WeakMap();
78011
79360
  _filterAnnouncement = new WeakMap();
78012
79361
  _pendingTicketId2 = new WeakMap();
78013
79362
  _openingTicket = new WeakMap();
79363
+ _columnsCollapsed = new WeakMap();
78014
79364
  __decorateElement(_init108, 4, "heading", _heading_dec10, _DeesKanban, _heading10);
78015
79365
  __decorateElement(_init108, 4, "tickets", _tickets_dec4, _DeesKanban, _tickets4);
78016
79366
  __decorateElement(_init108, 4, "columns", _columns_dec7, _DeesKanban, _columns7);
@@ -78027,6 +79377,7 @@ __decorateElement(_init108, 4, "filtersOpen", _filtersOpen_dec, _DeesKanban, _fi
78027
79377
  __decorateElement(_init108, 4, "filterAnnouncement", _filterAnnouncement_dec, _DeesKanban, _filterAnnouncement);
78028
79378
  __decorateElement(_init108, 4, "pendingTicketId", _pendingTicketId_dec2, _DeesKanban, _pendingTicketId2);
78029
79379
  __decorateElement(_init108, 4, "openingTicket", _openingTicket_dec, _DeesKanban, _openingTicket);
79380
+ __decorateElement(_init108, 4, "columnsCollapsed", _columnsCollapsed_dec, _DeesKanban, _columnsCollapsed);
78030
79381
  _DeesKanban = __decorateElement(_init108, 0, "DeesKanban", _DeesKanban_decorators, _DeesKanban);
78031
79382
  __name(_DeesKanban, "DeesKanban");
78032
79383
  __publicField(_DeesKanban, "demo", demoFunc71);
@@ -78038,10 +79389,18 @@ __publicField(_DeesKanban, "styles", [
78038
79389
  tableFilterPanelStyles,
78039
79390
  activeFilterBarStyles,
78040
79391
  i`
79392
+ /*
79393
+ * The board takes the height its host gives it, as a flex column's remaining space or a sized
79394
+ * box, and its columns scroll their cards inside it. Unbounded, it grows with its cards.
79395
+ */
78041
79396
  :host {
79397
+ display: flex;
79398
+ flex-direction: column;
79399
+ flex: 1 1 auto;
79400
+ height: 100%;
79401
+ min-height: 0;
78042
79402
  padding: 20px 24px;
78043
79403
  background: var(--dees-color-bg-canvas);
78044
- min-height: 100%;
78045
79404
  }
78046
79405
 
78047
79406
  .heading {
@@ -78108,6 +79467,8 @@ __publicField(_DeesKanban, "styles", [
78108
79467
 
78109
79468
  .columns {
78110
79469
  display: flex;
79470
+ flex: 1 1 auto;
79471
+ min-height: 0;
78111
79472
  gap: 20px;
78112
79473
  overflow-x: auto;
78113
79474
  padding: 3px var(--dees-spacing-2xs) var(--dees-spacing-lg);
@@ -114017,9 +115378,9 @@ var DeesDemoSimpleStudio = _DeesDemoSimpleStudio;
114017
115378
  var demoFunc83 = /* @__PURE__ */ __name(() => demoApp(b`<dees-demo-simple-studio></dees-demo-simple-studio>`), "demoFunc");
114018
115379
 
114019
115380
  // ts_web/elements/00group-simple/dees-simple-appdash/dees-simple-appdash.ts
114020
- var _terminalOpen_dec, _compact_dec9, __activeMessages_dec, _selectedView_dec, _collapsed_dec3, _globalMessages_dec, _executionEnvironment_dec, _terminalSetupCommand_dec, _viewTabs_dec, _name_dec3, _a138, _DeesSimpleAppDash_decorators, _init145, _name3, _viewTabs, _terminalSetupCommand, _executionEnvironment, _globalMessages, _collapsed3, _selectedView, __activeMessages, _compact9, _terminalOpen;
115381
+ var _terminalOpen_dec, _compact_dec9, __activeMessages_dec, _selectedView_dec, _collapsed_dec4, _globalMessages_dec, _executionEnvironment_dec, _terminalSetupCommand_dec, _viewTabs_dec, _name_dec3, _a138, _DeesSimpleAppDash_decorators, _init145, _name3, _viewTabs, _terminalSetupCommand, _executionEnvironment, _globalMessages, _collapsed4, _selectedView, __activeMessages, _compact9, _terminalOpen;
114021
115382
  _DeesSimpleAppDash_decorators = [customElement("dees-simple-appdash")];
114022
- var _DeesSimpleAppDash = class _DeesSimpleAppDash extends (_a138 = DeesElement, _name_dec3 = [n({ reflect: true })], _viewTabs_dec = [n({ type: Array })], _terminalSetupCommand_dec = [n({ reflect: true })], _executionEnvironment_dec = [n({ type: Object })], _globalMessages_dec = [n({ type: Array })], _collapsed_dec3 = [n({ type: Boolean, reflect: true })], _selectedView_dec = [r2()], __activeMessages_dec = [r2()], _compact_dec9 = [r2()], _terminalOpen_dec = [r2()], _a138) {
115383
+ var _DeesSimpleAppDash = class _DeesSimpleAppDash extends (_a138 = DeesElement, _name_dec3 = [n({ reflect: true })], _viewTabs_dec = [n({ type: Array })], _terminalSetupCommand_dec = [n({ reflect: true })], _executionEnvironment_dec = [n({ type: Object })], _globalMessages_dec = [n({ type: Array })], _collapsed_dec4 = [n({ type: Boolean, reflect: true })], _selectedView_dec = [r2()], __activeMessages_dec = [r2()], _compact_dec9 = [r2()], _terminalOpen_dec = [r2()], _a138) {
114023
115384
  constructor() {
114024
115385
  super();
114025
115386
  __publicField(this, "t", dcLocalize(this));
@@ -114028,7 +115389,7 @@ var _DeesSimpleAppDash = class _DeesSimpleAppDash extends (_a138 = DeesElement,
114028
115389
  __privateAdd(this, _terminalSetupCommand, __runInitializers(_init145, 16, this, 'echo "Terminal ready"')), __runInitializers(_init145, 19, this);
114029
115390
  __privateAdd(this, _executionEnvironment, __runInitializers(_init145, 20, this, null)), __runInitializers(_init145, 23, this);
114030
115391
  __privateAdd(this, _globalMessages, __runInitializers(_init145, 24, this, [])), __runInitializers(_init145, 27, this);
114031
- __privateAdd(this, _collapsed3, __runInitializers(_init145, 28, this, false)), __runInitializers(_init145, 31, this);
115392
+ __privateAdd(this, _collapsed4, __runInitializers(_init145, 28, this, false)), __runInitializers(_init145, 31, this);
114032
115393
  __privateAdd(this, _selectedView, __runInitializers(_init145, 32, this)), __runInitializers(_init145, 35, this);
114033
115394
  __privateAdd(this, __activeMessages, __runInitializers(_init145, 36, this, [])), __runInitializers(_init145, 39, this);
114034
115395
  __privateAdd(this, _compact9, __runInitializers(_init145, 40, this, false)), __runInitializers(_init145, 43, this);
@@ -114162,7 +115523,7 @@ var _DeesSimpleAppDash = class _DeesSimpleAppDash extends (_a138 = DeesElement,
114162
115523
  this.terminalOpen = true;
114163
115524
  const request = ++this.terminalRequest;
114164
115525
  try {
114165
- const { DeesWorkspaceTerminal: DeesWorkspaceTerminal3 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-workspace-terminal-O3NEQ4DO.js");
115526
+ const { DeesWorkspaceTerminal: DeesWorkspaceTerminal3 } = await import("./chunks/U6Ua8p1giFoD1s7vrUZUdpbg/dees-workspace-terminal-EU377EZY.js");
114166
115527
  await this.updateComplete;
114167
115528
  if (!this.isConnected || request !== this.terminalRequest) return;
114168
115529
  const terminal = new DeesWorkspaceTerminal3();
@@ -114214,7 +115575,7 @@ _viewTabs = new WeakMap();
114214
115575
  _terminalSetupCommand = new WeakMap();
114215
115576
  _executionEnvironment = new WeakMap();
114216
115577
  _globalMessages = new WeakMap();
114217
- _collapsed3 = new WeakMap();
115578
+ _collapsed4 = new WeakMap();
114218
115579
  _selectedView = new WeakMap();
114219
115580
  __activeMessages = new WeakMap();
114220
115581
  _compact9 = new WeakMap();
@@ -114224,7 +115585,7 @@ __decorateElement(_init145, 4, "viewTabs", _viewTabs_dec, _DeesSimpleAppDash, _v
114224
115585
  __decorateElement(_init145, 4, "terminalSetupCommand", _terminalSetupCommand_dec, _DeesSimpleAppDash, _terminalSetupCommand);
114225
115586
  __decorateElement(_init145, 4, "executionEnvironment", _executionEnvironment_dec, _DeesSimpleAppDash, _executionEnvironment);
114226
115587
  __decorateElement(_init145, 4, "globalMessages", _globalMessages_dec, _DeesSimpleAppDash, _globalMessages);
114227
- __decorateElement(_init145, 4, "collapsed", _collapsed_dec3, _DeesSimpleAppDash, _collapsed3);
115588
+ __decorateElement(_init145, 4, "collapsed", _collapsed_dec4, _DeesSimpleAppDash, _collapsed4);
114228
115589
  __decorateElement(_init145, 4, "selectedView", _selectedView_dec, _DeesSimpleAppDash, _selectedView);
114229
115590
  __decorateElement(_init145, 4, "_activeMessages", __activeMessages_dec, _DeesSimpleAppDash, __activeMessages);
114230
115591
  __decorateElement(_init145, 4, "compact", _compact_dec9, _DeesSimpleAppDash, _compact9);
@@ -121167,7 +122528,7 @@ var bright = {
121167
122528
  // ts_web/00_commitinfo_data.ts
121168
122529
  var commitinfo = {
121169
122530
  name: "@design.estate/dees-catalog",
121170
- version: "21.32.3",
122531
+ version: "21.33.1",
121171
122532
  description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
121172
122533
  };
121173
122534
  export {
@@ -121405,6 +122766,9 @@ export {
121405
122766
  harnessParseApplyPatch,
121406
122767
  harnessParseTodos,
121407
122768
  harnessPillStyles,
122769
+ harnessProposalState,
122770
+ harnessQuestionPending,
122771
+ harnessQuestionSeverity,
121408
122772
  harnessRendersToolRow,
121409
122773
  harnessStringifyValue,
121410
122774
  harnessStripAnsi,
@@ -121417,6 +122781,7 @@ export {
121417
122781
  harnessTerminalResultSummary,
121418
122782
  harnessToolStatusPresentation,
121419
122783
  harnessTruncate,
122784
+ harnessWithoutCredentials,
121420
122785
  hintTypeIcons,
121421
122786
  insetInlineStyles,
121422
122787
  isInViewport,