fluid-dnd 2.2.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/{HandlerPublisher-DGYFIYDd.cjs → HandlerPublisher-B68XPAcH.cjs} +1 -1
  2. package/dist/{HandlerPublisher-CRBvk0J7.js → HandlerPublisher-pcX0Zmas.js} +1 -1
  3. package/dist/core/{configHandler.d.ts → config/configHandler.d.ts} +2 -2
  4. package/dist/core/{configHandler.js → config/configHandler.js} +4 -5
  5. package/dist/core/{utils → config}/droppableConfigurator.d.ts +3 -3
  6. package/dist/core/{utils → config}/droppableConfigurator.js +28 -11
  7. package/dist/core/dragAndDrop.d.ts +3 -3
  8. package/dist/core/dragAndDrop.js +53 -9
  9. package/dist/core/events/changeDraggableStyles.d.ts +4 -0
  10. package/dist/core/events/changeDraggableStyles.js +40 -0
  11. package/dist/core/events/dragAndDrop/dragAndDrop.d.ts +9 -0
  12. package/dist/core/{utils/events/emitEvents.js → events/dragAndDrop/dragAndDrop.js} +26 -145
  13. package/dist/core/{utils/translate/GetTranslateBeforeDropping.d.ts → events/dragAndDrop/getTranslateBeforeDropping.d.ts} +2 -2
  14. package/dist/core/{utils/translate/GetTranslateBeforeDropping.js → events/dragAndDrop/getTranslateBeforeDropping.js} +7 -15
  15. package/dist/core/{utils/translate/GetTranslationByDraggingAndEvent.d.ts → events/dragAndDrop/getTranslationByDraggingAndEvent.d.ts} +2 -2
  16. package/dist/core/{utils/translate/GetTranslationByDraggingAndEvent.js → events/dragAndDrop/getTranslationByDraggingAndEvent.js} +4 -4
  17. package/dist/core/events/insert.d.ts +4 -0
  18. package/dist/core/events/insert.js +80 -0
  19. package/dist/core/events/remove.d.ts +4 -0
  20. package/dist/core/events/remove.js +51 -0
  21. package/dist/core/positioning/autoScroll.d.ts +5 -0
  22. package/dist/core/positioning/autoScroll.js +51 -0
  23. package/dist/core/{utils/SetTransform.d.ts → positioning/usePositioning.d.ts} +1 -1
  24. package/dist/core/{utils/SetTransform.js → positioning/usePositioning.js} +7 -30
  25. package/dist/core/{utils/tempChildren.d.ts → tempChildren.d.ts} +1 -2
  26. package/dist/core/{utils/tempChildren.js → tempChildren.js} +22 -29
  27. package/dist/core/useDraggable.js +16 -12
  28. package/dist/core/utils/GetStyles.d.ts +3 -3
  29. package/dist/core/utils/GetStyles.js +48 -36
  30. package/dist/core/utils/SetStyles.d.ts +3 -3
  31. package/dist/core/utils/SetStyles.js +12 -12
  32. package/dist/core/utils/observer.d.ts +1 -0
  33. package/dist/core/utils/observer.js +8 -0
  34. package/dist/index-2hBSSK9_.cjs +1 -0
  35. package/dist/index-DFXw7kYo.js +1223 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.mjs +1 -1
  38. package/dist/react/index.cjs +1 -1
  39. package/dist/react/index.mjs +4 -11
  40. package/dist/react/utils/ReactLilstConfig.d.ts +2 -2
  41. package/dist/react/utils/ReactLilstConfig.js +7 -17
  42. package/dist/svelte/index.cjs +1 -1
  43. package/dist/svelte/index.mjs +2 -2
  44. package/dist/svelte/utils/SvelteListCondig.js +1 -1
  45. package/dist/vue/index.cjs +1 -1
  46. package/dist/vue/index.mjs +2 -2
  47. package/dist/vue/utils/VueListCondig.d.ts +3 -3
  48. package/dist/vue/utils/VueListCondig.js +2 -5
  49. package/package.json +1 -1
  50. package/dist/core/utils/config.d.ts +0 -5
  51. package/dist/core/utils/config.js +0 -57
  52. package/dist/core/utils/events/emitEvents.d.ts +0 -11
  53. package/dist/core/utils/scroll.d.ts +0 -4
  54. package/dist/core/utils/scroll.js +0 -17
  55. package/dist/index-Dc95WWpv.js +0 -1271
  56. package/dist/index-DxKyk1TO.cjs +0 -1
  57. /package/dist/core/utils/{touchDevice.d.ts → typesCheckers.d.ts} +0 -0
  58. /package/dist/core/utils/{touchDevice.js → typesCheckers.js} +0 -0
