fluid-dnd 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HandlerPublisher-DBjPMiyO.js → HandlerPublisher-CRu7xI9p.js} +1 -1
- package/dist/{HandlerPublisher-1MmlNkG3.cjs → HandlerPublisher-CrUNmzg-.cjs} +1 -1
- package/dist/core/events/changeDraggableStyles.d.ts +1 -1
- package/dist/core/events/dragAndDrop/dragAndDrop.d.ts +1 -1
- package/dist/core/events/dragAndDrop/dragAndDrop.js +1 -5
- package/dist/core/events/insert.d.ts +1 -1
- package/dist/core/events/remove.d.ts +2 -2
- package/dist/core/events/remove.js +4 -5
- package/dist/core/index.d.ts +0 -6
- package/dist/core/index.js +0 -7
- package/dist/core/positioning/usePositioning.d.ts +2 -2
- package/dist/core/positioning/usePositioning.js +35 -24
- package/dist/core/tempChildren.d.ts +2 -2
- package/dist/core/tempChildren.js +0 -3
- package/dist/core/useDraggable.js +17 -10
- package/dist/core/useDroppable.js +1 -3
- package/dist/core/utils/GetStyles.d.ts +1 -0
- package/dist/core/utils/GetStyles.js +3 -0
- package/dist/core/utils/ParseStyles.d.ts +1 -1
- package/dist/core/utils/ParseStyles.js +1 -1
- package/dist/core/utils/SetStyles.d.ts +1 -6
- package/dist/core/utils/SetStyles.js +1 -29
- package/dist/core/utils/dom/classList.d.ts +2 -2
- package/dist/core/utils/dom/classList.js +2 -11
- package/dist/index-BOqB07mI.cjs +1 -0
- package/dist/index-CJpjY7r7.js +1130 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{insert-Dd8savAS.js → insert--mO_a1mv.js} +6 -6
- package/dist/{insert-T4Y6rI_j.cjs → insert-CEcy9QNd.cjs} +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.mjs +13 -13
- package/dist/remove-C4YcWK2S.js +48 -0
- package/dist/remove-dSzXNYxs.cjs +1 -0
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.mjs +3 -3
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/index-BdOAK6C7.cjs +0 -1
- package/dist/index-HczUoMBK.js +0 -1131
- package/dist/remove-BC4sUY1o.cjs +0 -1
- package/dist/remove-M01dmTvo.js +0 -48
package/dist/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BOqB07mI.cjs");exports.dragAndDrop=e.dragAndDrop;
|
package/dist/index.mjs
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
import { u as B, c as C, h as g, i as L,
|
1
|
+
import { u as B, c as C, h as g, i as L, D as N, j as F, e as O, g as _, f as G, o as M, a as u, k as v, r as T, l as R } from "./index-CJpjY7r7.js";
|
2
2
|
function w(s, n, t, e) {
|
3
3
|
const { delayBeforeInsert: r } = s, [l, f, i] = B(
|
4
4
|
s,
|
5
5
|
t,
|
6
6
|
e
|
7
7
|
), h = (o, a, c, m, S) => {
|
8
|
-
const
|
8
|
+
const D = C(
|
9
9
|
a,
|
10
10
|
"insert",
|
11
11
|
s.direction,
|
12
12
|
c
|
13
|
-
), { onInsertEvent:
|
14
|
-
for (const [
|
15
|
-
L(d, N) &&
|
13
|
+
), { onInsertEvent: I } = s, y = g(c);
|
14
|
+
for (const [A, d] of y.entries())
|
15
|
+
L(d, N) && A >= o && i(d, D);
|
16
16
|
F(a, !1, S), setTimeout(() => {
|
17
|
-
|
17
|
+
I(o, m), E(o, c, s), l(a), b(a, n), O(n, 0, !0);
|
18
18
|
}, r);
|
19
19
|
}, b = (o, a) => {
|
20
20
|
const [c] = _(o, a);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BOqB07mI.cjs");function f(s,t,n,i){const{delayBeforeInsert:a}=s,[c,g,o]=e.useChangeDraggableStyles(s,n,i),v=(r,l,d,m,S)=>{const b=e.getTranslationByDraggingAndEvent(l,"insert",s.direction,d),{onInsertEvent:I}=s,h=e.getParentDraggableChildren(d);for(const[y,u]of h.entries())e.containClass(u,e.DRAGGABLE_CLASS)&&y>=r&&o(u,b);e.addTempChildOnInsert(l,!1,S),setTimeout(()=>{I(r,m),T(r,d,s),c(l),E(l,t),e.removeTempChild(t,0,!0)},a)},E=(r,l)=>{const[d]=e.getSiblings(r,l);for(const m of[...d,r])e.removeTranslateWhitoutTransition(m)};return[v]}const A=s=>s.addedNodes.values().filter(n=>!e.isTempElement(n)).toArray().length>0,T=(s,t,n)=>{const{insertingFromClass:i,animationDuration:a}=n,c=e.observeMutation(()=>{const o=e.getParentDraggableChildren(t)[s];e.addClass(o,i),e.addClass(o,e.DISABLE_TRANSITION),setTimeout(()=>{e.removeClass(o,e.DISABLE_TRANSITION),e.removeClass(o,i),c.disconnect()},a)},t,{childList:!0},A)},D=(s,t,n,i)=>{if(!t)return;const{onInsertEvent:a,delayBeforeInsert:c}=s;setTimeout(()=>{a(n,i),T(n,t,s)},c)};exports.default=f;exports.insertToListEmpty=D;
|
package/dist/react/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),b=require("../HandlerPublisher-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),b=require("../HandlerPublisher-CrUNmzg-.cjs"),v=require("../index-BOqB07mI.cjs"),S=require("react-dom");function y(f,i){const[e,r]=u.useState(f),a=u.useRef(e);u.useEffect(()=>{a.current=e},[e]);function d(t,s=!1){const c=a.current[t],n=()=>{r(o=>[...o.slice(0,t),...o.slice(t+1)])};return s?S.flushSync(n):n(),c}function g(t,s,c=!1){const n=()=>{r(o=>[...o.slice(0,t),s,...o.slice(t)])};c?S.flushSync(n):n()}function h(){return e.length}function m(t){return e[t]}function l(t,s,c){Promise.resolve().then(()=>require("../insert-CEcy9QNd.cjs")).then(({insertToListEmpty:n})=>{n(t,i.current,s,c)})}return[e,r,{removeAtEvent:d,insertEvent:g,getLength:h,getValue:m,insertToListEmpty:l}]}const A=new b.HandlerPublisher;function D(f,i){const e=u.useRef(null),[r,a,d]=y(f,e),[g,h,m]=v.dragAndDrop(d,A,i,"data-index");return u.useEffect(()=>{const l=m(e.current);return()=>{l&&l.disconnect()}},[r.length,i]),[e,r,a,h,g]}exports.useDragAndDrop=D;
|
package/dist/react/index.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { useState as b, useRef as d, useEffect as S } from "react";
|
2
|
-
import { H as A } from "../HandlerPublisher-
|
3
|
-
import {
|
4
|
-
import { flushSync as
|
2
|
+
import { H as A } from "../HandlerPublisher-CRu7xI9p.js";
|
3
|
+
import { n as C } from "../index-CJpjY7r7.js";
|
4
|
+
import { flushSync as p } from "react-dom";
|
5
5
|
function E(l, i) {
|
6
6
|
const [t, r] = b(l), u = d(t);
|
7
7
|
S(() => {
|
@@ -11,47 +11,47 @@ function E(l, i) {
|
|
11
11
|
const o = u.current[e], n = () => {
|
12
12
|
r((c) => [...c.slice(0, e), ...c.slice(e + 1)]);
|
13
13
|
};
|
14
|
-
return s ?
|
14
|
+
return s ? p(n) : n(), o;
|
15
15
|
}
|
16
16
|
function m(e, s, o = !1) {
|
17
17
|
const n = () => {
|
18
18
|
r((c) => [...c.slice(0, e), s, ...c.slice(e)]);
|
19
19
|
};
|
20
|
-
o ?
|
20
|
+
o ? p(n) : n();
|
21
21
|
}
|
22
|
-
function
|
22
|
+
function g() {
|
23
23
|
return t.length;
|
24
24
|
}
|
25
|
-
function
|
25
|
+
function h(e) {
|
26
26
|
return t[e];
|
27
27
|
}
|
28
28
|
function a(e, s, o) {
|
29
|
-
import("../insert
|
29
|
+
import("../insert--mO_a1mv.js").then(({ insertToListEmpty: n }) => {
|
30
30
|
n(e, i.current, s, o);
|
31
31
|
});
|
32
32
|
}
|
33
33
|
return [t, r, {
|
34
34
|
removeAtEvent: f,
|
35
35
|
insertEvent: m,
|
36
|
-
getLength:
|
37
|
-
getValue:
|
36
|
+
getLength: g,
|
37
|
+
getValue: h,
|
38
38
|
insertToListEmpty: a
|
39
39
|
}];
|
40
40
|
}
|
41
41
|
const v = new A();
|
42
42
|
function k(l, i) {
|
43
|
-
const t = d(null), [r, u, f] = E(l, t), [m,
|
43
|
+
const t = d(null), [r, u, f] = E(l, t), [m, g, h] = C(
|
44
44
|
f,
|
45
45
|
v,
|
46
46
|
i,
|
47
47
|
"data-index"
|
48
48
|
);
|
49
49
|
return S(() => {
|
50
|
-
const a =
|
50
|
+
const a = h(t.current);
|
51
51
|
return () => {
|
52
52
|
a && a.disconnect();
|
53
53
|
};
|
54
|
-
}, [r.length, i]), [t, r, u,
|
54
|
+
}, [r.length, i]), [t, r, u, g, m];
|
55
55
|
}
|
56
56
|
export {
|
57
57
|
k as useDragAndDrop
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { u as B, a as C, r as d, b as W, g as l, c as j, m as T, s as k, d as p, e as q, f as w } from "./index-CJpjY7r7.js";
|
2
|
+
function z(r, m, u, g) {
|
3
|
+
const { animationDuration: v } = r, [f] = B(
|
4
|
+
r,
|
5
|
+
u,
|
6
|
+
g
|
7
|
+
), R = (s, e, o, t) => {
|
8
|
+
if (!o || !o.droppable || !o.config)
|
9
|
+
return;
|
10
|
+
const { droppable: i, config: n } = o;
|
11
|
+
let [a] = l(e, i);
|
12
|
+
a = [e, ...a].toReversed();
|
13
|
+
const A = j(
|
14
|
+
e,
|
15
|
+
"remove",
|
16
|
+
n.direction,
|
17
|
+
i
|
18
|
+
);
|
19
|
+
for (const [F, c] of a.entries())
|
20
|
+
F >= s && (T(c, A), setTimeout(() => {
|
21
|
+
t(c);
|
22
|
+
}, v));
|
23
|
+
}, S = (s) => {
|
24
|
+
q(m, v, !0), setTimeout(() => {
|
25
|
+
f(s), b(s, m);
|
26
|
+
}, v);
|
27
|
+
}, b = (s, e) => {
|
28
|
+
const [o] = l(s, e);
|
29
|
+
for (const t of [...o, s])
|
30
|
+
w(t);
|
31
|
+
}, h = (s, e, o, t) => {
|
32
|
+
const { removingClass: i, delayBeforeRemove: n } = r;
|
33
|
+
e == s && (C(o, i), setTimeout(() => {
|
34
|
+
y(s, e, o, t);
|
35
|
+
}, n));
|
36
|
+
}, y = (s, e, o, t) => {
|
37
|
+
const { removingClass: i, onRemoveAtEvent: n } = r;
|
38
|
+
d(o, i), W(o, m, !1, t), R(e, o, t, (a) => {
|
39
|
+
D(a), S(o);
|
40
|
+
}), n(s, !0);
|
41
|
+
}, D = (s) => {
|
42
|
+
k(s, v, p), T(s);
|
43
|
+
};
|
44
|
+
return [h];
|
45
|
+
}
|
46
|
+
export {
|
47
|
+
z as default
|
48
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-BOqB07mI.cjs");function d(a,l,T,u){const{animationDuration:m}=a,[g]=o.useChangeDraggableStyles(a,T,u),S=(s,t,e,i)=>{if(!e||!e.droppable||!e.config)return;const{droppable:n,config:r}=e;let[v]=o.getSiblings(t,n);v=[t,...v].toReversed();const D=o.getTranslationByDraggingAndEvent(t,"remove",r.direction,n);for(const[A,c]of v.entries())A>=s&&(o.moveTranslate(c,D),setTimeout(()=>{i(c)},m))},b=s=>{o.removeTempChild(l,m,!0),setTimeout(()=>{g(s),f(s,l)},m)},f=(s,t)=>{const[e]=o.getSiblings(s,t);for(const i of[...e,s])o.removeTranslateWhitoutTransition(i)},y=(s,t,e,i)=>{const{removingClass:n,delayBeforeRemove:r}=a;t==s&&(o.addClass(e,n),setTimeout(()=>{R(s,t,e,i)},r))},R=(s,t,e,i)=>{const{removingClass:n,onRemoveAtEvent:r}=a;o.removeClass(e,n),o.addTempChild(e,l,!1,i),S(t,e,i,v=>{h(v),b(e)}),r(s,!0)},h=s=>{o.setTranistion(s,m,o.draggableTargetTimingFunction),o.moveTranslate(s)};return[y]}exports.default=d;
|
package/dist/svelte/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var a=Object.defineProperty;var u=(n,e,t)=>e in n?a(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i=(n,e,t)=>u(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../HandlerPublisher-
|
1
|
+
"use strict";var a=Object.defineProperty;var u=(n,e,t)=>e in n?a(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i=(n,e,t)=>u(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../HandlerPublisher-CrUNmzg-.cjs"),c=require("../index-BOqB07mI.cjs");class h{constructor(e){i(this,"items");i(this,"parent");this.items=e}setParent(e){this.parent=e}removeAtEvent(e){const t=this.items;if(t.length<=0)return;const[r]=t.splice(e,1);return r}insertEvent(e,t){this.items.splice(e,0,t)}getLength(){return this.items.length}getValue(e){return this.items[e]}insertToListEmpty(e,t,r){Promise.resolve().then(()=>require("../insert-CEcy9QNd.cjs")).then(({insertToListEmpty:s})=>{s(e,this.parent,t,r)})}}const g=new d.HandlerPublisher;function m(n,e){const t=new h(n),[r,s,l]=c.dragAndDrop(t,g,e,"data-index");return[o=>(t.setParent(o),l(o),{destroy(){}}),s,r]}exports.useDragAndDrop=m;
|
package/dist/svelte/index.mjs
CHANGED
@@ -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 i = (n, t, e) => d(n, typeof t != "symbol" ? t + "" : t, e);
|
4
|
-
import { H as c } from "../HandlerPublisher-
|
5
|
-
import {
|
4
|
+
import { H as c } from "../HandlerPublisher-CRu7xI9p.js";
|
5
|
+
import { n as h } from "../index-CJpjY7r7.js";
|
6
6
|
class m {
|
7
7
|
constructor(t) {
|
8
8
|
i(this, "items");
|
@@ -29,7 +29,7 @@ class m {
|
|
29
29
|
return this.items[t];
|
30
30
|
}
|
31
31
|
insertToListEmpty(t, e, r) {
|
32
|
-
import("../insert
|
32
|
+
import("../insert--mO_a1mv.js").then(({ insertToListEmpty: s }) => {
|
33
33
|
s(t, this.parent, e, r);
|
34
34
|
});
|
35
35
|
}
|
package/dist/vue/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var a=Object.defineProperty;var c=(n,e,t)=>e in n?a(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i=(n,e,t)=>c(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),h=require("../HandlerPublisher-
|
1
|
+
"use strict";var a=Object.defineProperty;var c=(n,e,t)=>e in n?a(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i=(n,e,t)=>c(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),h=require("../HandlerPublisher-CrUNmzg-.cjs"),v=require("../index-BOqB07mI.cjs"),g=(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){i(this,"items");i(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return g(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){Promise.resolve().then(()=>require("../insert-CEcy9QNd.cjs")).then(({insertToListEmpty:s})=>{s(e,this.parent.value,t,r)})}}const A=new h.HandlerPublisher;function L(n,e){const t=u.ref();var r=new V(n,t);const[s,l,o]=v.dragAndDrop(r,A,e);return u.watch(t,()=>{o(t.value)}),[t,l,s]}exports.useDragAndDrop=L;
|
package/dist/vue/index.mjs
CHANGED
@@ -2,8 +2,8 @@ var a = Object.defineProperty;
|
|
2
2
|
var u = (n, t, e) => t in n ? a(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
3
3
|
var i = (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-
|
6
|
-
import { p } from "../index-
|
5
|
+
import { H as h } from "../HandlerPublisher-CRu7xI9p.js";
|
6
|
+
import { n as p } from "../index-CJpjY7r7.js";
|
7
7
|
const v = (n, t) => {
|
8
8
|
const e = n.value;
|
9
9
|
if (e.length <= 0)
|
@@ -32,7 +32,7 @@ class f {
|
|
32
32
|
return V(this.items, t);
|
33
33
|
}
|
34
34
|
insertToListEmpty(t, e, r) {
|
35
|
-
import("../insert
|
35
|
+
import("../insert--mO_a1mv.js").then(({ insertToListEmpty: s }) => {
|
36
36
|
s(t, this.parent.value, e, r);
|
37
37
|
});
|
38
38
|
}
|
package/package.json
CHANGED
package/dist/index-BdOAK6C7.cjs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";var _e=Object.defineProperty;var $e=(t,e,n)=>e in t?_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var X=(t,e,n)=>$e(t,typeof e!="symbol"?e+"":e,n);const Y="horizontal",z="vertical";var L=(t=>(t[t.NOT_DRAGGING=0]="NOT_DRAGGING",t[t.START_DRAGGING=1]="START_DRAGGING",t[t.DRAGING=2]="DRAGING",t[t.END_DRAGGING=3]="END_DRAGGING",t))(L||{});const W="draggable",Yt="droppable",Mt="handler-class",Lt="dragging",Xt="dragging-handler-class",Wt="dropping",le="grabbing",ue="grab",Ve="disable-transition",U=(t,e)=>t.classList.contains(e),at=(t,e,n=!1)=>{t.classList.toggle(e,n)},ot=(t,e)=>{t.classList.add(e)},qt=(t,e)=>{t.classList.remove(e)},Ye=(t,e)=>vt(e).every(n=>U(t,n)),ut=t=>t?`.${vt(t).join(".")}`:"",Xe=(t,e)=>{if(!e)return;const n=vt(e);t.classList.add(...n)},vt=t=>t?t.split(" ").filter(e=>e):[],We=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},kt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),qe=t=>t?parseInt(t):-1,He=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},ge=(t,e)=>t.x1>e.x1?ge(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,Tt=(t,e)=>!ze(t,e),ze=(t,e)=>{const{intersectionX:n,intersectionY:s,rect1:o,rect2:r}=fe(t,e);return s>=Math.min(o.height,r.height)/2&&n>=Math.min(o.width,r.width)/2},je=(t,e)=>!Ze(t,e),Ze=(t,e)=>{const{intersectionX:n,intersectionY:s}=fe(t,e);return s>=0&&n>=0},fe=(t,e)=>{const n=B(t),s=B(e),o=ne(n,s,z),r=ne(n,s,Y);return{rect1:n,rect2:s,intersectionX:r,intersectionY:o}},ne=(t,e,n)=>{const{before:s,distance:o}=P(n);return ge({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},Et=(t,e)=>t?kt(getComputedStyle(t)[e]):0,se=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},B=t=>t.getBoundingClientRect(),j=(t,e)=>{const{distance:n}=P(t);return[e[n],n]},Pt=(t,e)=>{const{axis:n}=P(t);return e[n]},gt=(t,e)=>{const{borderBeforeWidth:n}=P(t);return Et(e,n)},Nt=(t,e)=>{const{beforeMargin:n}=P(t);return Et(e,n)},pe=(t,e)=>{const{beforeMargin:n}=P(t);return Et(e,n)},St=(t,e)=>{const{afterMargin:n}=P(t);return Et(e,n)},J=(t,e)=>{const{before:n}=P(t);return e[n]},At=(t,e)=>{const{scrollElement:n}=P(t);return[e[n],n]},lt=(t,e)=>{const{scroll:n}=P(t);return e[n]},ke=(t,e)=>{const{inner:n}=P(t);return e[n]},Ut=(t,e)=>{const{page:n}=P(t);return e[n]},de=(t,e)=>{const{offset:n}=P(t);return e[n]},P=t=>{const e=t==Y;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",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",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:B}},Rt=(t,e)=>Je(t,e),Ue=t=>[...t.children].filter(n=>U(n,W)),Je=(t,e)=>{const n=[...e.children].filter(o=>U(o,W)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Ke=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},he=(t,e)=>{const n=Ke(t);return n?J(e,B(n))+gt(e,n):0},N=(t,e)=>t==null?void 0:t.isSameNode(e),me="startDrag",Bt="drag",De="startDrop",ct="temp-child",Jt="cubic-bezier(0.2, 0, 0, 1)",It={height:0,width:0},mt=t=>window.TouchEvent&&t instanceof TouchEvent,Q=t=>t instanceof HTMLElement,Te=t=>t instanceof MouseEvent,Qe=["onmouseup","onmousedown","onmousemove"],tn=(t,e)=>{t&&(t.style.height=`${e.height}px`,t.style.width=`${e.width}px`)},rt=(t,e=It)=>{!t||!Q(t)||(e.width==0&&e.height==0?t.style.transform="":t.style.transform=`translate(${e.width}px,${e.height}px)`)},en=(t,e,n,s)=>{t[e]=o=>{if(o.defaultPrevented)return;s&&s(o);const r=Ht(o);n(r)}},Vt=(t,e,n,s)=>{n&&(nn(e)?t[e]=n:en(t,e,n,s))},nn=t=>Qe.includes(t),sn=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},on=(t,e)=>{const n=(s,o)=>cn(e,window,o,s);if(Te(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,Y),n(s,z)]}},Ht=t=>{const e=rn(t);if(!e)return sn(t);const[n,s]=on(t,e),{clientX:o,clientY:r,pageX:i,pageY:a,screenX:f,screenY:l,target:h}=e;return{clientX:o,clientY:r,pageX:i,pageY:a,screenX:f,screenY:l,target:h,offsetX:n,offsetY:s}},rn=t=>{if(mt(t))return t.touches[0]??t.changedTouches[0];if(Te(t))return t},cn=(t,e,n,s)=>{const o=B(s);return Ut(n,t)-lt(n,e)-J(n,o)-gt(n,s)},Ct=(t,e,n="ease-out",s="transform")=>{Q(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},Se=(t,e,n)=>{!t||!Q(t)||(t[e]=()=>{n()})},an=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},ln=(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},un=(t,e)=>{e.forEach(n=>{gn(t,n)})},gn=(t,e)=>{var s;var n=an(t);n.sheet&&(ln(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},Ae=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&fn(t,`--${n}`,s)}},fn=(t,e,n)=>t&&t.style.setProperty(e,n),wt=t=>{Q(t)&&(t.style.transition="",t.style.transform="")},pn=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},dn=t=>{let e=.5;const n=.03,s=(i,a,f,l)=>{const[h]=j(i,B(t)),p=B(a),R=J(i,f)-J(i,p)+Pt(i,l),[I]=j(i,p),y=I-h,A=R/y,D=h/y,b=.25,v=.2,G=.8;let F=0;const q=je(t,a);!q&&A<v&&A>-D?F=o(A<0?0:A,v):!q&&A>G&&A<1+D&&(F=r(A,G));const _=b*h*F;e=Math.sign(_)*Math.min(Math.abs(_),Math.abs(e)+n),pn(a,i,e)},o=(i,a)=>Math.pow(i/a,1/3)-1,r=(i,a)=>Math.pow(1/(1-a)*(i-a),3);return[s]},hn=(t,e)=>{let n={offsetX:0,offsetY:0},s={top:0,left:0},o={x:0,y:0};const[r]=dn(t),i=p=>{t.style.transform=`translate( ${p.x}px, ${p.y}px)`},a=p=>{t.style.top=`${p.top}px`,t.style.left=`${p.left}px`},f=(p,R,I,y)=>{const A=v=>{const G=Ut(v,I),F=lt(v,window),q=ke(v,window),[_]=j(v,B(p)),Z=gt(v,p),K=Nt(v,p),k=G-de(v,n),tt=he(p,v);if(k>=F-_/2&&k<=F+q){const u=k-J(v,s)-Z-K-F-tt;return D(v),u}return Pt(v,o)},D=v=>{p&&U(p,Lt)&&v===y&&r(y,R,s,o)},b=v=>{const{axis:G}=P(v);o[G]=A(v),i(l())};b(Y),b(z)},l=()=>{let p=o;for(const R of e)p=R(p,t);return p};return[f,(p,R)=>{const[I,y,A,D]=Tn(p,R,t);s={top:I,left:y},a(s),n={offsetX:A,offsetY:D}}]},xt=(t,e,n)=>J(t,B(e))-J(t,B(n))-gt(t,n),mn=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=Dn(o,e);const i=o;return i&&r&&!N(i,r)&&(n+=xt(Y,i,r),s+=xt(z,i,r)),r&&e!=o&&(n+=xt(Y,r,e),s+=xt(z,r,e)),[n,s]},Dn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Mt}`);return n&&N(e,n)?t:n},oe=(t,e,n,s)=>{const o=he(n,t);return Ut(t,e)-de(t,s)-Nt(t,n)-gt(t,n)-lt(t,window)-o},Tn=(t,e,n)=>{const[s,o]=mn(t,n);return[oe(z,t,e,{offsetX:s,offsetY:o}),oe(Y,t,e,{offsetX:s,offsetY:o}),s,o]},H=class H{static addConfig(e,n){const s=H.configs.filter(r=>!N(r.droppable,e)),o=se(e);s.push({droppable:e,config:n,scroll:o}),H.configs=s}static updateScrolls(e,n){for(const s of H.configs){const{droppable:o}=s;(n&&Ye(o,n)||N(e,o))&&(s.scroll=se(o))}}static getConfig(e){return H.configs.find(({droppable:s})=>N(e,s))}};X(H,"configs",[]),X(H,"removeObsoleteConfigs",()=>{const e=H.configs.filter(({droppable:n})=>document.contains(n));H.configs=e});let it=H;const zt=t=>!t||t.length==0?0:kt(t.replace("px","")),Sn=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=kt(n.replace("%","")),{width:r}=B(t);return r*(o/100)}return zt(n)},An=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=Sn(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},vn=t=>{const{top:e,left:n}=getComputedStyle(t);return[zt(e),zt(n)]},Kt=(t,e)=>{const{gap:n}=P(e);return An(t,n)},En=(t,e)=>{const[n,s]=Kt(t,e);return s?n:0},Qt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const i=r[0];t(o,i)}});return o.observe(e,n),o},jt=t=>Q(t)?t.classList.contains(ct):!1;function Dt(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:i,width:a}=Cn(n,t,o,r);return Tt(t,s)&&e==Bt&&(i=0,a=0),{height:i,width:a}}const Cn=(t,e,n,s)=>{const o=St(t,e),r=Nt(t,e),i=Nt(t,s),[a,f]=Kt(e.parentElement,t),[l]=j(t,B(e));if(f)return re(l,r,o,a,0,t);const[h,p,R]=yn(n,i,o,r,t);return re(l,p,h,0,R,t)},yn=(t,e,n,s,o)=>{const r=Math.max(e,n);let i=s,a=e;if(t){const f=St(o,t);i=Math.max(f,s),a=Math.max(a,f)}return[r,i,a]},re=(t,e,n,s,o,r)=>bn(r,t+e+n+s-o),bn=(t,e)=>t==Y?{width:e,height:0}:{width:0,height:e},Gn="startDrag",ve="cubic-bezier(0.2, 0, 0, 1)",Ee=50,Ce="width, min-width, height",xn=(t,e,n)=>{let s=Dt(e,Gn,n,t);const o=En(t,n),[,r]=j(n,s);s[r]-=o;const[i,a]=Rn(n,e);return s[a]=i,s},Rn=(t,e)=>{const n=t==Y?z:Y;return j(n,B(e))},ft=(t,e=It)=>{tn(t,e),t.style.minWidth=`${e.width}px`},On=(t,e,n)=>s=>{e.contains(t)&&(ft(t,n),s.disconnect())},ye=(t,e)=>{const{scrollDistance:n,clientDistance:s}=P(e);return t[n]-t[s]},Mn=(t,e,n)=>{const[s]=At(t,n);return s/ye(e,t)},Nn=(t,e,n,s)=>{if(!s)return;const{direction:o}=e,r=Mn(o,t,n)>.99,[,i]=At(o,t);r&&(t[i]=ye(t,o))},be=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r,scroll:i}=n,{direction:a,animationDuration:f}=r;if(Nn(o,r,i,e),o.querySelector(`.${ct}`)||!t)return;var l=t.tagName=="LI"?"DIV":t.tagName,h=document.createElement(l);ot(h,ct),ft(h);const p=xn(o,t,a);return Ct(h,f,ve,Ce),[h,p,o]},Zt=(t,e,n,s,o)=>{const r=be(t,n,s);if(!r)return;const[i,a,f]=r;N(e,f)&&ft(i,a),Qt(On(i,f,a),f,{childList:!0,subtree:!0}),f.appendChild(i)},Bn=(t,e,n)=>{const s=be(t,e,n);if(!s)return;const[o,r,i]=s;i.appendChild(o),In(o,r)},In=(t,e)=>requestAnimationFrame(()=>{ft(t,e),requestAnimationFrame(()=>{Ct(t,0,ve,Ce)})}),wn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${ut(n)} > .${ct}`);r.forEach(i=>{const a=i.parentElement;if(N(e,a)||!o&&N(t,a))return;ft(i),setTimeout(()=>{var l;(l=i.parentNode)==null||l.removeChild(i)},s+Ee)})}},Ot=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${ct}`);s.forEach(o=>{const r=o;n?(ft(r),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+Ee)):t.removeChild(o)})},Ln=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:f=>{const{index:l,value:h}=f;r({index:l,value:e(h,s)})},onInsertEvent:(f,l)=>o(f,e(l,s),!0)}};class Pn{constructor(e,n,s,o,r,i){X(this,"initial");X(this,"current");X(this,"parent");X(this,"draggableElement");X(this,"groupClass");X(this,"dragEvent");X(this,"changeDroppable");X(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=i,this.initial=it.getConfig(s),this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!N(s,o))}getElementBelow(e,n){return(o=>{const[r]=o.getDraggableAncestor(n.clientX,n.clientY,e);return r})(this)}getCurrent(e,n){const s=this.getElementBelow(e,n);return!this.groupClass||!s?void 0:s.closest(ut(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(ut(this.groupClass))):[this.parent]).every(s=>Tt(e,s))}isNotInsideAnotherDroppable(e,n){return!Tt(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){Se(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=it.getConfig(e);if(n)return N(this.parent,e)?n:{...n,config:Ln(n,this.mapFrom)}}droppableIfInsideCurrent(e,n){return e&&!N(n,e)&&n.contains(e)}getCurrentConfig(e){var o,r;const n=this.draggableElement,s=this.getCurrent(n,e);return this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable)&&!this.droppableIfInsideCurrent(s,(r=this.current)==null?void 0:r.droppable)?this.current:s?(Q(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){const n=this.draggableElement;return!this.getCurrent(n,e)}}const ce=(t,e)=>{const{paddingBefore:n}=P(t),s=gt(t,e),o=Et(e,n),r=Pt(t,B(e));return s+o+r},Fn=(t,e)=>{const[n,s]=vn(e),o=ce(z,t);return[ce(Y,t)-s,o-n]};function _n(t,e,n,s,o,r,i,a,f){let l=0,h=0;const p=!!(n<0&&f);if(n===s&&!p)return ie({height:l,width:h},t,o,i,p);const[R,I,y,A]=Yn(e,n,s,f);if(p){const[d,m]=Fn(a,f);l+=m,h+=d}const[D,b]=Kt(a,t),[v,G,F]=Wn(R,I==null?void 0:I.previousElementSibling,A,b,p,t),[q,_,Z]=Xn(y,D,b,t),K=Vn(_,q,Z,G,v,D),[k]=At(t,a),tt=p?k:$n(a,r,t),u=(A?K-F:F-K)-tt;return t===z?l+=u:t===Y&&(h+=u),ie({height:l,width:h},t,o,i,p)}const $n=(t,e,n)=>{const[s]=At(n,t),[o]=At(n,e);return s-o},Vn=(t,e,n,s,o,r)=>{const i=Math.max(e,o);return Math.max(n,s)+t+i+r},Yn=(t,e,n,s)=>{const o=e<n,[r,i]=[e,n].toSorted((h,p)=>h-p),a=t[e]??s,f=t[n];let l=o?t.slice(r+1,i+1):t.slice(r,i);return r<0&&s&&(l=t.slice(r+1,i)),[a,f,l,o]},Xn=(t,e,n,s)=>{if(t.length==0)return[0,0,0];const o=St(s,t[0]);let r=0,i=-o;for(const[a,f]of t.entries()){const[l]=j(s,B(f)),h=pe(s,f);n&&(r+=h),n&&a>0?r+=e:r=Math.max(r,h),i+=r+l,r=St(s,f)}return[o,i,r]},ie=(t,e,n,s,o)=>{const r=lt(e,window),i=lt(e,n),a=o?0:i-2*r+lt(e,s),[,f]=j(e,t);return t[f]+=a,t},Wn=(t,e,n,s,o,r)=>{const i=n?t.previousElementSibling:e;return qn(i,t,s,o,r)},qn=(t,e,n,s,o)=>{if(n)return[0,0,0];const r=St(o,s?null:t),i=pe(o,e);let a=Math.max(r,i);return[r,i,a]},Ge=(t,e,n)=>{const{handlerSelector:s,animationDuration:o}=t,r=l=>{n(),i(l,!1),wt(l),l.style.top="",l.style.left="",Ae(l,{fixedHeight:"",fixedWidth:""})},i=(l,h)=>{at(l,Lt,h),a(h,l),e.toggleGrabClass(!h)},a=(l,h)=>{const p=h.querySelector(s);at(document.body,le,l),at(p||h,Xt,l)};return[r,i,(l,h)=>{Ct(l,o,Jt),rt(l,h)}]},Hn=50;function zn(t,e,n,s,o,r){let i=e;const{onRemoveAtEvent:a,animationDuration:f,draggingClass:l}=t,[h,p,R]=Ge(t,o,r),I=(u,d,m)=>{if(!m)return;const{droppable:C,config:x}=m,E=Dt(u,d,x.direction,C);A(u,d,E,C,x)},y=(u,d,m,C,x)=>{if(!m)return;const{droppable:E,scroll:O,config:M}=m,S=Dt(u,d,M.direction,E);v(u,d,S,C,E,O,M,x)},A=(u,d,m,C,x)=>{const[E]=Rt(u,C),O=Tt(u,C),{direction:M}=x;E.length==0&&b(m,1,M,E);for(const[S,w]of E.entries()){if(!U(w,W))continue;const $=D(M,u,w,m);if(!O&&$)m=$;else if(!O)continue;const nt=E.length-S;b(m,nt,M,E),d===me?rt(w,m):d===Bt&&R(w,m)}},D=(u,d,m,C)=>{const x=B(d),E=B(m),O=J(u,x),M=J(u,E),[S]=j(u,E),w=M+S/2,$=Pt(u,He(m)),nt=w-$;return O>nt?It:C},b=(u,d,m,C)=>{const x=C.filter(O=>U(O,W)).length,[E]=j(m,u);E==0?i=Math.max(i,d):i=Math.min(i,d-1),i=Math.min(i,x)},v=(u,d,m,C,x,E,O,M)=>{const[S,w]=Rt(u,x),$=S.toReversed(),nt=w===-1?$.length:w;$.splice(nt,0,u);const[Ft,yt,pt]=G(u,w,$,x);m=Dt(u,d,O.direction,n,Ft,yt);const _t=We(),bt=_n(O.direction,$,w,pt,_t,E,C,x,u);S.length==0&&F(void 0,m,u,bt);for(const[$t,dt]of S.toReversed().entries()){let Gt=m;pt-1>=$t&&(Gt=It),d===De&&!U(dt,ct)&&F(dt,Gt,u,bt)}q(pt,u,O,x,M)},G=(u,d,m,C)=>{const E=Tt(u,C)?d:i,O=()=>d<E?[E,E+1]:d>E?[E-1,E]:[E-1,E+1],[M,S]=O(),w=m[M]??null,$=m[S]??null;return[w,$,E]},F=(u,d,m,C)=>{rt(u,d),rt(m,C)},q=(u,d,m,C,x)=>{const{onInsertEvent:E,onDragEnd:O}=m;ot(d,Wt),K(d,n,C,()=>{if(qt(d,Wt),x!=null){const M=a(x,!0);M!=null&&(E(u,M,!0),O({value:M,index:u})),Z(d),_()}})},_=()=>{if(s){var u=document.querySelectorAll(`${ut(s)} > .${W}`);for(const d of u)wt(d)}},Z=u=>{setTimeout(()=>{qt(u,l)},Hn)},K=(u,d,m,C)=>{setTimeout(()=>{C&&C(),k(d,m),tt(m),h(u),et(u,d),et(u,m)},f)},k=(u,d)=>{N(u,d)?Ot(u,f):(Ot(u,f,!0),Ot(d,f))},tt=u=>{if(!N(n,u)){var[d]=n.querySelectorAll(`.${ct}`);d&&Q(d)&&(d.style.height="0px",d.style.width="0px")}},et=(u,d)=>{const[m]=Rt(u,d);for(const C of[...m,u])wt(C)};return[I,y,p]}const ae="onmousedown";function jn(t,e,n,s,o){const{handlerSelector:r,isDraggable:i,droppableGroup:a,animationDuration:f,draggingClass:l,droppableClass:h,onDragStart:p,delayBeforeTouchMoveEvent:R,coordinateTransform:I}=n,y=vt(a).map(c=>`droppable-group-${c}`).join(" ");let A=L.NOT_DRAGGING,D={scrollX:0,scrollY:0},b={pageX:0,pageY:0},v,G;const[F,q]=hn(t,I),_=()=>{A=L.NOT_DRAGGING},[Z,K,k]=zn(n,e,s,y,o,_),tt=()=>{ot(t,W)},et=c=>{ot(c,Mt),o.addSubscriber(c)},u=()=>{if(i(t)){const c=t.querySelector(r);et(c||t)}},d=()=>{u(),tt()},m=c=>{const g=c==null?void 0:c.querySelector(`.${Mt}`),T=g==null?void 0:g.parentElement;return g&&T&&U(T,Yt)&&!N(s,T)?null:g},C=c=>{const g=m(c)??c;g&&i(c)&&(Vt(g,ae,dt("mousemove","mouseup")),Vt(g,"ontouchstart",dt("touchmove","touchend"),T=>{const V=T.touches[0];G={x:V.clientX,y:V.clientY}}),x(g)),N(c,g)||Vt(c,ae,Gt),ot(s,Yt)},x=c=>{const g=c.querySelectorAll("img");Array.from(g).forEach(T=>{T.onmousedown=()=>!1})},E=()=>{if(b.pageX==0&&b.pageY==0||!S.current)return;const{droppable:c,config:g}=S.current;F(t,c,b,g.direction),Z(t,Bt,S.current)},O=c=>{const g=c.querySelectorAll(`.${W}`);for(const T of g)rt(T)},M=(c,g)=>{g&&A==L.DRAGING&&!N(c==null?void 0:c.droppable,g.droppable)&&(Z(t,Bt,g),O(g.droppable))},S=new Pn(t,y,s,E,M,n.mapFrom),w=c=>{if(!S.current)return;const g=y?Array.from(document.querySelectorAll(ut(y))):[s];for(const T of g)T.classList.toggle(h,!c&&N(T,S.current.droppable))},$=(c,g=!1)=>{S.updateConfig(c);const T=S.isOutside(c);w(T),A===L.START_DRAGGING&&!g?ee(c):A===L.DRAGING&&(nt(T),Me(c))},nt=(c=!0)=>{if(!S.current)return;const{droppable:g}=S.current;wn(g,s,y,f,c),!c&&Zt(t,s,A==L.START_DRAGGING,S.current)},Ft=c=>{if(mt(c)&&G&&A==L.START_DRAGGING){const g=c.touches[0],T=Math.abs(g.clientX-G.x),V=Math.abs(g.clientY-G.y);if(Math.abs(T)>5&&Math.abs(V)>5)return clearTimeout(v),!1}return!0},yt=c=>{clearTimeout(v);const g=Ht(c);if(mt(c)&&c.cancelable&&A==L.DRAGING&&c.preventDefault(),mt(c)&&!c.cancelable||!Ft(c)){te("touchmove",c);return}$(g,mt(c))},pt=(c,g)=>{c=="touchmove"?v=setTimeout(()=>{g()},R):g()},_t=(c,g)=>{const{clientX:T,clientY:V}=c,st=document.elementFromPoint(T,V),ht=st==null?void 0:st.closest(`.${W}`);return ht&&N(g,ht)},bt=c=>{const g=n.onGetValue(e);return{index:e,element:c,value:g}},$t=c=>{S.updateConfig(c),w(S.isOutside(c)),ee(c)},dt=(c,g)=>T=>{if(!_t(T,t))return;it.updateScrolls(s,y);const{scrollX:V,scrollY:st}=window;if(D={scrollX:V,scrollY:st},A===L.NOT_DRAGGING){A=L.START_DRAGGING;const ht=bt(t);ht&&p(ht),pt(c,()=>{c=="touchmove"&&$t(T)}),document.addEventListener(c,yt,{passive:!1}),Ne(s),document.addEventListener(g,xe(c),{once:!0})}},Gt=c=>S.updateConfig(c),xe=c=>g=>{te(c,g)},te=(c,g)=>{w(!0);const T=Ht(g);Ie(S.isOutside(T)),clearTimeout(v),document.removeEventListener(c,yt),S.updateConfig(T);const V=S.getCurrentConfig(T);if(V){const{droppable:st}=V;Re(st)}s.onscroll=null,_()},Re=c=>{if(c.onscroll=null,!y)return;const g=Array.from(document.querySelectorAll(ut(y)));for(const T of g)Q(T)&&(T.onscroll=null)},ee=c=>{Zt(t,s,A==L.START_DRAGGING,S.current),Oe(),Z(t,me,S.current),Le(t),q(c,t)},Oe=()=>{A=L.DRAGING},Me=c=>{const{pageX:g,pageY:T}=c;b={pageX:g,pageY:T},E()},Ne=c=>Se(c,"onscroll",Be),Be=()=>E(),Ie=c=>{if(A!==L.DRAGING&&A!==L.START_DRAGGING){_();return}A=L.END_DRAGGING,we(t),t.classList.contains(Lt)&&K(t,De,c?S.initial:S.current,D,e)},we=c=>{Ct(c,f,Jt),rt(c)},Le=c=>{const{height:g,width:T}=B(c);Ae(c,{fixedHeight:`${g}px`,fixedWidth:`${T}px`}),k(c,!0),at(c,l,!0),c.style.transition=""},Pe=c=>{Promise.resolve().then(()=>require("./remove-BC4sUY1o.cjs")).then(g=>{const[T]=g.default(n,s,o,_);S.initial&&T(e,c,t,A,S.initial)})},Fe=(c,g)=>{(c===e||c===n.onGetLegth()&&e===c-1)&&Promise.resolve().then(()=>require("./insert-T4Y6rI_j.cjs")).then(T=>{const[V]=T.default(n,s,o,_);V(c,t,s,g,S.initial)})};return d(),C(t),[Pe,Fe]}const Zn=(t,e)=>{t&&Xe(e,t)},kn=()=>{un(document.body,[`.${W}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Mt}{pointer-events:auto!important;}`,`.${ue}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Lt}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Xt}{pointer-events:none!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${le}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function Un(t,e,n,s="index"){const o=s;let r=[],i=[];const{droppableGroup:a}=t;if(!n)return[r,i];const f=vt(a).map(l=>`droppable-group-${l}`).join(" ");kn(),Zn(f,n);for(const l of n.children){const h=l.getAttribute(o),p=qe(h),R=l;if(R&&p>=0){const[I,y]=jn(R,p,t,n,e);r.push(I),i.push(y)}}return[r,i]}const Jn=(t,e)=>{const n=(a,f)=>t.removeAtEvent(a,f),s=(a,f,l)=>t.insertEvent(a,f,l),o=()=>t.getLength(),r=a=>t.getValue(a),i=a=>a;return{direction:(e==null?void 0:e.direction)??z,handlerSelector:(e==null?void 0:e.handlerSelector)??W,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)??i,delayBeforeTouchMoveEvent:(e==null?void 0:e.delayBeforeTouchMoveEvent)??150,coordinateTransform:(e==null?void 0:e.coordinateTransform)??[a=>a]}};function Kn(t,e,n,s="index"){let o=[],r=[],i;const a=Jn(t,n),f=D=>{for(const b of o)b(D)},l=(D,b)=>{if(a.onGetLegth()===0)t.insertToListEmpty(a,D,b);else for(const G of r)G(D,b)},h=D=>{const[b,v]=Un(a,e,D,s);o=b,r=v},p=D=>{const b=D.addedNodes.values().filter(G=>!jt(G)).toArray(),v=D.removedNodes.values().filter(G=>!jt(G)).toArray();return b.length>0||v.length>0},R=D=>{i=Qt(()=>{h(D)},D,{childList:!0},p)},I=D=>{ot(D,Yt)},y=D=>{it.addConfig(D,a)};return[f,l,D=>{if(D)return I(D),y(D),R(D),h(D),it.removeObsoleteConfigs(),i}]}exports.DISABLE_TRANSITION=Ve;exports.DRAGGABLE_CLASS=W;exports.DraggingState=L;exports.GRAB_CLASS=ue;exports.addClass=ot;exports.addTempChild=Zt;exports.addTempChildOnInsert=Bn;exports.containClass=U;exports.dragAndDrop=Kn;exports.draggableTargetTimingFunction=Jt;exports.getParentDraggableChildren=Ue;exports.getSiblings=Rt;exports.getTranslationByDraggingAndEvent=Dt;exports.isTempElement=jt;exports.moveTranslate=rt;exports.observeMutation=Qt;exports.removeClass=qt;exports.removeTempChild=Ot;exports.removeTranslateWhitoutTransition=wt;exports.setTranistion=Ct;exports.toggleClass=at;exports.useChangeDraggableStyles=Ge;
|