@object-ui/plugin-kanban 3.1.1 → 3.1.3

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.
@@ -1,8 +1,8 @@
1
- import { c as U, j as a, C as Q, P as X } from "./index-CyNcIIS1.js";
2
- import * as v from "react";
1
+ import { c as U, j as a, C as J, P as Q } from "./index-DP2mI15e.js";
2
+ import * as g from "react";
3
3
  import { flushSync as Z } from "react-dom";
4
- import { u as ee, a as te, D as se, c as ne, b as ie, d as re, P as oe, e as Y, S as le, v as ae, C as ce } from "./sortable.esm-CNNHgHk5.js";
5
- import { Button as G, Badge as L, Card as de, CardHeader as he, CardTitle as ue, CardDescription as fe, CardContent as me, Input as ge } from "@object-ui/components";
4
+ import { u as ee, a as te, D as se, c as ne, b as ie, d as re, P as oe, e as X, S as le, v as ae, C as ce } from "./sortable.esm-CNNHgHk5.js";
5
+ import { Button as Y, Badge as L, Card as he, CardHeader as de, CardTitle as ue, CardDescription as fe, CardContent as me, Input as ge } from "@object-ui/components";
6
6
  const pe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], ve = U("chevron-right", pe);
7
7
  const xe = [
8
8
  [
@@ -15,117 +15,117 @@ const xe = [
15
15
  ["path", { d: "M12 9v4", key: "juzpu7" }],
16
16
  ["path", { d: "M12 17h.01", key: "p32p05" }]
17
17
  ], be = U("triangle-alert", xe);
18
- function A(n, l, e) {
19
- let s = e.initialDeps ?? [], t, i = !0;
18
+ function _(i, l, e) {
19
+ let s = e.initialDeps ?? [], t, n = !0;
20
20
  function o() {
21
- var r, d, h;
21
+ var r, h, d;
22
22
  let u;
23
23
  e.key && ((r = e.debug) != null && r.call(e)) && (u = Date.now());
24
- const m = n();
25
- if (!(m.length !== s.length || m.some((w, p) => s[p] !== w)))
24
+ const m = i();
25
+ if (!(m.length !== s.length || m.some((E, x) => s[x] !== E)))
26
26
  return t;
27
27
  s = m;
28
- let g;
29
- if (e.key && ((d = e.debug) != null && d.call(e)) && (g = Date.now()), t = l(...m), e.key && ((h = e.debug) != null && h.call(e))) {
30
- const w = Math.round((Date.now() - u) * 100) / 100, p = Math.round((Date.now() - g) * 100) / 100, E = p / 16, z = (C, D) => {
31
- for (C = String(C); C.length < D; )
32
- C = " " + C;
33
- return C;
28
+ let v;
29
+ if (e.key && ((h = e.debug) != null && h.call(e)) && (v = Date.now()), t = l(...m), e.key && ((d = e.debug) != null && d.call(e))) {
30
+ const E = Math.round((Date.now() - u) * 100) / 100, x = Math.round((Date.now() - v) * 100) / 100, y = x / 16, O = (S, R) => {
31
+ for (S = String(S); S.length < R; )
32
+ S = " " + S;
33
+ return S;
34
34
  };
35
35
  console.info(
36
- `%c⏱ ${z(p, 5)} /${z(w, 5)} ms`,
36
+ `%c⏱ ${O(x, 5)} /${O(E, 5)} ms`,
37
37
  `
38
38
  font-size: .6rem;
39
39
  font-weight: bold;
40
40
  color: hsl(${Math.max(
41
41
  0,
42
- Math.min(120 - 120 * E, 120)
42
+ Math.min(120 - 120 * y, 120)
43
43
  )}deg 100% 31%);`,
44
44
  e?.key
45
45
  );
46
46
  }
47
- return e?.onChange && !(i && e.skipInitialOnChange) && e.onChange(t), i = !1, t;
47
+ return e?.onChange && !(n && e.skipInitialOnChange) && e.onChange(t), n = !1, t;
48
48
  }
49
49
  return o.updateDeps = (r) => {
50
50
  s = r;
51
51
  }, o;
52
52
  }
53
- function P(n, l) {
54
- if (n === void 0)
53
+ function P(i, l) {
54
+ if (i === void 0)
55
55
  throw new Error("Unexpected undefined");
56
- return n;
56
+ return i;
57
57
  }
58
- const Ce = (n, l) => Math.abs(n - l) < 1.01, ye = (n, l, e) => {
58
+ const Se = (i, l) => Math.abs(i - l) < 1.01, Ce = (i, l, e) => {
59
59
  let s;
60
60
  return function(...t) {
61
- n.clearTimeout(s), s = n.setTimeout(() => l.apply(this, t), e);
61
+ i.clearTimeout(s), s = i.setTimeout(() => l.apply(this, t), e);
62
62
  };
63
- }, H = (n) => {
64
- const { offsetWidth: l, offsetHeight: e } = n;
63
+ }, H = (i) => {
64
+ const { offsetWidth: l, offsetHeight: e } = i;
65
65
  return { width: l, height: e };
66
- }, we = (n) => n, Se = (n) => {
67
- const l = Math.max(n.startIndex - n.overscan, 0), e = Math.min(n.endIndex + n.overscan, n.count - 1), s = [];
66
+ }, we = (i) => i, Ee = (i) => {
67
+ const l = Math.max(i.startIndex - i.overscan, 0), e = Math.min(i.endIndex + i.overscan, i.count - 1), s = [];
68
68
  for (let t = l; t <= e; t++)
69
69
  s.push(t);
70
70
  return s;
71
- }, Ee = (n, l) => {
72
- const e = n.scrollElement;
71
+ }, ye = (i, l) => {
72
+ const e = i.scrollElement;
73
73
  if (!e)
74
74
  return;
75
- const s = n.targetWindow;
75
+ const s = i.targetWindow;
76
76
  if (!s)
77
77
  return;
78
78
  const t = (o) => {
79
- const { width: r, height: d } = o;
80
- l({ width: Math.round(r), height: Math.round(d) });
79
+ const { width: r, height: h } = o;
80
+ l({ width: Math.round(r), height: Math.round(h) });
81
81
  };
82
82
  if (t(H(e)), !s.ResizeObserver)
83
83
  return () => {
84
84
  };
85
- const i = new s.ResizeObserver((o) => {
85
+ const n = new s.ResizeObserver((o) => {
86
86
  const r = () => {
87
- const d = o[0];
88
- if (d?.borderBoxSize) {
89
- const h = d.borderBoxSize[0];
90
- if (h) {
91
- t({ width: h.inlineSize, height: h.blockSize });
87
+ const h = o[0];
88
+ if (h?.borderBoxSize) {
89
+ const d = h.borderBoxSize[0];
90
+ if (d) {
91
+ t({ width: d.inlineSize, height: d.blockSize });
92
92
  return;
93
93
  }
94
94
  }
95
95
  t(H(e));
96
96
  };
97
- n.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
97
+ i.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
98
98
  });
99
- return i.observe(e, { box: "border-box" }), () => {
100
- i.unobserve(e);
99
+ return n.observe(e, { box: "border-box" }), () => {
100
+ n.unobserve(e);
101
101
  };
102
102
  }, $ = {
103
103
  passive: !0
104
- }, q = typeof window > "u" ? !0 : "onscrollend" in window, Ie = (n, l) => {
105
- const e = n.scrollElement;
104
+ }, q = typeof window > "u" ? !0 : "onscrollend" in window, Ie = (i, l) => {
105
+ const e = i.scrollElement;
106
106
  if (!e)
107
107
  return;
108
- const s = n.targetWindow;
108
+ const s = i.targetWindow;
109
109
  if (!s)
110
110
  return;
111
111
  let t = 0;
112
- const i = n.options.useScrollendEvent && q ? () => {
113
- } : ye(
112
+ const n = i.options.useScrollendEvent && q ? () => {
113
+ } : Ce(
114
114
  s,
115
115
  () => {
116
116
  l(t, !1);
117
117
  },
118
- n.options.isScrollingResetDelay
118
+ i.options.isScrollingResetDelay
119
119
  ), o = (u) => () => {
120
- const { horizontal: m, isRtl: c } = n.options;
121
- t = m ? e.scrollLeft * (c && -1 || 1) : e.scrollTop, i(), l(t, u);
122
- }, r = o(!0), d = o(!1);
120
+ const { horizontal: m, isRtl: c } = i.options;
121
+ t = m ? e.scrollLeft * (c && -1 || 1) : e.scrollTop, n(), l(t, u);
122
+ }, r = o(!0), h = o(!1);
123
123
  e.addEventListener("scroll", r, $);
124
- const h = n.options.useScrollendEvent && q;
125
- return h && e.addEventListener("scrollend", d, $), () => {
126
- e.removeEventListener("scroll", r), h && e.removeEventListener("scrollend", d);
124
+ const d = i.options.useScrollendEvent && q;
125
+ return d && e.addEventListener("scrollend", h, $), () => {
126
+ e.removeEventListener("scroll", r), d && e.removeEventListener("scrollend", h);
127
127
  };
128
- }, ze = (n, l, e) => {
128
+ }, Oe = (i, l, e) => {
129
129
  if (l?.borderBoxSize) {
130
130
  const s = l.borderBoxSize[0];
131
131
  if (s)
@@ -133,26 +133,29 @@ const Ce = (n, l) => Math.abs(n - l) < 1.01, ye = (n, l, e) => {
133
133
  s[e.options.horizontal ? "inlineSize" : "blockSize"]
134
134
  );
135
135
  }
136
- return n[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
137
- }, Me = (n, {
136
+ return i[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
137
+ }, Me = (i, {
138
138
  adjustments: l = 0,
139
139
  behavior: e
140
140
  }, s) => {
141
- var t, i;
142
- const o = n + l;
143
- (i = (t = s.scrollElement) == null ? void 0 : t.scrollTo) == null || i.call(t, {
141
+ var t, n;
142
+ const o = i + l;
143
+ (n = (t = s.scrollElement) == null ? void 0 : t.scrollTo) == null || n.call(t, {
144
144
  [s.options.horizontal ? "left" : "top"]: o,
145
145
  behavior: e
146
146
  });
147
147
  };
148
- class Oe {
148
+ class ze {
149
149
  constructor(l) {
150
- this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.currentScrollToIndex = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
150
+ this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
151
+ var e, s, t;
152
+ return ((t = (s = (e = this.targetWindow) == null ? void 0 : e.performance) == null ? void 0 : s.now) == null ? void 0 : t.call(s)) ?? Date.now();
153
+ }, this.observer = /* @__PURE__ */ (() => {
151
154
  let e = null;
152
155
  const s = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((t) => {
153
- t.forEach((i) => {
156
+ t.forEach((n) => {
154
157
  const o = () => {
155
- this._measureElement(i.target, i);
158
+ this._measureElement(n.target, n);
156
159
  };
157
160
  this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
158
161
  });
@@ -163,12 +166,12 @@ class Oe {
163
166
  (t = s()) == null || t.disconnect(), e = null;
164
167
  },
165
168
  observe: (t) => {
166
- var i;
167
- return (i = s()) == null ? void 0 : i.observe(t, { box: "border-box" });
169
+ var n;
170
+ return (n = s()) == null ? void 0 : n.observe(t, { box: "border-box" });
168
171
  },
169
172
  unobserve: (t) => {
170
- var i;
171
- return (i = s()) == null ? void 0 : i.unobserve(t);
173
+ var n;
174
+ return (n = s()) == null ? void 0 : n.unobserve(t);
172
175
  }
173
176
  };
174
177
  })(), this.range = null, this.setOptions = (e) => {
@@ -184,10 +187,10 @@ class Oe {
184
187
  scrollPaddingEnd: 0,
185
188
  horizontal: !1,
186
189
  getItemKey: we,
187
- rangeExtractor: Se,
190
+ rangeExtractor: Ee,
188
191
  onChange: () => {
189
192
  },
190
- measureElement: ze,
193
+ measureElement: Oe,
191
194
  initialRect: { width: 0, height: 0 },
192
195
  scrollMargin: 0,
193
196
  gap: 0,
@@ -204,7 +207,7 @@ class Oe {
204
207
  }, this.notify = (e) => {
205
208
  var s, t;
206
209
  (t = (s = this.options).onChange) == null || t.call(s, this, e);
207
- }, this.maybeNotify = A(
210
+ }, this.maybeNotify = _(
208
211
  () => (this.calculateRange(), [
209
212
  this.isScrolling,
210
213
  this.range ? this.range.startIndex : null,
@@ -223,7 +226,7 @@ class Oe {
223
226
  ]
224
227
  }
225
228
  ), this.cleanup = () => {
226
- this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
229
+ this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
227
230
  }, this._didMount = () => () => {
228
231
  this.cleanup();
229
232
  }, this._willUpdate = () => {
@@ -241,28 +244,28 @@ class Oe {
241
244
  this.scrollRect = t, this.maybeNotify();
242
245
  })
243
246
  ), this.unsubs.push(
244
- this.options.observeElementOffset(this, (t, i) => {
245
- this.scrollAdjustments = 0, this.scrollDirection = i ? this.getScrollOffset() < t ? "forward" : "backward" : null, this.scrollOffset = t, this.isScrolling = i, this.maybeNotify();
247
+ this.options.observeElementOffset(this, (t, n) => {
248
+ this.scrollAdjustments = 0, this.scrollDirection = n ? this.getScrollOffset() < t ? "forward" : "backward" : null, this.scrollOffset = t, this.isScrolling = n, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
246
249
  })
247
250
  ), this._scrollToOffset(this.getScrollOffset(), {
248
251
  adjustments: void 0,
249
252
  behavior: void 0
250
253
  });
251
254
  }
252
- }, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, s) => {
253
- const t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
255
+ }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, s) => {
256
+ const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
254
257
  for (let o = s - 1; o >= 0; o--) {
255
258
  const r = e[o];
256
259
  if (t.has(r.lane))
257
260
  continue;
258
- const d = i.get(
261
+ const h = n.get(
259
262
  r.lane
260
263
  );
261
- if (d == null || r.end > d.end ? i.set(r.lane, r) : r.end < d.end && t.set(r.lane, !0), t.size === this.options.lanes)
264
+ if (h == null || r.end > h.end ? n.set(r.lane, r) : r.end < h.end && t.set(r.lane, !0), t.size === this.options.lanes)
262
265
  break;
263
266
  }
264
- return i.size === this.options.lanes ? Array.from(i.values()).sort((o, r) => o.end === r.end ? o.index - r.index : o.end - r.end)[0] : void 0;
265
- }, this.getMeasurementOptions = A(
267
+ return n.size === this.options.lanes ? Array.from(n.values()).sort((o, r) => o.end === r.end ? o.index - r.index : o.end - r.end)[0] : void 0;
268
+ }, this.getMeasurementOptions = _(
266
269
  () => [
267
270
  this.options.count,
268
271
  this.options.paddingStart,
@@ -271,20 +274,20 @@ class Oe {
271
274
  this.options.enabled,
272
275
  this.options.lanes
273
276
  ],
274
- (e, s, t, i, o, r) => (this.prevLanes !== void 0 && this.prevLanes !== r && (this.lanesChangedFlag = !0), this.prevLanes = r, this.pendingMeasuredCacheIndexes = [], {
277
+ (e, s, t, n, o, r) => (this.prevLanes !== void 0 && this.prevLanes !== r && (this.lanesChangedFlag = !0), this.prevLanes = r, this.pendingMeasuredCacheIndexes = [], {
275
278
  count: e,
276
279
  paddingStart: s,
277
280
  scrollMargin: t,
278
- getItemKey: i,
281
+ getItemKey: n,
279
282
  enabled: o,
280
283
  lanes: r
281
284
  }),
282
285
  {
283
286
  key: !1
284
287
  }
285
- ), this.getMeasurements = A(
288
+ ), this.getMeasurements = _(
286
289
  () => [this.getMeasurementOptions(), this.itemSizeCache],
287
- ({ count: e, paddingStart: s, scrollMargin: t, getItemKey: i, enabled: o, lanes: r }, d) => {
290
+ ({ count: e, paddingStart: s, scrollMargin: t, getItemKey: n, enabled: o, lanes: r }, h) => {
288
291
  if (!o)
289
292
  return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
290
293
  if (this.laneAssignments.size > e)
@@ -293,35 +296,35 @@ class Oe {
293
296
  this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
294
297
  this.itemSizeCache.set(c.key, c.size);
295
298
  }));
296
- const h = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
299
+ const d = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
297
300
  this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
298
- const u = this.measurementsCache.slice(0, h), m = new Array(r).fill(
301
+ const u = this.measurementsCache.slice(0, d), m = new Array(r).fill(
299
302
  void 0
300
303
  );
301
- for (let c = 0; c < h; c++) {
302
- const g = u[c];
303
- g && (m[g.lane] = c);
304
+ for (let c = 0; c < d; c++) {
305
+ const v = u[c];
306
+ v && (m[v.lane] = c);
304
307
  }
305
- for (let c = h; c < e; c++) {
306
- const g = i(c), w = this.laneAssignments.get(c);
307
- let p, E;
308
- if (w !== void 0 && this.options.lanes > 1) {
309
- p = w;
310
- const S = m[p], f = S !== void 0 ? u[S] : void 0;
311
- E = f ? f.end + this.options.gap : s + t;
308
+ for (let c = d; c < e; c++) {
309
+ const v = n(c), E = this.laneAssignments.get(c);
310
+ let x, y;
311
+ if (E !== void 0 && this.options.lanes > 1) {
312
+ x = E;
313
+ const w = m[x], f = w !== void 0 ? u[w] : void 0;
314
+ y = f ? f.end + this.options.gap : s + t;
312
315
  } else {
313
- const S = this.options.lanes === 1 ? u[c - 1] : this.getFurthestMeasurement(u, c);
314
- E = S ? S.end + this.options.gap : s + t, p = S ? S.lane : c % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(c, p);
316
+ const w = this.options.lanes === 1 ? u[c - 1] : this.getFurthestMeasurement(u, c);
317
+ y = w ? w.end + this.options.gap : s + t, x = w ? w.lane : c % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(c, x);
315
318
  }
316
- const z = d.get(g), C = typeof z == "number" ? z : this.options.estimateSize(c), D = E + C;
319
+ const O = h.get(v), S = typeof O == "number" ? O : this.options.estimateSize(c), R = y + S;
317
320
  u[c] = {
318
321
  index: c,
319
- start: E,
320
- size: C,
321
- end: D,
322
- key: g,
323
- lane: p
324
- }, m[p] = c;
322
+ start: y,
323
+ size: S,
324
+ end: R,
325
+ key: v,
326
+ lane: x
327
+ }, m[x] = c;
325
328
  }
326
329
  return this.measurementsCache = u, u;
327
330
  },
@@ -329,24 +332,24 @@ class Oe {
329
332
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
330
333
  debug: () => this.options.debug
331
334
  }
332
- ), this.calculateRange = A(
335
+ ), this.calculateRange = _(
333
336
  () => [
334
337
  this.getMeasurements(),
335
338
  this.getSize(),
336
339
  this.getScrollOffset(),
337
340
  this.options.lanes
338
341
  ],
339
- (e, s, t, i) => this.range = e.length > 0 && s > 0 ? je({
342
+ (e, s, t, n) => this.range = e.length > 0 && s > 0 ? je({
340
343
  measurements: e,
341
344
  outerSize: s,
342
345
  scrollOffset: t,
343
- lanes: i
346
+ lanes: n
344
347
  }) : null,
345
348
  {
346
349
  key: process.env.NODE_ENV !== "production" && "calculateRange",
347
350
  debug: () => this.options.debug
348
351
  }
349
- ), this.getVirtualIndexes = A(
352
+ ), this.getVirtualIndexes = _(
350
353
  () => {
351
354
  let e = null, s = null;
352
355
  const t = this.calculateRange();
@@ -358,8 +361,8 @@ class Oe {
358
361
  s
359
362
  ];
360
363
  },
361
- (e, s, t, i, o) => i === null || o === null ? [] : e({
362
- startIndex: i,
364
+ (e, s, t, n, o) => n === null || o === null ? [] : e({
365
+ startIndex: n,
363
366
  endIndex: o,
364
367
  overscan: s,
365
368
  count: t
@@ -373,21 +376,42 @@ class Oe {
373
376
  return t ? parseInt(t, 10) : (console.warn(
374
377
  `Missing attribute name '${s}={index}' on measured element.`
375
378
  ), -1);
379
+ }, this.shouldMeasureDuringScroll = (e) => {
380
+ var s;
381
+ if (!this.scrollState || this.scrollState.behavior !== "smooth")
382
+ return !0;
383
+ const t = this.scrollState.index ?? ((s = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : s.index);
384
+ if (t !== void 0 && this.range) {
385
+ const n = Math.max(
386
+ this.options.overscan,
387
+ Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
388
+ ), o = Math.max(0, t - n), r = Math.min(
389
+ this.options.count - 1,
390
+ t + n
391
+ );
392
+ return e >= o && e <= r;
393
+ }
394
+ return !0;
376
395
  }, this._measureElement = (e, s) => {
377
- const t = this.indexFromElement(e), i = this.measurementsCache[t];
378
- if (!i)
396
+ if (!e.isConnected) {
397
+ this.observer.unobserve(e);
379
398
  return;
380
- const o = i.key, r = this.elementsCache.get(o);
381
- r !== e && (r && this.observer.unobserve(r), this.observer.observe(e), this.elementsCache.set(o, e)), e.isConnected && this.resizeItem(t, this.options.measureElement(e, s, this));
399
+ }
400
+ const t = this.indexFromElement(e), n = this.measurementsCache[t];
401
+ if (!n)
402
+ return;
403
+ const o = n.key, r = this.elementsCache.get(o);
404
+ r !== e && (r && this.observer.unobserve(r), this.observer.observe(e), this.elementsCache.set(o, e)), this.shouldMeasureDuringScroll(t) && this.resizeItem(t, this.options.measureElement(e, s, this));
382
405
  }, this.resizeItem = (e, s) => {
383
- const t = this.measurementsCache[e];
384
- if (!t)
406
+ var t;
407
+ const n = this.measurementsCache[e];
408
+ if (!n)
385
409
  return;
386
- const i = this.itemSizeCache.get(t.key) ?? t.size, o = s - i;
387
- o !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(t, o, this) : t.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", o), this._scrollToOffset(this.getScrollOffset(), {
388
- adjustments: this.scrollAdjustments += o,
410
+ const o = this.itemSizeCache.get(n.key) ?? n.size, r = s - o;
411
+ r !== 0 && (((t = this.scrollState) == null ? void 0 : t.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(n, r, this) : n.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
412
+ adjustments: this.scrollAdjustments += r,
389
413
  behavior: void 0
390
- })), this.pendingMeasuredCacheIndexes.push(t.index), this.itemSizeCache = new Map(this.itemSizeCache.set(t.key, s)), this.notify(!1));
414
+ })), this.pendingMeasuredCacheIndexes.push(n.index), this.itemSizeCache = new Map(this.itemSizeCache.set(n.key, s)), this.notify(!1));
391
415
  }, this.measureElement = (e) => {
392
416
  if (!e) {
393
417
  this.elementsCache.forEach((s, t) => {
@@ -396,13 +420,13 @@ class Oe {
396
420
  return;
397
421
  }
398
422
  this._measureElement(e, void 0);
399
- }, this.getVirtualItems = A(
423
+ }, this.getVirtualItems = _(
400
424
  () => [this.getVirtualIndexes(), this.getMeasurements()],
401
425
  (e, s) => {
402
426
  const t = [];
403
- for (let i = 0, o = e.length; i < o; i++) {
404
- const r = e[i], d = s[r];
405
- t.push(d);
427
+ for (let n = 0, o = e.length; n < o; n++) {
428
+ const r = e[n], h = s[r];
429
+ t.push(h);
406
430
  }
407
431
  return t;
408
432
  },
@@ -414,7 +438,7 @@ class Oe {
414
438
  const s = this.getMeasurements();
415
439
  if (s.length !== 0)
416
440
  return P(
417
- s[J(
441
+ s[G(
418
442
  0,
419
443
  s.length - 1,
420
444
  (t) => P(s[t]).start,
@@ -431,76 +455,65 @@ class Oe {
431
455
  }
432
456
  }, this.getOffsetForAlignment = (e, s, t = 0) => {
433
457
  if (!this.scrollElement) return 0;
434
- const i = this.getSize(), o = this.getScrollOffset();
435
- s === "auto" && (s = e >= o + i ? "end" : "start"), s === "center" ? e += (t - i) / 2 : s === "end" && (e -= i);
458
+ const n = this.getSize(), o = this.getScrollOffset();
459
+ s === "auto" && (s = e >= o + n ? "end" : "start"), s === "center" ? e += (t - n) / 2 : s === "end" && (e -= n);
436
460
  const r = this.getMaxScrollOffset();
437
461
  return Math.max(Math.min(r, e), 0);
438
462
  }, this.getOffsetForIndex = (e, s = "auto") => {
439
463
  e = Math.max(0, Math.min(e, this.options.count - 1));
440
- const t = this.measurementsCache[e];
441
- if (!t)
442
- return;
443
- const i = this.getSize(), o = this.getScrollOffset();
464
+ const t = this.getSize(), n = this.getScrollOffset(), o = this.measurementsCache[e];
465
+ if (!o) return;
444
466
  if (s === "auto")
445
- if (t.end >= o + i - this.options.scrollPaddingEnd)
467
+ if (o.end >= n + t - this.options.scrollPaddingEnd)
446
468
  s = "end";
447
- else if (t.start <= o + this.options.scrollPaddingStart)
469
+ else if (o.start <= n + this.options.scrollPaddingStart)
448
470
  s = "start";
449
471
  else
450
- return [o, s];
472
+ return [n, s];
451
473
  if (s === "end" && e === this.options.count - 1)
452
474
  return [this.getMaxScrollOffset(), s];
453
- const r = s === "end" ? t.end + this.options.scrollPaddingEnd : t.start - this.options.scrollPaddingStart;
475
+ const r = s === "end" ? o.end + this.options.scrollPaddingEnd : o.start - this.options.scrollPaddingStart;
454
476
  return [
455
- this.getOffsetForAlignment(r, s, t.size),
477
+ this.getOffsetForAlignment(r, s, o.size),
456
478
  s
457
479
  ];
458
- }, this.isDynamicMode = () => this.elementsCache.size > 0, this.scrollToOffset = (e, { align: s = "start", behavior: t } = {}) => {
459
- t === "smooth" && this.isDynamicMode() && console.warn(
460
- "The `smooth` scroll behavior is not fully supported with dynamic size."
461
- ), this._scrollToOffset(this.getOffsetForAlignment(e, s), {
462
- adjustments: void 0,
463
- behavior: t
464
- });
465
- }, this.scrollToIndex = (e, { align: s = "auto", behavior: t } = {}) => {
466
- t === "smooth" && this.isDynamicMode() && console.warn(
467
- "The `smooth` scroll behavior is not fully supported with dynamic size."
468
- ), e = Math.max(0, Math.min(e, this.options.count - 1)), this.currentScrollToIndex = e;
469
- let i = 0;
470
- const o = 10, r = (h) => {
471
- if (!this.targetWindow) return;
472
- const u = this.getOffsetForIndex(e, h);
473
- if (!u) {
474
- console.warn("Failed to get offset for index:", e);
475
- return;
476
- }
477
- const [m, c] = u;
478
- this._scrollToOffset(m, { adjustments: void 0, behavior: t }), this.targetWindow.requestAnimationFrame(() => {
479
- if (!this.targetWindow) return;
480
- const g = () => {
481
- if (this.currentScrollToIndex !== e) return;
482
- const w = this.getScrollOffset(), p = this.getOffsetForIndex(e, c);
483
- if (!p) {
484
- console.warn("Failed to get offset for index:", e);
485
- return;
486
- }
487
- Ce(p[0], w) || d(c);
488
- };
489
- this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(g) : g();
490
- });
491
- }, d = (h) => {
492
- this.targetWindow && this.currentScrollToIndex === e && (i++, i < o ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", i, o), this.targetWindow.requestAnimationFrame(() => r(h))) : console.warn(
493
- `Failed to scroll to index ${e} after ${o} attempts.`
494
- ));
495
- };
496
- r(s);
497
- }, this.scrollBy = (e, { behavior: s } = {}) => {
498
- s === "smooth" && this.isDynamicMode() && console.warn(
499
- "The `smooth` scroll behavior is not fully supported with dynamic size."
500
- ), this._scrollToOffset(this.getScrollOffset() + e, {
501
- adjustments: void 0,
502
- behavior: s
503
- });
480
+ }, this.scrollToOffset = (e, { align: s = "start", behavior: t = "auto" } = {}) => {
481
+ const n = this.getOffsetForAlignment(e, s), o = this.now();
482
+ this.scrollState = {
483
+ index: null,
484
+ align: s,
485
+ behavior: t,
486
+ startedAt: o,
487
+ lastTargetOffset: n,
488
+ stableFrames: 0
489
+ }, this._scrollToOffset(n, { adjustments: void 0, behavior: t }), this.scheduleScrollReconcile();
490
+ }, this.scrollToIndex = (e, {
491
+ align: s = "auto",
492
+ behavior: t = "auto"
493
+ } = {}) => {
494
+ e = Math.max(0, Math.min(e, this.options.count - 1));
495
+ const n = this.getOffsetForIndex(e, s);
496
+ if (!n)
497
+ return;
498
+ const [o, r] = n, h = this.now();
499
+ this.scrollState = {
500
+ index: e,
501
+ align: r,
502
+ behavior: t,
503
+ startedAt: h,
504
+ lastTargetOffset: o,
505
+ stableFrames: 0
506
+ }, this._scrollToOffset(o, { adjustments: void 0, behavior: t }), this.scheduleScrollReconcile();
507
+ }, this.scrollBy = (e, { behavior: s = "auto" } = {}) => {
508
+ const t = this.getScrollOffset() + e, n = this.now();
509
+ this.scrollState = {
510
+ index: null,
511
+ align: "start",
512
+ behavior: s,
513
+ startedAt: n,
514
+ lastTargetOffset: t,
515
+ stableFrames: 0
516
+ }, this._scrollToOffset(t, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
504
517
  }, this.getTotalSize = () => {
505
518
  var e;
506
519
  const s = this.getMeasurements();
@@ -510,13 +523,13 @@ class Oe {
510
523
  else if (this.options.lanes === 1)
511
524
  t = ((e = s[s.length - 1]) == null ? void 0 : e.end) ?? 0;
512
525
  else {
513
- const i = Array(this.options.lanes).fill(null);
526
+ const n = Array(this.options.lanes).fill(null);
514
527
  let o = s.length - 1;
515
- for (; o >= 0 && i.some((r) => r === null); ) {
528
+ for (; o >= 0 && n.some((r) => r === null); ) {
516
529
  const r = s[o];
517
- i[r.lane] === null && (i[r.lane] = r.end), o--;
530
+ n[r.lane] === null && (n[r.lane] = r.end), o--;
518
531
  }
519
- t = Math.max(...i.filter((r) => r !== null));
532
+ t = Math.max(...n.filter((r) => r !== null));
520
533
  }
521
534
  return Math.max(
522
535
  t - this.options.scrollMargin + this.options.paddingEnd,
@@ -531,99 +544,127 @@ class Oe {
531
544
  this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
532
545
  }, this.setOptions(l);
533
546
  }
547
+ scheduleScrollReconcile() {
548
+ if (!this.targetWindow) {
549
+ this.scrollState = null;
550
+ return;
551
+ }
552
+ this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
553
+ this.rafId = null, this.reconcileScroll();
554
+ }));
555
+ }
556
+ reconcileScroll() {
557
+ if (!this.scrollState || !this.scrollElement) return;
558
+ if (this.now() - this.scrollState.startedAt > 5e3) {
559
+ this.scrollState = null;
560
+ return;
561
+ }
562
+ const s = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, t = s ? s[0] : this.scrollState.lastTargetOffset, n = 1, o = t !== this.scrollState.lastTargetOffset;
563
+ if (!o && Se(t, this.getScrollOffset())) {
564
+ if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= n) {
565
+ this.scrollState = null;
566
+ return;
567
+ }
568
+ } else
569
+ this.scrollState.stableFrames = 0, o && (this.scrollState.lastTargetOffset = t, this.scrollState.behavior = "auto", this._scrollToOffset(t, {
570
+ adjustments: void 0,
571
+ behavior: "auto"
572
+ }));
573
+ this.scheduleScrollReconcile();
574
+ }
534
575
  }
535
- const J = (n, l, e, s) => {
536
- for (; n <= l; ) {
537
- const t = (n + l) / 2 | 0, i = e(t);
538
- if (i < s)
539
- n = t + 1;
540
- else if (i > s)
576
+ const G = (i, l, e, s) => {
577
+ for (; i <= l; ) {
578
+ const t = (i + l) / 2 | 0, n = e(t);
579
+ if (n < s)
580
+ i = t + 1;
581
+ else if (n > s)
541
582
  l = t - 1;
542
583
  else
543
584
  return t;
544
585
  }
545
- return n > 0 ? n - 1 : 0;
586
+ return i > 0 ? i - 1 : 0;
546
587
  };
547
588
  function je({
548
- measurements: n,
589
+ measurements: i,
549
590
  outerSize: l,
550
591
  scrollOffset: e,
551
592
  lanes: s
552
593
  }) {
553
- const t = n.length - 1, i = (d) => n[d].start;
554
- if (n.length <= s)
594
+ const t = i.length - 1, n = (h) => i[h].start;
595
+ if (i.length <= s)
555
596
  return {
556
597
  startIndex: 0,
557
598
  endIndex: t
558
599
  };
559
- let o = J(
600
+ let o = G(
560
601
  0,
561
602
  t,
562
- i,
603
+ n,
563
604
  e
564
605
  ), r = o;
565
606
  if (s === 1)
566
- for (; r < t && n[r].end < e + l; )
607
+ for (; r < t && i[r].end < e + l; )
567
608
  r++;
568
609
  else if (s > 1) {
569
- const d = Array(s).fill(0);
570
- for (; r < t && d.some((u) => u < e + l); ) {
571
- const u = n[r];
572
- d[u.lane] = u.end, r++;
610
+ const h = Array(s).fill(0);
611
+ for (; r < t && h.some((u) => u < e + l); ) {
612
+ const u = i[r];
613
+ h[u.lane] = u.end, r++;
573
614
  }
574
- const h = Array(s).fill(e + l);
575
- for (; o >= 0 && h.some((u) => u >= e); ) {
576
- const u = n[o];
577
- h[u.lane] = u.start, o--;
615
+ const d = Array(s).fill(e + l);
616
+ for (; o >= 0 && d.some((u) => u >= e); ) {
617
+ const u = i[o];
618
+ d[u.lane] = u.start, o--;
578
619
  }
579
620
  o = Math.max(0, o - o % s), r = Math.min(t, r + (s - 1 - r % s));
580
621
  }
581
622
  return { startIndex: o, endIndex: r };
582
623
  }
583
- const K = typeof document < "u" ? v.useLayoutEffect : v.useEffect;
624
+ const K = typeof document < "u" ? g.useLayoutEffect : g.useEffect;
584
625
  function Ne({
585
- useFlushSync: n = !0,
626
+ useFlushSync: i = !0,
586
627
  ...l
587
628
  }) {
588
- const e = v.useReducer(() => ({}), {})[1], s = {
629
+ const e = g.useReducer(() => ({}), {})[1], s = {
589
630
  ...l,
590
- onChange: (i, o) => {
631
+ onChange: (n, o) => {
591
632
  var r;
592
- n && o ? Z(e) : e(), (r = l.onChange) == null || r.call(l, i, o);
633
+ i && o ? Z(e) : e(), (r = l.onChange) == null || r.call(l, n, o);
593
634
  }
594
- }, [t] = v.useState(
595
- () => new Oe(s)
635
+ }, [t] = g.useState(
636
+ () => new ze(s)
596
637
  );
597
638
  return t.setOptions(s), K(() => t._didMount(), []), K(() => t._willUpdate()), t;
598
639
  }
599
- function ke(n) {
640
+ function Ae(i) {
600
641
  return Ne({
601
- observeElementRect: Ee,
642
+ observeElementRect: ye,
602
643
  observeElementOffset: Ie,
603
644
  scrollToFn: Me,
604
- ...n
645
+ ...i
605
646
  });
606
647
  }
607
- const V = (...n) => n.filter(Boolean).join(" ");
608
- function Ae(n, l) {
648
+ const V = (...i) => i.filter(Boolean).join(" ");
649
+ function _e(i, l) {
609
650
  if (!l || l.length === 0) return {};
610
651
  for (const e of l) {
611
- const s = n[e.field];
652
+ const s = i[e.field];
612
653
  if (s == null) continue;
613
654
  let t = !1;
614
- const i = String(s);
655
+ const n = String(s);
615
656
  switch (e.operator) {
616
657
  case "equals":
617
- t = i === String(e.value);
658
+ t = n === String(e.value);
618
659
  break;
619
660
  case "not_equals":
620
- t = i !== String(e.value);
661
+ t = n !== String(e.value);
621
662
  break;
622
663
  case "contains":
623
- t = i.toLowerCase().includes(String(e.value).toLowerCase());
664
+ t = n.toLowerCase().includes(String(e.value).toLowerCase());
624
665
  break;
625
666
  case "in":
626
- t = Array.isArray(e.value) && e.value.includes(i);
667
+ t = Array.isArray(e.value) && e.value.includes(n);
627
668
  break;
628
669
  }
629
670
  if (t)
@@ -634,39 +675,39 @@ function Ae(n, l) {
634
675
  }
635
676
  return {};
636
677
  }
637
- function W({ card: n, conditionalFormatting: l }) {
678
+ function W({ card: i, conditionalFormatting: l }) {
638
679
  const {
639
680
  attributes: e,
640
681
  listeners: s,
641
682
  setNodeRef: t,
642
- transform: i,
683
+ transform: n,
643
684
  transition: o,
644
685
  isDragging: r
645
- } = Y({ id: n.id }), d = {
646
- transform: ce.Transform.toString(i),
686
+ } = X({ id: i.id }), h = {
687
+ transform: ce.Transform.toString(n),
647
688
  transition: o,
648
689
  opacity: r ? 0.5 : void 0
649
- }, h = Ae(n, l);
650
- return /* @__PURE__ */ a.jsx("div", { ref: t, style: d, ...e, ...s, children: /* @__PURE__ */ a.jsxs(de, { className: "mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group", style: h, children: [
651
- n.coverImage && /* @__PURE__ */ a.jsx("div", { className: "w-full h-32 overflow-hidden rounded-t-lg", children: /* @__PURE__ */ a.jsx(
690
+ }, d = _e(i, l);
691
+ return /* @__PURE__ */ a.jsx("div", { ref: t, style: h, ...e, ...s, children: /* @__PURE__ */ a.jsxs(he, { className: "mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group", style: d, children: [
692
+ i.coverImage && /* @__PURE__ */ a.jsx("div", { className: "w-full h-32 overflow-hidden rounded-t-lg", children: /* @__PURE__ */ a.jsx(
652
693
  "img",
653
694
  {
654
- src: n.coverImage,
695
+ src: i.coverImage,
655
696
  alt: "",
656
697
  className: "w-full h-full object-cover",
657
698
  loading: "lazy"
658
699
  }
659
700
  ) }),
660
- /* @__PURE__ */ a.jsxs(he, { className: "p-4", children: [
661
- /* @__PURE__ */ a.jsx(ue, { className: "text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors", children: n.title }),
662
- n.description && /* @__PURE__ */ a.jsx(fe, { className: "text-xs text-muted-foreground font-mono", children: n.description })
701
+ /* @__PURE__ */ a.jsxs(de, { className: "p-4", children: [
702
+ /* @__PURE__ */ a.jsx(ue, { className: "text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors", children: i.title }),
703
+ i.description && /* @__PURE__ */ a.jsx(fe, { className: "text-xs text-muted-foreground font-mono", children: i.description })
663
704
  ] }),
664
- n.badges && n.badges.length > 0 && /* @__PURE__ */ a.jsx(me, { className: "p-4 pt-0", children: /* @__PURE__ */ a.jsx("div", { className: "flex flex-wrap gap-1", children: n.badges.map((u, m) => /* @__PURE__ */ a.jsx(L, { variant: u.variant || "default", className: "text-xs", children: u.label }, m)) }) })
705
+ i.badges && i.badges.length > 0 && /* @__PURE__ */ a.jsx(me, { className: "p-4 pt-0", children: /* @__PURE__ */ a.jsx("div", { className: "flex flex-wrap gap-1", children: i.badges.map((u, m) => /* @__PURE__ */ a.jsx(L, { variant: u.variant || "default", className: "text-xs", children: u.label }, m)) }) })
665
706
  ] }) });
666
707
  }
667
- function De({ cards: n, parentRef: l, conditionalFormatting: e }) {
668
- const s = ke({
669
- count: n.length,
708
+ function Re({ cards: i, parentRef: l, conditionalFormatting: e }) {
709
+ const s = Ae({
710
+ count: i.length,
670
711
  getScrollElement: () => l.current,
671
712
  estimateSize: () => 120,
672
713
  overscan: 5
@@ -680,7 +721,7 @@ function De({ cards: n, parentRef: l, conditionalFormatting: e }) {
680
721
  position: "relative"
681
722
  },
682
723
  children: s.getVirtualItems().map((t) => {
683
- const i = n[t.index];
724
+ const n = i[t.index];
684
725
  return /* @__PURE__ */ a.jsx(
685
726
  "div",
686
727
  {
@@ -691,35 +732,35 @@ function De({ cards: n, parentRef: l, conditionalFormatting: e }) {
691
732
  width: "100%",
692
733
  transform: `translateY(${t.start}px)`
693
734
  },
694
- children: /* @__PURE__ */ a.jsx(W, { card: i, conditionalFormatting: e })
735
+ children: /* @__PURE__ */ a.jsx(W, { card: n, conditionalFormatting: e })
695
736
  },
696
- i.id
737
+ n.id
697
738
  );
698
739
  })
699
740
  }
700
741
  );
701
742
  }
702
- function Re({ columnId: n, onAdd: l }) {
703
- const [e, s] = v.useState(!1), [t, i] = v.useState(""), o = v.useRef(null), r = () => {
704
- const h = t.trim();
705
- h && (l(n, h), i("")), s(!1);
706
- }, d = (h) => {
707
- h.key === "Enter" ? (h.preventDefault(), r()) : h.key === "Escape" && (i(""), s(!1));
743
+ function ke({ columnId: i, onAdd: l }) {
744
+ const [e, s] = g.useState(!1), [t, n] = g.useState(""), o = g.useRef(null), r = () => {
745
+ const d = t.trim();
746
+ d && (l(i, d), n("")), s(!1);
747
+ }, h = (d) => {
748
+ d.key === "Enter" ? (d.preventDefault(), r()) : d.key === "Escape" && (n(""), s(!1));
708
749
  };
709
750
  return e ? /* @__PURE__ */ a.jsx("div", { className: "mt-2 space-y-2", children: /* @__PURE__ */ a.jsx(
710
751
  ge,
711
752
  {
712
753
  ref: o,
713
754
  value: t,
714
- onChange: (h) => i(h.target.value),
715
- onKeyDown: d,
755
+ onChange: (d) => n(d.target.value),
756
+ onKeyDown: h,
716
757
  onBlur: r,
717
758
  placeholder: "Enter card title...",
718
759
  className: "text-sm",
719
760
  autoFocus: !0
720
761
  }
721
762
  ) }) : /* @__PURE__ */ a.jsxs(
722
- G,
763
+ Y,
723
764
  {
724
765
  variant: "ghost",
725
766
  size: "sm",
@@ -728,176 +769,176 @@ function Re({ columnId: n, onAdd: l }) {
728
769
  s(!0), setTimeout(() => o.current?.focus(), 0);
729
770
  },
730
771
  children: [
731
- /* @__PURE__ */ a.jsx(X, { className: "h-4 w-4 mr-1" }),
772
+ /* @__PURE__ */ a.jsx(Q, { className: "h-4 w-4 mr-1" }),
732
773
  "Add Card"
733
774
  ]
734
775
  }
735
776
  );
736
777
  }
737
- function _e({
738
- column: n,
778
+ function De({
779
+ column: i,
739
780
  cards: l,
740
781
  onToggle: e,
741
782
  enableVirtual: s,
742
783
  quickAdd: t,
743
- onQuickAdd: i,
784
+ onQuickAdd: n,
744
785
  conditionalFormatting: o
745
786
  }) {
746
- const r = l || [], d = v.useRef(null), { setNodeRef: h } = Y({
747
- id: n.id,
787
+ const r = l || [], h = g.useRef(null), { setNodeRef: d } = X({
788
+ id: i.id,
748
789
  data: {
749
790
  type: "column"
750
791
  }
751
- }), u = n.limit && r.length >= n.limit, m = n.limit && r.length >= n.limit * 0.8;
792
+ }), u = i.limit && r.length >= i.limit, m = i.limit && r.length >= i.limit * 0.8;
752
793
  return /* @__PURE__ */ a.jsxs(
753
794
  "div",
754
795
  {
755
- ref: h,
796
+ ref: d,
756
797
  className: V(
757
798
  "flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all",
758
- n.collapsed ? "w-16" : "w-80",
759
- n.className
799
+ i.collapsed ? "w-16" : "w-80",
800
+ i.className
760
801
  ),
761
802
  children: [
762
803
  /* @__PURE__ */ a.jsxs("div", { className: "p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between", children: [
763
804
  /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
764
805
  /* @__PURE__ */ a.jsx(
765
- G,
806
+ Y,
766
807
  {
767
808
  variant: "ghost",
768
809
  size: "sm",
769
810
  className: "h-6 w-6 p-0",
770
- onClick: () => e(!n.collapsed),
771
- children: n.collapsed ? /* @__PURE__ */ a.jsx(ve, { className: "h-4 w-4" }) : /* @__PURE__ */ a.jsx(Q, { className: "h-4 w-4" })
811
+ onClick: () => e(!i.collapsed),
812
+ children: i.collapsed ? /* @__PURE__ */ a.jsx(ve, { className: "h-4 w-4" }) : /* @__PURE__ */ a.jsx(J, { className: "h-4 w-4" })
772
813
  }
773
814
  ),
774
- !n.collapsed && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
775
- /* @__PURE__ */ a.jsx("h3", { className: "font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate", children: n.title }),
815
+ !i.collapsed && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
816
+ /* @__PURE__ */ a.jsx("h3", { className: "font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate", children: i.title }),
776
817
  /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
777
818
  /* @__PURE__ */ a.jsxs("span", { className: V(
778
819
  "font-mono text-xs",
779
820
  u ? "text-destructive" : m ? "text-yellow-500" : "text-muted-foreground"
780
821
  ), children: [
781
822
  r.length,
782
- n.limit && ` / ${n.limit}`
823
+ i.limit && ` / ${i.limit}`
783
824
  ] }),
784
825
  u && /* @__PURE__ */ a.jsx(L, { variant: "destructive", className: "text-xs", children: "Full" }),
785
826
  m && !u && /* @__PURE__ */ a.jsx(be, { className: "h-3 w-3 text-yellow-500" })
786
827
  ] })
787
828
  ] })
788
829
  ] }),
789
- n.collapsed && /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
790
- /* @__PURE__ */ a.jsx("span", { className: "font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180", children: n.title }),
830
+ i.collapsed && /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
831
+ /* @__PURE__ */ a.jsx("span", { className: "font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180", children: i.title }),
791
832
  /* @__PURE__ */ a.jsx(L, { variant: "secondary", className: "text-xs", children: r.length })
792
833
  ] })
793
834
  ] }),
794
- !n.collapsed && /* @__PURE__ */ a.jsxs("div", { ref: d, className: "flex-1 p-4 overflow-y-auto", style: { maxHeight: "600px" }, children: [
835
+ !i.collapsed && /* @__PURE__ */ a.jsxs("div", { ref: h, className: "flex-1 p-4 overflow-y-auto", style: { maxHeight: "600px" }, children: [
795
836
  /* @__PURE__ */ a.jsx(
796
837
  le,
797
838
  {
798
839
  items: r.map((c) => c.id),
799
840
  strategy: ae,
800
- children: s ? /* @__PURE__ */ a.jsx(De, { cards: r, parentRef: d, conditionalFormatting: o }) : /* @__PURE__ */ a.jsx("div", { className: "space-y-2", children: r.map((c) => /* @__PURE__ */ a.jsx(W, { card: c, conditionalFormatting: o }, c.id)) })
841
+ children: s ? /* @__PURE__ */ a.jsx(Re, { cards: r, parentRef: h, conditionalFormatting: o }) : /* @__PURE__ */ a.jsx("div", { className: "space-y-2", children: r.map((c) => /* @__PURE__ */ a.jsx(W, { card: c, conditionalFormatting: o }, c.id)) })
801
842
  }
802
843
  ),
803
- t && i && /* @__PURE__ */ a.jsx(Re, { columnId: n.id, onAdd: i })
844
+ t && n && /* @__PURE__ */ a.jsx(ke, { columnId: i.id, onAdd: n })
804
845
  ] })
805
846
  ]
806
847
  }
807
848
  );
808
849
  }
809
850
  function We({
810
- columns: n,
851
+ columns: i,
811
852
  onCardMove: l,
812
853
  onColumnToggle: e,
813
854
  enableVirtualScrolling: s = !1,
814
855
  virtualScrollThreshold: t = 50,
815
- className: i,
856
+ className: n,
816
857
  quickAdd: o,
817
858
  onQuickAdd: r,
818
- conditionalFormatting: d
859
+ conditionalFormatting: h
819
860
  }) {
820
- const [h, u] = v.useState(null), m = v.useMemo(() => (n || []).map((f) => ({
861
+ const [d, u] = g.useState(null), m = g.useMemo(() => (i || []).map((f) => ({
821
862
  ...f,
822
863
  cards: f.cards || []
823
- })), [n]), [c, g] = v.useState(m);
824
- v.useEffect(() => {
825
- g(m);
864
+ })), [i]), [c, v] = g.useState(m);
865
+ g.useEffect(() => {
866
+ v(m);
826
867
  }, [m]);
827
- const w = ee(
868
+ const E = ee(
828
869
  te(oe, {
829
870
  activationConstraint: {
830
871
  distance: 8
831
872
  }
832
873
  })
833
- ), p = (f) => {
834
- const { active: x } = f, b = z(x.id);
874
+ ), x = (f) => {
875
+ const { active: p } = f, b = O(p.id);
835
876
  u(b);
836
- }, E = (f) => {
837
- const { active: x, over: b } = f;
877
+ }, y = (f) => {
878
+ const { active: p, over: b } = f;
838
879
  if (u(null), !b) return;
839
- const y = x.id, j = b.id;
840
- if (y === j) return;
841
- const M = C(y), N = C(j) || D(j);
880
+ const C = p.id, j = b.id;
881
+ if (C === j) return;
882
+ const M = S(C), N = S(j) || R(j);
842
883
  if (!(!M || !N))
843
884
  if (M.id === N.id) {
844
- const O = [...M.cards], k = O.findIndex((I) => I.id === y), T = O.findIndex((I) => I.id === j), B = re(O, k, T);
845
- g(
885
+ const z = [...M.cards], A = z.findIndex((I) => I.id === C), T = z.findIndex((I) => I.id === j), B = re(z, A, T);
886
+ v(
846
887
  (I) => I.map(
847
- (R) => R.id === M.id ? { ...R, cards: B } : R
888
+ (k) => k.id === M.id ? { ...k, cards: B } : k
848
889
  )
849
890
  );
850
891
  } else {
851
- const O = [...M.cards], k = [...N.cards], T = O.findIndex((_) => _.id === y), I = j === N.id ? k.length : k.findIndex((_) => _.id === j), [R] = O.splice(T, 1);
852
- k.splice(I, 0, R), g(
853
- (_) => _.map((F) => F.id === M.id ? { ...F, cards: O } : F.id === N.id ? { ...F, cards: k } : F)
854
- ), l && l(y, M.id, N.id, I);
892
+ const z = [...M.cards], A = [...N.cards], T = z.findIndex((D) => D.id === C), I = j === N.id ? A.length : A.findIndex((D) => D.id === j), [k] = z.splice(T, 1);
893
+ A.splice(I, 0, k), v(
894
+ (D) => D.map((F) => F.id === M.id ? { ...F, cards: z } : F.id === N.id ? { ...F, cards: A } : F)
895
+ ), l && l(C, M.id, N.id, I);
855
896
  }
856
- }, z = v.useCallback(
897
+ }, O = g.useCallback(
857
898
  (f) => {
858
- for (const x of c) {
859
- const b = x.cards.find((y) => y.id === f);
899
+ for (const p of c) {
900
+ const b = p.cards.find((C) => C.id === f);
860
901
  if (b) return b;
861
902
  }
862
903
  return null;
863
904
  },
864
905
  [c]
865
- ), C = v.useCallback(
866
- (f) => c.find((x) => x.cards.some((b) => b.id === f)) || null,
906
+ ), S = g.useCallback(
907
+ (f) => c.find((p) => p.cards.some((b) => b.id === f)) || null,
867
908
  [c]
868
- ), D = v.useCallback(
869
- (f) => c.find((x) => x.id === f) || null,
909
+ ), R = g.useCallback(
910
+ (f) => c.find((p) => p.id === f) || null,
870
911
  [c]
871
- ), S = v.useCallback((f, x) => {
872
- g(
873
- (b) => b.map((y) => y.id === f ? { ...y, collapsed: x } : y)
874
- ), e?.(f, x);
912
+ ), w = g.useCallback((f, p) => {
913
+ v(
914
+ (b) => b.map((C) => C.id === f ? { ...C, collapsed: p } : C)
915
+ ), e?.(f, p);
875
916
  }, [e]);
876
917
  return /* @__PURE__ */ a.jsxs(
877
918
  se,
878
919
  {
879
- sensors: w,
920
+ sensors: E,
880
921
  collisionDetection: ne,
881
- onDragStart: p,
882
- onDragEnd: E,
922
+ onDragStart: x,
923
+ onDragEnd: y,
883
924
  children: [
884
- /* @__PURE__ */ a.jsx("div", { className: V("flex gap-4 overflow-x-auto p-4", i), children: c.map((f) => {
885
- const x = s && f.cards.length > t;
925
+ /* @__PURE__ */ a.jsx("div", { className: V("flex gap-4 overflow-x-auto p-4", n), children: c.map((f) => {
926
+ const p = s && f.cards.length > t;
886
927
  return /* @__PURE__ */ a.jsx(
887
- _e,
928
+ De,
888
929
  {
889
930
  column: f,
890
931
  cards: f.cards,
891
- onToggle: (b) => S(f.id, b),
892
- enableVirtual: x,
932
+ onToggle: (b) => w(f.id, b),
933
+ enableVirtual: p,
893
934
  quickAdd: o,
894
935
  onQuickAdd: r,
895
- conditionalFormatting: d
936
+ conditionalFormatting: h
896
937
  },
897
938
  f.id
898
939
  );
899
940
  }) }),
900
- /* @__PURE__ */ a.jsx(ie, { children: h ? /* @__PURE__ */ a.jsx(W, { card: h, conditionalFormatting: d }) : null })
941
+ /* @__PURE__ */ a.jsx(ie, { children: d ? /* @__PURE__ */ a.jsx(W, { card: d, conditionalFormatting: h }) : null })
901
942
  ]
902
943
  }
903
944
  );