@@ -0,0 +1,1223 @@
1
+ var Be = Object.defineProperty;
2
+ var we = (e, t, n) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var H = (e, t, n) => we(e, typeof t != "symbol" ? t + "" : t, n);
4
+ const W = "horizontal", k = "vertical", Z = "draggable", Pt = "droppable", xt = "handler-class", wt = "dragging", $t = "dragging-handler-class", Gt = "dropping", ee = "grabbing", Oe = "grab", Zt = "disable-transition", tt = (e, t) => e.classList.contains(t), vt = (e, t, n = !1) => {
5
+ e.classList.toggle(t, n);
6
+ }, U = (e, t) => {
7
+ e.classList.add(t);
8
+ }, bt = (e, t) => {
9
+ e.classList.remove(t);
10
+ }, Re = (e, t) => Et(t).every(
11
+ (n) => tt(e, n)
12
+ ), ut = (e) => e ? `.${Et(e).join(".")}` : "", Le = (e, t) => {
13
+ if (!t)
14
+ return;
15
+ const n = Et(t);
16
+ e.classList.add(...n);
17
+ }, Et = (e) => e ? e.split(" ").filter((t) => t) : [], Fe = () => {
18
+ const { scrollX: e, scrollY: t } = window;
19
+ return { scrollX: e, scrollY: t };
20
+ }, Wt = (e) => !e || e.trim().length == 0 || e == "normal" ? 0 : parseFloat(e), Ne = (e) => e ? parseInt(e) : -1, Pe = (e) => {
21
+ const t = getComputedStyle(e), n = new DOMMatrixReadOnly(t.transform);
22
+ return {
23
+ x: n.m41,
24
+ y: n.m42
25
+ };
26
+ }, ne = (e, t) => e.x1 > t.x1 ? ne(t, e) : e.x2 < t.x1 ? 0 : e.x2 >= t.x2 ? e.x2 - e.x1 : e.x2 - t.x1, Tt = (e, t) => !$e(e, t), $e = (e, t) => {
27
+ const { intersectionX: n, intersectionY: s, rect1: o, rect2: r } = se(e, t);
28
+ return s >= Math.min(o.height, r.height) / 2 && n >= Math.min(o.width, r.width) / 2;
29
+ }, Ge = (e, t) => !Ie(e, t), Ie = (e, t) => {
30
+ const { intersectionX: n, intersectionY: s } = se(e, t);
31
+ return s >= 0 && n >= 0;
32
+ }, se = (e, t) => {
33
+ const n = Mt(e), s = Mt(t), o = kt(n, s, k), r = kt(n, s, W);
34
+ return {
35
+ rect1: n,
36
+ rect2: s,
37
+ intersectionX: r,
38
+ intersectionY: o
39
+ };
40
+ }, kt = (e, t, n) => {
41
+ const { before: s, distance: o } = R(n);
42
+ return ne(
43
+ {
44
+ x1: e[s],
45
+ x2: e[s] + e[o]
46
+ },
47
+ {
48
+ x1: t[s],
49
+ x2: t[s] + t[o]
50
+ }
51
+ );
52
+ }, N = (e, t) => e ? Wt(getComputedStyle(e)[t]) : 0, Jt = (e) => {
53
+ const { scrollLeft: t, scrollTop: n } = e;
54
+ return { scrollLeft: t, scrollTop: n };
55
+ }, Mt = (e) => e.getBoundingClientRect(), R = (e) => {
56
+ const t = e == W;
57
+ return {
58
+ beforeMargin: t ? "marginLeft" : "marginTop",
59
+ afterMargin: t ? "marginRight" : "marginBottom",
60
+ borderBeforeWidth: t ? "borderLeftWidth" : "borderTopWidth",
61
+ before: t ? "left" : "top",
62
+ after: t ? "right" : "down",
63
+ gap: t ? "columnGap" : "rowGap",
64
+ distance: t ? "width" : "height",
65
+ axis: t ? "x" : "y",
66
+ offset: t ? "offsetX" : "offsetY",
67
+ scroll: t ? "scrollX" : "scrollY",
68
+ scrollElement: t ? "scrollLeft" : "scrollTop",
69
+ page: t ? "pageX" : "pageY",
70
+ inner: t ? "innerWidth" : "innerHeight",
71
+ offsetElement: t ? "offsetLeft" : "offsetTop",
72
+ scrollDistance: t ? "scrollWidth" : "scrollHeight",
73
+ clientDistance: t ? "clientWidth" : "clientHeight",
74
+ paddingBefore: t ? "paddingLeft" : "paddingTop",
75
+ getRect: Mt
76
+ };
77
+ }, ct = (e, t) => Ye(e, t), oe = (e) => [...e.children].filter((n) => tt(n, Z)), Ye = (e, t) => {
78
+ const n = [...t.children].filter((o) => tt(o, Z) && !o.isEqualNode(e)).toReversed(), s = [...t.children].findLastIndex(
79
+ (o) => o.isEqualNode(e)
80
+ );
81
+ return [n, s, t];
82
+ }, Xe = (e) => {
83
+ let t = e.parentElement;
84
+ for (; t; ) {
85
+ if (window.getComputedStyle(t).position === "fixed")
86
+ return t;
87
+ t = t.parentElement;
88
+ }
89
+ return null;
90
+ }, re = (e, t) => {
91
+ const { before: n, borderBeforeWidth: s } = R(t), o = Xe(e);
92
+ return o ? Mt(o)[n] + N(o, s) : 0;
93
+ }, St = (e) => window.TouchEvent && e instanceof TouchEvent, J = (e) => e instanceof HTMLElement, ie = (e) => e instanceof MouseEvent, We = ["onmouseup", "onmousedown", "onmousemove"], _e = (e, t, n) => {
94
+ e && (e.style.height = `${t}px`, e.style.width = `${n}px`);
95
+ }, at = (e, t, n) => {
96
+ !e || !J(e) || (n == 0 && t == 0 ? e.style.transform = "" : e.style.transform = `translate(${n}px,${t}px)`);
97
+ }, He = (e, t, n, s) => {
98
+ e[t] = (o) => {
99
+ if (o.defaultPrevented)
100
+ return;
101
+ s && s(o);
102
+ const r = It(o);
103
+ n(r);
104
+ };
105
+ }, Ft = (e, t, n, s) => {
106
+ n && (Ve(t) ? e[t] = n : He(e, t, n, s));
107
+ }, Ve = (e) => We.includes(e), qe = (e) => {
108
+ const { target: t } = e;
109
+ return {
110
+ clientX: 0,
111
+ clientY: 0,
112
+ pageX: 0,
113
+ pageY: 0,
114
+ screenX: 0,
115
+ screenY: 0,
116
+ target: t,
117
+ offsetX: 0,
118
+ offsetY: 0
119
+ };
120
+ }, ze = (e, t) => {
121
+ const n = (s, o) => Ze(t, window, o, s);
122
+ if (ie(e)) {
123
+ const { offsetX: s, offsetY: o } = e;
124
+ return [s, o];
125
+ } else {
126
+ const s = e.target;
127
+ return [
128
+ n(s, W),
129
+ n(s, k)
130
+ ];
131
+ }
132
+ }, It = (e) => {
133
+ const t = je(e);
134
+ if (!t)
135
+ return qe(e);
136
+ const [n, s] = ze(e, t), { clientX: o, clientY: r, pageX: a, pageY: i, screenX: f, screenY: l, target: m } = t;
137
+ return {
138
+ clientX: o,
139
+ clientY: r,
140
+ pageX: a,
141
+ pageY: i,
142
+ screenX: f,
143
+ screenY: l,
144
+ target: m,
145
+ offsetX: n,
146
+ offsetY: s
147
+ };
148
+ }, je = (e) => {
149
+ if (St(e))
150
+ return e.touches[0] ?? e.changedTouches[0];
151
+ if (ie(e))
152
+ return e;
153
+ }, Ze = (e, t, n, s) => {
154
+ const { page: o, scroll: r, before: a, borderBeforeWidth: i, getRect: f } = R(n), l = f(s);
155
+ return e[o] - t[r] - l[a] - N(s, i);
156
+ }, Ot = (e, t, n = "ease-out", s = "transform") => {
157
+ J(e) && (e.style.transitionDuration = `${t}ms`, e.style.transitionTimingFunction = `${n}`, e.style.transitionProperty = `${s}`);
158
+ }, ce = (e, t, n) => {
159
+ !e || !J(e) || (e[t] = () => {
160
+ n();
161
+ });
162
+ }, ke = (e) => {
163
+ var t = e.querySelector("style");
164
+ if (!t) {
165
+ var n = document.createElement("style");
166
+ return e.appendChild(n), n;
167
+ }
168
+ return t;
169
+ }, Je = (e, t) => {
170
+ const n = /\.-?[_a-zA-Z0-9-*\s<>():]+/g, [s] = t.match(n) || [];
171
+ for (const o of e.cssRules) {
172
+ const [r] = o.cssText.match(n) || [];
173
+ if (s === r)
174
+ return !0;
175
+ }
176
+ return !1;
177
+ }, Ke = (e, t) => {
178
+ t.forEach((n) => {
179
+ Qe(e, n);
180
+ });
181
+ }, Qe = (e, t) => {
182
+ var s;
183
+ var n = ke(e);
184
+ n.sheet && (Je(n.sheet, t) || (s = n.sheet) == null || s.insertRule(t, n.sheet.cssRules.length));
185
+ }, ae = (e, t = {}) => {
186
+ for (const n of Object.keys(t)) {
187
+ const s = t[n];
188
+ s != null && Ue(e, `--${n}`, s);
189
+ }
190
+ }, Ue = (e, t, n) => e && e.style.setProperty(t, n), tn = (e, t, n) => {
191
+ n != 0 && (t === "vertical" ? e.scrollBy(0, n) : e.scrollBy(n, 0));
192
+ }, en = (e) => {
193
+ let t = 0.5;
194
+ const n = 0.03, s = (a, i, f, l) => {
195
+ const { before: m, distance: u, axis: D, getRect: T } = R(a), C = T(e)[u], O = T(i), S = f[m] - O[m] + l[D], v = O[u] - C, x = S / v, L = C / v, I = 0.25, P = 0.2, V = 0.8;
196
+ let _ = 0;
197
+ const $ = Ge(e, i);
198
+ !$ && x < P && x > -L ? _ = o(x < 0 ? 0 : x, P) : !$ && x > V && x < 1 + L && (_ = r(x, V));
199
+ const q = I * C * _;
200
+ t = Math.sign(q) * Math.min(Math.abs(q), Math.abs(t) + n), tn(i, a, t);
201
+ }, o = (a, i) => Math.pow(a / i, 1 / 3) - 1, r = (a, i) => Math.pow(1 / (1 - i) * (a - i), 3);
202
+ return [s];
203
+ }, nn = (e, t) => {
204
+ let n = { offsetX: 0, offsetY: 0 }, s = { top: 0, left: 0 }, o = { x: 0, y: 0 };
205
+ const [r] = en(e), a = (u) => {
206
+ e.style.transform = `translate( ${u.x}px, ${u.y}px)`;
207
+ }, i = (u) => {
208
+ e.style.top = `${u.top}px`, e.style.left = `${u.left}px`;
209
+ }, f = (u, D, T, C) => {
210
+ const O = (v) => {
211
+ const {
212
+ beforeMargin: x,
213
+ borderBeforeWidth: L,
214
+ before: I,
215
+ offset: P,
216
+ scroll: V,
217
+ page: _,
218
+ inner: $,
219
+ distance: q,
220
+ axis: nt,
221
+ getRect: K
222
+ } = R(v), Q = T[_], z = window[V], d = window[$], h = K(u)[q], p = N(u, L), A = N(u, x), B = Q - n[P], M = re(u, v);
223
+ if (B >= z - h / 2 && B <= z + d) {
224
+ const F = B - s[I] - p - A - z - M;
225
+ return S(v), F;
226
+ }
227
+ return o[nt];
228
+ }, S = (v) => {
229
+ u && tt(u, wt) && v === C && r(C, D, s, o);
230
+ }, E = (v) => {
231
+ const { axis: x } = R(v);
232
+ o[x] = O(v), a(l());
233
+ };
234
+ E(W), E(k);
235
+ }, l = () => {
236
+ let u = o;
237
+ for (const D of t)
238
+ u = D(u, e);
239
+ return u;
240
+ };
241
+ return [f, (u, D) => {
242
+ const [T, C, O, S] = rn(u, D, e);
243
+ s = {
244
+ top: T,
245
+ left: C
246
+ }, i(s), n = { offsetX: O, offsetY: S };
247
+ }];
248
+ }, At = (e, t, n) => {
249
+ const { borderBeforeWidth: s, before: o, getRect: r } = R(e);
250
+ return r(t)[o] - r(n)[o] - N(n, s);
251
+ }, sn = (e, t) => {
252
+ let { offsetX: n, offsetY: s, target: o } = e, r = on(o, t);
253
+ const a = o;
254
+ return a && r && !a.isSameNode(r) && (n += At(W, a, r), s += At(k, a, r)), r && t != o && (n += At(W, r, t), s += At(k, r, t)), [n, s];
255
+ }, on = (e, t) => {
256
+ const n = e == null ? void 0 : e.closest(`.${xt}`);
257
+ return n && n.isSameNode(t) ? e : n;
258
+ }, Kt = (e, t, n, s) => {
259
+ const { offset: o, beforeMargin: r, page: a, borderBeforeWidth: i, scroll: f } = R(e), l = re(n, e);
260
+ return t[a] - s[o] - N(n, r) - N(n, i) - window[f] - l;
261
+ }, rn = (e, t, n) => {
262
+ const [s, o] = sn(e, n);
263
+ return [
264
+ Kt(k, e, t, {
265
+ offsetX: s,
266
+ offsetY: o
267
+ }),
268
+ Kt(W, e, t, {
269
+ offsetX: s,
270
+ offsetY: o
271
+ }),
272
+ s,
273
+ o
274
+ ];
275
+ }, le = "startDrag", Bt = "drag", ue = "startDrop", ot = "temp-child", fe = "cubic-bezier(0.2, 0, 0, 1)", Yt = (e) => !e || e.length == 0 ? 0 : Wt(e.replace("px", "")), cn = (e, t) => {
276
+ const n = getComputedStyle(e)[t];
277
+ if (n.match("%")) {
278
+ const o = Wt(n.replace("%", "")), { width: r } = e.getBoundingClientRect();
279
+ return r * (o / 100);
280
+ }
281
+ return Yt(n);
282
+ }, _t = (e, t) => {
283
+ if (!(e instanceof Element))
284
+ return [
285
+ 0,
286
+ !1
287
+ ];
288
+ const n = cn(e, t), s = getComputedStyle(e).display, o = n > 0 || s === "flex";
289
+ return [n, o];
290
+ }, an = (e) => {
291
+ const { top: t, left: n } = getComputedStyle(e);
292
+ return [Yt(t), Yt(n)];
293
+ }, ln = (e, t) => {
294
+ const { gap: n } = R(t), [s, o] = _t(e, n);
295
+ return o ? s : 0;
296
+ };
297
+ function lt(e, t, n, s, o = e.previousElementSibling, r = e.nextElementSibling) {
298
+ let { height: a, width: i } = un(
299
+ n,
300
+ e,
301
+ o,
302
+ r
303
+ );
304
+ return Tt(e, s) && t == Bt && (a = 0, i = 0), { height: a, width: i };
305
+ }
306
+ const un = (e, t, n, s) => {
307
+ const {
308
+ afterMargin: o,
309
+ beforeMargin: r,
310
+ distance: a,
311
+ gap: i,
312
+ getRect: f
313
+ } = R(e), l = N(t, o), m = N(t, r), u = N(s, r), [D, T] = _t(t.parentElement, i), C = f(t)[a];
314
+ if (T)
315
+ return Qt(C, m, l, D, 0, e);
316
+ const [O, S, E] = fn(
317
+ n,
318
+ u,
319
+ l,
320
+ m,
321
+ o
322
+ );
323
+ return Qt(C, S, O, 0, E, e);
324
+ }, fn = (e, t, n, s, o) => {
325
+ const r = Math.max(t, n);
326
+ let a = s, i = t;
327
+ if (e) {
328
+ const f = N(e, o);
329
+ a = Math.max(f, s), i = Math.max(i, f);
330
+ }
331
+ return [r, a, i];
332
+ }, Qt = (e, t, n, s, o, r) => dn(r, e + t + n + s - o), dn = (e, t) => e == W ? { width: t, height: 0 } : { width: 0, height: t }, Ht = (e, t, n, s = () => !0) => {
333
+ const o = new MutationObserver((r) => {
334
+ if (r = r.filter(s), r.length > 0) {
335
+ const a = r[0];
336
+ e(o, a);
337
+ }
338
+ });
339
+ return o.observe(t, n), o;
340
+ }, Xt = (e) => J(e) ? e.classList.contains(ot) : !1, gn = "startDrag", de = "cubic-bezier(0.2, 0, 0, 1)", ge = 50, hn = (e, t, n) => {
341
+ let s = lt(t, gn, n, e);
342
+ const o = ln(e, n), { distance: r } = R(n);
343
+ s[r] -= o;
344
+ const [a, i] = pn(n, t);
345
+ return s[i] = a, s;
346
+ }, pn = (e, t) => {
347
+ const n = e == W ? k : W, { distance: s, getRect: o } = R(n);
348
+ return [o(t)[s], s];
349
+ }, ft = (e, t, n) => {
350
+ _e(e, t, n), e.style.minWidth = `${n}px`;
351
+ }, mn = (e, t, n) => (s) => {
352
+ t.contains(e) && (ft(e, n.height, n.width), s.disconnect());
353
+ }, vn = (e, t, n) => {
354
+ const { scrollDistance: s, clientDistance: o, scrollElement: r } = R(e);
355
+ return n[r] / (t[s] - t[o]);
356
+ }, Sn = (e, t) => {
357
+ if (!t)
358
+ return;
359
+ const { droppable: n, config: s, scroll: o } = e, { direction: r } = s, a = vn(s.direction, n, o) > 0.99, { scrollDistance: i, clientDistance: f, scrollElement: l } = R(r);
360
+ a && (n[l] = n[i] - n[f]);
361
+ }, he = (e, t, n, s) => {
362
+ if (!n)
363
+ return;
364
+ const { droppable: o, config: r } = n, { direction: a, animationDuration: i } = r;
365
+ if (Sn(n, t), o.querySelector(`.${ot}`) || !e)
366
+ return;
367
+ var f = e.tagName == "LI" ? "DIV" : e.tagName, l = document.createElement(f);
368
+ U(l, ot), ft(l, 0, 0);
369
+ const m = hn(o, e, a);
370
+ return Ot(
371
+ l,
372
+ i,
373
+ de,
374
+ "width, min-width, height"
375
+ ), [l, m, o];
376
+ }, Nt = (e, t, n, s, o) => {
377
+ const r = he(
378
+ e,
379
+ n,
380
+ s
381
+ );
382
+ if (!r)
383
+ return;
384
+ const [a, i, f] = r;
385
+ t.isSameNode(f) && ft(a, i.height, i.width), Ht(mn(a, f, i), f, {
386
+ childList: !0,
387
+ subtree: !0
388
+ }), f.appendChild(a);
389
+ }, Dn = (e, t, n) => {
390
+ const s = he(e, t, n);
391
+ if (!s)
392
+ return;
393
+ const [o, r, a] = s;
394
+ a.appendChild(o), bn(o, r);
395
+ }, bn = (e, t) => requestAnimationFrame(() => {
396
+ ft(e, t.height, t.width), requestAnimationFrame(() => {
397
+ Ot(e, 0, de, "width, min-width, height");
398
+ });
399
+ }), Tn = (e, t, n, s, o = !0) => {
400
+ if (n) {
401
+ var r = document.querySelectorAll(
402
+ `${ut(n)} > .${ot}`
403
+ );
404
+ r.forEach((a) => {
405
+ const i = a.parentElement;
406
+ if (i != null && i.isSameNode(t) || !o && (i != null && i.isSameNode(e)))
407
+ return;
408
+ ft(a, 0, 0), setTimeout(() => {
409
+ var l;
410
+ (l = a.parentNode) == null || l.removeChild(a);
411
+ }, s + ge);
412
+ });
413
+ }
414
+ }, Dt = (e, t, n = !1) => {
415
+ var s = e.querySelectorAll(`.${ot}`);
416
+ s.forEach((o) => {
417
+ const r = o;
418
+ n ? (ft(r, 0, 0), setTimeout(() => {
419
+ e.contains(r) && e.removeChild(r);
420
+ }, t + ge)) : e.removeChild(o);
421
+ });
422
+ }, Vt = (e, t, n) => {
423
+ const { handlerSelector: s, animationDuration: o } = e, r = (l) => {
424
+ n(), a(l, !1), l.style.transform = "", l.style.transition = "", l.style.top = "", l.style.left = "", ae(l, {
425
+ fixedHeight: "",
426
+ fixedWidth: ""
427
+ });
428
+ }, a = (l, m) => {
429
+ vt(l, wt, m), i(m, l), t.toggleGrabClass(!m);
430
+ }, i = (l, m) => {
431
+ const u = m.querySelector(s);
432
+ vt(document.body, ee, l), vt(u || m, $t, l);
433
+ };
434
+ return [r, a, (l, m) => {
435
+ const { width: u, height: D } = m;
436
+ at(l, D, u), Ot(l, o, fe);
437
+ }];
438
+ };
439
+ function En(e, t, n, s) {
440
+ const { animationDuration: o } = e, [r] = Vt(
441
+ e,
442
+ n,
443
+ s
444
+ ), a = (u, D, T, C) => {
445
+ if (!T || !T.droppable || !T.config)
446
+ return;
447
+ const { droppable: O, config: S } = T;
448
+ let [E] = ct(D, O);
449
+ E = [D, ...E].toReversed();
450
+ const v = lt(
451
+ D,
452
+ "remove",
453
+ S.direction,
454
+ O
455
+ );
456
+ for (const [x, L] of E.entries())
457
+ x >= u && (f(L, v), setTimeout(() => {
458
+ C(L);
459
+ }, o));
460
+ }, i = (u) => {
461
+ Dt(t, o, !0), setTimeout(() => {
462
+ r(u), l(u, t);
463
+ }, o);
464
+ }, f = (u, D) => {
465
+ const { width: T, height: C } = D;
466
+ at(u, C, T);
467
+ }, l = (u, D) => {
468
+ const [T] = ct(u, D);
469
+ for (const C of [...T, u])
470
+ m(C);
471
+ }, m = (u) => {
472
+ J(u) && (u.style.transition = "", u.style.transform = "");
473
+ };
474
+ return [a, i];
475
+ }
476
+ const j = class j {
477
+ static addConfig(t, n) {
478
+ const s = j.configs.filter(
479
+ (r) => !r.droppable.isSameNode(t)
480
+ ), o = Jt(t);
481
+ s.push({
482
+ droppable: t,
483
+ config: n,
484
+ scroll: o
485
+ }), j.configs = s;
486
+ }
487
+ static updateScrolls(t, n) {
488
+ for (const s of j.configs) {
489
+ const { droppable: o } = s;
490
+ (n && Re(o, n) || o.isSameNode(t)) && (s.scroll = Jt(o));
491
+ }
492
+ }
493
+ static getConfig(t) {
494
+ return j.configs.find(
495
+ ({ droppable: s }) => s.isSameNode(t)
496
+ );
497
+ }
498
+ };
499
+ H(j, "configs", []), H(j, "removeObsoleteConfigs", () => {
500
+ const t = j.configs.filter(
501
+ ({ droppable: n }) => document.contains(n)
502
+ );
503
+ j.configs = t;
504
+ });
505
+ let rt = j;
506
+ const yn = (e, t) => {
507
+ const { config: n, droppable: s } = e, { onInsertEvent: o, onDragEnd: r } = n;
508
+ return {
509
+ ...n,
510
+ onDragEnd: (f) => {
511
+ const { index: l, value: m } = f;
512
+ r({ index: l, value: t(m, s) });
513
+ },
514
+ onInsertEvent: (f, l) => o(f, t(l, s), !0)
515
+ };
516
+ };
517
+ class Cn {
518
+ constructor(t, n, s, o, r, a) {
519
+ H(this, "initial");
520
+ H(this, "current");
521
+ H(this, "parent");
522
+ H(this, "draggableElement");
523
+ H(this, "groupClass");
524
+ H(this, "dragEvent");
525
+ H(this, "changeDroppable");
526
+ H(this, "mapFrom");
527
+ this.parent = s, this.draggableElement = t, this.groupClass = n, this.dragEvent = o, this.mapFrom = a, this.initial = s ? rt.getConfig(s) : void 0, this.changeDroppable = r;
528
+ }
529
+ getDraggableAncestor(t, n, s) {
530
+ return document.elementsFromPoint(t, n).filter((o) => !o.isSameNode(s));
531
+ }
532
+ getElementBelow(t, n, s = !0) {
533
+ const o = (a) => {
534
+ const [i] = a.getDraggableAncestor(
535
+ n.clientX,
536
+ n.clientY,
537
+ t
538
+ );
539
+ return i;
540
+ };
541
+ let r = null;
542
+ return s ? (t.hidden = !0, r = o(this), t.hidden = !1) : r = o(this), r;
543
+ }
544
+ getCurrent(t, n, s = !0) {
545
+ const o = this.getElementBelow(t, n, s);
546
+ return !this.groupClass || !o ? void 0 : o.closest(ut(this.groupClass));
547
+ }
548
+ isOutsideOfAllDroppables(t) {
549
+ return (this.groupClass ? Array.from(document.querySelectorAll(ut(this.groupClass))) : [this.parent]).every((s) => Tt(t, s));
550
+ }
551
+ isNotInsideAnotherDroppable(t, n) {
552
+ return !Tt(t, n) || this.isOutsideOfAllDroppables(t);
553
+ }
554
+ onScrollEvent() {
555
+ this.dragEvent();
556
+ }
557
+ setOnScroll(t) {
558
+ ce(t, "onscroll", () => {
559
+ this.onScrollEvent();
560
+ });
561
+ }
562
+ getConfigFrom(t) {
563
+ const n = rt.getConfig(t);
564
+ if (n)
565
+ return t.isSameNode(this.parent) ? n : {
566
+ ...n,
567
+ config: yn(n, this.mapFrom)
568
+ };
569
+ }
570
+ getCurrentConfig(t) {
571
+ var o;
572
+ const n = this.draggableElement;
573
+ if (this.current && this.isNotInsideAnotherDroppable(n, (o = this.current) == null ? void 0 : o.droppable))
574
+ return this.current;
575
+ const s = this.getCurrent(n, t);
576
+ return s ? (J(s) && !s.onscroll && this.setOnScroll(s), this.getConfigFrom(s)) : this.getConfigFrom(this.parent);
577
+ }
578
+ updateConfig(t) {
579
+ const n = this.current;
580
+ this.current = this.getCurrentConfig(t), this.changeDroppable(this.current, n);
581
+ }
582
+ isOutside(t, n = !0) {
583
+ const s = this.draggableElement;
584
+ return !this.getCurrent(s, t, n);
585
+ }
586
+ }
587
+ const Ut = (e, t) => {
588
+ const { borderBeforeWidth: n, paddingBefore: s, axis: o, getRect: r } = R(e), a = N(t, n), i = N(t, s), f = r(t)[o];
589
+ return a + i + f;
590
+ }, An = (e, t) => {
591
+ const [n, s] = an(t), o = Ut(k, e);
592
+ return [Ut(W, e) - s, o - n];
593
+ };
594
+ function xn(e, t, n, s, o, r, a, i, f) {
595
+ let l = 0, m = 0;
596
+ const u = !!(n < 0 && f);
597
+ if (n === s && !u)
598
+ return te(
599
+ { height: l, width: m },
600
+ e,
601
+ o,
602
+ a,
603
+ u
604
+ );
605
+ const [D, T, C, O] = wn(
606
+ t,
607
+ n,
608
+ s,
609
+ f
610
+ );
611
+ if (u) {
612
+ const [p, A] = An(i, f);
613
+ l += A, m += p;
614
+ }
615
+ const {
616
+ scrollElement: S,
617
+ beforeMargin: E,
618
+ afterMargin: v,
619
+ distance: x,
620
+ gap: L
621
+ } = R(e), [I, P] = _t(i, L), [V, _, $] = Rn(
622
+ E,
623
+ v,
624
+ D,
625
+ T == null ? void 0 : T.previousElementSibling,
626
+ O,
627
+ P,
628
+ u
629
+ ), [q, nt, K] = On(
630
+ E,
631
+ v,
632
+ x,
633
+ C,
634
+ I,
635
+ P
636
+ ), Q = Bn(
637
+ nt,
638
+ q,
639
+ K,
640
+ _,
641
+ V,
642
+ I
643
+ ), z = u ? i[S] : Mn(S, i, r), h = (O ? Q - $ : $ - Q) - z;
644
+ return e === k ? l += h : e === W && (m += h), te(
645
+ { height: l, width: m },
646
+ e,
647
+ o,
648
+ a,
649
+ u
650
+ );
651
+ }
652
+ const Mn = (e, t, n) => {
653
+ const s = t[e], o = n[e];
654
+ return s - o;
655
+ }, Bn = (e, t, n, s, o, r) => {
656
+ const a = Math.max(t, o);
657
+ return Math.max(n, s) + e + a + r;
658
+ }, wn = (e, t, n, s) => {
659
+ const o = t < n, [r, a] = [t, n].toSorted((m, u) => m - u), i = e[t] ?? s, f = e[n];
660
+ let l = o ? e.slice(r + 1, a + 1) : e.slice(r, a);
661
+ return r < 0 && s && (l = e.slice(r + 1, a)), [i, f, l, o];
662
+ }, On = (e, t, n, s, o, r) => {
663
+ if (s.length == 0)
664
+ return [0, 0, 0];
665
+ const a = N(s[0], e);
666
+ let i = 0, f = -a;
667
+ for (const [l, m] of s.entries()) {
668
+ const u = m.getBoundingClientRect()[n], D = N(m, e);
669
+ r && (i += D), r && l > 0 ? i += o : i = Math.max(i, D), f += i + u, i = N(m, t);
670
+ }
671
+ return [a, f, i];
672
+ }, te = (e, t, n, s, o) => {
673
+ const { scroll: r, distance: a } = R(t), i = window[r], f = n[r], l = o ? 0 : f - 2 * i + s[r];
674
+ return e[a] += l, e;
675
+ }, Rn = (e, t, n, s, o, r, a) => {
676
+ const i = o ? n.previousElementSibling : s;
677
+ return Ln(
678
+ e,
679
+ t,
680
+ i,
681
+ n,
682
+ r,
683
+ a
684
+ );
685
+ }, Ln = (e, t, n, s, o, r) => {
686
+ if (o)
687
+ return [0, 0, 0];
688
+ const a = N(
689
+ r ? null : n,
690
+ t
691
+ ), i = N(s, e);
692
+ let f = Math.max(a, i);
693
+ return [a, i, f];
694
+ }, Fn = 50;
695
+ function Nn(e, t, n, s, o, r) {
696
+ let a = t;
697
+ const { direction: i, onRemoveAtEvent: f, animationDuration: l, draggingClass: m } = e, [u, D, T] = Vt(e, o, r), C = (d, h, p) => {
698
+ if (!p)
699
+ return;
700
+ const { droppable: A, config: B } = p, M = lt(d, h, B.direction, A);
701
+ S(d, h, M, p);
702
+ }, O = (d, h, p, A, B) => {
703
+ if (!p)
704
+ return;
705
+ const { droppable: M, config: w } = p, F = lt(d, h, w.direction, M);
706
+ L(
707
+ d,
708
+ h,
709
+ F,
710
+ A,
711
+ p,
712
+ B
713
+ );
714
+ }, S = (d, h, p, A) => {
715
+ const { config: B, droppable: M } = A, [w] = ct(d, M), F = Tt(d, M);
716
+ w.length == 0 && v(p, 1, B.direction, w);
717
+ for (const [Y, G] of w.entries()) {
718
+ if (!tt(G, Z))
719
+ continue;
720
+ const b = E(
721
+ B.direction,
722
+ d,
723
+ G,
724
+ p
725
+ );
726
+ if (!F && b)
727
+ p = b;
728
+ else if (!F)
729
+ continue;
730
+ const X = w.length - Y;
731
+ v(p, X, B.direction, w), h === le ? x(G, p) : h === Bt && T(G, p);
732
+ }
733
+ }, E = (d, h, p, A) => {
734
+ const { before: B, distance: M, axis: w, getRect: F } = R(d), Y = F(h), G = F(p), b = Y[B], X = G[B], dt = G[M], gt = X + dt / 2, ht = Pe(p)[w], et = gt - ht;
735
+ return b > et ? { height: 0, width: 0 } : A;
736
+ }, v = (d, h, p, A) => {
737
+ const B = A.filter((w) => tt(w, Z)).length, { distance: M } = R(p);
738
+ d[M] == 0 ? a = Math.max(a, h) : a = Math.min(a, h - 1), a = Math.min(a, B);
739
+ }, x = (d, h) => {
740
+ const { width: p, height: A } = h;
741
+ at(d, A, p);
742
+ }, L = (d, h, p, A, B, M) => {
743
+ const { droppable: w, scroll: F, config: Y } = B, [G, b] = ct(d, w), X = G.toReversed(), dt = b === -1 ? X.length : b;
744
+ X.splice(dt, 0, d);
745
+ const [gt, ht, et] = I(
746
+ d,
747
+ b,
748
+ X,
749
+ w
750
+ );
751
+ p = lt(
752
+ d,
753
+ h,
754
+ Y.direction,
755
+ n,
756
+ gt,
757
+ ht
758
+ );
759
+ const Rt = Fe(), yt = xn(
760
+ Y.direction,
761
+ X,
762
+ b,
763
+ et,
764
+ Rt,
765
+ F,
766
+ A,
767
+ w,
768
+ d
769
+ );
770
+ G.length == 0 && P(void 0, p, d, yt);
771
+ for (const [Lt, Ct] of G.toReversed().entries()) {
772
+ let pt = p;
773
+ et - 1 >= Lt && (pt = { height: 0, width: 0 }), h === ue && !tt(Ct, ot) && P(Ct, pt, d, yt);
774
+ }
775
+ V(et, d, Y, w, M);
776
+ }, I = (d, h, p, A) => {
777
+ const M = Tt(d, A) ? h : a, w = () => h < M ? [M, M + 1] : h > M ? [M - 1, M] : [M - 1, M + 1], [F, Y] = w(), G = p[F] ?? null, b = p[Y] ?? null;
778
+ return [G, b, M];
779
+ }, P = (d, h, p, A) => {
780
+ at(d, h.height, h.width), at(p, A.height, A.width);
781
+ }, V = (d, h, p, A, B) => {
782
+ const { onInsertEvent: M, onDragEnd: w } = p;
783
+ U(h, Gt), q(h, n, A, () => {
784
+ if (bt(h, Gt), B != null) {
785
+ const F = f(B, !0);
786
+ F != null && (M(d, F, !0), w({ value: F, index: d })), $(h), _();
787
+ }
788
+ });
789
+ }, _ = () => {
790
+ if (s) {
791
+ var d = document.querySelectorAll(
792
+ `${ut(s)} > .${Z}`
793
+ );
794
+ for (const h of d)
795
+ z(h);
796
+ }
797
+ }, $ = (d) => {
798
+ setTimeout(() => {
799
+ bt(d, m);
800
+ }, Fn);
801
+ }, q = (d, h, p, A) => {
802
+ setTimeout(() => {
803
+ A && A(), nt(h, p), K(p), u(d), Q(d, h), Q(d, p);
804
+ }, l);
805
+ }, nt = (d, h) => {
806
+ d.isSameNode(h) ? Dt(d, l) : (Dt(d, l, !0), Dt(h, l));
807
+ }, K = (d) => {
808
+ if (n.isSameNode(d))
809
+ return;
810
+ var [h] = n.querySelectorAll(`.${ot}`);
811
+ if (!h)
812
+ return;
813
+ const { distance: p } = R(i);
814
+ J(h) && (h.style[p] = "0px");
815
+ }, Q = (d, h) => {
816
+ const [p] = ct(d, h);
817
+ for (const A of [...p, d])
818
+ z(A);
819
+ }, z = (d) => {
820
+ J(d) && (d.style.transition = "", d.style.transform = "");
821
+ };
822
+ return [C, O, D];
823
+ }
824
+ function Pn(e, t, n, s) {
825
+ const { delayBeforeInsert: o } = e, [r, a, i] = Vt(
826
+ e,
827
+ n,
828
+ s
829
+ ), f = (u, D, T, C, O) => {
830
+ const S = lt(
831
+ D,
832
+ "insert",
833
+ e.direction,
834
+ T
835
+ ), { onInsertEvent: E } = e, v = oe(T);
836
+ for (const [x, L] of v.entries())
837
+ tt(L, Z) && x >= u && i(L, S);
838
+ O(), setTimeout(() => {
839
+ E(u, C), pe(u, T, e), r(D), l(D, t), Dt(t, 0, !0);
840
+ }, o);
841
+ }, l = (u, D) => {
842
+ const [T] = ct(u, D);
843
+ for (const C of [...T, u])
844
+ m(C);
845
+ }, m = (u) => {
846
+ J(u) && (u.style.transition = "", u.style.transform = "");
847
+ };
848
+ return [f];
849
+ }
850
+ const $n = (e) => e.addedNodes.values().filter((n) => !Xt(n)).toArray().length > 0, pe = (e, t, n) => {
851
+ const { insertingFromClass: s, animationDuration: o } = n, r = Ht(
852
+ () => {
853
+ const i = oe(t)[e];
854
+ U(i, s), U(i, Zt), setTimeout(() => {
855
+ bt(i, Zt), bt(i, s), r.disconnect();
856
+ }, o);
857
+ },
858
+ t,
859
+ {
860
+ childList: !0
861
+ },
862
+ $n
863
+ );
864
+ }, Hn = (e, t, n, s) => {
865
+ if (!t)
866
+ return;
867
+ const { onInsertEvent: o, delayBeforeInsert: r } = e;
868
+ setTimeout(() => {
869
+ o(n, s), pe(n, t, e);
870
+ }, r);
871
+ };
872
+ function Gn(e, t, n, s, o) {
873
+ const {
874
+ handlerSelector: r,
875
+ isDraggable: a,
876
+ droppableGroup: i,
877
+ animationDuration: f,
878
+ delayBeforeRemove: l,
879
+ draggingClass: m,
880
+ removingClass: u,
881
+ onRemoveAtEvent: D,
882
+ droppableClass: T,
883
+ onDragStart: C,
884
+ delayBeforeTouchMoveEvent: O,
885
+ coordinateTransform: S
886
+ } = n, E = Et(i).map((c) => `droppable-group-${c}`).join(" ");
887
+ let v = 0, x = {
888
+ scrollX: 0,
889
+ scrollY: 0
890
+ }, L = { pageX: 0, pageY: 0 }, I, P;
891
+ const [V, _] = nn(
892
+ e,
893
+ S
894
+ ), $ = () => {
895
+ v = 0;
896
+ }, [q, nt] = En(
897
+ n,
898
+ s,
899
+ o,
900
+ $
901
+ ), [K, Q, z] = Nn(
902
+ n,
903
+ t,
904
+ s,
905
+ E,
906
+ o,
907
+ $
908
+ ), [d] = Pn(
909
+ n,
910
+ s,
911
+ o,
912
+ $
913
+ ), h = () => {
914
+ U(e, Z);
915
+ }, p = (c) => {
916
+ U(c, xt), o.addSubscriber(c);
917
+ }, A = () => {
918
+ if (a(e)) {
919
+ const c = e.querySelector(r);
920
+ p(c || e);
921
+ }
922
+ }, B = () => {
923
+ A(), h();
924
+ }, M = (c) => {
925
+ const g = c == null ? void 0 : c.querySelector(`.${xt}`), y = g == null ? void 0 : g.parentElement;
926
+ return g && y && tt(y, Pt) && !y.isSameNode(s) ? null : g;
927
+ }, w = (c) => {
928
+ const g = M(c) ?? c;
929
+ g && a(c) && (Ft(g, "onmousedown", pt("mousemove", "mouseup")), Ft(
930
+ g,
931
+ "ontouchstart",
932
+ pt("touchmove", "touchend"),
933
+ (y) => {
934
+ P = {
935
+ x: y.touches[0].clientX,
936
+ y: y.touches[0].clientY
937
+ };
938
+ }
939
+ ), F(g)), c != null && c.isSameNode(g) || Ft(c, "onmousedown", me), U(s, Pt);
940
+ }, F = (c) => {
941
+ const g = c.querySelectorAll("img");
942
+ Array.from(g).forEach((y) => {
943
+ y.onmousedown = () => !1;
944
+ });
945
+ }, Y = () => {
946
+ if (L.pageX == 0 && L.pageY == 0 || !b.current)
947
+ return;
948
+ const { droppable: c, config: g } = b.current;
949
+ V(e, c, L, g.direction), K(e, Bt, b.current);
950
+ }, G = (c, g) => {
951
+ g && v == 2 && !(c != null && c.droppable.isSameNode(g.droppable)) && K(e, Bt, g);
952
+ }, b = new Cn(
953
+ e,
954
+ E,
955
+ s,
956
+ Y,
957
+ G,
958
+ n.mapFrom
959
+ ), X = (c) => {
960
+ if (!b.current)
961
+ return;
962
+ const g = E ? Array.from(document.querySelectorAll(ut(E))) : [s];
963
+ for (const y of g)
964
+ y.classList.toggle(
965
+ T,
966
+ !c && y.isSameNode(b.current.droppable)
967
+ );
968
+ }, dt = (c, g = !1) => {
969
+ b.updateConfig(c);
970
+ const y = b.isOutside(c);
971
+ X(y), v === 1 && !g ? zt(c) : v === 2 && (gt(y), be(c));
972
+ }, gt = (c = !0) => {
973
+ if (!b.current)
974
+ return;
975
+ const { droppable: g } = b.current;
976
+ Tn(g, s, E, f, c), !c && Nt(
977
+ e,
978
+ s,
979
+ v == 1,
980
+ b.current
981
+ );
982
+ }, ht = (c) => {
983
+ if (St(c) && P && v == 1) {
984
+ const g = Math.abs(c.touches[0].clientX - P.x), y = Math.abs(c.touches[0].clientY - P.y);
985
+ if (Math.abs(g) > 5 && Math.abs(y) > 5)
986
+ return clearTimeout(I), !1;
987
+ }
988
+ return !0;
989
+ }, et = (c) => {
990
+ clearTimeout(I);
991
+ const g = It(c);
992
+ if (St(c) && c.cancelable && v == 2 && c.preventDefault(), St(c) && !c.cancelable || !ht(c)) {
993
+ qt("touchmove", c);
994
+ return;
995
+ }
996
+ dt(g, St(c));
997
+ }, Rt = (c, g) => {
998
+ c == "touchmove" ? I = setTimeout(() => {
999
+ g();
1000
+ }, O) : g();
1001
+ }, yt = (c, g) => {
1002
+ const { clientX: y, clientY: it } = c, st = document.elementFromPoint(y, it), mt = st == null ? void 0 : st.closest(`.${Z}`);
1003
+ return mt && g.isSameNode(mt);
1004
+ }, Lt = (c) => {
1005
+ const g = n.onGetValue(t);
1006
+ return { index: t, element: c, value: g };
1007
+ }, Ct = (c) => {
1008
+ b.updateConfig(c), X(b.isOutside(c)), zt(c);
1009
+ }, pt = (c, g) => (y) => {
1010
+ if (!yt(y, e))
1011
+ return;
1012
+ rt.updateScrolls(s, E);
1013
+ const { scrollX: it, scrollY: st } = window;
1014
+ if (x = { scrollX: it, scrollY: st }, v === 0) {
1015
+ v = 1;
1016
+ const mt = Lt(e);
1017
+ mt && C(mt), Rt(c, () => {
1018
+ c == "touchmove" && Ct(y);
1019
+ }), document.addEventListener(c, et, {
1020
+ passive: !1
1021
+ }), Te(s), document.addEventListener(g, ve(c), {
1022
+ once: !0
1023
+ });
1024
+ }
1025
+ }, me = (c) => b.updateConfig(c), ve = (c) => (g) => {
1026
+ qt(c, g);
1027
+ }, qt = (c, g) => {
1028
+ X(!0);
1029
+ const y = It(g);
1030
+ ye(b.isOutside(y, !1)), clearTimeout(I), document.removeEventListener(c, et), b.updateConfig(y);
1031
+ const it = b.getCurrentConfig(y);
1032
+ if (it) {
1033
+ const { droppable: st } = it;
1034
+ Se(st);
1035
+ }
1036
+ s.onscroll = null, $();
1037
+ }, Se = (c) => {
1038
+ if (c.onscroll = null, !E)
1039
+ return;
1040
+ const g = Array.from(
1041
+ document.querySelectorAll(ut(E))
1042
+ );
1043
+ for (const y of g)
1044
+ J(y) && (y.onscroll = null);
1045
+ }, zt = (c) => {
1046
+ Nt(
1047
+ e,
1048
+ s,
1049
+ v == 1,
1050
+ b.current
1051
+ ), De(), K(e, le, b.current), Ce(e), _(c, e);
1052
+ }, De = () => {
1053
+ v = 2;
1054
+ }, be = (c) => {
1055
+ const { pageX: g, pageY: y } = c;
1056
+ L = { pageX: g, pageY: y }, Y();
1057
+ }, Te = (c) => ce(c, "onscroll", Ee), Ee = () => Y(), ye = (c) => {
1058
+ if (v !== 2 && v !== 1) {
1059
+ $();
1060
+ return;
1061
+ }
1062
+ v = 3, jt(e), e.classList.contains(wt) && Q(
1063
+ e,
1064
+ ue,
1065
+ c ? b.initial : b.current,
1066
+ x,
1067
+ t
1068
+ );
1069
+ }, jt = (c) => {
1070
+ Ot(c, f, fe), at(c, 0, 0);
1071
+ }, Ce = (c) => {
1072
+ const { height: g, width: y } = c.getBoundingClientRect();
1073
+ ae(c, {
1074
+ fixedHeight: `${g}px`,
1075
+ fixedWidth: `${y}px`
1076
+ }), z(c, !0), vt(c, m, !0), c.style.transition = "";
1077
+ }, Ae = (c, g) => {
1078
+ bt(e, u), Nt(
1079
+ e,
1080
+ s,
1081
+ v == 1,
1082
+ b.initial
1083
+ ), q(c, e, g, (y) => {
1084
+ jt(y), nt(e);
1085
+ }), D(t, !0);
1086
+ }, xe = (c) => {
1087
+ if (!b.initial)
1088
+ return;
1089
+ const g = b.initial;
1090
+ c == t && (U(e, u), setTimeout(() => {
1091
+ Ae(c, g);
1092
+ }, l));
1093
+ }, Me = (c, g) => {
1094
+ (c === t || c === n.onGetLegth() && t === c - 1) && d(c, e, s, g, () => {
1095
+ Dn(
1096
+ e,
1097
+ v == 1,
1098
+ b.initial
1099
+ );
1100
+ });
1101
+ };
1102
+ return B(), w(e), [xe, Me];
1103
+ }
1104
+ const In = (e, t) => {
1105
+ e && Le(t, e);
1106
+ }, Yn = () => {
1107
+ Ke(document.body, [
1108
+ `.${Z}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,
1109
+ `.${xt}{pointer-events:auto!important;}`,
1110
+ `.${Oe}{cursor:grab;}`,
1111
+ ".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",
1112
+ ".droppable{box-sizing:border-box!important;}",
1113
+ `.${wt}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,
1114
+ `.${$t}{pointer-events:none!important;}`,
1115
+ `.${Gt}{pointer-events:none!important;}`,
1116
+ `.${ee}{cursor:grabbing;}`,
1117
+ ".disable-transition{transition:none!important;}"
1118
+ ]);
1119
+ };
1120
+ function Xn(e, t, n, s = "index") {
1121
+ const o = s;
1122
+ let r = [], a = [];
1123
+ const { droppableGroup: i } = e;
1124
+ if (!n)
1125
+ return [
1126
+ r,
1127
+ a
1128
+ ];
1129
+ const f = Et(i).map((l) => `droppable-group-${l}`).join(" ");
1130
+ Yn(), In(f, n);
1131
+ for (const l of n.children) {
1132
+ const m = l.getAttribute(o), u = Ne(m), D = l;
1133
+ if (D && u >= 0) {
1134
+ const [T, C] = Gn(
1135
+ D,
1136
+ u,
1137
+ e,
1138
+ n,
1139
+ t
1140
+ );
1141
+ r.push(T), a.push(C);
1142
+ }
1143
+ }
1144
+ return [
1145
+ r,
1146
+ a
1147
+ ];
1148
+ }
1149
+ const Wn = (e, t) => {
1150
+ const n = (i, f) => e.removeAtEvent(i, f), s = (i, f, l) => e.insertEvent(i, f, l), o = () => e.getLength(), r = (i) => e.getValue(i), a = (i) => i;
1151
+ return {
1152
+ direction: (t == null ? void 0 : t.direction) ?? k,
1153
+ handlerSelector: (t == null ? void 0 : t.handlerSelector) ?? Z,
1154
+ draggingClass: (t == null ? void 0 : t.draggingClass) ?? "dragging",
1155
+ droppableClass: (t == null ? void 0 : t.droppableClass) ?? "droppable-hover",
1156
+ isDraggable: (t == null ? void 0 : t.isDraggable) ?? (() => !0),
1157
+ onDragStart: (t == null ? void 0 : t.onDragStart) ?? (() => {
1158
+ }),
1159
+ onDragEnd: (t == null ? void 0 : t.onDragEnd) ?? (() => {
1160
+ }),
1161
+ droppableGroup: t == null ? void 0 : t.droppableGroup,
1162
+ onRemoveAtEvent: n,
1163
+ onInsertEvent: s,
1164
+ onGetLegth: o,
1165
+ onGetValue: r,
1166
+ animationDuration: (t == null ? void 0 : t.animationDuration) ?? 200,
1167
+ removingClass: (t == null ? void 0 : t.removingClass) ?? "removing",
1168
+ insertingFromClass: (t == null ? void 0 : t.insertingFromClass) ?? "from-inserting",
1169
+ delayBeforeRemove: (t == null ? void 0 : t.delayBeforeRemove) ?? 200,
1170
+ delayBeforeInsert: (t == null ? void 0 : t.delayBeforeInsert) ?? 200,
1171
+ mapFrom: (t == null ? void 0 : t.mapFrom) ?? a,
1172
+ delayBeforeTouchMoveEvent: (t == null ? void 0 : t.delayBeforeTouchMoveEvent) ?? 150,
1173
+ coordinateTransform: (t == null ? void 0 : t.coordinateTransform) ?? [(i) => i]
1174
+ };
1175
+ };
1176
+ function Vn(e, t, n, s = "index") {
1177
+ let o = [], r = [], a;
1178
+ const i = Wn(e, n), f = (S) => {
1179
+ for (const E of o)
1180
+ E(S);
1181
+ }, l = (S, E) => {
1182
+ if (i.onGetLegth() === 0)
1183
+ e.insertToListEmpty(i, S, E);
1184
+ else
1185
+ for (const x of r)
1186
+ x(S, E);
1187
+ }, m = (S) => {
1188
+ const [E, v] = Xn(
1189
+ i,
1190
+ t,
1191
+ S,
1192
+ s
1193
+ );
1194
+ o = E, r = v;
1195
+ }, u = (S) => {
1196
+ const E = S.addedNodes.values().filter((x) => !Xt(x)).toArray(), v = S.removedNodes.values().filter((x) => !Xt(x)).toArray();
1197
+ return E.length > 0 || v.length > 0;
1198
+ }, D = (S) => {
1199
+ a = Ht(
1200
+ () => {
1201
+ m(S);
1202
+ },
1203
+ S,
1204
+ { childList: !0 },
1205
+ u
1206
+ );
1207
+ }, T = (S) => {
1208
+ U(S, Pt);
1209
+ }, C = (S) => {
1210
+ rt.addConfig(S, i);
1211
+ };
1212
+ return [f, l, (S) => {
1213
+ if (S)
1214
+ return T(S), C(S), D(S), m(S), rt.removeObsoleteConfigs(), a;
1215
+ }];
1216
+ }
1217
+ export {
1218
+ Oe as G,
1219
+ U as a,
1220
+ Vn as d,
1221
+ Hn as i,
1222
+ vt as t
1223
+ };