fluid-dnd 1.3.2-beta.0 → 1.3.3-beta.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.
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  <h1 align="center">
2
- <img src="https://github.com/carlosjorger/fluid-dnd/assets/50055316/dab15832-5290-42ca-b425-db177a2e589e" alt="Icon" width="150" height="140" />
2
+ <img src="public/fluid-dnd.svg"
3
+ alt="Icon" width="150" height="140" />
3
4
  <br>Fluid DnD<br>
4
5
  </h1>
5
6
 
@@ -57,9 +58,9 @@ library for lists with support for Vue, react and Svelte](https://fluid-dnd.netl
57
58
  - 📘 See others examples [here](https://fluid-dnd.netlify.app/example/vertical-list/single-vertical-list/).
58
59
 
59
60
  ## 📚 Libraries Support
60
- - Vue >=3.0.0
61
- - React >= 18.0.0
62
- - Svelte >= 5.0.0
61
+ - **Vue** >=3.0.0
62
+ - **React** >= 18.0.0
63
+ - **Svelte** >= 5.0.0
63
64
 
64
65
  ## 🤝 Contributing
65
66
 
@@ -1,7 +1,7 @@
1
1
  var d = Object.defineProperty;
2
2
  var e = (a, s, l) => s in a ? d(a, s, { enumerable: !0, configurable: !0, writable: !0, value: l }) : a[s] = l;
3
3
  var r = (a, s, l) => e(a, typeof s != "symbol" ? s + "" : s, l);
4
- import { a as h, t as n, G as t } from "./index-Br5-BQhK.js";
4
+ import { a as h, t as n, G as t } from "./index-8zYdjZIf.js";
5
5
  class c {
6
6
  constructor() {
7
7
  r(this, "handlers");
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var n=(e,s,l)=>s in e?d(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l;var a=(e,s,l)=>n(e,typeof s!="symbol"?s+"":s,l);const r=require("./index-DtPM9-d-.cjs");class h{constructor(){a(this,"handlers");this.handlers=[]}addSubscriber(s){this.handlers.includes(s)||(this.handlers.push(s),r.addClass(s,r.GRAB_CLASS))}toggleGrabClass(s){for(const l of this.handlers)r.toggleClass(l,r.GRAB_CLASS,s)}}exports.HandlerPublisher=h;
1
+ "use strict";var d=Object.defineProperty;var n=(e,s,l)=>s in e?d(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l;var a=(e,s,l)=>n(e,typeof s!="symbol"?s+"":s,l);const r=require("./index-C37ab-rG.cjs");class h{constructor(){a(this,"handlers");this.handlers=[]}addSubscriber(s){this.handlers.includes(s)||(this.handlers.push(s),r.addClass(s,r.GRAB_CLASS))}toggleGrabClass(s){for(const l of this.handlers)r.toggleClass(l,r.GRAB_CLASS,s)}}exports.HandlerPublisher=h;
@@ -1,4 +1,4 @@
1
1
  import { ListCondig, Config } from '.';
2
2
  import { default as HandlerPublisher } from './HandlerPublisher';
3
3
 
4
- export default function dragAndDrop<T>(listCondig: ListCondig<T>, handlerPublisher: HandlerPublisher, config?: Config<T>, indexAttr?: string, reactChildrenChanges?: Boolean): readonly [(index: number) => void, (index: number, value: T) => void, (parent: HTMLElement | null | undefined) => void];
4
+ export default function dragAndDrop<T>(listCondig: ListCondig<T>, handlerPublisher: HandlerPublisher, config?: Config<T>, indexAttr?: string): readonly [(index: number) => void, (index: number, value: T) => void, (parent: HTMLElement | null | undefined) => MutationObserver | undefined];
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 26.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 29.11 30.13" style="enable-background:new 0 0 29.11 30.13;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#00B4D8;}
7
+ .st1{fill:none;stroke:#00B4D8;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;}
8
+ </style>
9
+ <g>
10
+ <path class="st0" d="M28.15,15.78c0,0.5-0.07,0.96-0.15,1.34c-0.14,0.57-0.31,0.95-0.33,0.95c0.04-0.2,0.07-0.49,0.1-0.8
11
+ c0.15-1.87-0.19-3.76-1.03-5.47c-0.33-0.66-0.71-1.29-1.13-1.8c-1.67-2.05-4.1-3.22-6.67-3.22c-2.68,0-5.19,1.29-6.89,3.51
12
+ c-0.96,1.28-1.39,2.37-1.56,3.56c-0.11,0.61-0.94-1.29-2.46-1.61c-0.64-0.15-2.06,2.23-2.68,2.42C4.99,14.77,3.92,16.38,4,18.5
13
+ c0.1,2.35,2.2,5.65,1.93,6.6c-0.04,0.15-0.22,0.14-0.45,0c2.32,2.25,5.46,3.65,8.91,3.72c-4.56,0.15-8.52-2.1-10.85-5.59
14
+ c-0.08-0.12-0.18-0.24-0.26-0.37c-0.01-0.01-0.03-0.04-0.04-0.05c-0.18-0.26-0.33-0.53-0.48-0.81c-0.53-1.12-0.73-1.63-0.96-2.31
15
+ c-0.2-0.6-0.28-1-0.29-1.02c-0.01-0.03-0.03-0.12-0.05-0.24c-0.01-0.05-0.01-0.12-0.03-0.19c-0.01-0.05-0.01-0.1-0.03-0.15
16
+ c-0.04-0.33-0.1-0.71-0.14-0.94c0-0.04-0.01-0.08-0.01-0.11c0-0.05-0.01-0.1-0.01-0.11c0-0.01-0.01-0.04-0.01-0.08
17
+ c0-0.04-0.01-0.1-0.01-0.14c0-0.03-0.01-0.07-0.01-0.11c0-0.05-0.01-0.12-0.01-0.19s-0.01-0.14-0.01-0.22c0-0.01,0-0.01,0-0.03
18
+ c0-0.14-0.03-0.24-0.03-0.38v-0.34c0-7.5,6.04-13.61,13.49-13.61c6.37,0,11.72,4.48,13.12,10.48c0.05,0.2,0.11,0.42,0.14,0.62
19
+ C28.12,13.88,28.15,14.85,28.15,15.78z"/>
20
+ </g>
21
+ <path class="st1" d="M8.99,15.67l1.55-3.52c0.25-0.65,1.4-1.94,2.75-1.58c1.14,0.12,1.82,1.24,1.25,2.46l-0.48,1.56"/>
22
+ <path class="st1" d="M14.06,14.58l0.47-0.97c0.36-0.93,1.6-2.94,3.1-2.3c2.43,1.33,1.45,2.52,1.03,3.59l-0.74,1.39"/>
23
+ <path class="st1" d="M18.26,15.64c0.66-1.3,1.34-2.36,2.8-1.58c2.03,1.11,1.27,2.61,1.02,3.49l-0.4,0.78"/>
24
+ <path class="st1" d="M8.99,15.67c0,0,0.05-0.7,0.13-1.83c0.13-0.47,0.02-1.6-1.2-1.75C6.79,12.03,6.1,13.7,6,13.79
25
+ c-1.65,0.58-2.24,1.49-2.13,2.63c0.02,1.04-0.01,2.32-0.01,2.32c-0.19,1.11-0.31,2.8,1.71,5.47c0.02,0.02,2.33,3.19,7.12,3.79
26
+ c7.5,0.95,11.67-3.83,12.29-7.7c0.11-0.71,0.09-2.57-0.59-3.15c-0.66-0.64-1.51-0.47-2.03-0.06c-0.29,0.46-0.4,0.66-0.69,1.24"/>
27
+ </svg>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DtPM9-d-.cjs");exports.dragAndDrop=e.dragAndDrop;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-C37ab-rG.cjs");exports.dragAndDrop=e.dragAndDrop;
@@ -1,4 +1,4 @@
1
- import { d as o } from "../index-Br5-BQhK.js";
1
+ import { d as o } from "../index-8zYdjZIf.js";
2
2
  export {
3
3
  o as dragAndDrop
4
4
  };
@@ -231,14 +231,14 @@ const Je = (t, e, n, s) => {
231
231
  ), F = f(e)[c];
232
232
  if (O)
233
233
  return te(F, m, g, M, 0, t);
234
- const [y, p, T] = Ke(
234
+ const [y, p, E] = Ke(
235
235
  n,
236
236
  b,
237
237
  g,
238
238
  m,
239
239
  o
240
240
  );
241
- return te(F, p, y, 0, T, t);
241
+ return te(F, p, y, 0, E, t);
242
242
  }, Ke = (t, e, n, s, o) => {
243
243
  const r = Math.max(e, n);
244
244
  let c = s, l = e;
@@ -283,7 +283,7 @@ function tn(t, e, n, s, o, r, c, l, f) {
283
283
  }
284
284
  const {
285
285
  scrollElement: p,
286
- beforeMargin: T,
286
+ beforeMargin: E,
287
287
  afterMargin: R,
288
288
  distance: w,
289
289
  gap: P
@@ -292,7 +292,7 @@ function tn(t, e, n, s, o, r, c, l, f) {
292
292
  H,
293
293
  $
294
294
  ] = rn(
295
- T,
295
+ E,
296
296
  R,
297
297
  M,
298
298
  O == null ? void 0 : O.previousElementSibling,
@@ -300,7 +300,7 @@ function tn(t, e, n, s, o, r, c, l, f) {
300
300
  Z,
301
301
  b
302
302
  ), [k, q, J] = on(
303
- T,
303
+ E,
304
304
  R,
305
305
  w,
306
306
  F,
@@ -489,11 +489,11 @@ function vn(t, e, n, s, o, r) {
489
489
  } = t, O = (u, a, h, D, C) => {
490
490
  if (!D)
491
491
  return;
492
- const { droppable: E, config: v } = D, A = yt(
492
+ const { droppable: T, config: v } = D, A = yt(
493
493
  u,
494
494
  a,
495
495
  v.direction,
496
- E
496
+ T
497
497
  );
498
498
  ze(a) ? Z(
499
499
  u,
@@ -502,34 +502,34 @@ function vn(t, e, n, s, o, r) {
502
502
  h,
503
503
  D,
504
504
  C
505
- ) : T(
505
+ ) : E(
506
506
  u,
507
507
  a,
508
508
  A,
509
509
  D
510
510
  );
511
511
  }, F = (u, a, h, D, C) => {
512
- const E = yt(
512
+ const T = yt(
513
513
  a,
514
514
  "insert",
515
515
  t.direction,
516
516
  h
517
517
  ), { onInsertEvent: v } = t, A = ie(h);
518
518
  for (const [N, x] of A.entries())
519
- nt(x, U) && N >= u && X(x, E);
519
+ nt(x, U) && N >= u && X(x, T);
520
520
  C(), setTimeout(() => {
521
521
  v(u, D), me(u, h, t), et(a), W(a, n), vt(n, 0, !0);
522
522
  }, b);
523
523
  }, y = (u, a, h, D) => {
524
524
  if (!h || !h.droppable || !h.config)
525
525
  return;
526
- const { droppable: C, config: E } = h;
526
+ const { droppable: C, config: T } = h;
527
527
  let [v] = Mt(a, C);
528
528
  v = [a, ...v].toReversed();
529
529
  const A = yt(
530
530
  a,
531
531
  "remove",
532
- E.direction,
532
+ T.direction,
533
533
  C
534
534
  );
535
535
  for (const [N, x] of v.entries())
@@ -540,8 +540,8 @@ function vn(t, e, n, s, o, r) {
540
540
  vt(n, m, !0), setTimeout(() => {
541
541
  et(u), W(u, n);
542
542
  }, m);
543
- }, T = (u, a, h, D) => {
544
- const { config: C, droppable: E } = D, [v] = Mt(u, E), A = pt(u, E);
543
+ }, E = (u, a, h, D) => {
544
+ const { config: C, droppable: T } = D, [v] = Mt(u, T), A = pt(u, T);
545
545
  v.length == 0 && w(
546
546
  h,
547
547
  1,
@@ -570,20 +570,20 @@ function vn(t, e, n, s, o, r) {
570
570
  ), a === fe ? P(x, h) : a === Nt && X(x, h);
571
571
  }
572
572
  }, R = (u, a, h, D) => {
573
- const { before: C, distance: E, axis: v, getRect: A } = B(u), N = A(a), x = A(h), G = N[C], K = x[C], mt = x[E], ft = K + mt / 2, St = Be(h)[v], rt = ft - St;
573
+ const { before: C, distance: T, axis: v, getRect: A } = B(u), N = A(a), x = A(h), G = N[C], K = x[C], mt = x[T], ft = K + mt / 2, St = Be(h)[v], rt = ft - St;
574
574
  return G > rt ? { height: 0, width: 0 } : D;
575
575
  }, w = (u, a, h, D) => {
576
576
  const C = D.filter(
577
577
  (v) => nt(v, U)
578
- ).length, { distance: E } = B(h);
579
- u[E] == 0 ? c = Math.max(c, a) : c = Math.min(c, a - 1), c = Math.min(c, C);
578
+ ).length, { distance: T } = B(h);
579
+ u[T] == 0 ? c = Math.max(c, a) : c = Math.min(c, a - 1), c = Math.min(c, C);
580
580
  }, P = (u, a) => {
581
581
  const { width: h, height: D } = a;
582
582
  Et(u, D, h);
583
583
  }, X = (u, a) => {
584
584
  const { width: h, height: D } = a;
585
585
  Et(u, D, h), Pt(u, m, de);
586
- }, Z = (u, a, h, D, C, E) => {
586
+ }, Z = (u, a, h, D, C, T) => {
587
587
  const { droppable: v, scroll: A, config: N } = C, [x, G] = Mt(
588
588
  u,
589
589
  v
@@ -634,14 +634,14 @@ function vn(t, e, n, s, o, r) {
634
634
  u,
635
635
  N,
636
636
  v,
637
- E
637
+ T
638
638
  );
639
639
  }, _ = (u, a, h, D) => {
640
- const E = pt(u, D) ? a : c, v = () => a < E ? [E, E + 1] : a > E ? [E - 1, E] : [E - 1, E + 1], [A, N] = v(), x = h[A] ?? null, G = h[N] ?? null;
640
+ const T = pt(u, D) ? a : c, v = () => a < T ? [T, T + 1] : a > T ? [T - 1, T] : [T - 1, T + 1], [A, N] = v(), x = h[A] ?? null, G = h[N] ?? null;
641
641
  return [
642
642
  x,
643
643
  G,
644
- E
644
+ T
645
645
  ];
646
646
  }, H = (u, a, h, D) => {
647
647
  Et(u, a.height, a.width), Et(
@@ -650,11 +650,11 @@ function vn(t, e, n, s, o, r) {
650
650
  D.width
651
651
  );
652
652
  }, $ = (u, a, h, D, C) => {
653
- const { onInsertEvent: E, onDragEnd: v } = h;
653
+ const { onInsertEvent: T, onDragEnd: v } = h;
654
654
  st(a, Vt), J(a, n, D, () => {
655
655
  if (Ct(a, Vt), C != null) {
656
656
  const A = g(C, !0);
657
- A != null && (E(u, A, !0), v({ value: A, index: u })), q(a), k();
657
+ A != null && (T(u, A, !0), v({ value: A, index: u })), q(a), k();
658
658
  }
659
659
  });
660
660
  }, k = () => {
@@ -770,7 +770,7 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
770
770
  const M = (y) => {
771
771
  const {
772
772
  beforeMargin: p,
773
- borderBeforeWidth: T,
773
+ borderBeforeWidth: E,
774
774
  before: R,
775
775
  offset: w,
776
776
  scroll: P,
@@ -779,7 +779,7 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
779
779
  distance: _,
780
780
  axis: H,
781
781
  getRect: $
782
- } = B(y), k = m[X], q = window[P], J = window[Z], I = $(f)[_], z = L(f, T), W = L(f, p), Y = k - e[w], et = ce(f, y);
782
+ } = B(y), k = m[X], q = window[P], J = window[Z], I = $(f)[_], z = L(f, E), W = L(f, p), Y = k - e[w], et = ce(f, y);
783
783
  if (Y >= q - I / 2 && Y <= q + J) {
784
784
  const ot = Y - n[R] - z - W - q - et;
785
785
  return O(y), ot;
@@ -787,7 +787,7 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
787
787
  return s[H];
788
788
  }, O = (y) => {
789
789
  if (f && nt(f, Ft) && y === b) {
790
- const { before: p, distance: T, axis: R, getRect: w } = B(b), P = w(f)[T], X = w(g), Z = n[p] - X[p] + s[R], H = X[T] - P, $ = Z / H, k = P / H, q = 0.1, J = 0.2, I = 0.8;
790
+ const { before: p, distance: E, axis: R, getRect: w } = B(b), P = w(f)[E], X = w(g), Z = n[p] - X[p] + s[R], H = X[E] - P, $ = Z / H, k = P / H, q = 0.1, J = 0.2, I = 0.8;
791
791
  let z = 0;
792
792
  const W = pt(f, g);
793
793
  !W && $ < J && $ > -k ? z = $ / J - 1 : !W && $ > I && $ < 1 + k && (z = 1 / (1 - I) * ($ - I));
@@ -961,7 +961,7 @@ function Bn(t, e, n, s, o) {
961
961
  droppableClass: O,
962
962
  onDragStart: F
963
963
  } = n, y = At(l).map((i) => `droppable-group-${i}`).join(" ");
964
- let p = 0, T = {
964
+ let p = 0, E = {
965
965
  scrollX: 0,
966
966
  scrollY: 0
967
967
  }, R = { pageX: 0, pageY: 0 }, w, P;
@@ -1024,14 +1024,14 @@ function Bn(t, e, n, s, o) {
1024
1024
  X(t, i, R, d.direction), _(
1025
1025
  t,
1026
1026
  Nt,
1027
- T,
1027
+ E,
1028
1028
  a.current
1029
1029
  );
1030
1030
  }, u = (i, d) => {
1031
1031
  d && p == 2 && !(i != null && i.droppable.isSameNode(d.droppable)) && _(
1032
1032
  t,
1033
1033
  Nt,
1034
- T,
1034
+ E,
1035
1035
  d
1036
1036
  );
1037
1037
  }, a = new wn(
@@ -1072,7 +1072,7 @@ function Bn(t, e, n, s, o) {
1072
1072
  p == 1,
1073
1073
  a.current
1074
1074
  );
1075
- }, E = (i) => {
1075
+ }, T = (i) => {
1076
1076
  if (Tt(i) && P && p == 1) {
1077
1077
  const d = Math.abs(i.touches[0].clientX - P.x), S = Math.abs(i.touches[0].clientY - P.y);
1078
1078
  if (Math.abs(d) > 5 && Math.abs(S) > 5)
@@ -1082,7 +1082,7 @@ function Bn(t, e, n, s, o) {
1082
1082
  }, v = (i) => {
1083
1083
  clearTimeout(w);
1084
1084
  const d = _t(i);
1085
- if (Tt(i) && i.cancelable && i.preventDefault(), Tt(i) && !i.cancelable || !E(i)) {
1085
+ if (Tt(i) && i.cancelable && i.preventDefault(), Tt(i) && !i.cancelable || !T(i)) {
1086
1086
  ft("touchmove", i);
1087
1087
  return;
1088
1088
  }
@@ -1102,7 +1102,7 @@ function Bn(t, e, n, s, o) {
1102
1102
  return;
1103
1103
  lt.updateScrolls(s, y);
1104
1104
  const { scrollX: dt, scrollY: ct } = window;
1105
- if (T = { scrollX: dt, scrollY: ct }, p === 0) {
1105
+ if (E = { scrollX: dt, scrollY: ct }, p === 0) {
1106
1106
  p = 1;
1107
1107
  const Dt = x(t);
1108
1108
  Dt && F(Dt), A(i, () => {
@@ -1142,7 +1142,7 @@ function Bn(t, e, n, s, o) {
1142
1142
  ), $t(), _(
1143
1143
  t,
1144
1144
  fe,
1145
- T,
1145
+ E,
1146
1146
  a.current
1147
1147
  ), Se(t), Z(i, t);
1148
1148
  }, $t = () => {
@@ -1158,7 +1158,7 @@ function Bn(t, e, n, s, o) {
1158
1158
  p = 3, Jt(t), t.classList.contains(Ft) && _(
1159
1159
  t,
1160
1160
  jt,
1161
- T,
1161
+ E,
1162
1162
  i ? a.initial : a.current,
1163
1163
  e
1164
1164
  );
@@ -1253,27 +1253,27 @@ function Ln(t, e, n, s = "index") {
1253
1253
  c
1254
1254
  ];
1255
1255
  }
1256
- function Fn(t, e, n, s = "index", o = !0) {
1257
- let r = [], c = [];
1256
+ function Fn(t, e, n, s = "index") {
1257
+ let o = [], r = [], c;
1258
1258
  const l = Tn(t, n), f = (p) => {
1259
- for (const T of r)
1260
- T(p);
1261
- }, g = (p, T) => {
1259
+ for (const E of o)
1260
+ E(p);
1261
+ }, g = (p, E) => {
1262
1262
  if (l.onGetLegth() === 0)
1263
- t.insertToListEmpty(l, p, T);
1263
+ t.insertToListEmpty(l, p, E);
1264
1264
  else
1265
- for (const w of c)
1266
- w(p, T);
1265
+ for (const w of r)
1266
+ w(p, E);
1267
1267
  }, m = (p) => {
1268
- const [T, R] = Ln(l, e, p, s);
1269
- r = T, c = R;
1268
+ const [E, R] = Ln(l, e, p, s);
1269
+ o = E, r = R;
1270
1270
  }, b = (p) => {
1271
- const T = p.addedNodes.values().filter((w) => !qt(w)).toArray(), R = p.removedNodes.values().filter((w) => !qt(w)).toArray();
1272
- return T.length > 0 || R.length > 0;
1271
+ const E = p.addedNodes.values().filter((w) => !qt(w)).toArray(), R = p.removedNodes.values().filter((w) => !qt(w)).toArray();
1272
+ return E.length > 0 || R.length > 0;
1273
1273
  }, M = (p) => {
1274
- kt(
1275
- (T) => {
1276
- m(p), o || T.disconnect();
1274
+ c = kt(
1275
+ () => {
1276
+ m(p);
1277
1277
  },
1278
1278
  p,
1279
1279
  { childList: !0 },
@@ -1288,7 +1288,8 @@ function Fn(t, e, n, s = "index", o = !0) {
1288
1288
  );
1289
1289
  };
1290
1290
  return [f, g, (p) => {
1291
- p && (O(p), F(p), M(p), m(p), lt.removeObsoleteConfigs());
1291
+ if (p)
1292
+ return O(p), F(p), M(p), m(p), lt.removeObsoleteConfigs(), c;
1292
1293
  }];
1293
1294
  }
1294
1295
  export {
@@ -1 +1 @@
1
- "use strict";var Ee=Object.defineProperty;var ye=(t,e,n)=>e in t?Ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var j=(t,e,n)=>ye(t,typeof e!="symbol"?e+"":e,n);const U="draggable",Xt="droppable",Mt="handler-class",Ft="dragging",Wt="dragging-handler-class",_t="dropping",oe="grabbing",re="grab",Kt="disable-transition",st=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},tt=(t,e)=>{t.classList.add(e)},Ct=(t,e)=>{t.classList.remove(e)},Ce=(t,e)=>At(e).every(n=>st(t,n)),pt=t=>t?`.${At(t).join(".")}`:"",Ae=(t,e)=>{if(!e)return;const n=At(e);t.classList.add(...n)},At=t=>t?t.split(" ").filter(e=>e):[],_="horizontal",et="vertical",xe=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},zt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),we=t=>t?parseInt(t):-1,Be=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},ie=(t,e)=>t.x1>e.x1?ie(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,ht=(t,e)=>!Re(t,e),Re=(t,e)=>{const n=Ot(t),s=Ot(e),o=Qt(n,s,et),r=Qt(n,s,_);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Qt=(t,e,n)=>{const{before:s,distance:o}=B(n);return ie({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},M=(t,e)=>t?zt(getComputedStyle(t)[e]):0,Ut=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Ot=t=>t.getBoundingClientRect(),B=t=>{const e=t==_;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",after:e?"right":"down",gap:e?"columnGap":"rowGap",distance:e?"width":"height",axis:e?"x":"y",offset:e?"offsetX":"offsetY",scroll:e?"scrollX":"scrollY",scrollElement:e?"scrollLeft":"scrollTop",page:e?"pageX":"pageY",inner:e?"innerWidth":"innerHeight",offsetElement:e?"offsetLeft":"offsetTop",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:Ot}},Rt=(t,e)=>Le(t,e),ce=t=>[...t.children].filter(n=>st(n,U)),Le=(t,e)=>{const n=[...e.children].filter(o=>st(o,U)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Me=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ae=(t,e)=>{const{before:n,borderBeforeWidth:s}=B(e),o=Me(t);return o?Ot(o)[n]+M(o,s):0},Tt=t=>window.TouchEvent&&t instanceof TouchEvent,it=t=>t instanceof HTMLElement,le=t=>t instanceof MouseEvent,Oe=["onmouseup","onmousedown","onmousemove"],Ne=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Et=(t,e,n)=>{!t||!it(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Fe=(t,e,n,s)=>{t[e]=o=>{if(o.defaultPrevented)return;s&&s(o);const r=Vt(o);n(r)}},It=(t,e,n,s)=>{n&&(Pe(e)?t[e]=n:Fe(t,e,n,s))},Pe=t=>Oe.includes(t),$e=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Ge=(t,e)=>{const n=(s,o)=>Ye(e,window,o,s);if(le(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,et)]}},Vt=t=>{const e=Ie(t);if(!e)return $e(t);const[n,s]=Ge(t,e),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m}=e;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m,offsetX:n,offsetY:s}},Ie=t=>{if(Tt(t))return t.touches[0]??t.changedTouches[0];if(le(t))return t},Ye=(t,e,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:f}=B(n),g=f(s);return t[o]-e[r]-g[c]-M(s,l)},Pt=(t,e,n="ease-out",s="transform")=>{it(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ue=(t,e,n)=>{!t||!it(t)||(t[e]=()=>{n()})},Xe=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},We=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},_e=(t,e)=>{e.forEach(n=>{Ve(t,n)})},Ve=(t,e)=>{var s;var n=Xe(t);n.sheet&&(We(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},fe=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&He(t,`--${n}`,s)}},He=(t,e,n)=>t&&t.style.setProperty(e,n),de="startDrag",Nt="drag",jt="startDrop",qe="drop",at="temp-child",ge="cubic-bezier(0.2, 0, 0, 1)",ze=t=>t===qe||t===jt,Ht=t=>!t||t.length==0?0:zt(t.replace("px","")),je=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=zt(n.replace("%","")),{width:r}=t.getBoundingClientRect();return r*(o/100)}return Ht(n)},Zt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=je(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},Ze=t=>{const{top:e,left:n}=getComputedStyle(t);return[Ht(e),Ht(n)]},ke=(t,e)=>{const{gap:n}=B(e),[s,o]=Zt(t,n);return o?s:0};function yt(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:c,width:l}=Je(n,t,o,r);return ht(t,s)&&e==Nt&&(c=0,l=0),{height:c,width:l}}const Je=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:f}=B(t),g=M(e,o),m=M(e,r),b=M(s,r),[R,O]=Zt(e.parentElement,l),F=f(e)[c];if(O)return te(F,m,g,R,0,t);const[y,p,T]=Ke(n,b,g,m,o);return te(F,p,y,0,T,t)},Ke=(t,e,n,s,o)=>{const r=Math.max(e,n);let c=s,l=e;if(t){const f=M(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[r,c,l]},te=(t,e,n,s,o,r)=>Qe(r,t+e+n+s-o),Qe=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},ee=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=B(t),c=M(e,n),l=M(e,s),f=r(e)[o];return c+l+f},Ue=(t,e)=>{const[n,s]=Ze(e),o=ee(et,t);return[ee(_,t)-s,o-n]};function tn(t,e,n,s,o,r,c,l,f){let g=0,m=0;const b=!!(n<0&&f);if(n===s&&!b)return ne({height:g,width:m},t,o,c,b);const[R,O,F,y]=sn(e,n,s,f);if(b){const[nt,ut]=Ue(l,f);g+=ut,m+=nt}const{scrollElement:p,beforeMargin:T,afterMargin:L,distance:w,gap:P}=B(t),[X,Z]=Zt(l,P),[V,H,$]=rn(T,L,R,O==null?void 0:O.previousElementSibling,y,Z,b),[k,q,J]=on(T,L,w,F,X,Z),I=nn(q,k,J,H,V,X),z=b?l[p]:en(p,l,r),Y=(y?I-$:$-I)-z;return t===et?g+=Y:t===_&&(m+=Y),ne({height:g,width:m},t,o,c,b)}const en=(t,e,n)=>{const s=e[t],o=n[t];return s-o},nn=(t,e,n,s,o,r)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+r},sn=(t,e,n,s)=>{const o=e<n,[r,c]=[e,n].toSorted((m,b)=>m-b),l=t[e]??s,f=t[n];let g=o?t.slice(r+1,c+1):t.slice(r,c);return r<0&&s&&(g=t.slice(r+1,c)),[l,f,g,o]},on=(t,e,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=M(s[0],t);let l=0,f=-c;for(const[g,m]of s.entries()){const b=m.getBoundingClientRect()[n],R=M(m,t);r&&(l+=R),r&&g>0?l+=o:l=Math.max(l,R),f+=l+b,l=M(m,e)}return[c,f,l]},ne=(t,e,n,s,o)=>{const{scroll:r,distance:c}=B(e),l=window[r],f=n[r],g=o?0:f-2*l+s[r];return t[c]+=g,t},rn=(t,e,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return cn(t,e,l,n,r,c)},cn=(t,e,n,s,o,r)=>{if(o)return[0,0,0];const c=M(r?null:n,e),l=M(s,t);let f=Math.max(c,l);return[c,l,f]},kt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];t(o,c)}});return o.observe(e,n),o},an=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},ln=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=B(t);return n[r]/(e[s]-e[o])},un="startDrag",pe="cubic-bezier(0.2, 0, 0, 1)",he=50,qt=t=>it(t)?t.classList.contains(at):!1,fn=(t,e,n)=>{let s=yt(e,un,n,t);const o=ke(t,n),{distance:r}=B(n);s[r]-=o;const[c,l]=dn(n,e);return s[l]=c,s},dn=(t,e)=>{const n=t==_?et:_,{distance:s,getRect:o}=B(n);return[o(e)[s],s]},mt=(t,e,n)=>{Ne(t,e,n),t.style.minWidth=`${n}px`},gn=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},pn=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:r}=s,c=ln(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:g}=B(r);c&&(n[g]=n[l]-n[f])},me=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(pn(n,e),o.querySelector(`.${at}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,g=document.createElement(f);tt(g,at),mt(g,0,0);const m=fn(o,t,c);return Pt(g,l,pe,"width, min-width, height"),[g,m,o]},Yt=(t,e,n,s,o)=>{const r=me(t,n,s);if(!r)return;const[c,l,f]=r;e.isSameNode(f)&&mt(c,l.height,l.width),kt(gn(c,f,l),f,{childList:!0,subtree:!0}),f.appendChild(c)},hn=(t,e,n)=>{const s=me(t,e,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),mn(o,r)},mn=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Pt(t,0,pe,"width, min-width, height")})}),Sn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;mt(c,0,0),setTimeout(()=>{var g;(g=c.parentNode)==null||g.removeChild(c)},s+he)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+he)):t.removeChild(o)})},Dn=50;function vn(t,e,n,s,o,r){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:g,animationDuration:m,delayBeforeInsert:b,draggingClass:R}=t,O=(u,a,h,D,C)=>{if(!D)return;const{droppable:E,config:v}=D,A=yt(u,a,v.direction,E);ze(a)?Z(u,a,A,h,D,C):T(u,a,A,D)},F=(u,a,h,D,C)=>{const E=yt(a,"insert",t.direction,h),{onInsertEvent:v}=t,A=ce(h);for(const[N,x]of A.entries())st(x,U)&&N>=u&&X(x,E);C(),setTimeout(()=>{v(u,D),Se(u,h,t),nt(a),W(a,n),bt(n,0,!0)},b)},y=(u,a,h,D)=>{if(!h||!h.droppable||!h.config)return;const{droppable:C,config:E}=h;let[v]=Rt(a,C);v=[a,...v].toReversed();const A=yt(a,"remove",E.direction,C);for(const[N,x]of v.entries())N>=u&&(P(x,A),setTimeout(()=>{D(x)},m))},p=u=>{bt(n,m,!0),setTimeout(()=>{nt(u),W(u,n)},m)},T=(u,a,h,D)=>{const{config:C,droppable:E}=D,[v]=Rt(u,E),A=ht(u,E);v.length==0&&w(h,1,C.direction,v);for(const[N,x]of v.entries()){if(!st(x,U))continue;const G=L(C.direction,u,x,h);if(!A&&G)h=G;else if(!A)continue;const K=v.length-N;w(h,K,C.direction,v),a===de?P(x,h):a===Nt&&X(x,h)}},L=(u,a,h,D)=>{const{before:C,distance:E,axis:v,getRect:A}=B(u),N=A(a),x=A(h),G=N[C],K=x[C],St=x[E],ft=K+St/2,Dt=Be(h)[v],rt=ft-Dt;return G>rt?{height:0,width:0}:D},w=(u,a,h,D)=>{const C=D.filter(v=>st(v,U)).length,{distance:E}=B(h);u[E]==0?c=Math.max(c,a):c=Math.min(c,a-1),c=Math.min(c,C)},P=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h)},X=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h),Pt(u,m,ge)},Z=(u,a,h,D,C,E)=>{const{droppable:v,scroll:A,config:N}=C,[x,G]=Rt(u,v),K=x.toReversed(),St=G===-1?K.length:G;K.splice(St,0,u);const[ft,Dt,rt]=V(u,G,K,v);h=yt(u,a,N.direction,n,ft,Dt);const $t=xe(),xt=tn(N.direction,K,G,rt,$t,A,D,v,u);x.length==0&&H(void 0,h,u,xt);for(const[Gt,wt]of x.toReversed().entries()){let Bt=h;rt-1>=Gt&&(Bt={height:0,width:0}),a===jt&&!st(wt,at)&&H(wt,Bt,u,xt)}$(rt,u,N,v,E)},V=(u,a,h,D)=>{const E=ht(u,D)?a:c,v=()=>a<E?[E,E+1]:a>E?[E-1,E]:[E-1,E+1],[A,N]=v(),x=h[A]??null,G=h[N]??null;return[x,G,E]},H=(u,a,h,D)=>{Et(u,a.height,a.width),Et(h,D.height,D.width)},$=(u,a,h,D,C)=>{const{onInsertEvent:E,onDragEnd:v}=h;tt(a,_t),J(a,n,D,()=>{if(Ct(a,_t),C!=null){const A=g(C,!0);A!=null&&(E(u,A,!0),v({value:A,index:u})),q(a),k()}})},k=()=>{if(s){var u=document.querySelectorAll(`${pt(s)} > .${U}`);for(const a of u)Y(a)}},q=u=>{setTimeout(()=>{Ct(u,R)},Dn)},J=(u,a,h,D)=>{setTimeout(()=>{D&&D(),I(a,h),z(h),nt(u),W(u,a),W(u,h)},m)},I=(u,a)=>{u.isSameNode(a)?bt(u,m):(bt(u,m,!0),bt(a,m))},z=u=>{if(n.isSameNode(u))return;var[a]=n.querySelectorAll(`.${at}`);if(!a)return;const{distance:h}=B(l);it(a)&&(a.style[h]="0px")},W=(u,a)=>{const[h]=Rt(u,a);for(const D of[...h,u])Y(D)},Y=u=>{it(u)&&(u.style.transition="",u.style.transform="")},nt=u=>{r(),ot(u,!1),u.style.transform="",u.style.transition="",u.style.top="",u.style.left="",fe(u,{fixedHeight:"",fixedWidth:""})},ut=(u,a)=>{const h=a.querySelector(f);gt(document.body,oe,u),gt(h||a,Wt,u)},ot=(u,a)=>{gt(u,Ft,a),ut(a,u),o.toggleGrabClass(!a)};return[O,y,F,p,ot]}const bn=t=>t.addedNodes.values().filter(n=>!qt(n)).toArray().length>0,Se=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ce(e)[t];tt(l,s),tt(l,Kt),setTimeout(()=>{Ct(l,Kt),Ct(l,s),r.disconnect()},o)},e,{childList:!0},bn)},Tn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:r}=t;setTimeout(()=>{o(n,s),Se(n,e,t)},r)},En=(t,e)=>{const n=(l,f)=>t.removeAtEvent(l,f),s=(l,f,g)=>t.insertEvent(l,f,g),o=()=>t.getLength(),r=l=>t.getValue(l),c=l=>l;return{direction:(e==null?void 0:e.direction)??et,handlerSelector:(e==null?void 0:e.handlerSelector)??U,draggingClass:(e==null?void 0:e.draggingClass)??"dragging",droppableClass:(e==null?void 0:e.droppableClass)??"droppable-hover",isDraggable:(e==null?void 0:e.isDraggable)??(()=>!0),onDragStart:(e==null?void 0:e.onDragStart)??(()=>{}),onDragEnd:(e==null?void 0:e.onDragEnd)??(()=>{}),droppableGroup:e==null?void 0:e.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(e==null?void 0:e.animationDuration)??200,removingClass:(e==null?void 0:e.removingClass)??"removing",insertingFromClass:(e==null?void 0:e.insertingFromClass)??"from-inserting",delayBeforeRemove:(e==null?void 0:e.delayBeforeRemove)??200,delayBeforeInsert:(e==null?void 0:e.delayBeforeInsert)??200,mapFrom:(e==null?void 0:e.mapFrom)??c}},yn=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:f=>{const{index:g,value:m}=f;r({index:g,value:e(m,s)})},onInsertEvent:(f,g)=>o(f,e(g,s),!0)}},Cn=t=>{let e={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=f=>{t.style.transform=`translate( ${f.x}px, ${f.y}px)`},r=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,g,m,b)=>{const R=y=>{const{beforeMargin:p,borderBeforeWidth:T,before:L,offset:w,scroll:P,page:X,inner:Z,distance:V,axis:H,getRect:$}=B(y),k=m[X],q=window[P],J=window[Z],I=$(f)[V],z=M(f,T),W=M(f,p),Y=k-e[w],nt=ae(f,y);if(Y>=q-I/2&&Y<=q+J){const ot=Y-n[L]-z-W-q-nt;return O(y),ot}return s[H]},O=y=>{if(f&&st(f,Ft)&&y===b){const{before:p,distance:T,axis:L,getRect:w}=B(b),P=w(f)[T],X=w(g),Z=n[p]-X[p]+s[L],H=X[T]-P,$=Z/H,k=P/H,q=.1,J=.2,I=.8;let z=0;const W=ht(f,g);!W&&$<J&&$>-k?z=$/J-1:!W&&$>I&&$<1+k&&(z=1/(1-I)*($-I));const Y=q*P*z;an(g,b,Y)}},F=y=>{const{axis:p}=B(y);s[p]=R(y),o(s)};F(_),F(et)},(f,g)=>{const[m,b,R,O]=wn(f,g,t);n={top:m,left:b},r(n),e={offsetX:R,offsetY:O}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=B(t);return r(e)[o]-r(n)[o]-M(n,s)},An=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=xn(o,e);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(_,c,r),s+=Lt(et,c,r)),r&&e!=o&&(n+=Lt(_,r,e),s+=Lt(et,r,e)),[n,s]},xn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Mt}`);return n&&n.isSameNode(e)?t:n},se=(t,e,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:f}=B(t),g=ae(n,t);return e[c]-s[o]-M(n,r)-M(n,l)-window[f]-g},wn=(t,e,n)=>{const[s,o]=An(t,n);return[se(et,t,e,{offsetX:s,offsetY:o}),se(_,t,e,{offsetX:s,offsetY:o}),s,o]},Q=class Q{static addConfig(e,n){const s=Q.configs.filter(r=>!r.droppable.isSameNode(e)),o=Ut(e);s.push({droppable:e,config:n,scroll:o}),Q.configs=s}static updateScrolls(e,n){for(const s of Q.configs){const{droppable:o}=s;(n&&Ce(o,n)||o.isSameNode(e))&&(s.scroll=Ut(o))}}static getConfig(e){return Q.configs.find(({droppable:s})=>s.isSameNode(e))}};j(Q,"configs",[]),j(Q,"removeObsoleteConfigs",()=>{const e=Q.configs.filter(({droppable:n})=>document.contains(n));Q.configs=e});let lt=Q;class Bn{constructor(e,n,s,o,r,c){j(this,"initial");j(this,"current");j(this,"parent");j(this,"draggableElement");j(this,"groupClass");j(this,"dragEvent");j(this,"changeDroppable");j(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?lt.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!o.isSameNode(s))}getElementBelow(e,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,e);return l};let r=null;return s?(e.hidden=!0,r=o(this),e.hidden=!1):r=o(this),r}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(e,s))}isNotInsideAnotherDroppable(e,n){return!ht(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ue(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=lt.getConfig(e);if(n)return e.isSameNode(this.parent)?n:{...n,config:yn(n,this.mapFrom)}}getCurrentConfig(e){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,e);return s?(it(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(e){const n=this.current;this.current=this.getCurrentConfig(e),this.changeDroppable(this.current,n)}isOutside(e,n=!0){const s=this.draggableElement;return!this.getCurrent(s,e,n)}}function Rn(t,e,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:g,draggingClass:m,removingClass:b,onRemoveAtEvent:R,droppableClass:O,onDragStart:F}=n,y=At(l).map(i=>`droppable-group-${i}`).join(" ");let p=0,T={scrollX:0,scrollY:0},L={pageX:0,pageY:0},w,P;const[X,Z]=Cn(t),[V,H,$,k,q]=vn(n,e,s,y,o,()=>p=0),J=()=>{tt(t,U)},I=i=>{tt(i,Mt),o.addSubscriber(i)},z=()=>{if(c(t)){const i=t.querySelector(r);I(i||t)}},W=()=>{z(),J()},Y=i=>{const d=i==null?void 0:i.querySelector(`.${Mt}`),S=d==null?void 0:d.parentElement;return d&&S&&st(S,Xt)&&!S.isSameNode(s)?null:d},nt=i=>{const d=Y(i)??i;d&&c(i)&&(It(d,"onmousedown",G("mousemove","mouseup")),It(d,"ontouchstart",G("touchmove","touchend"),S=>{P={x:S.touches[0].clientX,y:S.touches[0].clientY}}),ut(d)),i!=null&&i.isSameNode(d)||It(i,"onmousedown",K),tt(s,Xt)},ut=i=>{const d=i.querySelectorAll("img");Array.from(d).forEach(S=>{S.onmousedown=()=>!1})},ot=()=>{if(L.pageX==0&&L.pageY==0||!a.current)return;const{droppable:i,config:d}=a.current;X(t,i,L,d.direction),V(t,Nt,T,a.current)},u=(i,d)=>{d&&p==2&&!(i!=null&&i.droppable.isSameNode(d.droppable))&&V(t,Nt,T,d)},a=new Bn(t,y,s,ot,u,n.mapFrom),h=i=>{if(!a.current)return;const d=y?Array.from(document.querySelectorAll(pt(y))):[s];for(const S of d)S.classList.toggle(O,!i&&S.isSameNode(a.current.droppable))},D=(i,d=!1)=>{a.updateConfig(i);const S=a.isOutside(i);h(S),p===1&&!d?rt(i):p===2&&(C(S),xt(i))},C=(i=!0)=>{if(!a.current)return;const{droppable:d}=a.current;Sn(d,s,y,f,i),!i&&Yt(t,s,p==1,a.current)},E=i=>{if(Tt(i)&&P&&p==1){const d=Math.abs(i.touches[0].clientX-P.x),S=Math.abs(i.touches[0].clientY-P.y);if(Math.abs(d)>5&&Math.abs(S)>5)return clearTimeout(w),!1}return!0},v=i=>{clearTimeout(w);const d=Vt(i);if(Tt(i)&&i.cancelable&&i.preventDefault(),Tt(i)&&!i.cancelable||!E(i)){ft("touchmove",i);return}D(d,Tt(i))},A=(i,d)=>{i=="touchmove"?w=setTimeout(()=>{d()},150):d()},N=(i,d)=>{const{clientX:S,clientY:dt}=i,ct=document.elementFromPoint(S,dt),vt=ct==null?void 0:ct.closest(`.${U}`);return vt&&d.isSameNode(vt)},x=i=>{const d=n.onGetValue(e);return{index:e,element:i,value:d}},G=(i,d)=>S=>{if(!N(S,t))return;lt.updateScrolls(s,y);const{scrollX:dt,scrollY:ct}=window;if(T={scrollX:dt,scrollY:ct},p===0){p=1;const vt=x(t);vt&&F(vt),A(i,()=>{i=="touchmove"&&(a.updateConfig(S),h(a.isOutside(S)),rt(S))}),document.addEventListener(i,v,{passive:!1}),Gt(s),document.addEventListener(d,St(i),{once:!0})}},K=i=>a.updateConfig(i),St=i=>d=>{ft(i,d)},ft=(i,d)=>{h(!0);const S=Vt(d);Bt(a.isOutside(S,!1)),clearTimeout(w),document.removeEventListener(i,v),a.updateConfig(S);const dt=a.getCurrentConfig(S);if(dt){const{droppable:ct}=dt;Dt(ct)}s.onscroll=null},Dt=i=>{if(i.onscroll=null,!y)return;const d=Array.from(document.querySelectorAll(pt(y)));for(const S of d)it(S)&&(S.onscroll=null)},rt=i=>{Yt(t,s,p==1,a.current),$t(),V(t,de,T,a.current),De(t),Z(i,t)},$t=()=>{p=2},xt=i=>{const{pageX:d,pageY:S}=i;L={pageX:d,pageY:S},ot()},Gt=i=>ue(i,"onscroll",wt),wt=()=>ot(),Bt=i=>{if(p!==2&&p!==1){p=0;return}p=3,Jt(t),t.classList.contains(Ft)&&V(t,jt,T,i?a.initial:a.current,e)},Jt=i=>{Pt(i,f,ge),Et(i,0,0)},De=i=>{const{height:d,width:S}=i.getBoundingClientRect();fe(i,{fixedHeight:`${d}px`,fixedWidth:`${S}px`}),q(i,!0),gt(i,m,!0),i.style.transition=""},ve=(i,d)=>{Ct(t,b),Yt(t,s,p==1,a.initial),H(i,t,d,S=>{Jt(S),k(t)}),R(e,!0)},be=i=>{if(!a.initial)return;const d=a.initial;i==e&&(tt(t,b),setTimeout(()=>{ve(i,d)},g))},Te=(i,d)=>{(i===e||i===n.onGetLegth()&&e===i-1)&&$(i,t,s,d,()=>{hn(t,p==1,a.initial)})};return W(),nt(t),[be,Te]}const Ln=(t,e)=>{t&&Ae(e,t)},Mn=()=>{_e(document.body,[`.${U}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Mt}{pointer-events:auto!important;}`,`.${re}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ft}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${_t}{pointer-events:none!important;}`,`.${oe}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function On(t,e,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=t;if(!n)return[r,c];const f=At(l).map(g=>`droppable-group-${g}`).join(" ");Mn(),Ln(f,n);for(const g of n.children){const m=g.getAttribute(o),b=we(m),R=g;if(R&&b>=0){const[O,F]=Rn(R,b,t,n,e);r.push(O),c.push(F)}}return[r,c]}function Nn(t,e,n,s="index",o=!0){let r=[],c=[];const l=En(t,n),f=p=>{for(const T of r)T(p)},g=(p,T)=>{if(l.onGetLegth()===0)t.insertToListEmpty(l,p,T);else for(const w of c)w(p,T)},m=p=>{const[T,L]=On(l,e,p,s);r=T,c=L},b=p=>{const T=p.addedNodes.values().filter(w=>!qt(w)).toArray(),L=p.removedNodes.values().filter(w=>!qt(w)).toArray();return T.length>0||L.length>0},R=p=>{kt(T=>{m(p),o||T.disconnect()},p,{childList:!0},b)},O=p=>{tt(p,Xt)},F=p=>{lt.addConfig(p,l)};return[f,g,p=>{p&&(O(p),F(p),R(p),m(p),lt.removeObsoleteConfigs())}]}exports.GRAB_CLASS=re;exports.addClass=tt;exports.dragAndDrop=Nn;exports.insertToListEmpty=Tn;exports.toggleClass=gt;
1
+ "use strict";var Ee=Object.defineProperty;var ye=(t,e,n)=>e in t?Ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var j=(t,e,n)=>ye(t,typeof e!="symbol"?e+"":e,n);const U="draggable",Xt="droppable",Mt="handler-class",Ft="dragging",Wt="dragging-handler-class",_t="dropping",oe="grabbing",re="grab",Kt="disable-transition",st=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},tt=(t,e)=>{t.classList.add(e)},Ct=(t,e)=>{t.classList.remove(e)},Ce=(t,e)=>At(e).every(n=>st(t,n)),pt=t=>t?`.${At(t).join(".")}`:"",Ae=(t,e)=>{if(!e)return;const n=At(e);t.classList.add(...n)},At=t=>t?t.split(" ").filter(e=>e):[],_="horizontal",et="vertical",xe=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},zt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),we=t=>t?parseInt(t):-1,Be=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},ie=(t,e)=>t.x1>e.x1?ie(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,ht=(t,e)=>!Re(t,e),Re=(t,e)=>{const n=Ot(t),s=Ot(e),o=Qt(n,s,et),r=Qt(n,s,_);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Qt=(t,e,n)=>{const{before:s,distance:o}=B(n);return ie({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},M=(t,e)=>t?zt(getComputedStyle(t)[e]):0,Ut=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Ot=t=>t.getBoundingClientRect(),B=t=>{const e=t==_;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",after:e?"right":"down",gap:e?"columnGap":"rowGap",distance:e?"width":"height",axis:e?"x":"y",offset:e?"offsetX":"offsetY",scroll:e?"scrollX":"scrollY",scrollElement:e?"scrollLeft":"scrollTop",page:e?"pageX":"pageY",inner:e?"innerWidth":"innerHeight",offsetElement:e?"offsetLeft":"offsetTop",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:Ot}},Rt=(t,e)=>Le(t,e),ce=t=>[...t.children].filter(n=>st(n,U)),Le=(t,e)=>{const n=[...e.children].filter(o=>st(o,U)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Me=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ae=(t,e)=>{const{before:n,borderBeforeWidth:s}=B(e),o=Me(t);return o?Ot(o)[n]+M(o,s):0},Tt=t=>window.TouchEvent&&t instanceof TouchEvent,it=t=>t instanceof HTMLElement,le=t=>t instanceof MouseEvent,Oe=["onmouseup","onmousedown","onmousemove"],Ne=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Et=(t,e,n)=>{!t||!it(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Fe=(t,e,n,s)=>{t[e]=o=>{if(o.defaultPrevented)return;s&&s(o);const r=Vt(o);n(r)}},It=(t,e,n,s)=>{n&&(Pe(e)?t[e]=n:Fe(t,e,n,s))},Pe=t=>Oe.includes(t),$e=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Ge=(t,e)=>{const n=(s,o)=>Ye(e,window,o,s);if(le(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,et)]}},Vt=t=>{const e=Ie(t);if(!e)return $e(t);const[n,s]=Ge(t,e),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m}=e;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:f,screenY:g,target:m,offsetX:n,offsetY:s}},Ie=t=>{if(Tt(t))return t.touches[0]??t.changedTouches[0];if(le(t))return t},Ye=(t,e,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:f}=B(n),g=f(s);return t[o]-e[r]-g[c]-M(s,l)},Pt=(t,e,n="ease-out",s="transform")=>{it(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ue=(t,e,n)=>{!t||!it(t)||(t[e]=()=>{n()})},Xe=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},We=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},_e=(t,e)=>{e.forEach(n=>{Ve(t,n)})},Ve=(t,e)=>{var s;var n=Xe(t);n.sheet&&(We(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},fe=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&He(t,`--${n}`,s)}},He=(t,e,n)=>t&&t.style.setProperty(e,n),de="startDrag",Nt="drag",jt="startDrop",qe="drop",at="temp-child",ge="cubic-bezier(0.2, 0, 0, 1)",ze=t=>t===qe||t===jt,Ht=t=>!t||t.length==0?0:zt(t.replace("px","")),je=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=zt(n.replace("%","")),{width:r}=t.getBoundingClientRect();return r*(o/100)}return Ht(n)},Zt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=je(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},Ze=t=>{const{top:e,left:n}=getComputedStyle(t);return[Ht(e),Ht(n)]},ke=(t,e)=>{const{gap:n}=B(e),[s,o]=Zt(t,n);return o?s:0};function yt(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:c,width:l}=Je(n,t,o,r);return ht(t,s)&&e==Nt&&(c=0,l=0),{height:c,width:l}}const Je=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:f}=B(t),g=M(e,o),m=M(e,r),b=M(s,r),[R,O]=Zt(e.parentElement,l),F=f(e)[c];if(O)return te(F,m,g,R,0,t);const[y,p,E]=Ke(n,b,g,m,o);return te(F,p,y,0,E,t)},Ke=(t,e,n,s,o)=>{const r=Math.max(e,n);let c=s,l=e;if(t){const f=M(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[r,c,l]},te=(t,e,n,s,o,r)=>Qe(r,t+e+n+s-o),Qe=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},ee=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=B(t),c=M(e,n),l=M(e,s),f=r(e)[o];return c+l+f},Ue=(t,e)=>{const[n,s]=Ze(e),o=ee(et,t);return[ee(_,t)-s,o-n]};function tn(t,e,n,s,o,r,c,l,f){let g=0,m=0;const b=!!(n<0&&f);if(n===s&&!b)return ne({height:g,width:m},t,o,c,b);const[R,O,F,y]=sn(e,n,s,f);if(b){const[nt,ut]=Ue(l,f);g+=ut,m+=nt}const{scrollElement:p,beforeMargin:E,afterMargin:L,distance:w,gap:P}=B(t),[X,Z]=Zt(l,P),[V,H,$]=rn(E,L,R,O==null?void 0:O.previousElementSibling,y,Z,b),[k,q,J]=on(E,L,w,F,X,Z),I=nn(q,k,J,H,V,X),z=b?l[p]:en(p,l,r),Y=(y?I-$:$-I)-z;return t===et?g+=Y:t===_&&(m+=Y),ne({height:g,width:m},t,o,c,b)}const en=(t,e,n)=>{const s=e[t],o=n[t];return s-o},nn=(t,e,n,s,o,r)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+r},sn=(t,e,n,s)=>{const o=e<n,[r,c]=[e,n].toSorted((m,b)=>m-b),l=t[e]??s,f=t[n];let g=o?t.slice(r+1,c+1):t.slice(r,c);return r<0&&s&&(g=t.slice(r+1,c)),[l,f,g,o]},on=(t,e,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=M(s[0],t);let l=0,f=-c;for(const[g,m]of s.entries()){const b=m.getBoundingClientRect()[n],R=M(m,t);r&&(l+=R),r&&g>0?l+=o:l=Math.max(l,R),f+=l+b,l=M(m,e)}return[c,f,l]},ne=(t,e,n,s,o)=>{const{scroll:r,distance:c}=B(e),l=window[r],f=n[r],g=o?0:f-2*l+s[r];return t[c]+=g,t},rn=(t,e,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return cn(t,e,l,n,r,c)},cn=(t,e,n,s,o,r)=>{if(o)return[0,0,0];const c=M(r?null:n,e),l=M(s,t);let f=Math.max(c,l);return[c,l,f]},kt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];t(o,c)}});return o.observe(e,n),o},an=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},ln=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=B(t);return n[r]/(e[s]-e[o])},un="startDrag",pe="cubic-bezier(0.2, 0, 0, 1)",he=50,qt=t=>it(t)?t.classList.contains(at):!1,fn=(t,e,n)=>{let s=yt(e,un,n,t);const o=ke(t,n),{distance:r}=B(n);s[r]-=o;const[c,l]=dn(n,e);return s[l]=c,s},dn=(t,e)=>{const n=t==_?et:_,{distance:s,getRect:o}=B(n);return[o(e)[s],s]},mt=(t,e,n)=>{Ne(t,e,n),t.style.minWidth=`${n}px`},gn=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},pn=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:r}=s,c=ln(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:g}=B(r);c&&(n[g]=n[l]-n[f])},me=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(pn(n,e),o.querySelector(`.${at}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,g=document.createElement(f);tt(g,at),mt(g,0,0);const m=fn(o,t,c);return Pt(g,l,pe,"width, min-width, height"),[g,m,o]},Yt=(t,e,n,s,o)=>{const r=me(t,n,s);if(!r)return;const[c,l,f]=r;e.isSameNode(f)&&mt(c,l.height,l.width),kt(gn(c,f,l),f,{childList:!0,subtree:!0}),f.appendChild(c)},hn=(t,e,n)=>{const s=me(t,e,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),mn(o,r)},mn=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Pt(t,0,pe,"width, min-width, height")})}),Sn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;mt(c,0,0),setTimeout(()=>{var g;(g=c.parentNode)==null||g.removeChild(c)},s+he)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+he)):t.removeChild(o)})},Dn=50;function vn(t,e,n,s,o,r){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:g,animationDuration:m,delayBeforeInsert:b,draggingClass:R}=t,O=(u,a,h,D,C)=>{if(!D)return;const{droppable:T,config:v}=D,A=yt(u,a,v.direction,T);ze(a)?Z(u,a,A,h,D,C):E(u,a,A,D)},F=(u,a,h,D,C)=>{const T=yt(a,"insert",t.direction,h),{onInsertEvent:v}=t,A=ce(h);for(const[N,x]of A.entries())st(x,U)&&N>=u&&X(x,T);C(),setTimeout(()=>{v(u,D),Se(u,h,t),nt(a),W(a,n),bt(n,0,!0)},b)},y=(u,a,h,D)=>{if(!h||!h.droppable||!h.config)return;const{droppable:C,config:T}=h;let[v]=Rt(a,C);v=[a,...v].toReversed();const A=yt(a,"remove",T.direction,C);for(const[N,x]of v.entries())N>=u&&(P(x,A),setTimeout(()=>{D(x)},m))},p=u=>{bt(n,m,!0),setTimeout(()=>{nt(u),W(u,n)},m)},E=(u,a,h,D)=>{const{config:C,droppable:T}=D,[v]=Rt(u,T),A=ht(u,T);v.length==0&&w(h,1,C.direction,v);for(const[N,x]of v.entries()){if(!st(x,U))continue;const G=L(C.direction,u,x,h);if(!A&&G)h=G;else if(!A)continue;const K=v.length-N;w(h,K,C.direction,v),a===de?P(x,h):a===Nt&&X(x,h)}},L=(u,a,h,D)=>{const{before:C,distance:T,axis:v,getRect:A}=B(u),N=A(a),x=A(h),G=N[C],K=x[C],St=x[T],ft=K+St/2,Dt=Be(h)[v],rt=ft-Dt;return G>rt?{height:0,width:0}:D},w=(u,a,h,D)=>{const C=D.filter(v=>st(v,U)).length,{distance:T}=B(h);u[T]==0?c=Math.max(c,a):c=Math.min(c,a-1),c=Math.min(c,C)},P=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h)},X=(u,a)=>{const{width:h,height:D}=a;Et(u,D,h),Pt(u,m,ge)},Z=(u,a,h,D,C,T)=>{const{droppable:v,scroll:A,config:N}=C,[x,G]=Rt(u,v),K=x.toReversed(),St=G===-1?K.length:G;K.splice(St,0,u);const[ft,Dt,rt]=V(u,G,K,v);h=yt(u,a,N.direction,n,ft,Dt);const $t=xe(),xt=tn(N.direction,K,G,rt,$t,A,D,v,u);x.length==0&&H(void 0,h,u,xt);for(const[Gt,wt]of x.toReversed().entries()){let Bt=h;rt-1>=Gt&&(Bt={height:0,width:0}),a===jt&&!st(wt,at)&&H(wt,Bt,u,xt)}$(rt,u,N,v,T)},V=(u,a,h,D)=>{const T=ht(u,D)?a:c,v=()=>a<T?[T,T+1]:a>T?[T-1,T]:[T-1,T+1],[A,N]=v(),x=h[A]??null,G=h[N]??null;return[x,G,T]},H=(u,a,h,D)=>{Et(u,a.height,a.width),Et(h,D.height,D.width)},$=(u,a,h,D,C)=>{const{onInsertEvent:T,onDragEnd:v}=h;tt(a,_t),J(a,n,D,()=>{if(Ct(a,_t),C!=null){const A=g(C,!0);A!=null&&(T(u,A,!0),v({value:A,index:u})),q(a),k()}})},k=()=>{if(s){var u=document.querySelectorAll(`${pt(s)} > .${U}`);for(const a of u)Y(a)}},q=u=>{setTimeout(()=>{Ct(u,R)},Dn)},J=(u,a,h,D)=>{setTimeout(()=>{D&&D(),I(a,h),z(h),nt(u),W(u,a),W(u,h)},m)},I=(u,a)=>{u.isSameNode(a)?bt(u,m):(bt(u,m,!0),bt(a,m))},z=u=>{if(n.isSameNode(u))return;var[a]=n.querySelectorAll(`.${at}`);if(!a)return;const{distance:h}=B(l);it(a)&&(a.style[h]="0px")},W=(u,a)=>{const[h]=Rt(u,a);for(const D of[...h,u])Y(D)},Y=u=>{it(u)&&(u.style.transition="",u.style.transform="")},nt=u=>{r(),ot(u,!1),u.style.transform="",u.style.transition="",u.style.top="",u.style.left="",fe(u,{fixedHeight:"",fixedWidth:""})},ut=(u,a)=>{const h=a.querySelector(f);gt(document.body,oe,u),gt(h||a,Wt,u)},ot=(u,a)=>{gt(u,Ft,a),ut(a,u),o.toggleGrabClass(!a)};return[O,y,F,p,ot]}const bn=t=>t.addedNodes.values().filter(n=>!qt(n)).toArray().length>0,Se=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ce(e)[t];tt(l,s),tt(l,Kt),setTimeout(()=>{Ct(l,Kt),Ct(l,s),r.disconnect()},o)},e,{childList:!0},bn)},Tn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:r}=t;setTimeout(()=>{o(n,s),Se(n,e,t)},r)},En=(t,e)=>{const n=(l,f)=>t.removeAtEvent(l,f),s=(l,f,g)=>t.insertEvent(l,f,g),o=()=>t.getLength(),r=l=>t.getValue(l),c=l=>l;return{direction:(e==null?void 0:e.direction)??et,handlerSelector:(e==null?void 0:e.handlerSelector)??U,draggingClass:(e==null?void 0:e.draggingClass)??"dragging",droppableClass:(e==null?void 0:e.droppableClass)??"droppable-hover",isDraggable:(e==null?void 0:e.isDraggable)??(()=>!0),onDragStart:(e==null?void 0:e.onDragStart)??(()=>{}),onDragEnd:(e==null?void 0:e.onDragEnd)??(()=>{}),droppableGroup:e==null?void 0:e.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(e==null?void 0:e.animationDuration)??200,removingClass:(e==null?void 0:e.removingClass)??"removing",insertingFromClass:(e==null?void 0:e.insertingFromClass)??"from-inserting",delayBeforeRemove:(e==null?void 0:e.delayBeforeRemove)??200,delayBeforeInsert:(e==null?void 0:e.delayBeforeInsert)??200,mapFrom:(e==null?void 0:e.mapFrom)??c}},yn=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:f=>{const{index:g,value:m}=f;r({index:g,value:e(m,s)})},onInsertEvent:(f,g)=>o(f,e(g,s),!0)}},Cn=t=>{let e={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=f=>{t.style.transform=`translate( ${f.x}px, ${f.y}px)`},r=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,g,m,b)=>{const R=y=>{const{beforeMargin:p,borderBeforeWidth:E,before:L,offset:w,scroll:P,page:X,inner:Z,distance:V,axis:H,getRect:$}=B(y),k=m[X],q=window[P],J=window[Z],I=$(f)[V],z=M(f,E),W=M(f,p),Y=k-e[w],nt=ae(f,y);if(Y>=q-I/2&&Y<=q+J){const ot=Y-n[L]-z-W-q-nt;return O(y),ot}return s[H]},O=y=>{if(f&&st(f,Ft)&&y===b){const{before:p,distance:E,axis:L,getRect:w}=B(b),P=w(f)[E],X=w(g),Z=n[p]-X[p]+s[L],H=X[E]-P,$=Z/H,k=P/H,q=.1,J=.2,I=.8;let z=0;const W=ht(f,g);!W&&$<J&&$>-k?z=$/J-1:!W&&$>I&&$<1+k&&(z=1/(1-I)*($-I));const Y=q*P*z;an(g,b,Y)}},F=y=>{const{axis:p}=B(y);s[p]=R(y),o(s)};F(_),F(et)},(f,g)=>{const[m,b,R,O]=wn(f,g,t);n={top:m,left:b},r(n),e={offsetX:R,offsetY:O}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=B(t);return r(e)[o]-r(n)[o]-M(n,s)},An=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=xn(o,e);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(_,c,r),s+=Lt(et,c,r)),r&&e!=o&&(n+=Lt(_,r,e),s+=Lt(et,r,e)),[n,s]},xn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Mt}`);return n&&n.isSameNode(e)?t:n},se=(t,e,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:f}=B(t),g=ae(n,t);return e[c]-s[o]-M(n,r)-M(n,l)-window[f]-g},wn=(t,e,n)=>{const[s,o]=An(t,n);return[se(et,t,e,{offsetX:s,offsetY:o}),se(_,t,e,{offsetX:s,offsetY:o}),s,o]},Q=class Q{static addConfig(e,n){const s=Q.configs.filter(r=>!r.droppable.isSameNode(e)),o=Ut(e);s.push({droppable:e,config:n,scroll:o}),Q.configs=s}static updateScrolls(e,n){for(const s of Q.configs){const{droppable:o}=s;(n&&Ce(o,n)||o.isSameNode(e))&&(s.scroll=Ut(o))}}static getConfig(e){return Q.configs.find(({droppable:s})=>s.isSameNode(e))}};j(Q,"configs",[]),j(Q,"removeObsoleteConfigs",()=>{const e=Q.configs.filter(({droppable:n})=>document.contains(n));Q.configs=e});let lt=Q;class Bn{constructor(e,n,s,o,r,c){j(this,"initial");j(this,"current");j(this,"parent");j(this,"draggableElement");j(this,"groupClass");j(this,"dragEvent");j(this,"changeDroppable");j(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?lt.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!o.isSameNode(s))}getElementBelow(e,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,e);return l};let r=null;return s?(e.hidden=!0,r=o(this),e.hidden=!1):r=o(this),r}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(e,s))}isNotInsideAnotherDroppable(e,n){return!ht(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ue(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=lt.getConfig(e);if(n)return e.isSameNode(this.parent)?n:{...n,config:yn(n,this.mapFrom)}}getCurrentConfig(e){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,e);return s?(it(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(e){const n=this.current;this.current=this.getCurrentConfig(e),this.changeDroppable(this.current,n)}isOutside(e,n=!0){const s=this.draggableElement;return!this.getCurrent(s,e,n)}}function Rn(t,e,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:g,draggingClass:m,removingClass:b,onRemoveAtEvent:R,droppableClass:O,onDragStart:F}=n,y=At(l).map(i=>`droppable-group-${i}`).join(" ");let p=0,E={scrollX:0,scrollY:0},L={pageX:0,pageY:0},w,P;const[X,Z]=Cn(t),[V,H,$,k,q]=vn(n,e,s,y,o,()=>p=0),J=()=>{tt(t,U)},I=i=>{tt(i,Mt),o.addSubscriber(i)},z=()=>{if(c(t)){const i=t.querySelector(r);I(i||t)}},W=()=>{z(),J()},Y=i=>{const d=i==null?void 0:i.querySelector(`.${Mt}`),S=d==null?void 0:d.parentElement;return d&&S&&st(S,Xt)&&!S.isSameNode(s)?null:d},nt=i=>{const d=Y(i)??i;d&&c(i)&&(It(d,"onmousedown",G("mousemove","mouseup")),It(d,"ontouchstart",G("touchmove","touchend"),S=>{P={x:S.touches[0].clientX,y:S.touches[0].clientY}}),ut(d)),i!=null&&i.isSameNode(d)||It(i,"onmousedown",K),tt(s,Xt)},ut=i=>{const d=i.querySelectorAll("img");Array.from(d).forEach(S=>{S.onmousedown=()=>!1})},ot=()=>{if(L.pageX==0&&L.pageY==0||!a.current)return;const{droppable:i,config:d}=a.current;X(t,i,L,d.direction),V(t,Nt,E,a.current)},u=(i,d)=>{d&&p==2&&!(i!=null&&i.droppable.isSameNode(d.droppable))&&V(t,Nt,E,d)},a=new Bn(t,y,s,ot,u,n.mapFrom),h=i=>{if(!a.current)return;const d=y?Array.from(document.querySelectorAll(pt(y))):[s];for(const S of d)S.classList.toggle(O,!i&&S.isSameNode(a.current.droppable))},D=(i,d=!1)=>{a.updateConfig(i);const S=a.isOutside(i);h(S),p===1&&!d?rt(i):p===2&&(C(S),xt(i))},C=(i=!0)=>{if(!a.current)return;const{droppable:d}=a.current;Sn(d,s,y,f,i),!i&&Yt(t,s,p==1,a.current)},T=i=>{if(Tt(i)&&P&&p==1){const d=Math.abs(i.touches[0].clientX-P.x),S=Math.abs(i.touches[0].clientY-P.y);if(Math.abs(d)>5&&Math.abs(S)>5)return clearTimeout(w),!1}return!0},v=i=>{clearTimeout(w);const d=Vt(i);if(Tt(i)&&i.cancelable&&i.preventDefault(),Tt(i)&&!i.cancelable||!T(i)){ft("touchmove",i);return}D(d,Tt(i))},A=(i,d)=>{i=="touchmove"?w=setTimeout(()=>{d()},150):d()},N=(i,d)=>{const{clientX:S,clientY:dt}=i,ct=document.elementFromPoint(S,dt),vt=ct==null?void 0:ct.closest(`.${U}`);return vt&&d.isSameNode(vt)},x=i=>{const d=n.onGetValue(e);return{index:e,element:i,value:d}},G=(i,d)=>S=>{if(!N(S,t))return;lt.updateScrolls(s,y);const{scrollX:dt,scrollY:ct}=window;if(E={scrollX:dt,scrollY:ct},p===0){p=1;const vt=x(t);vt&&F(vt),A(i,()=>{i=="touchmove"&&(a.updateConfig(S),h(a.isOutside(S)),rt(S))}),document.addEventListener(i,v,{passive:!1}),Gt(s),document.addEventListener(d,St(i),{once:!0})}},K=i=>a.updateConfig(i),St=i=>d=>{ft(i,d)},ft=(i,d)=>{h(!0);const S=Vt(d);Bt(a.isOutside(S,!1)),clearTimeout(w),document.removeEventListener(i,v),a.updateConfig(S);const dt=a.getCurrentConfig(S);if(dt){const{droppable:ct}=dt;Dt(ct)}s.onscroll=null},Dt=i=>{if(i.onscroll=null,!y)return;const d=Array.from(document.querySelectorAll(pt(y)));for(const S of d)it(S)&&(S.onscroll=null)},rt=i=>{Yt(t,s,p==1,a.current),$t(),V(t,de,E,a.current),De(t),Z(i,t)},$t=()=>{p=2},xt=i=>{const{pageX:d,pageY:S}=i;L={pageX:d,pageY:S},ot()},Gt=i=>ue(i,"onscroll",wt),wt=()=>ot(),Bt=i=>{if(p!==2&&p!==1){p=0;return}p=3,Jt(t),t.classList.contains(Ft)&&V(t,jt,E,i?a.initial:a.current,e)},Jt=i=>{Pt(i,f,ge),Et(i,0,0)},De=i=>{const{height:d,width:S}=i.getBoundingClientRect();fe(i,{fixedHeight:`${d}px`,fixedWidth:`${S}px`}),q(i,!0),gt(i,m,!0),i.style.transition=""},ve=(i,d)=>{Ct(t,b),Yt(t,s,p==1,a.initial),H(i,t,d,S=>{Jt(S),k(t)}),R(e,!0)},be=i=>{if(!a.initial)return;const d=a.initial;i==e&&(tt(t,b),setTimeout(()=>{ve(i,d)},g))},Te=(i,d)=>{(i===e||i===n.onGetLegth()&&e===i-1)&&$(i,t,s,d,()=>{hn(t,p==1,a.initial)})};return W(),nt(t),[be,Te]}const Ln=(t,e)=>{t&&Ae(e,t)},Mn=()=>{_e(document.body,[`.${U}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Mt}{pointer-events:auto!important;}`,`.${re}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ft}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${_t}{pointer-events:none!important;}`,`.${oe}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function On(t,e,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=t;if(!n)return[r,c];const f=At(l).map(g=>`droppable-group-${g}`).join(" ");Mn(),Ln(f,n);for(const g of n.children){const m=g.getAttribute(o),b=we(m),R=g;if(R&&b>=0){const[O,F]=Rn(R,b,t,n,e);r.push(O),c.push(F)}}return[r,c]}function Nn(t,e,n,s="index"){let o=[],r=[],c;const l=En(t,n),f=p=>{for(const E of o)E(p)},g=(p,E)=>{if(l.onGetLegth()===0)t.insertToListEmpty(l,p,E);else for(const w of r)w(p,E)},m=p=>{const[E,L]=On(l,e,p,s);o=E,r=L},b=p=>{const E=p.addedNodes.values().filter(w=>!qt(w)).toArray(),L=p.removedNodes.values().filter(w=>!qt(w)).toArray();return E.length>0||L.length>0},R=p=>{c=kt(()=>{m(p)},p,{childList:!0},b)},O=p=>{tt(p,Xt)},F=p=>{lt.addConfig(p,l)};return[f,g,p=>{if(p)return O(p),F(p),R(p),m(p),lt.removeObsoleteConfigs(),c}]}exports.GRAB_CLASS=re;exports.addClass=tt;exports.dragAndDrop=Nn;exports.insertToListEmpty=Tn;exports.toggleClass=gt;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),y=require("../HandlerPublisher-DopQmmiO.cjs"),S=require("../index-DtPM9-d-.cjs"),h=require("react-dom");function A(a,l){const[e,n]=u.useState(a),i=u.useRef(e);u.useEffect(()=>{i.current=e},[e]);function f(t,r=!1){const s=i.current[t],c=()=>{n(o=>[...o.slice(0,t),...o.slice(t+1)])};return r?h.flushSync(c):c(),s}function d(t,r,s=!1){const c=()=>{n(o=>[...o.slice(0,t),r,...o.slice(t)])};s?h.flushSync(c):c()}function g(){return e.length}function m(t){return e[t]}function b(t,r,s){S.insertToListEmpty(t,l.current,r,s)}return[e,n,{removeAtEvent:f,insertEvent:d,getLength:g,getValue:m,insertToListEmpty:b}]}const D=new y.HandlerPublisher;function E(a,l){const e=u.useRef(null),[n,i,f]=A(a,e),[d,g,m]=S.dragAndDrop(f,D,l,"data-index",!1);return u.useEffect(()=>{m(e.current)}),[e,n,i,g,d]}exports.useDragAndDrop=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),y=require("../HandlerPublisher-F9_9P96L.cjs"),b=require("../index-C37ab-rG.cjs"),S=require("react-dom");function A(a,f){const[e,n]=s.useState(a),i=s.useRef(e);s.useEffect(()=>{i.current=e},[e]);function g(t,r=!1){const c=i.current[t],o=()=>{n(u=>[...u.slice(0,t),...u.slice(t+1)])};return r?S.flushSync(o):o(),c}function d(t,r,c=!1){const o=()=>{n(u=>[...u.slice(0,t),r,...u.slice(t)])};c?S.flushSync(o):o()}function h(){return e.length}function m(t){return e[t]}function l(t,r,c){b.insertToListEmpty(t,f.current,r,c)}return[e,n,{removeAtEvent:g,insertEvent:d,getLength:h,getValue:m,insertToListEmpty:l}]}const D=new y.HandlerPublisher;function E(a,f){const e=s.useRef(null),[n,i,g]=A(a,e),[d,h,m]=s.useMemo(()=>b.dragAndDrop(g,D,f,"data-index"),[n.length]);return s.useEffect(()=>{const l=m(e.current);return()=>{l&&(console.log("disconnect"),l.disconnect())}},[n.length]),[e,n,i,h,d]}exports.useDragAndDrop=E;
@@ -1,55 +1,58 @@
1
- import { useState as S, useRef as d, useEffect as h } from "react";
2
- import { H as A } from "../HandlerPublisher-BjHK5JWM.js";
3
- import { i as C, d as L } from "../index-Br5-BQhK.js";
4
- import { flushSync as p } from "react-dom";
5
- function b(a, u) {
6
- const [t, n] = S(a), c = d(t);
7
- h(() => {
8
- c.current = t;
1
+ import { useState as S, useRef as p, useEffect as E, useMemo as b } from "react";
2
+ import { H as A } from "../HandlerPublisher-BbQeSll4.js";
3
+ import { i as C, d as L } from "../index-8zYdjZIf.js";
4
+ import { flushSync as h } from "react-dom";
5
+ function v(a, l) {
6
+ const [t, n] = S(a), i = p(t);
7
+ E(() => {
8
+ i.current = t;
9
9
  }, [t]);
10
- function l(e, s = !1) {
11
- const r = c.current[e], o = () => {
12
- n((i) => [
13
- ...i.slice(0, e),
14
- ...i.slice(e + 1)
10
+ function f(e, s = !1) {
11
+ const r = i.current[e], o = () => {
12
+ n((c) => [
13
+ ...c.slice(0, e),
14
+ ...c.slice(e + 1)
15
15
  ]);
16
16
  };
17
- return s ? p(o) : o(), r;
17
+ return s ? h(o) : o(), r;
18
18
  }
19
- function f(e, s, r = !1) {
19
+ function m(e, s, r = !1) {
20
20
  const o = () => {
21
- n((i) => [
22
- ...i.slice(0, e),
21
+ n((c) => [
22
+ ...c.slice(0, e),
23
23
  s,
24
- ...i.slice(e)
24
+ ...c.slice(e)
25
25
  ]);
26
26
  };
27
- r ? p(o) : o();
27
+ r ? h(o) : o();
28
28
  }
29
- function m() {
29
+ function g() {
30
30
  return t.length;
31
31
  }
32
- function g(e) {
32
+ function d(e) {
33
33
  return t[e];
34
34
  }
35
- function E(e, s, r) {
36
- C(e, u.current, s, r);
35
+ function u(e, s, r) {
36
+ C(e, l.current, s, r);
37
37
  }
38
38
  return [t, n, {
39
- removeAtEvent: l,
40
- insertEvent: f,
41
- getLength: m,
42
- getValue: g,
43
- insertToListEmpty: E
39
+ removeAtEvent: f,
40
+ insertEvent: m,
41
+ getLength: g,
42
+ getValue: d,
43
+ insertToListEmpty: u
44
44
  }];
45
45
  }
46
46
  const y = new A();
47
- function k(a, u) {
48
- const t = d(null), [n, c, l] = b(a, t), [f, m, g] = L(l, y, u, "data-index", !1);
49
- return h(() => {
50
- g(t.current);
51
- }), [t, n, c, m, f];
47
+ function H(a, l) {
48
+ const t = p(null), [n, i, f] = v(a, t), [m, g, d] = b(() => L(f, y, l, "data-index"), [n.length]);
49
+ return E(() => {
50
+ const u = d(t.current);
51
+ return () => {
52
+ u && (console.log("disconnect"), u.disconnect());
53
+ };
54
+ }, [n.length]), [t, n, i, g, m];
52
55
  }
53
56
  export {
54
- k as useDragAndDrop
57
+ H as useDragAndDrop
55
58
  };
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-DopQmmiO.cjs"),o=require("../index-DtPM9-d-.cjs");class g{constructor(t){s(this,"items");s(this,"parent");this.items=t}setParent(t){this.parent=t}removeAtEvent(t){const e=this.items;if(e.length<=0)return;const[r]=e.splice(t,1);return r}insertEvent(t,e){this.items.splice(t,0,e)}getLength(){return this.items.length}getValue(t){return this.items[t]}insertToListEmpty(t,e,r){o.insertToListEmpty(t,this.parent,e,r)}}const h=new c.HandlerPublisher;function m(n,t){const e=new g(n),[r,l,a]=o.dragAndDrop(e,h,t,"data-index");return[i=>(e.setParent(i),a(i),{destroy(){}}),l,r]}exports.useDragAndDrop=m;
1
+ "use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-F9_9P96L.cjs"),o=require("../index-C37ab-rG.cjs");class g{constructor(t){s(this,"items");s(this,"parent");this.items=t}setParent(t){this.parent=t}removeAtEvent(t){const e=this.items;if(e.length<=0)return;const[r]=e.splice(t,1);return r}insertEvent(t,e){this.items.splice(t,0,e)}getLength(){return this.items.length}getValue(t){return this.items[t]}insertToListEmpty(t,e,r){o.insertToListEmpty(t,this.parent,e,r)}}const h=new c.HandlerPublisher;function m(n,t){const e=new g(n),[r,l,a]=o.dragAndDrop(e,h,t,"data-index");return[i=>(e.setParent(i),a(i),{destroy(){}}),l,r]}exports.useDragAndDrop=m;
@@ -1,8 +1,8 @@
1
1
  var l = Object.defineProperty;
2
2
  var d = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var r = (n, t, e) => d(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { H as c } from "../HandlerPublisher-BjHK5JWM.js";
5
- import { i as m, d as u } from "../index-Br5-BQhK.js";
4
+ import { H as c } from "../HandlerPublisher-BbQeSll4.js";
5
+ import { i as m, d as u } from "../index-8zYdjZIf.js";
6
6
  class h {
7
7
  constructor(t) {
8
8
  r(this, "items");
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-DopQmmiO.cjs"),u=require("../index-DtPM9-d-.cjs"),v=(n,e)=>{const t=n.value;if(t.length<=0)return;const[r]=t.splice(e,1);return r},d=(n,e,t)=>{n.value.splice(e,0,t)},m=n=>n.value.length,p=(n,e)=>n.value[e];class V{constructor(e,t){s(this,"items");s(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return v(this.items,e)}insertEvent(e,t){return d(this.items,e,t)}getLength(){return m(this.items)}getValue(e){return p(this.items,e)}insertToListEmpty(e,t,r){u.insertToListEmpty(e,this.parent.value,t,r)}}const A=new g.HandlerPublisher;function L(n,e){const t=i.ref();var r=new V(n,t);const[l,o,a]=u.dragAndDrop(r,A,e);return i.watch(t,()=>{a(t.value)}),[t,o,l]}exports.useDragAndDrop=L;
1
+ "use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-F9_9P96L.cjs"),u=require("../index-C37ab-rG.cjs"),v=(n,e)=>{const t=n.value;if(t.length<=0)return;const[r]=t.splice(e,1);return r},d=(n,e,t)=>{n.value.splice(e,0,t)},m=n=>n.value.length,p=(n,e)=>n.value[e];class V{constructor(e,t){s(this,"items");s(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return v(this.items,e)}insertEvent(e,t){return d(this.items,e,t)}getLength(){return m(this.items)}getValue(e){return p(this.items,e)}insertToListEmpty(e,t,r){u.insertToListEmpty(e,this.parent.value,t,r)}}const A=new g.HandlerPublisher;function L(n,e){const t=i.ref();var r=new V(n,t);const[l,o,a]=u.dragAndDrop(r,A,e);return i.watch(t,()=>{a(t.value)}),[t,o,l]}exports.useDragAndDrop=L;
@@ -2,8 +2,8 @@ var l = Object.defineProperty;
2
2
  var u = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var r = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { ref as c, watch as m } from "vue";
5
- import { H as h } from "../HandlerPublisher-BjHK5JWM.js";
6
- import { i as p, d as v } from "../index-Br5-BQhK.js";
5
+ import { H as h } from "../HandlerPublisher-BbQeSll4.js";
6
+ import { i as p, d as v } from "../index-8zYdjZIf.js";
7
7
  const g = (n, t) => {
8
8
  const e = n.value;
9
9
  if (e.length <= 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-dnd",
3
- "version": "1.3.2-beta.0",
3
+ "version": "1.3.3-beta.0",
4
4
  "description": "An agnostic drag and drop library to sort all kind of lists. With current support for vue, react and svelte",
5
5
  "type": "module",
6
6
  "homepage": "https://fluid-dnd.netlify.app",