@wyxos/vibe 2.1.17 → 2.2.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.
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as Pe, ref as c, computed as x, createElementBlock as P, openBlock as I, createElementVNode as R, normalizeStyle as U, watch as re, onMounted as lt, onUnmounted as $t, createCommentVNode as G, createBlock as _t, unref as se, toDisplayString as je, Fragment as at, normalizeClass as Tt, createVNode as Q, mergeDefaults as un, useAttrs as cn, shallowRef as Pt, provide as fn, mergeProps as dn, renderSlot as vn, renderList as Et, nextTick as Rt, inject as mn } from "vue";
2
- const hn = {
1
+ import { defineComponent as xe, ref as v, computed as k, createElementBlock as T, openBlock as _, createElementVNode as C, normalizeStyle as U, watch as oe, onMounted as Qe, onUnmounted as zt, createCommentVNode as Z, createBlock as Ft, unref as le, toDisplayString as Ze, normalizeClass as _t, createVNode as Q, mergeDefaults as fn, useAttrs as dn, shallowRef as Tt, provide as vn, mergeProps as mn, renderSlot as hn, Fragment as Pt, renderList as Et, nextTick as Bt, inject as gn } from "vue";
2
+ const pn = {
3
3
  mode: "default",
4
4
  pageSize: 20,
5
5
  backfillRequestDelayMs: 2e3,
@@ -12,7 +12,7 @@ const hn = {
12
12
  headerHeight: 0,
13
13
  footerHeight: 0,
14
14
  overscanPx: 600
15
- }, gn = ["aria-label", "aria-valuemax", "aria-valuenow"], zt = /* @__PURE__ */ Pe({
15
+ }, yn = ["aria-label", "aria-valuemax", "aria-valuenow"], Lt = /* @__PURE__ */ xe({
16
16
  __name: "MasonryVideoControls",
17
17
  props: {
18
18
  currentTime: {},
@@ -22,154 +22,152 @@ const hn = {
22
22
  keyboardStep: { default: 5 }
23
23
  },
24
24
  emits: ["seek"],
25
- setup(l, { expose: M, emit: i }) {
26
- const s = l, d = i, S = c(null), b = c(null), u = c(null), y = c(!1), v = x(
27
- () => Number.isFinite(s.step) ? Math.max(0, s.step) : 0
28
- ), p = x(
29
- () => Number.isFinite(s.duration) ? Math.max(0, s.duration) : 0
30
- ), k = x(() => {
31
- const h = Number.isFinite(s.currentTime) ? s.currentTime : 0;
32
- return C(h, 0, p.value);
33
- }), _ = x(
34
- () => p.value > 0 ? k.value / p.value : 0
25
+ setup(o, { expose: M, emit: i }) {
26
+ const a = o, f = i, y = v(null), w = v(null), g = v(null), d = v(!1), p = k(
27
+ () => Number.isFinite(a.step) ? Math.max(0, a.step) : 0
28
+ ), b = k(
29
+ () => Number.isFinite(a.duration) ? Math.max(0, a.duration) : 0
30
+ ), S = k(() => {
31
+ const u = Number.isFinite(a.currentTime) ? a.currentTime : 0;
32
+ return P(u, 0, b.value);
33
+ }), N = k(
34
+ () => b.value > 0 ? S.value / b.value : 0
35
35
  );
36
- function C(h, T, N) {
37
- return Math.min(N, Math.max(T, h));
38
- }
39
- function F(h) {
40
- return v.value <= 0 ? h : Math.round(h / v.value) * v.value;
41
- }
42
- function H(h) {
43
- const T = C(h, 0, p.value);
44
- d("seek", F(T));
45
- }
46
- function A(h) {
47
- const T = b.value;
48
- if (!T) return;
49
- const N = T.getBoundingClientRect();
50
- if (!N.width) return;
51
- const K = C((h - N.left) / N.width, 0, 1);
52
- H(K * p.value);
53
- }
54
- function ie(h) {
55
- const T = b.value;
56
- T && (y.value = !0, T.setPointerCapture && T.setPointerCapture(h.pointerId), A(h.clientX));
57
- }
58
- function Y(h) {
59
- y.value && A(h.clientX);
60
- }
61
- function q(h) {
62
- if (!y.value) return;
63
- y.value = !1;
64
- const T = b.value;
65
- T?.releasePointerCapture && T.releasePointerCapture(h.pointerId);
66
- }
67
- function Z(h) {
68
- if (p.value <= 0) return;
69
- const T = Number.isFinite(s.keyboardStep) ? s.keyboardStep : 1;
70
- let N = k.value;
71
- switch (h.key) {
36
+ function P(u, I, B) {
37
+ return Math.min(B, Math.max(I, u));
38
+ }
39
+ function F(u) {
40
+ return p.value <= 0 ? u : Math.round(u / p.value) * p.value;
41
+ }
42
+ function L(u) {
43
+ const I = P(u, 0, b.value);
44
+ f("seek", F(I));
45
+ }
46
+ function R(u) {
47
+ const I = w.value;
48
+ if (!I) return;
49
+ const B = I.getBoundingClientRect();
50
+ if (!B.width) return;
51
+ const j = P((u - B.left) / B.width, 0, 1);
52
+ L(j * b.value);
53
+ }
54
+ function X(u) {
55
+ const I = w.value;
56
+ I && (d.value = !0, I.setPointerCapture && I.setPointerCapture(u.pointerId), R(u.clientX));
57
+ }
58
+ function $(u) {
59
+ d.value && R(u.clientX);
60
+ }
61
+ function H(u) {
62
+ if (!d.value) return;
63
+ d.value = !1;
64
+ const I = w.value;
65
+ I?.releasePointerCapture && I.releasePointerCapture(u.pointerId);
66
+ }
67
+ function q(u) {
68
+ if (b.value <= 0) return;
69
+ const I = Number.isFinite(a.keyboardStep) ? a.keyboardStep : 1;
70
+ let B = S.value;
71
+ switch (u.key) {
72
72
  case "ArrowLeft":
73
73
  case "ArrowDown":
74
- N -= T;
74
+ B -= I;
75
75
  break;
76
76
  case "ArrowRight":
77
77
  case "ArrowUp":
78
- N += T;
78
+ B += I;
79
79
  break;
80
80
  case "Home":
81
- N = 0;
81
+ B = 0;
82
82
  break;
83
83
  case "End":
84
- N = p.value;
84
+ B = b.value;
85
85
  break;
86
86
  default:
87
87
  return;
88
88
  }
89
- h.preventDefault(), H(N);
89
+ u.preventDefault(), L(B);
90
90
  }
91
- function ee() {
92
- S.value?.focus();
91
+ function ae() {
92
+ y.value?.focus();
93
93
  }
94
94
  return M({
95
- focus: ee,
96
- seekTo: H,
97
- percent: _,
98
- currentValue: k,
99
- maxValue: p,
100
- isDragging: y,
101
- rootEl: S,
102
- trackEl: b,
103
- thumbEl: u
104
- }), (h, T) => (I(), P("div", {
95
+ focus: ae,
96
+ seekTo: L,
97
+ percent: N,
98
+ currentValue: S,
99
+ maxValue: b,
100
+ isDragging: d,
101
+ rootEl: y,
102
+ trackEl: w,
103
+ thumbEl: g
104
+ }), (u, I) => (_(), T("div", {
105
105
  ref_key: "rootEl",
106
- ref: S,
106
+ ref: y,
107
107
  class: "w-full select-none",
108
108
  role: "slider",
109
109
  tabindex: "0",
110
- "aria-label": s.ariaLabel,
110
+ "aria-label": a.ariaLabel,
111
111
  "aria-valuemin": 0,
112
- "aria-valuemax": p.value,
113
- "aria-valuenow": k.value,
114
- onKeydown: Z
112
+ "aria-valuemax": b.value,
113
+ "aria-valuenow": S.value,
114
+ onKeydown: q
115
115
  }, [
116
- R("div", {
116
+ C("div", {
117
117
  ref_key: "trackEl",
118
- ref: b,
118
+ ref: w,
119
119
  class: "relative h-2 w-full cursor-pointer rounded-full bg-slate-200",
120
- onPointerdown: ie,
121
- onPointermove: Y,
122
- onPointerup: q,
123
- onPointercancel: q,
124
- onPointerleave: q
120
+ onPointerdown: X,
121
+ onPointermove: $,
122
+ onPointerup: H,
123
+ onPointercancel: H,
124
+ onPointerleave: H
125
125
  }, [
126
- R("div", {
126
+ C("div", {
127
127
  class: "absolute inset-y-0 left-0 rounded-full bg-slate-500",
128
- style: U({ width: `${_.value * 100}%` })
128
+ style: U({ width: `${N.value * 100}%` })
129
129
  }, null, 4),
130
- R("div", {
130
+ C("div", {
131
131
  ref_key: "thumbEl",
132
- ref: u,
132
+ ref: g,
133
133
  class: "absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full bg-slate-700 shadow",
134
- style: U({ left: `${_.value * 100}%` }),
134
+ style: U({ left: `${N.value * 100}%` }),
135
135
  "aria-hidden": "true"
136
136
  }, null, 4)
137
137
  ], 544)
138
- ], 40, gn));
138
+ ], 40, yn));
139
139
  }
140
- }), pn = {
140
+ }), wn = {
141
141
  key: 0,
142
142
  "data-testid": "masonry-loader-spinner",
143
143
  class: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-1"
144
- }, yn = {
144
+ }, bn = {
145
145
  key: 1,
146
146
  class: "h-5 w-5 animate-spin text-slate-500",
147
147
  viewBox: "0 0 24 24",
148
148
  "aria-hidden": "true"
149
- }, wn = {
150
- key: 2,
151
- "data-testid": "masonry-loader-retry-status",
152
- class: "text-xs font-medium text-slate-600"
153
- }, bn = {
149
+ }, xn = {
154
150
  key: 1,
155
151
  "data-testid": "masonry-loader-error",
156
152
  class: "absolute inset-0 z-20 grid place-items-center p-3 pointer-events-none"
157
- }, xn = { class: "pointer-events-auto flex flex-col items-center justify-center gap-2" }, Sn = { class: "text-center text-xs font-medium text-red-700" }, Mn = ["src", "width", "height", "alt"], kn = ["poster"], In = ["src"], Fn = {
153
+ }, kn = { class: "pointer-events-auto flex flex-col items-center justify-center gap-2" }, Mn = {
154
+ key: 1,
155
+ class: "text-center text-xs font-medium text-red-700"
156
+ }, Sn = ["src", "width", "height", "alt"], In = ["poster"], Fn = ["src"], _n = {
158
157
  key: 4,
159
158
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-20 px-2 pb-2 opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100"
160
- }, At = 3, Bt = /* @__PURE__ */ Pe({
159
+ }, Rt = /* @__PURE__ */ xe({
161
160
  __name: "MasonryLoader",
162
161
  props: {
163
162
  item: {},
164
163
  remove: {},
165
164
  loaderSlotFn: {},
166
165
  errorSlotFn: {},
167
- timeoutSeconds: { default: 15 },
168
166
  hovered: { type: Boolean, default: !1 }
169
167
  },
170
168
  emits: ["success", "error"],
171
- setup(l, { emit: M }) {
172
- const i = l, s = M, d = Pe({
169
+ setup(o, { emit: M }) {
170
+ const i = o, a = M, f = xe({
173
171
  name: "SlotRenderer",
174
172
  props: {
175
173
  slotFn: {
@@ -181,177 +179,130 @@ const hn = {
181
179
  required: !0
182
180
  }
183
181
  },
184
- setup(a) {
182
+ setup(s) {
185
183
  return () => {
186
- const f = a.slotFn;
187
- return f ? f(a.slotProps) : null;
184
+ const x = s.slotFn;
185
+ return x ? x(s.slotProps) : null;
188
186
  };
189
187
  }
190
- }), S = c(null), b = c(null), u = c(null), y = c(null), v = c(!1), p = c(!1), k = c(!1), _ = c(!1), C = c(0), F = c(0), H = c(null), A = x(() => i.item?.type === "video"), ie = x(() => {
191
- if (!A.value) return;
192
- const a = i.item?.preview, f = i.item?.original;
193
- if (!(typeof a != "string" || !a) && !(typeof f == "string" && a === f) && !/\.(mp4|webm)(\?|#|$)/i.test(a))
194
- return a;
195
- }), Y = x(() => {
196
- if (!A.value) return;
197
- const a = i.item?.preview;
198
- if (typeof a == "string" && a && /\.(mp4|webm)(\?|#|$)/i.test(a))
199
- return a;
200
- const f = i.item?.original;
201
- if (typeof f == "string" && f) return f;
202
- }), q = c(!1), Z = x(() => !!i.hovered), ee = c(0), h = c(0), T = x(() => {
203
- const a = i.item?.timeoutSeconds;
204
- return typeof a == "number" && Number.isFinite(a) ? a : typeof i.timeoutSeconds == "number" && Number.isFinite(i.timeoutSeconds) ? i.timeoutSeconds : 0;
205
- });
206
- function N() {
188
+ }), y = v(null), w = v(null), g = v(null), d = v(!1), p = v(!1), b = v(!1), S = v(null), N = k(() => i.item?.type === "video"), P = k(() => {
189
+ if (!N.value) return;
190
+ const s = i.item?.preview, x = i.item?.original;
191
+ if (!(typeof s != "string" || !s) && !(typeof x == "string" && s === x) && !/\.(mp4|webm)(\?|#|$)/i.test(s) && /\.(png|jpe?g|gif|webp)(\?|#|$)/i.test(s))
192
+ return s;
193
+ }), F = k(() => {
194
+ if (!N.value) return;
195
+ const s = i.item?.preview;
196
+ if (typeof s == "string" && s && !/\.(png|jpe?g|gif|webp)(\?|#|$)/i.test(s))
197
+ return s;
198
+ const x = i.item?.original;
199
+ if (typeof x == "string" && x) return x;
200
+ }), L = v(!1), R = k(() => !!i.hovered), X = v(0), $ = v(0);
201
+ function H() {
207
202
  i.remove?.();
208
203
  }
209
- const K = x(() => {
210
- const a = i.item?.width, f = i.item?.height;
211
- return { aspectRatio: `${a} / ${f}` };
212
- }), Ee = x(() => i.item?.type === "image"), te = x(() => _.value ? `Retrying ${F.value}/${At}` : "");
213
- let J = null, ue = null, X = null, O = null;
214
- function ne() {
215
- X != null && (window.clearTimeout(X), X = null);
216
- }
217
- function ce() {
218
- O != null && (window.clearTimeout(O), O = null);
219
- }
220
- function we() {
221
- ne();
222
- const a = T.value;
223
- if (a <= 0) return;
224
- const f = a * 1e3;
225
- X = window.setTimeout(() => {
226
- v.value && (p.value || k.value || (Re(), ke(new Error("timeout"))));
227
- }, f);
228
- }
229
- function Re() {
230
- const a = b.value;
231
- a && (a.removeAttribute("src"), a.src = "");
232
- const f = u.value;
233
- if (!f) return;
234
- f.pause();
235
- const D = y.value;
236
- D && D.removeAttribute("src"), f.removeAttribute("src"), f.load();
237
- }
238
- function Ne() {
239
- if (!v.value) return;
240
- if (F.value >= At) {
241
- _.value = !1;
242
- return;
243
- }
244
- ce();
245
- const a = F.value + 1;
246
- F.value = a, _.value = !0;
247
- const f = (a - 1) * 1e3;
248
- O = window.setTimeout(() => {
249
- O = null, v.value && Ae({ resetAutoRetry: !1 });
250
- }, f);
251
- }
252
- function be() {
253
- v.value || (v.value = !0, p.value = !1, k.value = !1, we());
254
- }
255
- function xe(a) {
256
- ee.value = Number.isFinite(a.duration) ? a.duration : 0, h.value = Number.isFinite(a.currentTime) ? a.currentTime : 0;
257
- }
258
- async function Se() {
259
- if (!A.value || !Z.value || !v.value || !p.value || !q.value) return;
260
- const a = u.value;
261
- if (a)
204
+ const q = k(() => {
205
+ const s = i.item?.width, x = i.item?.height;
206
+ return { aspectRatio: `${s} / ${x}` };
207
+ }), ae = k(() => i.item?.type === "image");
208
+ let u = null, I = null;
209
+ function B() {
210
+ d.value || (d.value = !0, p.value = !1, b.value = !1, S.value = null);
211
+ }
212
+ function j(s) {
213
+ X.value = Number.isFinite(s.duration) ? s.duration : 0, $.value = Number.isFinite(s.currentTime) ? s.currentTime : 0;
214
+ }
215
+ async function re() {
216
+ if (!N.value || !R.value || !d.value || !p.value || !L.value) return;
217
+ const s = g.value;
218
+ if (s)
262
219
  try {
263
- a.muted = !0, await a.play();
220
+ s.muted = !0, await s.play();
264
221
  } catch {
265
222
  }
266
223
  }
267
- function He() {
268
- const a = u.value;
269
- a && (a.paused || a.pause());
224
+ function ee() {
225
+ const s = g.value;
226
+ s && (s.paused || s.pause());
270
227
  }
271
- function Le() {
272
- const a = u.value;
273
- a && (a.paused || a.pause());
228
+ function Pe() {
229
+ const s = g.value;
230
+ s && (s.paused || s.pause());
274
231
  }
275
- re(
232
+ oe(
276
233
  () => i.hovered,
277
- (a) => {
278
- if (a) {
279
- be(), Se();
234
+ (s) => {
235
+ if (s) {
236
+ B(), re();
280
237
  return;
281
238
  }
282
- He();
239
+ ee();
283
240
  }
284
241
  );
285
- function fe(a) {
286
- const f = u.value;
287
- f && Number.isFinite(a) && (f.currentTime = Math.max(0, Math.min(a, Number.isFinite(f.duration) ? f.duration : a)), xe(f));
242
+ function Ee(s) {
243
+ const x = g.value;
244
+ x && Number.isFinite(s) && (x.currentTime = Math.max(0, Math.min(s, Number.isFinite(x.duration) ? x.duration : s)), j(x));
288
245
  }
289
- lt(() => {
246
+ Qe(() => {
290
247
  if (typeof IntersectionObserver > "u") {
291
- be();
248
+ B();
292
249
  return;
293
250
  }
294
- if (J = new IntersectionObserver(
295
- (a) => {
296
- for (const f of a)
297
- if (f.isIntersecting && !((f.intersectionRatio ?? 0) < 0.5)) {
298
- be(), J?.disconnect(), J = null;
251
+ if (u = new IntersectionObserver(
252
+ (s) => {
253
+ for (const x of s)
254
+ if (x.isIntersecting && !((x.intersectionRatio ?? 0) < 0.5)) {
255
+ B(), u?.disconnect(), u = null;
299
256
  return;
300
257
  }
301
258
  },
302
259
  { threshold: [0, 0.5, 1] }
303
- ), S.value && J.observe(S.value), A.value && S.value) {
304
- const a = S.value.closest('[data-testid="items-scroll-container"]');
305
- ue = new IntersectionObserver(
306
- (f) => {
307
- for (const D of f) {
308
- const We = D.intersectionRatio ?? 0, Ve = !!D.isIntersecting && We >= 0.5;
309
- q.value = Ve, Ve ? Z.value && Se() : Le();
260
+ ), y.value && u.observe(y.value), N.value && y.value) {
261
+ const s = y.value.closest('[data-testid="items-scroll-container"]');
262
+ I = new IntersectionObserver(
263
+ (x) => {
264
+ for (const J of x) {
265
+ const Be = J.intersectionRatio ?? 0, Me = !!J.isIntersecting && Be >= 0.5;
266
+ L.value = Me, Me ? R.value && re() : Pe();
310
267
  }
311
268
  },
312
269
  {
313
- root: a ?? void 0,
270
+ root: s ?? void 0,
314
271
  threshold: [0, 0.25, 0.5, 0.75, 1]
315
272
  }
316
- ), ue.observe(S.value);
273
+ ), I.observe(y.value);
317
274
  }
318
- }), $t(() => {
319
- J?.disconnect(), J = null, ue?.disconnect(), ue = null, ne(), ce();
275
+ }), zt(() => {
276
+ u?.disconnect(), u = null, I?.disconnect(), I = null;
320
277
  });
321
- function Me() {
322
- p.value || (p.value = !0, k.value = !1, H.value = null, ne(), ce(), _.value = !1, F.value = 0, s("success", i.item));
323
- }
324
- function ke(a) {
325
- k.value || (p.value = !1, k.value = !0, H.value = a, ne(), s("error", { item: i.item, error: a }), Ne());
326
- }
327
- function Ae({ resetAutoRetry: a }) {
328
- v.value && (p.value = !1, k.value = !1, H.value = null, C.value += 1, a && (ce(), _.value = !1, F.value = 0), we());
278
+ function G() {
279
+ p.value || (p.value = !0, b.value = !1, S.value = null, a("success", i.item));
329
280
  }
330
- function de() {
331
- Ae({ resetAutoRetry: !0 });
281
+ function K(s) {
282
+ b.value || (p.value = !1, b.value = !0, S.value = s, a("error", { item: i.item, error: s }));
332
283
  }
333
- function Ue() {
334
- Me();
335
- const a = u.value;
336
- a && xe(a), Se();
284
+ function ke() {
285
+ G();
286
+ const s = g.value;
287
+ s && j(s), re();
337
288
  }
338
- function j() {
339
- const a = u.value;
340
- a && xe(a);
289
+ function ge() {
290
+ const s = g.value;
291
+ s && j(s);
341
292
  }
342
- return (a, f) => (I(), P("div", {
293
+ return (s, x) => (_(), T("div", {
343
294
  ref_key: "rootEl",
344
- ref: S,
295
+ ref: y,
345
296
  class: "relative bg-slate-100",
346
- style: U(K.value)
297
+ style: U(q.value)
347
298
  }, [
348
- v.value && !p.value && (!k.value || _.value) ? (I(), P("div", pn, [
349
- i.loaderSlotFn ? (I(), _t(se(d), {
299
+ d.value && !p.value && !b.value ? (_(), T("div", wn, [
300
+ i.loaderSlotFn ? (_(), Ft(le(f), {
350
301
  key: 0,
351
302
  "slot-fn": i.loaderSlotFn,
352
- "slot-props": { item: i.item, remove: N }
353
- }, null, 8, ["slot-fn", "slot-props"])) : (I(), P("svg", yn, f[2] || (f[2] = [
354
- R("circle", {
303
+ "slot-props": { item: i.item, remove: H }
304
+ }, null, 8, ["slot-fn", "slot-props"])) : (_(), T("svg", bn, x[2] || (x[2] = [
305
+ C("circle", {
355
306
  class: "opacity-25",
356
307
  cx: "12",
357
308
  cy: "12",
@@ -360,35 +311,26 @@ const hn = {
360
311
  stroke: "currentColor",
361
312
  "stroke-width": "4"
362
313
  }, null, -1),
363
- R("path", {
314
+ C("path", {
364
315
  class: "opacity-75",
365
316
  fill: "currentColor",
366
317
  d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
367
318
  }, null, -1)
368
- ]))),
369
- _.value ? (I(), P("p", wn, je(te.value), 1)) : G("", !0)
370
- ])) : v.value && k.value && !_.value ? (I(), P("div", bn, [
371
- R("div", xn, [
372
- i.errorSlotFn ? (I(), _t(se(d), {
319
+ ])))
320
+ ])) : d.value && b.value ? (_(), T("div", xn, [
321
+ C("div", kn, [
322
+ i.errorSlotFn ? (_(), Ft(le(f), {
373
323
  key: 0,
374
324
  "slot-fn": i.errorSlotFn,
375
- "slot-props": { item: i.item, remove: N, error: H.value, retry: de }
376
- }, null, 8, ["slot-fn", "slot-props"])) : (I(), P(at, { key: 1 }, [
377
- R("p", Sn, "Error " + je(H.value), 1),
378
- R("button", {
379
- type: "button",
380
- "data-testid": "masonry-loader-retry",
381
- class: "inline-flex items-center rounded-md border border-slate-200 bg-white px-2 py-1 text-xs font-medium text-slate-700",
382
- onClick: de
383
- }, " Retry ")
384
- ], 64))
325
+ "slot-props": { item: i.item, remove: H, error: S.value }
326
+ }, null, 8, ["slot-fn", "slot-props"])) : (_(), T("p", Mn, "Error " + Ze(S.value), 1))
385
327
  ])
386
- ])) : G("", !0),
387
- v.value && Ee.value && !k.value ? (I(), P("img", {
388
- key: i.item.id + ":img:" + C.value,
328
+ ])) : Z("", !0),
329
+ d.value && ae.value && !b.value ? (_(), T("img", {
330
+ key: i.item.id + ":img",
389
331
  ref_key: "imgEl",
390
- ref: b,
391
- class: Tt([
332
+ ref: w,
333
+ class: _t([
392
334
  "h-full w-full object-cover transition-opacity duration-300",
393
335
  p.value ? "opacity-100" : "opacity-0"
394
336
  ]),
@@ -397,231 +339,243 @@ const hn = {
397
339
  height: i.item.height,
398
340
  loading: "lazy",
399
341
  alt: i.item.id,
400
- onLoad: Me,
401
- onError: f[0] || (f[0] = (D) => ke(D))
402
- }, null, 42, Mn)) : v.value && !k.value ? (I(), P("video", {
403
- key: i.item.id + ":vid:" + C.value,
404
- class: Tt([
342
+ onLoad: G,
343
+ onError: x[0] || (x[0] = (J) => K(J))
344
+ }, null, 42, Sn)) : d.value && !b.value ? (_(), T("video", {
345
+ key: i.item.id + ":vid",
346
+ class: _t([
405
347
  "h-full w-full object-cover transition-opacity duration-300",
406
348
  p.value ? "opacity-100" : "opacity-0"
407
349
  ]),
408
- poster: ie.value,
350
+ poster: P.value,
409
351
  ref_key: "videoEl",
410
- ref: u,
352
+ ref: g,
411
353
  playsinline: "",
412
354
  loop: "",
413
355
  preload: "metadata",
414
- onLoadedmetadata: Ue,
415
- onTimeupdate: j,
416
- onDurationchange: j,
417
- onLoadeddata: j,
418
- onError: f[1] || (f[1] = (D) => ke(D))
356
+ onLoadedmetadata: ke,
357
+ onTimeupdate: ge,
358
+ onDurationchange: ge,
359
+ onLoadeddata: ge,
360
+ onError: x[1] || (x[1] = (J) => K(J))
419
361
  }, [
420
- R("source", {
421
- ref_key: "videoSourceEl",
422
- ref: y,
423
- src: Y.value,
362
+ C("source", {
363
+ src: F.value,
424
364
  type: "video/mp4"
425
- }, null, 8, In)
426
- ], 42, kn)) : G("", !0),
427
- v.value && A.value && !k.value ? (I(), P("div", Fn, [
428
- Q(zt, {
429
- duration: ee.value,
430
- "current-time": h.value,
431
- onSeek: fe
365
+ }, null, 8, Fn)
366
+ ], 42, In)) : Z("", !0),
367
+ d.value && N.value && !b.value ? (_(), T("div", _n, [
368
+ Q(Lt, {
369
+ duration: X.value,
370
+ "current-time": $.value,
371
+ onSeek: Ee
432
372
  }, null, 8, ["duration", "current-time"])
433
- ])) : G("", !0)
373
+ ])) : Z("", !0)
434
374
  ], 4));
435
375
  }
436
- }), Dt = Symbol("masonryItemRegistry");
437
- function _n(l, M) {
438
- return !l || l <= 0 || !M || M <= 0 ? 1 : Math.max(1, Math.floor(l / M));
376
+ }), $t = Symbol("masonryItemRegistry");
377
+ function Tn(o, M) {
378
+ return !o || o <= 0 || !M || M <= 0 ? 1 : Math.max(1, Math.floor(o / M));
379
+ }
380
+ function Pn(o, M, i, a = 0) {
381
+ if (!o || o <= 0 || !M || M <= 0) return i;
382
+ const f = typeof a == "number" && a > 0 ? a : 0, y = Math.max(0, M - 1) * f, w = o - y;
383
+ return !w || w <= 0 ? i : w / M;
439
384
  }
440
- function Tn(l, M, i, s = 0) {
441
- if (!l || l <= 0 || !M || M <= 0) return i;
442
- const d = typeof s == "number" && s > 0 ? s : 0, S = Math.max(0, M - 1) * d, b = l - S;
443
- return !b || b <= 0 ? i : b / M;
385
+ function En(o, M) {
386
+ const i = o?.width, a = o?.height;
387
+ return typeof i == "number" && typeof a == "number" && i > 0 && a > 0 ? a / i * M : M;
444
388
  }
445
- function Pn(l, M) {
446
- const i = l?.width, s = l?.height;
447
- return typeof i == "number" && typeof s == "number" && i > 0 && s > 0 ? s / i * M : M;
389
+ function Dt(o) {
390
+ return Number.isFinite(o) && o > 0 ? Math.floor(o) : 1;
448
391
  }
449
- function qt(l) {
450
- return Number.isFinite(l) && l > 0 ? Math.floor(l) : 1;
392
+ function et(o) {
393
+ return Number.isFinite(o) && o > 0 ? Math.floor(o) : 0;
451
394
  }
452
- function rt(l) {
453
- return Number.isFinite(l) && l > 0 ? Math.floor(l) : 0;
395
+ function Bn() {
396
+ const o = new Error("aborted");
397
+ return o.name = "AbortError", o;
454
398
  }
455
- function En(l) {
456
- async function M(s) {
457
- const d = rt(s);
458
- if (d <= 0) return;
459
- l.stats.value = {
460
- ...l.stats.value,
461
- cooldownMsTotal: d,
462
- cooldownMsRemaining: d
399
+ function Rn(o) {
400
+ async function M(a) {
401
+ const f = et(a);
402
+ if (f <= 0) return;
403
+ o.stats.value = {
404
+ ...o.stats.value,
405
+ cooldownMsTotal: f,
406
+ cooldownMsRemaining: f
463
407
  };
464
- const S = Date.now(), b = 100;
465
- await new Promise((u) => {
466
- const y = setInterval(() => {
467
- const v = Date.now() - S, p = Math.max(0, d - v);
468
- l.stats.value = {
469
- ...l.stats.value,
470
- cooldownMsTotal: d,
471
- cooldownMsRemaining: p
472
- }, p <= 0 && (clearInterval(y), u());
473
- }, b);
408
+ const y = Date.now(), w = 100;
409
+ await new Promise((g) => {
410
+ const d = setInterval(() => {
411
+ const p = Date.now() - y, b = Math.max(0, f - p);
412
+ o.stats.value = {
413
+ ...o.stats.value,
414
+ cooldownMsTotal: f,
415
+ cooldownMsRemaining: b
416
+ }, b <= 0 && (clearInterval(d), g());
417
+ }, w);
474
418
  });
475
419
  }
476
- async function i(s) {
477
- const d = qt(l.getPageSize()), S = l.isEnabled(), b = rt(l.getRequestDelayMs()), u = [];
478
- let y = 0;
479
- l.buffer.value.length && (y = l.buffer.value.length, u.push(...l.buffer.value), l.buffer.value = []), l.stats.value = {
480
- ...l.stats.value,
481
- enabled: S,
420
+ async function i(a) {
421
+ const f = Dt(o.getPageSize()), y = o.isEnabled(), w = et(o.getRequestDelayMs()), g = o.stats.value.page ?? null, d = o.getCancelToken?.() ?? null, p = () => d !== null && o.getCancelToken && o.getCancelToken() !== d, b = () => {
422
+ if (p()) throw Bn();
423
+ }, S = [];
424
+ let N = 0;
425
+ o.buffer.value.length && (N = o.buffer.value.length, S.push(...o.buffer.value), o.buffer.value = []), o.stats.value = {
426
+ ...o.stats.value,
427
+ enabled: y,
482
428
  isBackfillActive: !1,
483
429
  isRequestInFlight: !1,
484
- requestPage: null,
485
- cooldownMsTotal: b,
430
+ page: g ?? a,
431
+ next: a,
432
+ cooldownMsTotal: w,
486
433
  cooldownMsRemaining: 0,
487
434
  progress: {
488
435
  collected: 0,
489
436
  target: 0
490
437
  },
491
- pageSize: d,
438
+ pageSize: f,
492
439
  bufferSize: 0
493
440
  };
494
- const v = [];
495
- let p = s, k = 0, _ = !1;
496
- for (; u.length < d && p != null; ) {
497
- const H = p;
498
- _ && (l.stats.value = {
499
- ...l.stats.value,
500
- enabled: S,
441
+ const P = [];
442
+ let F = a, L = 0, R = !1;
443
+ for (; S.length < f && F != null; ) {
444
+ b();
445
+ const H = F;
446
+ R && (o.stats.value = {
447
+ ...o.stats.value,
448
+ enabled: y,
501
449
  isBackfillActive: !0,
502
450
  isRequestInFlight: !0,
503
- requestPage: H,
451
+ page: H,
452
+ next: null,
504
453
  progress: {
505
- collected: Math.min(u.length, d),
506
- target: d
454
+ collected: Math.min(S.length, f),
455
+ target: f
507
456
  },
508
- cooldownMsTotal: b,
457
+ cooldownMsTotal: w,
509
458
  cooldownMsRemaining: 0,
510
- pageSize: d
459
+ pageSize: f
511
460
  });
512
- const A = await l.getContent(H);
513
- v.push(H), _ && (l.stats.value = {
514
- ...l.stats.value,
515
- enabled: S,
461
+ const q = await o.getContent(H);
462
+ b(), P.push(H), R && (o.stats.value = {
463
+ ...o.stats.value,
464
+ enabled: y,
516
465
  isBackfillActive: !0,
517
466
  isRequestInFlight: !1,
518
- requestPage: null
519
- }), k += A.items.length, l.markEnterFromLeft(A.items), u.push(...A.items), p = A.nextPage, !_ && u.length < d && p != null ? (_ = !0, l.stats.value = {
520
- ...l.stats.value,
521
- enabled: S,
467
+ page: H,
468
+ next: q.nextPage
469
+ }), L += q.items.length, o.markEnterFromLeft(q.items), S.push(...q.items), F = q.nextPage, !R && S.length < f && F != null ? (R = !0, o.stats.value = {
470
+ ...o.stats.value,
471
+ enabled: y,
522
472
  isBackfillActive: !0,
523
473
  isRequestInFlight: !1,
524
- requestPage: null,
474
+ page: H,
475
+ next: F,
525
476
  progress: {
526
- collected: Math.min(u.length, d),
527
- target: d
477
+ collected: Math.min(S.length, f),
478
+ target: f
528
479
  },
529
- cooldownMsTotal: b,
480
+ cooldownMsTotal: w,
530
481
  cooldownMsRemaining: 0,
531
- pageSize: d
532
- }) : _ && (l.stats.value = {
533
- ...l.stats.value,
534
- enabled: S,
482
+ pageSize: f
483
+ }) : R && (o.stats.value = {
484
+ ...o.stats.value,
485
+ enabled: y,
535
486
  isBackfillActive: !0,
487
+ page: H,
488
+ next: F,
536
489
  progress: {
537
- collected: Math.min(u.length, d),
538
- target: d
490
+ collected: Math.min(S.length, f),
491
+ target: f
539
492
  }
540
- }), _ && u.length < d && p != null && await M(b);
493
+ }), R && S.length < f && F != null && (await M(w), b());
541
494
  }
542
- const C = u.slice(0, d), F = u.slice(d);
543
- return l.buffer.value = F, l.stats.value = {
544
- ...l.stats.value,
545
- enabled: S,
495
+ const X = S.slice(0, f), $ = S.slice(f);
496
+ return o.buffer.value = $, o.stats.value = {
497
+ ...o.stats.value,
498
+ enabled: y,
546
499
  isBackfillActive: !1,
547
500
  isRequestInFlight: !1,
548
- requestPage: null,
501
+ page: P.length ? P[P.length - 1] : g ?? a,
502
+ next: F,
549
503
  progress: {
550
504
  collected: 0,
551
505
  target: 0
552
506
  },
553
- cooldownMsTotal: b,
507
+ cooldownMsTotal: w,
554
508
  cooldownMsRemaining: 0,
555
- pageSize: d,
556
- bufferSize: F.length,
509
+ pageSize: f,
510
+ bufferSize: $.length,
557
511
  lastBatch: {
558
- startPage: s,
559
- pages: v,
560
- usedFromBuffer: y,
561
- fetchedFromNetwork: k,
562
- collectedTotal: u.length,
563
- emitted: C.length,
564
- carried: F.length
512
+ startPage: a,
513
+ pages: P,
514
+ usedFromBuffer: N,
515
+ fetchedFromNetwork: L,
516
+ collectedTotal: S.length,
517
+ emitted: X.length,
518
+ carried: $.length
565
519
  },
566
520
  totals: {
567
- pagesFetched: l.stats.value.totals.pagesFetched + v.length,
568
- itemsFetchedFromNetwork: l.stats.value.totals.itemsFetchedFromNetwork + k
521
+ pagesFetched: o.stats.value.totals.pagesFetched + P.length,
522
+ itemsFetchedFromNetwork: o.stats.value.totals.itemsFetchedFromNetwork + L
569
523
  }
570
- }, { batchItems: C, pages: v, nextPage: p };
524
+ }, { batchItems: X, pages: P, nextPage: F };
571
525
  }
572
526
  return { loadBackfillBatch: i };
573
527
  }
574
- function Rn(l) {
575
- const M = l.columnCount, i = l.columnWidth, s = l.gapX, d = l.gapY, S = l.headerHeight, b = l.footerHeight, u = l.bucketPx, y = Array.from({ length: M }, () => 0), v = new Array(l.items.length), p = new Array(l.items.length), k = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
576
- let C = 0;
577
- for (let F = 0; F < l.items.length; F += 1) {
578
- const H = l.items[F];
579
- H?.id && _.set(H.id, F);
580
- let A = 0;
581
- for (let h = 1; h < y.length; h += 1)
582
- y[h] < y[A] && (A = h);
583
- const ie = A * (i + s), Y = y[A], q = Pn(H, i) + S + b;
584
- v[F] = { x: ie, y: Y }, p[F] = q, y[A] = Y + q + d, C = Math.max(C, Y + q);
585
- const Z = Math.floor(Y / u), ee = Math.floor((Y + q) / u);
586
- for (let h = Z; h <= ee; h += 1) {
587
- const T = k.get(h);
588
- T ? T.push(F) : k.set(h, [F]);
528
+ function An(o) {
529
+ const M = o.columnCount, i = o.columnWidth, a = o.gapX, f = o.gapY, y = o.headerHeight, w = o.footerHeight, g = o.bucketPx, d = Array.from({ length: M }, () => 0), p = new Array(o.items.length), b = new Array(o.items.length), S = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
530
+ let P = 0;
531
+ for (let F = 0; F < o.items.length; F += 1) {
532
+ const L = o.items[F];
533
+ L?.id && N.set(L.id, F);
534
+ let R = 0;
535
+ for (let u = 1; u < d.length; u += 1)
536
+ d[u] < d[R] && (R = u);
537
+ const X = R * (i + a), $ = d[R], H = En(L, i) + y + w;
538
+ p[F] = { x: X, y: $ }, b[F] = H, d[R] = $ + H + f, P = Math.max(P, $ + H);
539
+ const q = Math.floor($ / g), ae = Math.floor(($ + H) / g);
540
+ for (let u = q; u <= ae; u += 1) {
541
+ const I = S.get(u);
542
+ I ? I.push(F) : S.set(u, [F]);
589
543
  }
590
544
  }
591
- return { positions: v, heights: p, buckets: k, contentHeight: C, indexById: _ };
545
+ return { positions: p, heights: b, buckets: S, contentHeight: P, indexById: N };
592
546
  }
593
- function An(l) {
594
- const M = l.itemCount;
547
+ function Cn(o) {
548
+ const M = o.itemCount;
595
549
  if (!M) return [];
596
- if (l.viewportHeight <= 0) return Array.from({ length: M }, (y, v) => v);
597
- const i = Math.max(0, l.scrollTop - l.overscanPx), s = l.scrollTop + l.viewportHeight + l.overscanPx, d = Math.floor(i / l.bucketPx), S = Math.floor(s / l.bucketPx), b = /* @__PURE__ */ new Set();
598
- for (let y = d; y <= S; y += 1) {
599
- const v = l.buckets.get(y);
600
- if (v)
601
- for (const p of v) b.add(p);
550
+ if (o.viewportHeight <= 0) return Array.from({ length: M }, (d, p) => p);
551
+ const i = Math.max(0, o.scrollTop - o.overscanPx), a = o.scrollTop + o.viewportHeight + o.overscanPx, f = Math.floor(i / o.bucketPx), y = Math.floor(a / o.bucketPx), w = /* @__PURE__ */ new Set();
552
+ for (let d = f; d <= y; d += 1) {
553
+ const p = o.buckets.get(d);
554
+ if (p)
555
+ for (const b of p) w.add(b);
602
556
  }
603
- const u = Array.from(b);
604
- return u.sort((y, v) => y - v), u;
557
+ const g = Array.from(w);
558
+ return g.sort((d, p) => d - p), g;
605
559
  }
606
- const Bn = { class: "hidden" }, Cn = {
560
+ const Nn = { class: "hidden" }, Hn = {
607
561
  key: 0,
608
562
  class: "flex h-full items-center justify-center"
609
- }, Nn = {
563
+ }, Vn = {
610
564
  key: 1,
611
565
  class: "text-sm font-medium text-red-700"
612
- }, Hn = ["onMouseenter", "onMouseleave"], Ln = {
566
+ }, zn = ["onMouseenter", "onMouseleave"], Ln = {
613
567
  key: 0,
614
568
  class: "pointer-events-auto absolute inset-0 z-10"
615
- }, Vn = { class: "relative" }, $n = {
569
+ }, $n = { class: "relative" }, Dn = {
616
570
  key: 0,
617
571
  class: "pointer-events-auto absolute inset-0 z-10"
618
- }, zn = { class: "mt-4 pb-2 text-center text-xs text-slate-600" }, Dn = {
572
+ }, On = { class: "mt-4 pb-2 text-center text-xs text-slate-600" }, Yn = {
619
573
  key: 0,
620
574
  class: "inline-flex items-center justify-center gap-2"
621
- }, qn = { key: 1 }, On = { key: 2 }, Ct = 100, Yn = 200, Nt = 600, Ht = 300, Lt = 600, Vt = 600, Xn = 400, jn = 5, Un = 1e3, Wn = /* @__PURE__ */ Pe({
575
+ }, qn = { key: 1 }, Xn = { key: 2 }, At = 100, jn = 200, Ct = 600, Nt = 300, Ht = 600, Vt = 600, Un = 400, Wn = 5, Gn = 1e3, Kn = /* @__PURE__ */ xe({
622
576
  inheritAttrs: !1,
623
577
  __name: "Masonry",
624
- props: /* @__PURE__ */ un({
578
+ props: /* @__PURE__ */ fn({
625
579
  getContent: {},
626
580
  mode: {},
627
581
  pageSize: {},
@@ -637,10 +591,10 @@ const Bn = { class: "hidden" }, Cn = {
637
591
  headerHeight: {},
638
592
  footerHeight: {},
639
593
  overscanPx: {}
640
- }, hn),
641
- emits: ["update:items", "preloaded", "failures"],
642
- setup(l, { expose: M, emit: i }) {
643
- const s = l, d = i, S = cn(), b = Pe({
594
+ }, pn),
595
+ emits: ["update:items", "preloaded", "failures", "removed"],
596
+ setup(o, { expose: M, emit: i }) {
597
+ const a = o, f = i, y = dn(), w = xe({
644
598
  name: "SlotRenderer",
645
599
  props: {
646
600
  slotFn: {
@@ -658,281 +612,282 @@ const Bn = { class: "hidden" }, Cn = {
658
612
  return n ? n(e.slotProps) : null;
659
613
  };
660
614
  }
661
- }), u = Pt(null), y = c(null);
662
- function v(e) {
663
- y.value = e;
664
- }
615
+ }), g = Tt(null), d = v(null);
665
616
  function p(e) {
666
- y.value === e && (y.value = null);
617
+ d.value = e;
667
618
  }
668
- fn(Dt, (e) => {
669
- u.value || (u.value = e);
670
- });
671
- const k = [], _ = [];
672
- let C = null, F = null;
673
- function H() {
674
- if (!k.length) return;
675
- const e = k.splice(0, k.length);
676
- d("preloaded", e);
677
- }
678
- function A() {
679
- if (!_.length) return;
680
- const e = _.splice(0, _.length);
681
- d("failures", e);
682
- }
683
- function ie() {
684
- C || (C = setTimeout(() => {
685
- C = null, H();
686
- }, Ct));
619
+ function b(e) {
620
+ d.value === e && (d.value = null);
687
621
  }
688
- function Y() {
622
+ vn($t, (e) => {
623
+ g.value || (g.value = e);
624
+ });
625
+ const S = [], N = [];
626
+ let P = null, F = null;
627
+ function L() {
628
+ if (!S.length) return;
629
+ const e = S.splice(0, S.length);
630
+ f("preloaded", e);
631
+ }
632
+ function R() {
633
+ if (!N.length) return;
634
+ const e = N.splice(0, N.length);
635
+ f("failures", e);
636
+ }
637
+ function X() {
638
+ P || (P = setTimeout(() => {
639
+ P = null, L();
640
+ }, At));
641
+ }
642
+ function $() {
689
643
  F || (F = setTimeout(() => {
690
- F = null, A();
691
- }, Ct));
644
+ F = null, R();
645
+ }, At));
692
646
  }
693
- function q(e) {
694
- u.value?.onPreloaded?.(e), k.push(e), ie();
647
+ function H(e) {
648
+ g.value?.onPreloaded?.(e), S.push(e), X();
695
649
  }
696
- function Z(e) {
697
- u.value?.onFailed?.(e), _.push(e), Y();
650
+ function q(e) {
651
+ g.value?.onFailed?.(e), N.push(e), $();
698
652
  }
699
- lt(() => {
700
- if (!u.value)
653
+ Qe(() => {
654
+ if (!g.value)
701
655
  throw new Error("[Masonry] Missing <MasonryItem> definition. Add <MasonryItem> as a child of <Masonry>.");
702
656
  });
703
- const ee = x(() => {
704
- const { class: e, ...n } = S;
657
+ const ae = k(() => {
658
+ const { class: e, ...n } = y;
705
659
  return n;
706
- }), h = c(null), T = c(0), N = c(0), K = c(0);
707
- let Ee;
708
- const te = x(() => s.gapX), J = x(() => s.gapY);
709
- function ue(e) {
660
+ }), u = v(null), I = v(0), B = v(0), j = v(0);
661
+ let re;
662
+ const ee = k(() => a.gapX), Pe = k(() => a.gapY);
663
+ function Ee(e) {
710
664
  if (!e) return 0;
711
- const n = Math.max(0, te.value);
665
+ const n = Math.max(0, ee.value);
712
666
  return Math.max(0, e.clientWidth - n);
713
667
  }
714
- const X = x(() => s.headerHeight), O = x(() => s.footerHeight), ne = x(() => u.value?.header), ce = x(() => u.value?.loader), we = x(() => u.value?.footer), Re = x(() => u.value?.overlay), Ne = x(() => u.value?.error), be = x(() => !!ne.value), xe = x(() => !!we.value), Se = x(() => !!Re.value), He = x(() => {
715
- if (X.value > 0) return { height: `${X.value}px` };
716
- }), Le = x(() => {
717
- if (O.value > 0) return { height: `${O.value}px` };
718
- }), fe = c([]), Me = c([]), ke = c(/* @__PURE__ */ new Map()), Ae = c(0), de = c(/* @__PURE__ */ new Map());
719
- function Ue(e) {
668
+ const G = k(() => a.headerHeight), K = k(() => a.footerHeight), ke = k(() => g.value?.header), ge = k(() => g.value?.loader), s = k(() => g.value?.footer), x = k(() => g.value?.overlay), J = k(() => g.value?.error), Be = k(() => !!ke.value), Me = k(() => !!s.value), tt = k(() => !!x.value), nt = k(() => {
669
+ if (G.value > 0) return { height: `${G.value}px` };
670
+ }), ot = k(() => {
671
+ if (K.value > 0) return { height: `${K.value}px` };
672
+ }), Se = v([]), Oe = v([]), lt = v(/* @__PURE__ */ new Map()), at = v(0), Re = v(/* @__PURE__ */ new Map());
673
+ function Ot(e) {
720
674
  const n = typeof e == "number" && Number.isFinite(e) ? e : 0;
721
- return K.value + N.value + Math.max(0, n);
675
+ return j.value + B.value + Math.max(0, n);
722
676
  }
723
- const j = c(/* @__PURE__ */ new Set()), a = c(/* @__PURE__ */ new Set()), f = /* @__PURE__ */ new Set(), D = c(/* @__PURE__ */ new Map());
724
- function We(e) {
677
+ const se = v(/* @__PURE__ */ new Set()), ie = v(/* @__PURE__ */ new Set()), Ae = /* @__PURE__ */ new Set(), Ie = v(/* @__PURE__ */ new Map());
678
+ function Yt(e) {
725
679
  return Number.isFinite(e) ? Math.max(0, Math.min(250, e)) : 0;
726
680
  }
727
- function Ve(e) {
728
- if (!a.value.has(e)) return;
729
- const n = D.value.get(e) ?? 0;
681
+ function qt(e) {
682
+ if (!ie.value.has(e)) return;
683
+ const n = Ie.value.get(e) ?? 0;
730
684
  if (!(n <= 0))
731
685
  return `${n}ms`;
732
686
  }
733
- const $e = c(/* @__PURE__ */ new Map()), oe = c(/* @__PURE__ */ new Set()), le = c([]);
734
- function Ot(e) {
735
- const n = $e.value.get(e);
687
+ const Ce = v(/* @__PURE__ */ new Map()), te = v(/* @__PURE__ */ new Set()), ne = v([]);
688
+ function Xt(e) {
689
+ const n = Ce.value.get(e);
736
690
  return n || { dx: 0, dy: 0 };
737
691
  }
738
- function Yt(e) {
739
- if (a.value.has(e)) return `transform ${Lt}ms ease-out`;
740
- if (oe.value.has(e)) return `transform ${Ht}ms ease-out`;
692
+ function jt(e) {
693
+ if (ie.value.has(e)) return `transform ${Ht}ms ease-out`;
694
+ if (te.value.has(e)) return `transform ${Nt}ms ease-out`;
741
695
  }
742
- function Xt(e) {
743
- const t = g.value[e]?.id, o = fe.value[e] ?? { x: 0, y: 0 }, r = Me.value[e] ?? 0, m = r > 0 ? r : Ce.value, w = o.x, B = t && j.value.has(t) ? Ue(m) : o.y, V = t ? Ot(t) : { dx: 0, dy: 0 };
744
- return `translate3d(${w + V.dx}px,${B + V.dy}px,0)`;
696
+ function Ut(e) {
697
+ const t = m.value[e]?.id, l = Se.value[e] ?? { x: 0, y: 0 }, r = Oe.value[e] ?? 0, c = r > 0 ? r : Te.value, h = l.x, E = t && se.value.has(t) ? Ot(c) : l.y, O = t ? Xt(t) : { dx: 0, dy: 0 };
698
+ return `translate3d(${h + O.dx}px,${E + O.dy}px,0)`;
745
699
  }
746
- function Ie(e) {
700
+ function pe(e) {
747
701
  (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (t) => setTimeout(() => t(0), 0))(() => e());
748
702
  }
749
- function jt(e) {
750
- Ie(() => Ie(e));
703
+ function Wt(e) {
704
+ pe(() => pe(e));
751
705
  }
752
- const st = /* @__PURE__ */ new Set();
753
- function it(e) {
706
+ const rt = /* @__PURE__ */ new Set();
707
+ function st(e) {
754
708
  return typeof e == "number" && Number.isFinite(e) && e > 0;
755
709
  }
756
- function ze(e) {
710
+ function Ne(e) {
757
711
  if (!Array.isArray(e) || e.length === 0) return;
758
- const n = new Set(j.value);
712
+ const n = new Set(se.value);
759
713
  let t = !1;
760
- for (const o of e) {
761
- const r = o?.id;
714
+ for (const l of e) {
715
+ const r = l?.id;
762
716
  if (r) {
763
- if (!st.has(r)) {
764
- const m = o?.width, w = o?.height;
765
- (!it(m) || !it(w)) && (st.add(r), console.warn(
766
- `[Masonry] Item "${r}" has invalid dimensions (width=${String(m)}, height=${String(
767
- w
717
+ if (!rt.has(r)) {
718
+ const c = l?.width, h = l?.height;
719
+ (!st(c) || !st(h)) && (rt.add(r), console.warn(
720
+ `[Masonry] Item "${r}" has invalid dimensions (width=${String(c)}, height=${String(
721
+ h
768
722
  )}); layout expects { id, width, height }.`
769
723
  ));
770
724
  }
771
725
  n.has(r) || (n.add(r), t = !0);
772
726
  }
773
727
  }
774
- t && (j.value = n);
728
+ t && (se.value = n);
775
729
  }
776
- function ut() {
730
+ function it() {
777
731
  const e = /* @__PURE__ */ new Map();
778
- for (const n of tt.value) {
779
- const o = g.value[n]?.id;
780
- if (!o) continue;
781
- const r = fe.value[n];
782
- r && e.set(o, { x: r.x, y: r.y });
732
+ for (const n of We.value) {
733
+ const l = m.value[n]?.id;
734
+ if (!l) continue;
735
+ const r = Se.value[n];
736
+ r && e.set(l, { x: r.x, y: r.y });
783
737
  }
784
738
  return e;
785
739
  }
786
- function ct(e, n) {
740
+ function ut(e, n) {
787
741
  if (!e.size) return;
788
- const t = /* @__PURE__ */ new Map(), o = [];
789
- for (const [m, w] of e.entries()) {
790
- if (n?.has(m)) continue;
791
- const B = de.value.get(m);
792
- if (B == null) continue;
793
- const V = fe.value[B];
794
- if (!V) continue;
795
- const L = w.x - V.x, E = w.y - V.y;
796
- (L || E) && (t.set(m, { dx: L, dy: E }), o.push(m));
742
+ const t = /* @__PURE__ */ new Map(), l = [];
743
+ for (const [c, h] of e.entries()) {
744
+ if (n?.has(c)) continue;
745
+ const E = Re.value.get(c);
746
+ if (E == null) continue;
747
+ const O = Se.value[E];
748
+ if (!O) continue;
749
+ const Y = h.x - O.x, z = h.y - O.y;
750
+ (Y || z) && (t.set(c, { dx: Y, dy: z }), l.push(c));
797
751
  }
798
752
  if (!t.size) return;
799
- $e.value = t;
800
- const r = new Set(oe.value);
801
- for (const m of o) r.delete(m);
802
- oe.value = r, Ie(() => {
803
- oe.value = /* @__PURE__ */ new Set([...oe.value, ...o]), Ie(() => {
804
- $e.value = /* @__PURE__ */ new Map();
753
+ Ce.value = t;
754
+ const r = new Set(te.value);
755
+ for (const c of l) r.delete(c);
756
+ te.value = r, pe(() => {
757
+ te.value = /* @__PURE__ */ new Set([...te.value, ...l]), pe(() => {
758
+ Ce.value = /* @__PURE__ */ new Map();
805
759
  });
806
760
  }), setTimeout(() => {
807
- const m = new Set(oe.value);
808
- for (const w of o) m.delete(w);
809
- oe.value = m;
810
- }, Ht);
811
- }
812
- const ve = c(!0), me = c(!1), Fe = c("");
813
- let z = 0, Ge = 0, Ke = 0;
814
- function ft(e) {
761
+ const c = new Set(te.value);
762
+ for (const h of l) c.delete(h);
763
+ te.value = c;
764
+ }, Nt);
765
+ }
766
+ const ue = v(!0), ce = v(!1), ye = v("");
767
+ let D = 0, Ye = 0, He = 0, Ve = 0, Fe = !1;
768
+ function ct(e) {
815
769
  return e instanceof Error && e.name === "AbortError";
816
770
  }
817
- function dt() {
771
+ function ft() {
818
772
  const e = new Error("aborted");
819
773
  return e.name = "AbortError", e;
820
774
  }
821
- function Ut(e) {
775
+ function Gt(e) {
822
776
  return new Promise((n) => setTimeout(n, e));
823
777
  }
824
- async function vt(e, n) {
778
+ async function dt(e, n) {
825
779
  let t = 0;
826
780
  for (; ; ) {
827
- if (n !== z) throw dt();
781
+ if (n !== D) throw ft();
828
782
  try {
829
- return await s.getContent(e);
830
- } catch (o) {
831
- if (n !== z) throw dt();
832
- if (t >= jn) throw o;
833
- t += 1, await Ut(t * Un);
783
+ return await a.getContent(e);
784
+ } catch (l) {
785
+ if (n !== D) throw ft();
786
+ if (t >= Wn) throw l;
787
+ t += 1, await Gt(t * Gn);
834
788
  }
835
789
  }
836
790
  }
837
- const W = c([]), mt = c([]), Je = c([]), $ = c(s.page), De = c([]);
838
- let he = null, ge = null, qe = 0;
839
- function Wt(e) {
791
+ const W = v([]), vt = v([]), qe = v([]), V = v(a.page), ze = v([]);
792
+ let fe = null, de = null, Le = 0;
793
+ function Kt(e) {
840
794
  let n = -1;
841
795
  for (const t of e) {
842
- const o = t?.originalIndex;
843
- Be(o) && o > n && (n = o);
796
+ const l = t?.originalIndex;
797
+ _e(l) && l > n && (n = l);
844
798
  }
845
- qe = n + 1;
799
+ Le = n + 1;
846
800
  }
847
- function _e(e) {
801
+ function we(e) {
848
802
  for (const n of e)
849
- !n || typeof n != "object" || n.id && n.originalIndex == null && (n.originalIndex = qe, qe += 1);
803
+ !n || typeof n != "object" || n.id && n.originalIndex == null && (n.originalIndex = Le, Le += 1);
850
804
  }
851
- const pe = /* @__PURE__ */ new Map(), ye = [];
852
- function Be(e) {
805
+ const ve = /* @__PURE__ */ new Map(), me = [];
806
+ function _e(e) {
853
807
  return typeof e == "number" && Number.isFinite(e);
854
808
  }
855
- function Gt(e, n) {
809
+ function Jt(e, n) {
856
810
  if (!n.length) return e;
857
811
  const t = /* @__PURE__ */ new Set();
858
- for (const w of e) {
859
- const B = w?.id;
860
- B && t.add(B);
812
+ for (const h of e) {
813
+ const E = h?.id;
814
+ E && t.add(E);
861
815
  }
862
- const o = [];
863
- for (const w of n) {
864
- const B = w?.id;
865
- B && (t.has(B) || (o.push(w), t.add(B)));
816
+ const l = [];
817
+ for (const h of n) {
818
+ const E = h?.id;
819
+ E && (t.has(E) || (l.push(h), t.add(E)));
866
820
  }
867
- if (!o.length) return e;
868
- const r = o.slice().sort((w, B) => {
869
- const V = Be(w.originalIndex) ? w.originalIndex : Number.POSITIVE_INFINITY, L = Be(B.originalIndex) ? B.originalIndex : Number.POSITIVE_INFINITY;
870
- return V - L;
871
- }), m = e.slice();
872
- for (const w of r) {
873
- const B = w.originalIndex;
874
- if (!Be(B)) {
875
- m.push(w);
821
+ if (!l.length) return e;
822
+ const r = l.slice().sort((h, E) => {
823
+ const O = _e(h.originalIndex) ? h.originalIndex : Number.POSITIVE_INFINITY, Y = _e(E.originalIndex) ? E.originalIndex : Number.POSITIVE_INFINITY;
824
+ return O - Y;
825
+ }), c = e.slice();
826
+ for (const h of r) {
827
+ const E = h.originalIndex;
828
+ if (!_e(E)) {
829
+ c.push(h);
876
830
  continue;
877
831
  }
878
- let V = 0, L = m.length;
879
- for (; V < L; ) {
880
- const E = V + L >> 1, ae = m[E]?.originalIndex;
881
- (Be(ae) ? ae : Number.POSITIVE_INFINITY) <= B ? V = E + 1 : L = E;
832
+ let O = 0, Y = c.length;
833
+ for (; O < Y; ) {
834
+ const z = O + Y >> 1, A = c[z]?.originalIndex;
835
+ (_e(A) ? A : Number.POSITIVE_INFINITY) <= E ? O = z + 1 : Y = z;
882
836
  }
883
- m.splice(V, 0, w);
837
+ c.splice(O, 0, h);
884
838
  }
885
- return m;
839
+ return c;
886
840
  }
887
- async function ht(e) {
841
+ async function mt(e) {
888
842
  if (!e.length) return;
889
- ze(e);
890
- const n = ut();
891
- g.value = Gt(g.value, e), await Rt(), ct(n);
843
+ Fe = !0, Ne(e);
844
+ const n = it();
845
+ m.value = Jt(m.value, e), await Bt(), ut(n);
892
846
  }
893
- async function Kt(e) {
894
- const t = (Array.isArray(e) ? e : [e]).map(et).filter(Boolean);
847
+ async function Qt(e) {
848
+ const t = (Array.isArray(e) ? e : [e]).map(Ue).filter(Boolean);
895
849
  if (!t.length) return;
896
- const o = [];
850
+ const l = [];
897
851
  for (const r of t) {
898
- const m = pe.get(r);
899
- m && o.push(m);
852
+ const c = ve.get(r);
853
+ c && l.push(c);
900
854
  }
901
- if (o.length) {
902
- await ht(o);
903
- for (const r of o)
904
- r?.id && pe.delete(r.id);
855
+ if (l.length) {
856
+ await mt(l);
857
+ for (const r of l)
858
+ r?.id && ve.delete(r.id);
905
859
  }
906
860
  }
907
- async function Jt() {
908
- const e = ye.pop();
861
+ async function Zt() {
862
+ const e = me.pop();
909
863
  if (!e?.length) return;
910
864
  const n = [];
911
865
  for (const t of e) {
912
- const o = pe.get(t);
913
- o && n.push(o);
866
+ const l = ve.get(t);
867
+ l && n.push(l);
914
868
  }
915
869
  if (n.length) {
916
- await ht(n);
870
+ await mt(n);
917
871
  for (const t of n)
918
- t?.id && pe.delete(t.id);
872
+ t?.id && ve.delete(t.id);
919
873
  }
920
874
  }
921
- function Qt(e) {
922
- const t = (Array.isArray(e) ? e : [e]).map(et).filter(Boolean);
875
+ function en(e) {
876
+ const t = (Array.isArray(e) ? e : [e]).map(Ue).filter(Boolean);
923
877
  if (!t.length) return;
924
- const o = new Set(t);
925
- for (const r of o) pe.delete(r);
926
- for (let r = ye.length - 1; r >= 0; r -= 1) {
927
- const w = ye[r].filter((B) => !o.has(B));
928
- w.length ? ye[r] = w : ye.splice(r, 1);
878
+ const l = new Set(t);
879
+ for (const r of l) ve.delete(r);
880
+ for (let r = me.length - 1; r >= 0; r -= 1) {
881
+ const h = me[r].filter((E) => !l.has(E));
882
+ h.length ? me[r] = h : me.splice(r, 1);
929
883
  }
930
884
  }
931
- const Qe = Pt({
885
+ const Xe = Tt({
932
886
  enabled: !1,
933
887
  isBackfillActive: !1,
934
888
  isRequestInFlight: !1,
935
- requestPage: null,
889
+ page: a.page,
890
+ next: a.page,
936
891
  progress: {
937
892
  collected: 0,
938
893
  target: 0
@@ -946,93 +901,95 @@ const Bn = { class: "hidden" }, Cn = {
946
901
  pagesFetched: 0,
947
902
  itemsFetchedFromNetwork: 0
948
903
  }
949
- }), gt = En({
950
- getContent: (e) => vt(e, z),
951
- markEnterFromLeft: ze,
952
- buffer: De,
953
- stats: Qe,
954
- isEnabled: () => s.mode === "backfill",
955
- getPageSize: () => s.pageSize,
956
- getRequestDelayMs: () => s.backfillRequestDelayMs
957
- }), Oe = x(() => s.items !== void 0);
958
- re(
959
- () => s.items,
904
+ }), ht = Rn({
905
+ getContent: (e) => dt(e, D),
906
+ markEnterFromLeft: Ne,
907
+ buffer: ze,
908
+ stats: Xe,
909
+ isEnabled: () => a.mode === "backfill",
910
+ getPageSize: () => a.pageSize,
911
+ getRequestDelayMs: () => a.backfillRequestDelayMs,
912
+ getCancelToken: () => Ye
913
+ }), $e = k(() => a.items !== void 0);
914
+ oe(
915
+ () => a.items,
960
916
  (e) => {
961
- Oe.value && (Je.value = Array.isArray(e) ? e : []);
917
+ $e.value && (qe.value = Array.isArray(e) ? e : []);
962
918
  },
963
919
  { immediate: !0 }
964
920
  );
965
- const g = x({
921
+ const m = k({
966
922
  get() {
967
- return Oe.value ? Je.value : mt.value;
923
+ return $e.value ? qe.value : vt.value;
968
924
  },
969
925
  set(e) {
970
- Oe.value ? (Je.value = e, d("update:items", e)) : mt.value = e;
926
+ $e.value ? (qe.value = e, f("update:items", e)) : vt.value = e;
971
927
  }
972
- }), Te = c(!1), Ze = c(!1);
973
- async function pt(e) {
974
- const n = await vt(e, z);
975
- return _e(n.items), ze(n.items), { items: n.items, nextPage: n.nextPage };
928
+ }), be = v(!1), je = v(!1);
929
+ async function gt(e) {
930
+ const n = await dt(e, D);
931
+ return we(n.items), Ne(n.items), { items: n.items, nextPage: n.nextPage };
976
932
  }
977
- function et(e) {
933
+ function Ue(e) {
978
934
  return e ? typeof e == "string" ? e : e?.id : null;
979
935
  }
980
- async function yt(e) {
981
- const t = (Array.isArray(e) ? e : [e]).map(et).filter(Boolean);
936
+ async function pt(e) {
937
+ const t = (Array.isArray(e) ? e : [e]).map(Ue).filter(Boolean);
982
938
  if (!t.length) return;
983
- const o = new Set(t), r = [];
984
- for (const L of o) {
985
- const E = de.value.get(L);
986
- if (E == null) continue;
987
- const ae = g.value[E];
988
- ae && (pe.set(L, ae), r.push(L));
939
+ const l = new Set(t), r = [], c = [];
940
+ for (const z of l) {
941
+ const A = Re.value.get(z);
942
+ if (A == null) continue;
943
+ const he = m.value[A];
944
+ he && (ve.set(z, he), c.push(z), r.push(he));
989
945
  }
990
- r.length && ye.push(r);
991
- const m = ut(), w = Ce.value, B = K.value + N.value, V = [];
992
- for (const L of o) {
993
- const E = de.value.get(L);
994
- if (E == null) continue;
995
- const ae = g.value[E];
996
- if (!ae) continue;
997
- const Xe = fe.value[E] ?? { x: 0, y: 0 }, Ft = Me.value[E] ?? w, sn = Math.max(Xe.y, B);
998
- V.push({
999
- id: L,
1000
- item: ae,
1001
- fromX: Xe.x,
1002
- fromY: Xe.y,
1003
- toY: sn + Math.max(0, Ft),
1004
- width: w,
1005
- height: Ft,
946
+ c.length && (me.push(c), Fe = !0);
947
+ const h = it(), E = Te.value, O = j.value + B.value, Y = [];
948
+ for (const z of l) {
949
+ const A = Re.value.get(z);
950
+ if (A == null) continue;
951
+ const he = m.value[A];
952
+ if (!he) continue;
953
+ const Je = Se.value[A] ?? { x: 0, y: 0 }, It = Oe.value[A] ?? E, cn = Math.max(Je.y, O);
954
+ Y.push({
955
+ id: z,
956
+ item: he,
957
+ fromX: Je.x,
958
+ fromY: Je.y,
959
+ toY: cn + Math.max(0, It),
960
+ width: E,
961
+ height: It,
1006
962
  leaving: !0
1007
963
  });
1008
964
  }
1009
- if (V.length && (le.value = [...le.value, ...V]), g.value = g.value.filter((L) => {
1010
- const E = L?.id;
1011
- return !E || !o.has(E);
1012
- }), await Rt(), ct(m, o), V.length) {
1013
- const L = new Set(V.map((E) => E.id));
1014
- Ie(() => {
1015
- le.value = le.value.map(
1016
- (E) => L.has(E.id) ? { ...E, leaving: !1 } : E
965
+ if (Y.length && (ne.value = [...ne.value, ...Y]), m.value = m.value.filter((z) => {
966
+ const A = z?.id;
967
+ return !A || !l.has(A);
968
+ }), await Bt(), ut(h, l), Y.length) {
969
+ const z = new Set(Y.map((A) => A.id));
970
+ pe(() => {
971
+ ne.value = ne.value.map(
972
+ (A) => z.has(A.id) ? { ...A, leaving: !1 } : A
1017
973
  ), setTimeout(() => {
1018
- le.value = le.value.filter((E) => !L.has(E.id));
974
+ ne.value = ne.value.filter((A) => !z.has(A.id));
1019
975
  }, Vt);
1020
976
  });
1021
977
  }
978
+ r.length && f("removed", { items: r, ids: c });
1022
979
  }
1023
- async function Ye(e) {
1024
- return yt(e);
980
+ async function De(e) {
981
+ return pt(e);
1025
982
  }
1026
- function Zt() {
1027
- z += 1, he = null, ge = null, ve.value = !1, me.value = !1;
983
+ function tn() {
984
+ D += 1, Ye += 1, fe = null, de = null, ue.value = !1, ce.value = !1;
1028
985
  }
1029
986
  M({
1030
- remove: yt,
1031
- restore: Kt,
1032
- undo: Jt,
1033
- forget: Qt,
1034
- loadNextPage: bt,
1035
- cancel: Zt,
987
+ remove: pt,
988
+ restore: Qt,
989
+ undo: Zt,
990
+ forget: en,
991
+ loadNextPage: wt,
992
+ cancel: tn,
1036
993
  get pagesLoaded() {
1037
994
  return W.value;
1038
995
  },
@@ -1040,147 +997,152 @@ const Bn = { class: "hidden" }, Cn = {
1040
997
  W.value = e;
1041
998
  },
1042
999
  get nextPage() {
1043
- return $.value;
1000
+ return V.value;
1044
1001
  },
1045
1002
  set nextPage(e) {
1046
- $.value = e;
1003
+ V.value = e;
1047
1004
  },
1048
1005
  get isLoading() {
1049
- return ve.value || me.value;
1006
+ return ue.value || ce.value;
1050
1007
  },
1051
1008
  get hasReachedEnd() {
1052
- return s.mode !== "backfill" ? $.value == null : $.value == null && De.value.length === 0;
1009
+ return a.mode !== "backfill" ? V.value == null : V.value == null && ze.value.length === 0;
1053
1010
  },
1054
1011
  get backfillStats() {
1055
- return Qe.value;
1012
+ return Xe.value;
1056
1013
  }
1057
1014
  });
1058
- function wt() {
1059
- const e = Rn({
1060
- items: g.value,
1061
- columnCount: ot.value,
1062
- columnWidth: Ce.value,
1063
- gapX: te.value,
1064
- gapY: J.value,
1065
- headerHeight: X.value,
1066
- footerHeight: O.value,
1067
- bucketPx: Nt
1015
+ function yt() {
1016
+ const e = An({
1017
+ items: m.value,
1018
+ columnCount: Ke.value,
1019
+ columnWidth: Te.value,
1020
+ gapX: ee.value,
1021
+ gapY: Pe.value,
1022
+ headerHeight: G.value,
1023
+ footerHeight: K.value,
1024
+ bucketPx: Ct
1068
1025
  });
1069
- fe.value = e.positions, Me.value = e.heights, ke.value = e.buckets, Ae.value = e.contentHeight, de.value = e.indexById;
1070
- }
1071
- const en = x(() => Math.max(Ae.value, N.value) + Yn), tt = x(() => An({
1072
- itemCount: g.value.length,
1073
- viewportHeight: N.value,
1074
- scrollTop: K.value,
1075
- overscanPx: s.overscanPx,
1076
- bucketPx: Nt,
1077
- buckets: ke.value
1026
+ Se.value = e.positions, Oe.value = e.heights, lt.value = e.buckets, at.value = e.contentHeight, Re.value = e.indexById;
1027
+ }
1028
+ const nn = k(() => Math.max(at.value, B.value) + jn), We = k(() => Cn({
1029
+ itemCount: m.value.length,
1030
+ viewportHeight: B.value,
1031
+ scrollTop: j.value,
1032
+ overscanPx: a.overscanPx,
1033
+ bucketPx: Ct,
1034
+ buckets: lt.value
1078
1035
  }));
1079
- re(
1080
- tt,
1036
+ oe(
1037
+ We,
1081
1038
  (e) => {
1082
1039
  if (!e?.length) return;
1083
- if (Te.value && !Ze.value) {
1084
- const o = [];
1040
+ if (be.value && !je.value) {
1041
+ const l = [];
1085
1042
  for (const r of e) {
1086
- const m = g.value[r];
1087
- m && o.push(m);
1043
+ const c = m.value[r];
1044
+ c && l.push(c);
1088
1045
  }
1089
- o.length && ze(o), Ze.value = !0;
1046
+ l.length && Ne(l), je.value = !0;
1090
1047
  }
1091
1048
  const n = [];
1092
- for (const o of e) {
1093
- const r = g.value[o]?.id;
1094
- r && j.value.has(r) && (f.has(r) || (f.add(r), n.push(r)));
1049
+ for (const l of e) {
1050
+ const r = m.value[l]?.id;
1051
+ r && se.value.has(r) && (Ae.has(r) || (Ae.add(r), n.push(r)));
1095
1052
  }
1096
1053
  if (!n.length) return;
1097
- const t = n.length > 1 ? We(s.enterStaggerMs) : 0;
1054
+ const t = n.length > 1 ? Yt(a.enterStaggerMs) : 0;
1098
1055
  if (t > 0) {
1099
- const o = new Map(D.value);
1056
+ const l = new Map(Ie.value);
1100
1057
  for (let r = 0; r < n.length; r += 1) {
1101
- const m = n[r], w = Math.min(r * t, Xn);
1102
- o.set(m, w);
1058
+ const c = n[r], h = Math.min(r * t, Un);
1059
+ l.set(c, h);
1103
1060
  }
1104
- D.value = o;
1061
+ Ie.value = l;
1105
1062
  }
1106
- Ie(() => {
1107
- const o = new Set(a.value);
1108
- for (const r of n) o.add(r);
1109
- a.value = o;
1110
- }), jt(() => {
1111
- const o = new Set(j.value);
1112
- for (const r of n) o.delete(r);
1113
- j.value = o, setTimeout(() => {
1114
- const r = new Set(a.value), m = new Map(D.value);
1115
- for (const w of n)
1116
- r.delete(w), f.delete(w), m.delete(w);
1117
- a.value = r, D.value = m;
1118
- }, Lt);
1063
+ pe(() => {
1064
+ const l = new Set(ie.value);
1065
+ for (const r of n) l.add(r);
1066
+ ie.value = l;
1067
+ }), Wt(() => {
1068
+ const l = new Set(se.value);
1069
+ for (const r of n) l.delete(r);
1070
+ se.value = l, setTimeout(() => {
1071
+ const r = new Set(ie.value), c = new Map(Ie.value);
1072
+ for (const h of n)
1073
+ r.delete(h), Ae.delete(h), c.delete(h);
1074
+ ie.value = r, Ie.value = c;
1075
+ }, Ht);
1119
1076
  });
1120
1077
  },
1121
1078
  { flush: "post" }
1122
1079
  );
1123
- async function bt() {
1124
- if (he) return he;
1125
- if (ve.value || me.value || s.mode !== "backfill" && $.value == null || s.mode === "backfill" && $.value == null && De.value.length === 0)
1080
+ async function wt() {
1081
+ if (fe) return fe;
1082
+ if (ue.value || ce.value || a.mode !== "backfill" && V.value == null || a.mode === "backfill" && V.value == null && ze.value.length === 0)
1126
1083
  return;
1127
- const e = z;
1084
+ const e = D;
1128
1085
  let n = null;
1129
1086
  return n = (async () => {
1130
1087
  try {
1131
- if (me.value = !0, Fe.value = "", s.mode === "backfill") {
1132
- const r = await gt.loadBackfillBatch($.value);
1133
- if (e !== z) return;
1134
- r.pages.length && (W.value = [...W.value, ...r.pages]), _e(r.batchItems), g.value = [...g.value, ...r.batchItems], $.value = r.nextPage;
1088
+ if (ce.value = !0, ye.value = "", a.mode === "backfill") {
1089
+ const r = await ht.loadBackfillBatch(V.value);
1090
+ if (e !== D) return;
1091
+ r.pages.length && (W.value = [...W.value, ...r.pages]), we(r.batchItems), m.value = [...m.value, ...r.batchItems], V.value = r.nextPage;
1135
1092
  return;
1136
1093
  }
1137
- const t = $.value;
1094
+ const t = V.value;
1138
1095
  if (t == null) return;
1139
- const o = await pt(t);
1140
- if (e !== z) return;
1141
- W.value = [...W.value, t], _e(o.items), g.value = [...g.value, ...o.items], $.value = o.nextPage;
1096
+ const l = await gt(t);
1097
+ if (e !== D) return;
1098
+ W.value = [...W.value, t], we(l.items), m.value = [...m.value, ...l.items], V.value = l.nextPage;
1142
1099
  } catch (t) {
1143
- if (e !== z || ft(t)) return;
1144
- Fe.value = t instanceof Error ? t.message : String(t);
1100
+ if (e !== D || ct(t)) return;
1101
+ ye.value = t instanceof Error ? t.message : String(t);
1145
1102
  } finally {
1146
- e === z && (me.value = !1), he === n && (he = null);
1103
+ e === D && (ce.value = !1), fe === n && (fe = null);
1147
1104
  }
1148
- })(), he = n, n;
1105
+ })(), fe = n, n;
1149
1106
  }
1150
- function tn() {
1151
- const e = h.value;
1107
+ function on() {
1108
+ const e = u.value;
1152
1109
  if (!e) return;
1153
- const n = e.scrollTop, t = e.clientHeight, o = e.scrollHeight;
1154
- K.value = n, N.value = t;
1155
- const r = Ge, m = Ke, w = m > 0 && o < m;
1156
- if (Ge = n, Ke = o, w && n <= r) return;
1157
- o - (n + t) <= s.prefetchThresholdPx && bt();
1158
- }
1159
- function xt() {
1160
- return h.value;
1161
- }
1162
- function St(e) {
1163
- T.value = ue(e), N.value = e.clientHeight;
1164
- }
1165
- function nn() {
1166
- typeof ResizeObserver > "u" || (Ee = new ResizeObserver(() => {
1167
- const e = xt();
1168
- e && St(e);
1110
+ const n = e.scrollTop, t = e.clientHeight, l = e.scrollHeight;
1111
+ j.value = n, B.value = t;
1112
+ const r = He, c = Ve, h = n > r, E = c > 0 && l < c;
1113
+ if (He = n, Ve = l, Fe) {
1114
+ if (!h) return;
1115
+ Fe = !1;
1116
+ }
1117
+ if (E && !h) return;
1118
+ l - (n + t) <= a.prefetchThresholdPx && wt();
1119
+ }
1120
+ function bt() {
1121
+ return u.value;
1122
+ }
1123
+ function xt(e) {
1124
+ I.value = Ee(e), B.value = e.clientHeight;
1125
+ }
1126
+ function ln() {
1127
+ typeof ResizeObserver > "u" || (re = new ResizeObserver(() => {
1128
+ const e = bt();
1129
+ e && xt(e);
1169
1130
  }));
1170
1131
  }
1171
- function on() {
1132
+ function an() {
1172
1133
  return {
1173
- enabled: s.mode === "backfill",
1134
+ enabled: a.mode === "backfill",
1174
1135
  isBackfillActive: !1,
1175
1136
  isRequestInFlight: !1,
1176
- requestPage: null,
1137
+ page: a.page,
1138
+ next: a.page,
1177
1139
  progress: {
1178
1140
  collected: 0,
1179
1141
  target: 0
1180
1142
  },
1181
1143
  cooldownMsRemaining: 0,
1182
- cooldownMsTotal: rt(s.backfillRequestDelayMs),
1183
- pageSize: qt(s.pageSize),
1144
+ cooldownMsTotal: et(a.backfillRequestDelayMs),
1145
+ pageSize: Dt(a.pageSize),
1184
1146
  bufferSize: 0,
1185
1147
  lastBatch: null,
1186
1148
  totals: {
@@ -1189,127 +1151,127 @@ const Bn = { class: "hidden" }, Cn = {
1189
1151
  }
1190
1152
  };
1191
1153
  }
1192
- function Mt() {
1193
- z += 1, he = null, ge = null, Ge = 0, Ke = 0, qe = 0, pe.clear(), ye.length = 0, j.value = /* @__PURE__ */ new Set(), a.value = /* @__PURE__ */ new Set(), f.clear(), $e.value = /* @__PURE__ */ new Map(), oe.value = /* @__PURE__ */ new Set(), le.value = [], W.value = [], $.value = null, De.value = [], Qe.value = on(), ve.value = !0, me.value = !1, Fe.value = "", Ze.value = !1;
1154
+ function kt() {
1155
+ D += 1, Ye += 1, fe = null, de = null, He = 0, Ve = 0, Fe = !1, Le = 0, ve.clear(), me.length = 0, se.value = /* @__PURE__ */ new Set(), ie.value = /* @__PURE__ */ new Set(), Ae.clear(), Ce.value = /* @__PURE__ */ new Map(), te.value = /* @__PURE__ */ new Set(), ne.value = [], W.value = [], V.value = null, ze.value = [], Xe.value = an(), ue.value = !0, ce.value = !1, ye.value = "", je.value = !1;
1194
1156
  }
1195
- function kt(e) {
1196
- Mt(), g.value = [], $.value = e;
1157
+ function Mt(e) {
1158
+ kt(), m.value = [], V.value = e;
1197
1159
  }
1198
- function ln(e) {
1199
- const n = Array.isArray(e) ? e : [e], t = [], o = /* @__PURE__ */ new Set();
1160
+ function rn(e) {
1161
+ const n = Array.isArray(e) ? e : [e], t = [], l = /* @__PURE__ */ new Set();
1200
1162
  for (const r of n) {
1201
1163
  if (r == null) continue;
1202
- const m = typeof r == "string" ? `s:${r}` : `n:${String(r)}`;
1203
- o.has(m) || (o.add(m), t.push(r));
1164
+ const c = typeof r == "string" ? `s:${r}` : `n:${String(r)}`;
1165
+ l.has(c) || (l.add(c), t.push(r));
1204
1166
  }
1205
1167
  return t;
1206
1168
  }
1207
- function nt(e) {
1208
- Mt(), W.value = e ? ln(e) : [], $.value = s.page, ve.value = !1, Wt(g.value), _e(g.value);
1169
+ function Ge(e) {
1170
+ kt(), W.value = e ? rn(e) : [], V.value = a.page, ue.value = !1, Kt(m.value), we(m.value);
1209
1171
  }
1210
- async function It(e) {
1211
- if (ge) return ge;
1212
- const n = z;
1172
+ async function St(e) {
1173
+ if (de) return de;
1174
+ const n = D;
1213
1175
  let t = null;
1214
1176
  return t = (async () => {
1215
1177
  try {
1216
- if (s.mode === "backfill") {
1217
- const o = await gt.loadBackfillBatch(e);
1218
- if (n !== z) return;
1219
- W.value = o.pages.length ? o.pages : [e], _e(o.batchItems), g.value = o.batchItems, $.value = o.nextPage;
1178
+ if (a.mode === "backfill") {
1179
+ const l = await ht.loadBackfillBatch(e);
1180
+ if (n !== D) return;
1181
+ W.value = l.pages.length ? l.pages : [e], we(l.batchItems), m.value = l.batchItems, V.value = l.nextPage;
1220
1182
  } else {
1221
- const o = await pt(e);
1222
- if (n !== z) return;
1223
- W.value = [e], _e(o.items), g.value = o.items, $.value = o.nextPage;
1183
+ const l = await gt(e);
1184
+ if (n !== D) return;
1185
+ W.value = [e], we(l.items), m.value = l.items, V.value = l.nextPage;
1224
1186
  }
1225
- } catch (o) {
1226
- if (n !== z || ft(o)) return;
1227
- Fe.value = o instanceof Error ? o.message : String(o);
1187
+ } catch (l) {
1188
+ if (n !== D || ct(l)) return;
1189
+ ye.value = l instanceof Error ? l.message : String(l);
1228
1190
  } finally {
1229
- n === z && (ve.value = !1), ge === t && (ge = null);
1191
+ n === D && (ue.value = !1), de === t && (de = null);
1230
1192
  }
1231
- })(), ge = t, t;
1193
+ })(), de = t, t;
1232
1194
  }
1233
- function an() {
1234
- const e = xt();
1235
- e && (St(e), K.value = e.scrollTop, Ee?.observe(e));
1195
+ function sn() {
1196
+ const e = bt();
1197
+ e && (xt(e), j.value = e.scrollTop, He = e.scrollTop, Ve = e.scrollHeight, re?.observe(e));
1236
1198
  }
1237
- lt(async () => {
1238
- if (nn(), an(), s.restoredPages != null) {
1239
- Te.value = !0, nt(s.restoredPages);
1199
+ Qe(async () => {
1200
+ if (ln(), sn(), a.restoredPages != null) {
1201
+ be.value = !0, Ge(a.restoredPages);
1240
1202
  return;
1241
1203
  }
1242
- if (Oe.value && g.value.length > 0) {
1243
- Te.value = !0, nt();
1204
+ if ($e.value && m.value.length > 0) {
1205
+ be.value = !0, Ge();
1244
1206
  return;
1245
1207
  }
1246
- Te.value = !1, kt(s.page), await It(s.page);
1247
- }), $t(() => {
1248
- Ee?.disconnect(), C && (clearTimeout(C), C = null), F && (clearTimeout(F), F = null), H(), A();
1249
- }), re(
1250
- () => s.page,
1208
+ be.value = !1, Mt(a.page), await St(a.page);
1209
+ }), zt(() => {
1210
+ re?.disconnect(), P && (clearTimeout(P), P = null), F && (clearTimeout(F), F = null), L(), R();
1211
+ }), oe(
1212
+ () => a.page,
1251
1213
  async (e) => {
1252
- if (Te.value) {
1253
- $.value = e;
1214
+ if (be.value) {
1215
+ V.value = e;
1254
1216
  return;
1255
1217
  }
1256
- kt(e), await It(e);
1218
+ Mt(e), await St(e);
1257
1219
  }
1258
- ), re(
1259
- () => s.restoredPages,
1220
+ ), oe(
1221
+ () => a.restoredPages,
1260
1222
  (e) => {
1261
- e && (Te.value = !0, nt(e));
1223
+ e && (be.value = !0, Ge(e));
1262
1224
  }
1263
- ), re(
1264
- te,
1225
+ ), oe(
1226
+ ee,
1265
1227
  () => {
1266
- const e = h.value;
1267
- e && (T.value = ue(e));
1228
+ const e = u.value;
1229
+ e && (I.value = Ee(e));
1268
1230
  },
1269
1231
  { immediate: !1 }
1270
1232
  );
1271
- const ot = x(() => _n(T.value, s.itemWidth)), Ce = x(
1272
- () => Tn(T.value, ot.value, s.itemWidth, te.value)
1233
+ const Ke = k(() => Tn(I.value, a.itemWidth)), Te = k(
1234
+ () => Pn(I.value, Ke.value, a.itemWidth, ee.value)
1273
1235
  );
1274
- re(
1275
- [ot, Ce, te, J, X, O],
1236
+ oe(
1237
+ [Ke, Te, ee, Pe, G, K],
1276
1238
  () => {
1277
- wt();
1239
+ yt();
1278
1240
  },
1279
1241
  { immediate: !0 }
1280
- ), re(
1242
+ ), oe(
1281
1243
  // Performance note: this component targets very large arrays (e.g. 10k items).
1282
1244
  // Avoid deep watchers over items; rebuild layout only when the list structure
1283
1245
  // changes (new array reference or length change). This keeps metadata-only
1284
1246
  // updates (e.g. reactions) cheap.
1285
- () => [g.value, g.value.length],
1286
- () => wt(),
1247
+ () => [m.value, m.value.length],
1248
+ () => yt(),
1287
1249
  { immediate: !0 }
1288
1250
  );
1289
- const rn = x(() => [
1251
+ const un = k(() => [
1290
1252
  "mt-8 flex min-h-0 flex-1 flex-col rounded-2xl border border-slate-200/70 bg-white/70 p-5 shadow-sm backdrop-blur",
1291
- S.class
1253
+ y.class
1292
1254
  ]);
1293
- return (e, n) => (I(), P("section", dn(ee.value, { class: rn.value }), [
1294
- R("div", Bn, [
1295
- vn(e.$slots, "default")
1255
+ return (e, n) => (_(), T("section", mn(ae.value, { class: un.value }), [
1256
+ C("div", Nn, [
1257
+ hn(e.$slots, "default")
1296
1258
  ]),
1297
- R("div", {
1259
+ C("div", {
1298
1260
  ref_key: "scrollViewportRef",
1299
- ref: h,
1261
+ ref: u,
1300
1262
  "data-testid": "items-scroll-container",
1301
1263
  class: "mt-4 min-h-0 flex-1 overflow-auto",
1302
- style: U({ paddingRight: te.value + "px" }),
1303
- onScroll: tn
1264
+ style: U({ paddingRight: ee.value + "px" }),
1265
+ onScroll: on
1304
1266
  }, [
1305
- ve.value ? (I(), P("div", Cn, n[0] || (n[0] = [
1306
- R("div", { class: "inline-flex items-center gap-3 text-sm text-slate-600" }, [
1307
- R("svg", {
1267
+ ue.value ? (_(), T("div", Hn, n[0] || (n[0] = [
1268
+ C("div", { class: "inline-flex items-center gap-3 text-sm text-slate-600" }, [
1269
+ C("svg", {
1308
1270
  class: "h-5 w-5 animate-spin text-slate-500",
1309
1271
  viewBox: "0 0 24 24",
1310
1272
  "aria-hidden": "true"
1311
1273
  }, [
1312
- R("circle", {
1274
+ C("circle", {
1313
1275
  class: "opacity-25",
1314
1276
  cx: "12",
1315
1277
  cy: "12",
@@ -1318,75 +1280,75 @@ const Bn = { class: "hidden" }, Cn = {
1318
1280
  stroke: "currentColor",
1319
1281
  "stroke-width": "4"
1320
1282
  }),
1321
- R("path", {
1283
+ C("path", {
1322
1284
  class: "opacity-75",
1323
1285
  fill: "currentColor",
1324
1286
  d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
1325
1287
  })
1326
1288
  ]),
1327
- R("span", null, "Loading…")
1289
+ C("span", null, "Loading…")
1328
1290
  ], -1)
1329
- ]))) : Fe.value ? (I(), P("p", Nn, "Error: " + je(Fe.value), 1)) : (I(), P("div", {
1291
+ ]))) : ye.value ? (_(), T("p", Vn, "Error: " + Ze(ye.value), 1)) : (_(), T("div", {
1330
1292
  key: 2,
1331
1293
  class: "relative",
1332
- style: U({ height: en.value + "px" })
1294
+ style: U({ height: nn.value + "px" })
1333
1295
  }, [
1334
- (I(!0), P(at, null, Et(tt.value, (t) => (I(), P("article", {
1335
- key: g.value[t].id,
1296
+ (_(!0), T(Pt, null, Et(We.value, (t) => (_(), T("article", {
1297
+ key: m.value[t].id,
1336
1298
  "data-testid": "item-card",
1337
1299
  class: "absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
1338
1300
  style: U({
1339
- width: Ce.value + "px",
1340
- transition: Yt(g.value[t].id),
1341
- transitionDelay: Ve(g.value[t].id),
1342
- transform: Xt(t)
1301
+ width: Te.value + "px",
1302
+ transition: jt(m.value[t].id),
1303
+ transitionDelay: qt(m.value[t].id),
1304
+ transform: Ut(t)
1343
1305
  })
1344
1306
  }, [
1345
- be.value || X.value > 0 ? (I(), P("div", {
1307
+ Be.value || G.value > 0 ? (_(), T("div", {
1346
1308
  key: 0,
1347
1309
  "data-testid": "item-header-container",
1348
1310
  class: "w-full",
1349
- style: U(He.value)
1311
+ style: U(nt.value)
1350
1312
  }, [
1351
- Q(se(b), {
1352
- "slot-fn": ne.value,
1353
- "slot-props": { item: g.value[t], remove: () => Ye(g.value[t]) }
1313
+ Q(le(w), {
1314
+ "slot-fn": ke.value,
1315
+ "slot-props": { item: m.value[t], remove: () => De(m.value[t]) }
1354
1316
  }, null, 8, ["slot-fn", "slot-props"])
1355
- ], 4)) : G("", !0),
1356
- R("div", {
1317
+ ], 4)) : Z("", !0),
1318
+ C("div", {
1357
1319
  class: "group relative",
1358
- onMouseenter: (o) => v(g.value[t].id),
1359
- onMouseleave: (o) => p(g.value[t].id)
1320
+ onMouseenter: (l) => p(m.value[t].id),
1321
+ onMouseleave: (l) => b(m.value[t].id)
1360
1322
  }, [
1361
- Q(Bt, {
1362
- item: g.value[t],
1363
- remove: () => Ye(g.value[t]),
1364
- "loader-slot-fn": ce.value,
1365
- "error-slot-fn": Ne.value,
1366
- hovered: y.value === g.value[t].id,
1367
- onSuccess: q,
1368
- onError: Z
1323
+ Q(Rt, {
1324
+ item: m.value[t],
1325
+ remove: () => De(m.value[t]),
1326
+ "loader-slot-fn": ge.value,
1327
+ "error-slot-fn": J.value,
1328
+ hovered: d.value === m.value[t].id,
1329
+ onSuccess: H,
1330
+ onError: q
1369
1331
  }, null, 8, ["item", "remove", "loader-slot-fn", "error-slot-fn", "hovered"]),
1370
- Se.value ? (I(), P("div", Ln, [
1371
- Q(se(b), {
1372
- "slot-fn": Re.value,
1373
- "slot-props": { item: g.value[t], remove: () => Ye(g.value[t]) }
1332
+ tt.value ? (_(), T("div", Ln, [
1333
+ Q(le(w), {
1334
+ "slot-fn": x.value,
1335
+ "slot-props": { item: m.value[t], remove: () => De(m.value[t]) }
1374
1336
  }, null, 8, ["slot-fn", "slot-props"])
1375
- ])) : G("", !0)
1376
- ], 40, Hn),
1377
- xe.value || O.value > 0 ? (I(), P("div", {
1337
+ ])) : Z("", !0)
1338
+ ], 40, zn),
1339
+ Me.value || K.value > 0 ? (_(), T("div", {
1378
1340
  key: 1,
1379
1341
  "data-testid": "item-footer-container",
1380
1342
  class: "w-full",
1381
- style: U(Le.value)
1343
+ style: U(ot.value)
1382
1344
  }, [
1383
- Q(se(b), {
1384
- "slot-fn": we.value,
1385
- "slot-props": { item: g.value[t], remove: () => Ye(g.value[t]) }
1345
+ Q(le(w), {
1346
+ "slot-fn": s.value,
1347
+ "slot-props": { item: m.value[t], remove: () => De(m.value[t]) }
1386
1348
  }, null, 8, ["slot-fn", "slot-props"])
1387
- ], 4)) : G("", !0)
1349
+ ], 4)) : Z("", !0)
1388
1350
  ], 4))), 128)),
1389
- (I(!0), P(at, null, Et(le.value, (t) => (I(), P("article", {
1351
+ (_(!0), T(Pt, null, Et(ne.value, (t) => (_(), T("article", {
1390
1352
  key: t.id + ":leaving",
1391
1353
  "data-testid": "item-card-leaving",
1392
1354
  class: "pointer-events-none absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
@@ -1396,57 +1358,57 @@ const Bn = { class: "hidden" }, Cn = {
1396
1358
  transform: t.leaving ? "translate3d(" + t.fromX + "px," + t.fromY + "px,0)" : "translate3d(" + t.fromX + "px," + t.toY + "px,0)"
1397
1359
  })
1398
1360
  }, [
1399
- be.value || X.value > 0 ? (I(), P("div", {
1361
+ Be.value || G.value > 0 ? (_(), T("div", {
1400
1362
  key: 0,
1401
1363
  "data-testid": "item-header-container",
1402
1364
  class: "w-full",
1403
- style: U(He.value)
1365
+ style: U(nt.value)
1404
1366
  }, [
1405
- Q(se(b), {
1406
- "slot-fn": ne.value,
1367
+ Q(le(w), {
1368
+ "slot-fn": ke.value,
1407
1369
  "slot-props": { item: t.item, remove: () => {
1408
1370
  } }
1409
1371
  }, null, 8, ["slot-fn", "slot-props"])
1410
- ], 4)) : G("", !0),
1411
- R("div", Vn, [
1412
- Q(Bt, {
1372
+ ], 4)) : Z("", !0),
1373
+ C("div", $n, [
1374
+ Q(Rt, {
1413
1375
  item: t.item,
1414
1376
  remove: () => {
1415
1377
  },
1416
- "loader-slot-fn": ce.value,
1417
- "error-slot-fn": Ne.value,
1378
+ "loader-slot-fn": ge.value,
1379
+ "error-slot-fn": J.value,
1418
1380
  hovered: !1
1419
1381
  }, null, 8, ["item", "loader-slot-fn", "error-slot-fn"]),
1420
- Se.value ? (I(), P("div", $n, [
1421
- Q(se(b), {
1422
- "slot-fn": Re.value,
1382
+ tt.value ? (_(), T("div", Dn, [
1383
+ Q(le(w), {
1384
+ "slot-fn": x.value,
1423
1385
  "slot-props": { item: t.item, remove: () => {
1424
1386
  } }
1425
1387
  }, null, 8, ["slot-fn", "slot-props"])
1426
- ])) : G("", !0)
1388
+ ])) : Z("", !0)
1427
1389
  ]),
1428
- xe.value || O.value > 0 ? (I(), P("div", {
1390
+ Me.value || K.value > 0 ? (_(), T("div", {
1429
1391
  key: 1,
1430
1392
  "data-testid": "item-footer-container",
1431
1393
  class: "w-full",
1432
- style: U(Le.value)
1394
+ style: U(ot.value)
1433
1395
  }, [
1434
- Q(se(b), {
1435
- "slot-fn": we.value,
1396
+ Q(le(w), {
1397
+ "slot-fn": s.value,
1436
1398
  "slot-props": { item: t.item, remove: () => {
1437
1399
  } }
1438
1400
  }, null, 8, ["slot-fn", "slot-props"])
1439
- ], 4)) : G("", !0)
1401
+ ], 4)) : Z("", !0)
1440
1402
  ], 4))), 128))
1441
1403
  ], 4)),
1442
- R("div", zn, [
1443
- me.value ? (I(), P("span", Dn, n[1] || (n[1] = [
1444
- R("svg", {
1404
+ C("div", On, [
1405
+ ce.value ? (_(), T("span", Yn, n[1] || (n[1] = [
1406
+ C("svg", {
1445
1407
  class: "h-4 w-4 animate-spin text-slate-500",
1446
1408
  viewBox: "0 0 24 24",
1447
1409
  "aria-hidden": "true"
1448
1410
  }, [
1449
- R("circle", {
1411
+ C("circle", {
1450
1412
  class: "opacity-25",
1451
1413
  cx: "12",
1452
1414
  cy: "12",
@@ -1455,50 +1417,50 @@ const Bn = { class: "hidden" }, Cn = {
1455
1417
  stroke: "currentColor",
1456
1418
  "stroke-width": "4"
1457
1419
  }),
1458
- R("path", {
1420
+ C("path", {
1459
1421
  class: "opacity-75",
1460
1422
  fill: "currentColor",
1461
1423
  d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
1462
1424
  })
1463
1425
  ], -1),
1464
- R("span", null, "Loading more…", -1)
1465
- ]))) : $.value == null ? (I(), P("span", qn, "End of list")) : (I(), P("span", On, "Scroll to load page " + je($.value), 1))
1426
+ C("span", null, "Loading more…", -1)
1427
+ ]))) : V.value == null ? (_(), T("span", qn, "End of list")) : (_(), T("span", Xn, "Scroll to load page " + Ze(V.value), 1))
1466
1428
  ])
1467
1429
  ], 36)
1468
1430
  ], 16));
1469
1431
  }
1470
- }), Gn = Pe({
1432
+ }), Jn = xe({
1471
1433
  name: "MasonryItem",
1472
- setup(l, { slots: M, attrs: i }) {
1473
- const s = mn(Dt, null);
1474
- if (!s)
1434
+ setup(o, { slots: M, attrs: i }) {
1435
+ const a = gn($t, null);
1436
+ if (!a)
1475
1437
  return () => null;
1476
- const d = i.onPreloaded, S = i.onFailed, b = M.overlay, u = M.default;
1477
- return s({
1438
+ const f = i.onPreloaded, y = i.onFailed, w = M.overlay, g = M.default;
1439
+ return a({
1478
1440
  header: M.header,
1479
1441
  loader: M.loader,
1480
- overlay: b ?? u,
1442
+ overlay: w ?? g,
1481
1443
  error: M.error,
1482
1444
  footer: M.footer,
1483
- onPreloaded: typeof d == "function" ? d : Array.isArray(d) ? (y) => {
1484
- for (const v of d)
1485
- typeof v == "function" && v(y);
1445
+ onPreloaded: typeof f == "function" ? f : Array.isArray(f) ? (d) => {
1446
+ for (const p of f)
1447
+ typeof p == "function" && p(d);
1486
1448
  } : void 0,
1487
- onFailed: typeof S == "function" ? S : Array.isArray(S) ? (y) => {
1488
- for (const v of S)
1489
- typeof v == "function" && v(y);
1449
+ onFailed: typeof y == "function" ? y : Array.isArray(y) ? (d) => {
1450
+ for (const p of y)
1451
+ typeof p == "function" && p(d);
1490
1452
  } : void 0
1491
1453
  }), () => null;
1492
1454
  }
1493
- }), Jn = {
1494
- install(l) {
1495
- l.component("Masonry", Wn), l.component("MasonryItem", Gn), l.component("MasonryVideoControls", zt);
1455
+ }), Zn = {
1456
+ install(o) {
1457
+ o.component("Masonry", Kn), o.component("MasonryItem", Jn), o.component("MasonryVideoControls", Lt);
1496
1458
  }
1497
1459
  };
1498
1460
  export {
1499
- Wn as Masonry,
1500
- Gn as MasonryItem,
1501
- zt as MasonryVideoControls,
1502
- Jn as VibePlugin,
1503
- hn as masonryDefaults
1461
+ Kn as Masonry,
1462
+ Jn as MasonryItem,
1463
+ Lt as MasonryVideoControls,
1464
+ Zn as VibePlugin,
1465
+ pn as masonryDefaults
1504
1466
  };