fluid-dnd 1.0.0-beta.0 → 1.0.1-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 +3 -3
- package/dist/HandlerPublisher-BbGTnlu0.js +20 -0
- package/dist/HandlerPublisher-Bd4_qrME.cjs +1 -0
- package/dist/index/index.cjs +1 -0
- package/dist/index/index.mjs +4 -0
- package/dist/{fluid-dnd.js → index-D1rUx9iZ.js} +274 -263
- package/dist/index-GRcZUS5t.cjs +1 -0
- package/dist/svelte/index.cjs +1 -0
- package/dist/svelte/index.mjs +45 -0
- package/dist/vue/index.cjs +1 -0
- package/dist/vue/index.mjs +49 -0
- package/package.json +11 -21
- package/dist/fluid-dnd.umd.cjs +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var me=Object.defineProperty;var Se=(t,e,n)=>e in t?me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var J=(t,e,n)=>Se(t,typeof e!="symbol"?e+"":e,n);const Q="draggable",It="droppable",Ot="handler-class",Ht="dragging",Wt="dragging-handler-class",Xt="dropping",ne="grabbing",se="grab",Zt="disable-transition",nt=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},U=(t,e)=>{t.classList.add(e)},yt=(t,e)=>{t.classList.remove(e)},De=(t,e)=>Ct(e).every(n=>nt(t,n)),dt=t=>t?`.${Ct(t).join(".")}`:"",ve=(t,e)=>{if(!e)return;const n=Ct(e);t.classList.add(...n)},Ct=t=>t?t.split(" ").filter(e=>e):[],_="horizontal",tt="vertical",be=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},qt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),Te=t=>t?parseInt(t):-1,Ee=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},oe=(t,e)=>t.x1>e.x1?oe(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,pt=(t,e)=>!ye(t,e),ye=(t,e)=>{const n=Mt(t),s=Mt(e),o=Jt(n,s,tt),i=Jt(n,s,_);return o>=Math.min(n.height,s.height)/2&&i>=Math.min(n.width,s.width)/2},Jt=(t,e,n)=>{const{before:s,distance:o}=w(n);return oe({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},L=(t,e)=>t?qt(getComputedStyle(t)[e]):0,Kt=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Mt=t=>t.getBoundingClientRect(),w=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:Mt}},Rt=(t,e)=>Ce(t,e),re=t=>[...t.children].filter(n=>nt(n,Q)),Ce=(t,e)=>{const n=[...e.children].filter(o=>nt(o,Q)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Ae=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ie=(t,e)=>{const{before:n,borderBeforeWidth:s}=w(e),o=Ae(t);return o?Mt(o)[n]+L(o,s):0},Yt=t=>window.TouchEvent&&t instanceof TouchEvent,at=t=>t instanceof HTMLElement,ce=t=>t instanceof MouseEvent,xe=["onmouseup","onmousedown","onmousemove"],we=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Tt=(t,e,n)=>{!t||!at(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Be=(t,e,n)=>{t[e]=s=>{if(s.defaultPrevented)return;const o=Vt(s);n(o)}},$t=(t,e,n)=>{n&&(Re(e)?t[e]=n:Be(t,e,n))},Re=t=>xe.includes(t),Le=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Oe=(t,e)=>{const n=(s,o)=>Pe(e,window,o,s);if(ce(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,_),n(s,tt)]}},Vt=t=>{const e=Me(t);if(!e)return Le(t);const[n,s]=Oe(t,e),{clientX:o,clientY:i,pageX:c,pageY:l,screenX:f,screenY:p,target:h}=e;return{clientX:o,clientY:i,pageX:c,pageY:l,screenX:f,screenY:p,target:h,offsetX:n,offsetY:s}},Me=t=>{if(Yt(t))return t.touches[0]??t.changedTouches[0];if(ce(t))return t},Pe=(t,e,n,s)=>{const{page:o,scroll:i,before:c,borderBeforeWidth:l,getRect:f}=w(n),p=f(s);return t[o]-e[i]-p[c]-L(s,l)},Nt=(t,e,n="ease-out",s="transform")=>{at(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},ae=(t,e,n)=>{!t||!at(t)||(t[e]=()=>{n()})},Ne=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},Fe=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[i]=o.cssText.match(n)||[];if(s===i)return!0}return!1},$e=(t,e)=>{e.forEach(n=>{Ge(t,n)})},Ge=(t,e)=>{var s;var n=Ne(t);n.sheet&&(Fe(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},le=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&Ie(t,`--${n}`,s)}},Ie=(t,e,n)=>t&&t.style.setProperty(e,n),ue="startDrag",Pt="drag",zt="startDrop",We="drop",ht="temp-child",fe="cubic-bezier(0.2, 0, 0, 1)",Xe=t=>t===We||t===zt,_t=t=>!t||t.length==0?0:qt(t.replace("px","")),Ye=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=qt(n.replace("%","")),{width:i}=t.getBoundingClientRect();return i*(o/100)}return _t(n)},jt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=Ye(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},Ve=t=>{const{top:e,left:n}=getComputedStyle(t);return[_t(e),_t(n)]},_e=(t,e)=>{const{gap:n}=w(e),[s,o]=jt(t,n);return o?s:0};function Et(t,e,n,s,o=t.previousElementSibling,i=t.nextElementSibling){let{height:c,width:l}=He(n,t,o,i);return pt(t,s)&&e==Pt&&(c=0,l=0),{height:c,width:l}}const He=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:i,distance:c,gap:l,getRect:f}=w(t),p=L(e,o),h=L(e,i),b=L(s,i),[B,M]=jt(e.parentElement,l),S=f(e)[c];if(M)return Qt(S,h,p,B,0,t);const[D,v,R]=qe(n,b,p,h,o);return Qt(S,v,D,0,R,t)},qe=(t,e,n,s,o)=>{const i=Math.max(e,n);let c=s,l=e;if(t){const f=L(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[i,c,l]},Qt=(t,e,n,s,o,i)=>ze(i,t+e+n+s-o),ze=(t,e)=>t==_?{width:e,height:0}:{width:0,height:e},Ut=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:i}=w(t),c=L(e,n),l=L(e,s),f=i(e)[o];return c+l+f},je=(t,e)=>{const[n,s]=Ve(e),o=Ut(tt,t);return[Ut(_,t)-s,o-n]};function ke(t,e,n,s,o,i,c,l,f){let p=0,h=0;const b=!!(n<0&&f);if(n===s&&!b)return te({height:p,width:h},t,o,c,b);const[B,M,S,D]=Ke(e,n,s,f);if(b){const[et,ot]=je(l,f);p+=ot,h+=et}const{scrollElement:v,beforeMargin:R,afterMargin:N,distance:I,gap:W}=w(t),[X,F]=jt(l,W),[st,H,P]=Ue(R,N,B,M==null?void 0:M.previousElementSibling,D,F,b),[k,q,z]=Qe(R,N,I,S,X,F),Y=Je(q,k,z,H,st,X),j=b?l[v]:Ze(v,l,i),$=(D?Y-P:P-Y)-j;return t===tt?p+=$:t===_&&(h+=$),te({height:p,width:h},t,o,c,b)}const Ze=(t,e,n)=>{const s=e[t],o=n[t];return s-o},Je=(t,e,n,s,o,i)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+i},Ke=(t,e,n,s)=>{const o=e<n,[i,c]=[e,n].toSorted((h,b)=>h-b),l=t[e]??s,f=t[n];let p=o?t.slice(i+1,c+1):t.slice(i,c);return i<0&&s&&(p=t.slice(i+1,c)),[l,f,p,o]},Qe=(t,e,n,s,o,i)=>{if(s.length==0)return[0,0,0];const c=L(s[0],t);let l=0,f=-c;for(const[p,h]of s.entries()){const b=h.getBoundingClientRect()[n],B=L(h,t);i&&(l+=B),i&&p>0?l+=o:l=Math.max(l,B),f+=l+b,l=L(h,e)}return[c,f,l]},te=(t,e,n,s,o)=>{const{scroll:i,distance:c}=w(e),l=window[i],f=n[i],p=o?0:f-2*l+s[i];return t[c]+=p,t},Ue=(t,e,n,s,o,i,c)=>{const l=o?n.previousElementSibling:s;return tn(t,e,l,n,i,c)},tn=(t,e,n,s,o,i)=>{if(o)return[0,0,0];const c=L(i?null:n,e),l=L(s,t);let f=Math.max(c,l);return[c,l,f]},kt=(t,e,n)=>{const s=new MutationObserver(o=>{o.forEach(i=>{t(s,i)})});return s.observe(e,n),s},en=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},nn=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:i}=w(t);return n[i]/(e[s]-e[o])},sn="startDrag",ge="cubic-bezier(0.2, 0, 0, 1)",on=(t,e,n)=>{let s=Et(e,sn,n,t);const o=_e(t,n),{distance:i}=w(n);s[i]-=o;const[c,l]=rn(n,e);return s[l]=c,s},rn=(t,e)=>{const n=t==_?tt:_,{distance:s,getRect:o}=w(n);return[o(e)[s],s]},mt=(t,e,n)=>{we(t,e,n),t.style.minWidth=`${n}px`},cn=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},an=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:i}=s,c=nn(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:p}=w(i);c&&(n[p]=n[l]-n[f])},de=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:i}=n,{direction:c,animationDuration:l}=i;if(an(n,e),o.querySelector(`.${ht}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,p=document.createElement(f);U(p,ht),mt(p,0,0);const h=on(o,t,c);return Nt(p,l,ge,"width, min-width, height"),[p,h,o]},Gt=(t,e,n,s,o)=>{const i=de(t,n,s);if(!i)return;const[c,l,f]=i;e.isSameNode(f)&&mt(c,l.height,l.width),kt(cn(c,f,l),f,{childList:!0,subtree:!0}),f.appendChild(c)},ln=(t,e,n)=>{const s=de(t,e,n);if(!s)return;const[o,i,c]=s;c.appendChild(o),un(o,i)},un=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Nt(t,0,ge,"width, min-width, height")})}),fn=(t,e,n,s,o=!0)=>{if(n){var i=document.querySelectorAll(`${dt(n)} > .${ht}`);i.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 p;(p=c.parentNode)==null||p.removeChild(c)},s)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${ht}`);s.forEach(o=>{n?(mt(o,0,0),setTimeout(()=>{t.contains(o)&&t.removeChild(o)},e)):t.removeChild(o)})},gn=50;function dn(t,e,n,s,o,i){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:p,animationDuration:h,delayBeforeInsert:b,draggingClass:B}=t,M=(r,u,g,m,C)=>{if(!m)return;const{droppable:T,config:E}=m,A=Et(r,u,E.direction,T);Xe(u)?F(r,u,A,g,m,C):R(r,u,A,m)},S=(r,u,g,m,C)=>{const T=Et(u,"insert",t.direction,g),{onInsertEvent:E}=t,A=re(g);for(const[O,x]of A.entries())nt(x,Q)&&O>=r&&X(x,T);C(),setTimeout(()=>{E(r,m),bt(n,0,!0),pe(r,g,t),et(u),V(u,n)},b)},D=(r,u,g,m)=>{if(!g||!g.droppable||!g.config)return;const{droppable:C,config:T}=g;let[E]=Rt(u,C);E=[u,...E].toReversed();const A=Et(u,"remove",T.direction,C);for(const[O,x]of E.entries())O>=r&&(W(x,A),setTimeout(()=>{m(x)},h))},v=r=>{bt(n,h,!0),setTimeout(()=>{et(r),V(r,n)},h)},R=(r,u,g,m)=>{const{config:C,droppable:T}=m,[E]=Rt(r,T),A=pt(r,T);E.length==0&&I(g,1,C.direction,E);for(const[O,x]of E.entries()){if(!nt(x,Q))continue;const G=N(C.direction,r,x,g);if(!A&&G)g=G;else if(!A)continue;const Z=E.length-O;I(g,Z,C.direction,E),u===ue?W(x,g):u===Pt&&X(x,g)}},N=(r,u,g,m)=>{const{before:C,distance:T,axis:E,getRect:A}=w(r),O=A(u),x=A(g),G=O[C],Z=x[C],ut=x[T],St=Z+ut/2,Dt=Ee(g)[E],ct=St-Dt;return G>ct?{height:0,width:0}:m},I=(r,u,g,m)=>{const C=m.filter(E=>nt(E,Q)).length,{distance:T}=w(g);r[T]==0?c=Math.max(c,u):c=Math.min(c,u-1),c=Math.min(c,C)},W=(r,u)=>{const{width:g,height:m}=u;Tt(r,m,g)},X=(r,u)=>{const{width:g,height:m}=u;Tt(r,m,g),Nt(r,h,fe)},F=(r,u,g,m,C,T)=>{const{droppable:E,scroll:A,config:O}=C,[x,G]=Rt(r,E),Z=x.toReversed(),ut=G===-1?Z.length:G;Z.splice(ut,0,r);const[St,Dt,ct]=st(r,G,Z,E);g=Et(r,u,O.direction,n,St,Dt);const Ft=be(),At=ke(O.direction,Z,G,ct,Ft,A,m,E,r);x.length==0&&H(void 0,g,r,At);for(const[xt,wt]of x.toReversed().entries()){let Bt=g;ct-1>=xt&&(Bt={height:0,width:0}),u===zt&&!nt(wt,ht)&&H(wt,Bt,r,At)}P(ct,r,O,E,T)},st=(r,u,g,m)=>{const T=pt(r,m)?u:c,E=()=>u<T?[T,T+1]:u>T?[T-1,T]:[T-1,T+1],[A,O]=E(),x=g[A]??null,G=g[O]??null;return[x,G,T]},H=(r,u,g,m)=>{Tt(r,u.height,u.width),Tt(g,m.height,m.width)},P=(r,u,g,m,C)=>{const{onInsertEvent:T,onDragEnd:E}=g;U(u,Xt),z(u,n,m,()=>{if(yt(u,Xt),C!=null){const A=p(C);A!=null&&(T(r,A),E({value:A,index:r})),q(u),k()}})},k=()=>{if(s){var r=document.querySelectorAll(`${dt(s)} > .${Q}`);for(const u of r)$(u)}},q=r=>{setTimeout(()=>{yt(r,B)},gn)},z=(r,u,g,m)=>{setTimeout(()=>{m&&m(),Y(u,g),j(g),et(r),V(r,u),V(r,g)},h)},Y=(r,u)=>{r.isSameNode(u)?bt(r,h):(bt(r,h,!0),bt(u,h))},j=r=>{if(n.isSameNode(r))return;var[u]=n.querySelectorAll(`.${ht}`);if(!u)return;const{distance:g}=w(l);at(u)&&(u.style[g]="0px")},V=(r,u)=>{const[g]=Rt(r,u);for(const m of[...g,r])$(m)},$=r=>{at(r)&&(r.style.transition="",r.style.transform="")},et=r=>{i(),lt(r,!1),r.style.transform="",r.style.transition="",r.style.top="",r.style.left="",le(r,{fixedHeight:"",fixedWidth:""})},ot=(r,u)=>{const g=u.querySelector(f);gt(document.body,ne,r),gt(g||u,Wt,r)},lt=(r,u)=>{gt(r,Ht,u),ot(u,r),o.toggleGrabClass(!u)};return[M,D,S,v,lt]}const pe=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,i=kt(()=>{const l=re(e)[t];U(l,s),U(l,Zt),setTimeout(()=>{yt(l,Zt),yt(l,s),i.disconnect()},o)},e,{childList:!0})},pn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:i}=t;setTimeout(()=>{o(n,s),pe(n,e,t)},i)},hn=(t,e)=>{const n=c=>t.removeAtEvent(c),s=(c,l)=>t.insertEvent(c,l),o=()=>t.getLength(),i=c=>t.getValue(c);return{direction:(e==null?void 0:e.direction)??tt,handlerSelector:(e==null?void 0:e.handlerSelector)??Q,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:i,animationDuration:(e==null?void 0:e.animationDuration)??150,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}},mn=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)`},i=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,p,h,b)=>{const B=D=>{const{beforeMargin:v,borderBeforeWidth:R,before:N,offset:I,scroll:W,page:X,inner:F,distance:st,axis:H,getRect:P}=w(D),k=h[X],q=window[W],z=window[F],Y=P(f)[st],j=L(f,R),V=L(f,v),$=k-e[I],et=ie(f,D);if($>=q-Y/2&&$<=q+z){const lt=$-n[N]-j-V-q-et;return M(D),lt}return s[H]},M=D=>{if(f&&nt(f,Ht)&&D===b){const{before:v,distance:R,axis:N,getRect:I}=w(b),W=I(f)[R],X=I(p),F=n[v]-X[v]+s[N],H=X[R]-W,P=F/H,k=W/H,q=.1,z=.2,Y=.8;let j=0;const V=pt(f,p);!V&&P<z&&P>-k?j=P/z-1:!V&&P>Y&&P<1+k&&(j=1/(1-Y)*(P-Y));const $=q*W*j;en(p,b,$)}},S=D=>{const{axis:v}=w(D);s[v]=B(D),o(s)};S(_),S(tt)},(f,p)=>{const[h,b,B,M]=vn(f,p,t);n={top:h,left:b},i(n),e={offsetX:B,offsetY:M}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:i}=w(t);return i(e)[o]-i(n)[o]-L(n,s)},Sn=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,i=Dn(o,e);const c=o;return c&&i&&!c.isSameNode(i)&&(n+=Lt(_,c,i),s+=Lt(tt,c,i)),i&&e!=o&&(n+=Lt(_,i,e),s+=Lt(tt,i,e)),[n,s]},Dn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Ot}`);return n&&n.isSameNode(e)?t:n},ee=(t,e,n,s)=>{const{offset:o,beforeMargin:i,page:c,borderBeforeWidth:l,scroll:f}=w(t),p=ie(n,t);return e[c]-s[o]-L(n,i)-L(n,l)-window[f]-p},vn=(t,e,n)=>{const[s,o]=Sn(t,n);return[ee(tt,t,e,{offsetX:s,offsetY:o}),ee(_,t,e,{offsetX:s,offsetY:o}),s,o]},K=class K{static addConfig(e,n){const s=K.configs.filter(i=>!i.droppable.isSameNode(e)),o=Kt(e);s.push({droppable:e,config:n,scroll:o}),K.configs=s}static updateScrolls(e,n){for(const s of K.configs){const{droppable:o}=s;(n&&De(o,n)||o.isSameNode(e))&&(s.scroll=Kt(o))}}static getConfig(e){return K.configs.find(({droppable:s})=>s.isSameNode(e))}};J(K,"configs",[]),J(K,"removeObsoleteConfigs",()=>{const e=K.configs.filter(({droppable:n})=>document.contains(n));K.configs=e});let it=K;class bn{constructor(e,n,s,o,i){J(this,"initial");J(this,"current");J(this,"parent");J(this,"draggableElement");J(this,"groupClass");J(this,"dragEvent");J(this,"changeDroppable");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.initial=s?it.getConfig(s):void 0,this.changeDroppable=i}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 i=null;return s?(e.hidden=!0,i=o(this),e.hidden=!1):i=o(this),i}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(dt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(dt(this.groupClass))):[this.parent]).every(s=>pt(e,s))}isNotInsideAnotherDroppable(e,n){return!pt(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){ae(e,"onscroll",()=>{this.onScrollEvent()})}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?(at(s)&&!s.onscroll&&this.setOnScroll(s),it.getConfig(s)):it.getConfig(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 Tn(t,e,n,s,o){const{handlerSelector:i,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:p,draggingClass:h,removingClass:b,onRemoveAtEvent:B,droppableClass:M,onDragStart:S}=n,D=Ct(l).map(a=>`droppable-group-${a}`).join(" ");let v=0,R={scrollX:0,scrollY:0},N={pageX:0,pageY:0},I;const[W,X]=mn(t),[F,st,H,P,k]=dn(n,e,s,D,o,()=>v=0),q=()=>{U(t,Q)},z=a=>{U(a,Ot),o.addSubscriber(a)},Y=()=>{if(c(t)){const a=t.querySelector(i);z(a||t)}},j=()=>{$e(document.body,[`.${Q}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Ot}{pointer-events:auto!important;}`,`.${se}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ht}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${Xt}{pointer-events:none!important;}`,`.${ne}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"]),Y(),q()},V=a=>{const d=a==null?void 0:a.querySelector(`.${Ot}`),y=d==null?void 0:d.parentElement;return d&&y&&nt(y,It)&&!y.isSameNode(s)?null:d},$=a=>{const d=V(a)??a;d&&c(a)&&($t(d,"onmousedown",O("mousemove","mouseup")),$t(d,"ontouchstart",O("touchmove","touchend")),et(d)),a!=null&&a.isSameNode(d)||$t(a,"onmousedown",x),U(s,It)},et=a=>{const d=a.querySelectorAll("img");Array.from(d).forEach(y=>{y.onmousedown=()=>!1})},ot=()=>{if(N.pageX==0&&N.pageY==0||!r.current)return;const{droppable:a,config:d}=r.current;W(t,a,N,d.direction),F(t,Pt,R,r.current)},lt=(a,d)=>{d&&v==2&&!(a!=null&&a.droppable.isSameNode(d.droppable))&&F(t,Pt,R,d)},r=new bn(t,D,s,ot,lt),u=a=>{if(!r.current)return;const d=D?Array.from(document.querySelectorAll(dt(D))):[s];for(const y of d)y.classList.toggle(M,!a&&y.isSameNode(r.current.droppable))},g=a=>{r.updateConfig(a);const d=r.isOutside(a);u(d),v===1?ut(a):v===2&&(m(d),Dt(a))},m=(a=!0)=>{if(!r.current)return;const{droppable:d}=r.current;fn(d,s,D,f,a),!a&&Gt(t,s,v==1,r.current)},C=a=>{if(Yt(a)&&a.cancelable)a.preventDefault();else if(Yt(a))return;const d=Vt(a);g(d)},T=(a,d)=>{a=="touchmove"?I=setTimeout(()=>{d()},200):d()},E=(a,d)=>{const{clientX:y,clientY:ft}=a,rt=document.elementFromPoint(y,ft),vt=rt==null?void 0:rt.closest(`.${Q}`);return rt&&d&&vt&&!d.isSameNode(vt)},A=a=>{const d=n.onGetValue(e);return{index:e,element:a,value:d}},O=(a,d)=>y=>{if(E(y,t))return;it.updateScrolls(s,D);const{scrollX:ft,scrollY:rt}=window;if(R={scrollX:ft,scrollY:rt},v===0){v=1;const vt=A(t);vt&&S(vt),T(a,()=>{a=="touchmove"&&(r.updateConfig(y),u(r.isOutside(y)),ut(y)),document.addEventListener(a,C,{passive:!1})}),ct(s),document.addEventListener(d,G(a),{once:!0})}},x=a=>r.updateConfig(a),G=a=>d=>{u(!0);const y=Vt(d);clearTimeout(I),At(r.isOutside(y,!1)),document.removeEventListener(a,C),r.updateConfig(y);const ft=r.getCurrentConfig(y);if(ft){const{droppable:rt}=ft;Z(rt)}s.onscroll=null},Z=a=>{if(a.onscroll=null,!D)return;const d=Array.from(document.querySelectorAll(dt(D)));for(const y of d)at(y)&&(y.onscroll=null)},ut=a=>{Gt(t,s,v==1,r.current),St(),F(t,ue,R,r.current),wt(t),X(a,t)},St=()=>{v=2},Dt=a=>{const{pageX:d,pageY:y}=a;N={pageX:d,pageY:y},ot()},ct=a=>ae(a,"onscroll",Ft),Ft=()=>ot(),At=a=>{if(v!==2){v=0;return}v=3,xt(t),F(t,zt,R,a?r.initial:r.current,e)},xt=a=>{Nt(a,f,fe),Tt(a,0,0)},wt=a=>{const{height:d,width:y}=a.getBoundingClientRect();le(a,{fixedHeight:`${d}px`,fixedWidth:`${y}px`}),k(a,!0),gt(a,h,!0),a.style.transition=""},Bt=a=>{if(!r.initial)return;const d=r.initial;a==e&&(U(t,b),setTimeout(()=>{B(e),yt(t,b),Gt(t,s,v==1,r.initial),st(a,t,d,y=>{xt(y),P(t)})},p))},he=(a,d)=>{(a===e||a===n.onGetLegth()&&e===a-1)&&H(a,t,s,d,()=>{ln(t,v==1,r.initial)})};return j(),$(t),[Bt,he]}const En=(t,e)=>{t&&ve(e,t)};function yn(t,e,n,s="index"){const o=s;let i=[],c=[];const{droppableGroup:l}=t;if(!n)return[i,c];const f=Ct(l).map(p=>`droppable-group-${p}`).join(" ");En(f,n);for(const p of n.children){const h=p.getAttribute(o),b=Te(h),B=p;if(B&&b>=0){const[M,S]=Tn(B,b,t,n,e);i.push(M),c.push(S)}}return[i,c]}function Cn(t,e,n,s="index"){let o=[],i=[];const c=hn(t,n),l=S=>{for(const D of o)D(S)},f=(S,D)=>{if(c.onGetLegth()===0)t.insertToListEmpty(c,S,D);else for(const R of i)R(S,D)},p=S=>{const[D,v]=yn(c,e,S,s);o=D,i=v},h=S=>{kt(()=>{p(S)},S,{childList:!0})},b=S=>{U(S,It)},B=S=>{it.addConfig(S,c)};return[l,f,S=>{S&&(b(S),B(S),h(S),p(S),it.removeObsoleteConfigs())}]}exports.GRAB_CLASS=se;exports.addClass=U;exports.dragAndDrop=Cn;exports.insertToListEmpty=pn;exports.toggleClass=gt;
|
@@ -0,0 +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-Bd4_qrME.cjs"),o=require("../index-GRcZUS5t.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;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
var l = Object.defineProperty;
|
2
|
+
var d = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
3
|
+
var r = (n, t, e) => d(n, typeof t != "symbol" ? t + "" : t, e);
|
4
|
+
import { H as c } from "../HandlerPublisher-BbGTnlu0.js";
|
5
|
+
import { i as m, d as u } from "../index-D1rUx9iZ.js";
|
6
|
+
class h {
|
7
|
+
constructor(t) {
|
8
|
+
r(this, "items");
|
9
|
+
r(this, "parent");
|
10
|
+
this.items = t;
|
11
|
+
}
|
12
|
+
setParent(t) {
|
13
|
+
this.parent = t;
|
14
|
+
}
|
15
|
+
removeAtEvent(t) {
|
16
|
+
const e = this.items;
|
17
|
+
if (e.length <= 0)
|
18
|
+
return;
|
19
|
+
const [s] = e.splice(t, 1);
|
20
|
+
return s;
|
21
|
+
}
|
22
|
+
insertEvent(t, e) {
|
23
|
+
this.items.splice(t, 0, e);
|
24
|
+
}
|
25
|
+
getLength() {
|
26
|
+
return this.items.length;
|
27
|
+
}
|
28
|
+
getValue(t) {
|
29
|
+
return this.items[t];
|
30
|
+
}
|
31
|
+
insertToListEmpty(t, e, s) {
|
32
|
+
m(t, this.parent, e, s);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
const p = new c();
|
36
|
+
function P(n, t) {
|
37
|
+
const e = new h(n), [s, o, a] = u(e, p, t, "data-index");
|
38
|
+
return [(i) => (e.setParent(i), a(i), {
|
39
|
+
destroy() {
|
40
|
+
}
|
41
|
+
}), o, s];
|
42
|
+
}
|
43
|
+
export {
|
44
|
+
P as useDragAndDrop
|
45
|
+
};
|
@@ -0,0 +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-Bd4_qrME.cjs"),u=require("../index-GRcZUS5t.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;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
var l = Object.defineProperty;
|
2
|
+
var u = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
3
|
+
var r = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
|
4
|
+
import { ref as c, watch as m } from "vue";
|
5
|
+
import { H as h } from "../HandlerPublisher-BbGTnlu0.js";
|
6
|
+
import { i as p, d as v } from "../index-D1rUx9iZ.js";
|
7
|
+
const g = (n, t) => {
|
8
|
+
const e = n.value;
|
9
|
+
if (e.length <= 0)
|
10
|
+
return;
|
11
|
+
const [s] = e.splice(t, 1);
|
12
|
+
return s;
|
13
|
+
}, d = (n, t, e) => {
|
14
|
+
n.value.splice(t, 0, e);
|
15
|
+
}, V = (n) => n.value.length, L = (n, t) => n.value[t];
|
16
|
+
class f {
|
17
|
+
constructor(t, e) {
|
18
|
+
r(this, "items");
|
19
|
+
r(this, "parent");
|
20
|
+
this.items = t, this.parent = e;
|
21
|
+
}
|
22
|
+
removeAtEvent(t) {
|
23
|
+
return g(this.items, t);
|
24
|
+
}
|
25
|
+
insertEvent(t, e) {
|
26
|
+
return d(this.items, t, e);
|
27
|
+
}
|
28
|
+
getLength() {
|
29
|
+
return V(this.items);
|
30
|
+
}
|
31
|
+
getValue(t) {
|
32
|
+
return L(this.items, t);
|
33
|
+
}
|
34
|
+
insertToListEmpty(t, e, s) {
|
35
|
+
p(t, this.parent.value, e, s);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
const A = new h();
|
39
|
+
function P(n, t) {
|
40
|
+
const e = c();
|
41
|
+
var s = new f(n, e);
|
42
|
+
const [i, o, a] = v(s, A, t);
|
43
|
+
return m(e, () => {
|
44
|
+
a(e.value);
|
45
|
+
}), [e, o, i];
|
46
|
+
}
|
47
|
+
export {
|
48
|
+
P as useDragAndDrop
|
49
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "fluid-dnd",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.1-beta.0",
|
4
4
|
"description": "An agnostic drag and drop library to sort all kind of lists. With current support for vue 3 and svelte",
|
5
5
|
"type": "module",
|
6
6
|
"homepage": "https://vue-fluid-dnd.netlify.app",
|
@@ -15,30 +15,20 @@
|
|
15
15
|
"main": "./dist/fluid-dnd.umd.cjs",
|
16
16
|
"module": "./dist/fluid-dnd.js",
|
17
17
|
"exports": {
|
18
|
+
"./vue": {
|
19
|
+
"types": "./vue/index.d.ts",
|
20
|
+
"import": "./vue/fluid-dnd.js",
|
21
|
+
"require": "./vue/fluid-dnd.cjs"
|
22
|
+
},
|
23
|
+
"./svelte": {
|
24
|
+
"types": "./svelte/index.d.ts",
|
25
|
+
"import": "./svelte/fluid-dnd.js",
|
26
|
+
"require": "./svelte/fluid-dnd.cjs"
|
27
|
+
},
|
18
28
|
".": {
|
19
29
|
"types": "./dist/index.d.ts",
|
20
30
|
"import": "./dist/fluid-dnd.js",
|
21
31
|
"require": "./dist/fluid-dnd.umd.cjs"
|
22
|
-
},
|
23
|
-
"./vue": {
|
24
|
-
"require": {
|
25
|
-
"types": "./vue/index.d.cts",
|
26
|
-
"default": "./vue/index.cjs"
|
27
|
-
},
|
28
|
-
"import": {
|
29
|
-
"types": "./vue/index.d.ts",
|
30
|
-
"default": "./vue/index.mjs"
|
31
|
-
}
|
32
|
-
},
|
33
|
-
"./svelte": {
|
34
|
-
"require": {
|
35
|
-
"types": "./svelte/index.d.cts",
|
36
|
-
"default": "./svelte/index.cjs"
|
37
|
-
},
|
38
|
-
"import": {
|
39
|
-
"types": "./svelte/index.d.ts",
|
40
|
-
"default": "./svelte/index.mjs"
|
41
|
-
}
|
42
32
|
}
|
43
33
|
},
|
44
34
|
"types": "./dist/index.d.ts",
|
package/dist/fluid-dnd.umd.cjs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
(function(Y,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(Y=typeof globalThis<"u"?globalThis:Y||self,C(Y.FluidDnd={}))})(this,function(Y){"use strict";var En=Object.defineProperty;var Cn=(Y,C,N)=>C in Y?En(Y,C,{enumerable:!0,configurable:!0,writable:!0,value:N}):Y[C]=N;var tt=(Y,C,N)=>Cn(Y,typeof C!="symbol"?C+"":C,N);const C="horizontal",N="vertical",J="draggable",$t="droppable",xt="handler-class",Gt="dragging",Wt="dragging-handler-class",Xt="dropping",Jt="grabbing",pe="grab",Kt="disable-transition",he=(t,e)=>{const n=c=>t.removeAtEvent(c),s=(c,l)=>t.insertEvent(c,l),o=()=>t.getLength(),i=c=>t.getValue(c);return{direction:(e==null?void 0:e.direction)??N,handlerSelector:(e==null?void 0:e.handlerSelector)??J,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:i,animationDuration:(e==null?void 0:e.animationDuration)??150,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}},et=(t,e)=>t.classList.contains(e),St=(t,e,n=!1)=>{t.classList.toggle(e,n)},nt=(t,e)=>{t.classList.add(e)},Dt=(t,e)=>{t.classList.remove(e)},me=(t,e)=>bt(e).every(n=>et(t,n)),ut=t=>t?`.${bt(t).join(".")}`:"",Se=(t,e)=>{if(!e)return;const n=bt(e);t.classList.add(...n)},bt=t=>t?t.split(" ").filter(e=>e):[],De=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},Yt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),be=t=>t?parseInt(t):-1,ve=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},Qt=(t,e)=>t.x1>e.x1?Qt(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,ft=(t,e)=>!Te(t,e),Te=(t,e)=>{const n=wt(t),s=wt(e),o=Ut(n,s,N),i=Ut(n,s,C);return o>=Math.min(n.height,s.height)/2&&i>=Math.min(n.width,s.width)/2},Ut=(t,e,n)=>{const{before:s,distance:o}=B(n);return Qt({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},O=(t,e)=>t?Yt(getComputedStyle(t)[e]):0,te=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},wt=t=>t.getBoundingClientRect(),B=t=>{const e=t==C;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:wt}},Bt=(t,e)=>ye(t,e),ee=t=>[...t.children].filter(n=>et(n,J)),ye=(t,e)=>{const n=[...e.children].filter(o=>et(o,J)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Ee=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ne=(t,e)=>{const{before:n,borderBeforeWidth:s}=B(e),o=Ee(t);return o?wt(o)[n]+O(o,s):0},It=t=>window.TouchEvent&&t instanceof TouchEvent,at=t=>t instanceof HTMLElement,se=t=>t instanceof MouseEvent,Ce=["onmouseup","onmousedown","onmousemove"],Ae=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},vt=(t,e,n)=>{!t||!at(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},xe=(t,e,n)=>{t[e]=s=>{if(s.defaultPrevented)return;const o=Ht(s);n(o)}},Vt=(t,e,n)=>{n&&(we(e)?t[e]=n:xe(t,e,n))},we=t=>Ce.includes(t),Be=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Re=(t,e)=>{const n=(s,o)=>Oe(e,window,o,s);if(se(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,C),n(s,N)]}},Ht=t=>{const e=Le(t);if(!e)return Be(t);const[n,s]=Re(t,e),{clientX:o,clientY:i,pageX:c,pageY:l,screenX:f,screenY:p,target:h}=e;return{clientX:o,clientY:i,pageX:c,pageY:l,screenX:f,screenY:p,target:h,offsetX:n,offsetY:s}},Le=t=>{if(It(t))return t.touches[0]??t.changedTouches[0];if(se(t))return t},Oe=(t,e,n,s)=>{const{page:o,scroll:i,before:c,borderBeforeWidth:l,getRect:f}=B(n),p=f(s);return t[o]-e[i]-p[c]-O(s,l)},Rt=(t,e,n="ease-out",s="transform")=>{at(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},oe=(t,e,n)=>{!t||!at(t)||(t[e]=()=>{n()})},Me=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},Pe=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[i]=o.cssText.match(n)||[];if(s===i)return!0}return!1},Ne=(t,e)=>{e.forEach(n=>{Fe(t,n)})},Fe=(t,e)=>{var s;var n=Me(t);n.sheet&&(Pe(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},re=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&$e(t,`--${n}`,s)}},$e=(t,e,n)=>t&&t.style.setProperty(e,n),Ge=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},We=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:i}=B(t);return n[i]/(e[s]-e[o])},Xe=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)`},i=f=>{t.style.top=`${f.top}px`,t.style.left=`${f.left}px`};return[(f,p,h,v)=>{const R=D=>{const{beforeMargin:b,borderBeforeWidth:L,before:$,offset:I,scroll:V,page:H,inner:G,distance:rt,axis:z,getRect:F}=B(D),Q=h[H],j=window[V],k=window[G],_=F(f)[rt],Z=O(f,L),q=O(f,b),W=Q-e[I],st=ne(f,D);if(W>=j-_/2&&W<=j+k){const pt=W-n[$]-Z-q-j-st;return P(D),pt}return s[z]},P=D=>{if(f&&et(f,Gt)&&D===v){const{before:b,distance:L,axis:$,getRect:I}=B(v),V=I(f)[L],H=I(p),G=n[b]-H[b]+s[$],z=H[L]-V,F=G/z,Q=V/z,j=.1,k=.2,_=.8;let Z=0;const q=ft(f,p);!q&&F<k&&F>-Q?Z=F/k-1:!q&&F>_&&F<1+Q&&(Z=1/(1-_)*(F-_));const W=j*V*Z;Ge(p,v,W)}},S=D=>{const{axis:b}=B(D);s[b]=R(D),o(s)};S(C),S(N)},(f,p)=>{const[h,v,R,P]=Ve(f,p,t);n={top:h,left:v},i(n),e={offsetX:R,offsetY:P}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:i}=B(t);return i(e)[o]-i(n)[o]-O(n,s)},Ye=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,i=Ie(o,e);const c=o;return c&&i&&!c.isSameNode(i)&&(n+=Lt(C,c,i),s+=Lt(N,c,i)),i&&e!=o&&(n+=Lt(C,i,e),s+=Lt(N,i,e)),[n,s]},Ie=(t,e)=>{const n=t==null?void 0:t.closest(`.${xt}`);return n&&n.isSameNode(e)?t:n},ie=(t,e,n,s)=>{const{offset:o,beforeMargin:i,page:c,borderBeforeWidth:l,scroll:f}=B(t),p=ne(n,t);return e[c]-s[o]-O(n,i)-O(n,l)-window[f]-p},Ve=(t,e,n)=>{const[s,o]=Ye(t,n);return[ie(N,t,e,{offsetX:s,offsetY:o}),ie(C,t,e,{offsetX:s,offsetY:o}),s,o]},ce="startDrag",Ot="drag",_t="startDrop",He="drop",dt="temp-child",ae="cubic-bezier(0.2, 0, 0, 1)",_e=t=>t===He||t===_t,qt=t=>!t||t.length==0?0:Yt(t.replace("px","")),qe=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=Yt(n.replace("%","")),{width:i}=t.getBoundingClientRect();return i*(o/100)}return qt(n)},zt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=qe(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},ze=t=>{const{top:e,left:n}=getComputedStyle(t);return[qt(e),qt(n)]},je=(t,e)=>{const{gap:n}=B(e),[s,o]=zt(t,n);return o?s:0};function Tt(t,e,n,s,o=t.previousElementSibling,i=t.nextElementSibling){let{height:c,width:l}=ke(n,t,o,i);return ft(t,s)&&e==Ot&&(c=0,l=0),{height:c,width:l}}const ke=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:i,distance:c,gap:l,getRect:f}=B(t),p=O(e,o),h=O(e,i),v=O(s,i),[R,P]=zt(e.parentElement,l),S=f(e)[c];if(P)return le(S,h,p,R,0,t);const[D,b,L]=Ze(n,v,p,h,o);return le(S,b,D,0,L,t)},Ze=(t,e,n,s,o)=>{const i=Math.max(e,n);let c=s,l=e;if(t){const f=O(t,o);c=Math.max(f,s),l=Math.max(l,f)}return[i,c,l]},le=(t,e,n,s,o,i)=>Je(i,t+e+n+s-o),Je=(t,e)=>t==C?{width:e,height:0}:{width:0,height:e},ue=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:i}=B(t),c=O(e,n),l=O(e,s),f=i(e)[o];return c+l+f},Ke=(t,e)=>{const[n,s]=ze(e),o=ue(N,t);return[ue(C,t)-s,o-n]};function Qe(t,e,n,s,o,i,c,l,f){let p=0,h=0;const v=!!(n<0&&f);if(n===s&&!v)return fe({height:p,width:h},t,o,c,v);const[R,P,S,D]=en(e,n,s,f);if(v){const[st,it]=Ke(l,f);p+=it,h+=st}const{scrollElement:b,beforeMargin:L,afterMargin:$,distance:I,gap:V}=B(t),[H,G]=zt(l,V),[rt,z,F]=sn(L,$,R,P==null?void 0:P.previousElementSibling,D,G,v),[Q,j,k]=nn(L,$,I,S,H,G),_=tn(j,Q,k,z,rt,H),Z=v?l[b]:Ue(b,l,i),W=(D?_-F:F-_)-Z;return t===N?p+=W:t===C&&(h+=W),fe({height:p,width:h},t,o,c,v)}const Ue=(t,e,n)=>{const s=e[t],o=n[t];return s-o},tn=(t,e,n,s,o,i)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+i},en=(t,e,n,s)=>{const o=e<n,[i,c]=[e,n].toSorted((h,v)=>h-v),l=t[e]??s,f=t[n];let p=o?t.slice(i+1,c+1):t.slice(i,c);return i<0&&s&&(p=t.slice(i+1,c)),[l,f,p,o]},nn=(t,e,n,s,o,i)=>{if(s.length==0)return[0,0,0];const c=O(s[0],t);let l=0,f=-c;for(const[p,h]of s.entries()){const v=h.getBoundingClientRect()[n],R=O(h,t);i&&(l+=R),i&&p>0?l+=o:l=Math.max(l,R),f+=l+v,l=O(h,e)}return[c,f,l]},fe=(t,e,n,s,o)=>{const{scroll:i,distance:c}=B(e),l=window[i],f=n[i],p=o?0:f-2*l+s[i];return t[c]+=p,t},sn=(t,e,n,s,o,i,c)=>{const l=o?n.previousElementSibling:s;return on(t,e,l,n,i,c)},on=(t,e,n,s,o,i)=>{if(o)return[0,0,0];const c=O(i?null:n,e),l=O(s,t);let f=Math.max(c,l);return[c,l,f]},jt=(t,e,n)=>{const s=new MutationObserver(o=>{o.forEach(i=>{t(s,i)})});return s.observe(e,n),s},rn="startDrag",de="cubic-bezier(0.2, 0, 0, 1)",cn=(t,e,n)=>{let s=Tt(e,rn,n,t);const o=je(t,n),{distance:i}=B(n);s[i]-=o;const[c,l]=an(n,e);return s[l]=c,s},an=(t,e)=>{const n=t==C?N:C,{distance:s,getRect:o}=B(n);return[o(e)[s],s]},gt=(t,e,n)=>{Ae(t,e,n),t.style.minWidth=`${n}px`},ln=(t,e,n)=>s=>{e.contains(t)&&(gt(t,n.height,n.width),s.disconnect())},un=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:i}=s,c=We(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:f,scrollElement:p}=B(i);c&&(n[p]=n[l]-n[f])},ge=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:i}=n,{direction:c,animationDuration:l}=i;if(un(n,e),o.querySelector(`.${dt}`)||!t)return;var f=t.tagName=="LI"?"DIV":t.tagName,p=document.createElement(f);nt(p,dt),gt(p,0,0);const h=cn(o,t,c);return Rt(p,l,de,"width, min-width, height"),[p,h,o]},kt=(t,e,n,s,o)=>{const i=ge(t,n,s);if(!i)return;const[c,l,f]=i;e.isSameNode(f)&>(c,l.height,l.width),jt(ln(c,f,l),f,{childList:!0,subtree:!0}),f.appendChild(c)},fn=(t,e,n)=>{const s=ge(t,e,n);if(!s)return;const[o,i,c]=s;c.appendChild(o),dn(o,i)},dn=(t,e)=>requestAnimationFrame(()=>{gt(t,e.height,e.width),requestAnimationFrame(()=>{Rt(t,0,de,"width, min-width, height")})}),gn=(t,e,n,s,o=!0)=>{if(n){var i=document.querySelectorAll(`${ut(n)} > .${dt}`);i.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;gt(c,0,0),setTimeout(()=>{var p;(p=c.parentNode)==null||p.removeChild(c)},s)})}},yt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${dt}`);s.forEach(o=>{n?(gt(o,0,0),setTimeout(()=>{t.contains(o)&&t.removeChild(o)},e)):t.removeChild(o)})},pn=50;function hn(t,e,n,s,o,i){let c=e;const{direction:l,handlerSelector:f,onRemoveAtEvent:p,animationDuration:h,delayBeforeInsert:v,draggingClass:R}=t,P=(r,u,d,m,A)=>{if(!m)return;const{droppable:T,config:y}=m,x=Tt(r,u,y.direction,T);_e(u)?G(r,u,x,d,m,A):L(r,u,x,m)},S=(r,u,d,m,A)=>{const T=Tt(u,"insert",t.direction,d),{onInsertEvent:y}=t,x=ee(d);for(const[M,w]of x.entries())et(w,J)&&M>=r&&H(w,T);A(),setTimeout(()=>{y(r,m),yt(n,0,!0),mn(r,d,t),st(u),q(u,n)},v)},D=(r,u,d,m)=>{if(!d||!d.droppable||!d.config)return;const{droppable:A,config:T}=d;let[y]=Bt(u,A);y=[u,...y].toReversed();const x=Tt(u,"remove",T.direction,A);for(const[M,w]of y.entries())M>=r&&(V(w,x),setTimeout(()=>{m(w)},h))},b=r=>{yt(n,h,!0),setTimeout(()=>{st(r),q(r,n)},h)},L=(r,u,d,m)=>{const{config:A,droppable:T}=m,[y]=Bt(r,T),x=ft(r,T);y.length==0&&I(d,1,A.direction,y);for(const[M,w]of y.entries()){if(!et(w,J))continue;const X=$(A.direction,r,w,d);if(!x&&X)d=X;else if(!x)continue;const U=y.length-M;I(d,U,A.direction,y),u===ce?V(w,d):u===Ot&&H(w,d)}},$=(r,u,d,m)=>{const{before:A,distance:T,axis:y,getRect:x}=B(r),M=x(u),w=x(d),X=M[A],U=w[A],ht=w[T],Et=U+ht/2,Ct=ve(d)[y],lt=Et-Ct;return X>lt?{height:0,width:0}:m},I=(r,u,d,m)=>{const A=m.filter(y=>et(y,J)).length,{distance:T}=B(d);r[T]==0?c=Math.max(c,u):c=Math.min(c,u-1),c=Math.min(c,A)},V=(r,u)=>{const{width:d,height:m}=u;vt(r,m,d)},H=(r,u)=>{const{width:d,height:m}=u;vt(r,m,d),Rt(r,h,ae)},G=(r,u,d,m,A,T)=>{const{droppable:y,scroll:x,config:M}=A,[w,X]=Bt(r,y),U=w.toReversed(),ht=X===-1?U.length:X;U.splice(ht,0,r);const[Et,Ct,lt]=rt(r,X,U,y);d=Tt(r,u,M.direction,n,Et,Ct);const Zt=De(),Mt=Qe(M.direction,U,X,lt,Zt,x,m,y,r);w.length==0&&z(void 0,d,r,Mt);for(const[Pt,Nt]of w.toReversed().entries()){let Ft=d;lt-1>=Pt&&(Ft={height:0,width:0}),u===_t&&!et(Nt,dt)&&z(Nt,Ft,r,Mt)}F(lt,r,M,y,T)},rt=(r,u,d,m)=>{const T=ft(r,m)?u:c,y=()=>u<T?[T,T+1]:u>T?[T-1,T]:[T-1,T+1],[x,M]=y(),w=d[x]??null,X=d[M]??null;return[w,X,T]},z=(r,u,d,m)=>{vt(r,u.height,u.width),vt(d,m.height,m.width)},F=(r,u,d,m,A)=>{const{onInsertEvent:T,onDragEnd:y}=d;nt(u,Xt),k(u,n,m,()=>{if(Dt(u,Xt),A!=null){const x=p(A);x!=null&&(T(r,x),y({value:x,index:r})),j(u),Q()}})},Q=()=>{if(s){var r=document.querySelectorAll(`${ut(s)} > .${J}`);for(const u of r)W(u)}},j=r=>{setTimeout(()=>{Dt(r,R)},pn)},k=(r,u,d,m)=>{setTimeout(()=>{m&&m(),_(u,d),Z(d),st(r),q(r,u),q(r,d)},h)},_=(r,u)=>{r.isSameNode(u)?yt(r,h):(yt(r,h,!0),yt(u,h))},Z=r=>{if(n.isSameNode(r))return;var[u]=n.querySelectorAll(`.${dt}`);if(!u)return;const{distance:d}=B(l);at(u)&&(u.style[d]="0px")},q=(r,u)=>{const[d]=Bt(r,u);for(const m of[...d,r])W(m)},W=r=>{at(r)&&(r.style.transition="",r.style.transform="")},st=r=>{i(),pt(r,!1),r.style.transform="",r.style.transition="",r.style.top="",r.style.left="",re(r,{fixedHeight:"",fixedWidth:""})},it=(r,u)=>{const d=u.querySelector(f);St(document.body,Jt,r),St(d||u,Wt,r)},pt=(r,u)=>{St(r,Gt,u),it(u,r),o.toggleGrabClass(!u)};return[P,D,S,b,pt]}const mn=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,i=jt(()=>{const l=ee(e)[t];nt(l,s),nt(l,Kt),setTimeout(()=>{Dt(l,Kt),Dt(l,s),i.disconnect()},o)},e,{childList:!0})},K=class K{static addConfig(e,n){const s=K.configs.filter(i=>!i.droppable.isSameNode(e)),o=te(e);s.push({droppable:e,config:n,scroll:o}),K.configs=s}static updateScrolls(e,n){for(const s of K.configs){const{droppable:o}=s;(n&&me(o,n)||o.isSameNode(e))&&(s.scroll=te(o))}}static getConfig(e){return K.configs.find(({droppable:s})=>s.isSameNode(e))}};tt(K,"configs",[]),tt(K,"removeObsoleteConfigs",()=>{const e=K.configs.filter(({droppable:n})=>document.contains(n));K.configs=e});let ot=K;class Sn{constructor(e,n,s,o,i){tt(this,"initial");tt(this,"current");tt(this,"parent");tt(this,"draggableElement");tt(this,"groupClass");tt(this,"dragEvent");tt(this,"changeDroppable");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.initial=s?ot.getConfig(s):void 0,this.changeDroppable=i}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 i=null;return s?(e.hidden=!0,i=o(this),e.hidden=!1):i=o(this),i}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(ut(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(ut(this.groupClass))):[this.parent]).every(s=>ft(e,s))}isNotInsideAnotherDroppable(e,n){return!ft(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){oe(e,"onscroll",()=>{this.onScrollEvent()})}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?(at(s)&&!s.onscroll&&this.setOnScroll(s),ot.getConfig(s)):ot.getConfig(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 Dn(t,e,n,s,o){const{handlerSelector:i,isDraggable:c,droppableGroup:l,animationDuration:f,delayBeforeRemove:p,draggingClass:h,removingClass:v,onRemoveAtEvent:R,droppableClass:P,onDragStart:S}=n,D=bt(l).map(a=>`droppable-group-${a}`).join(" ");let b=0,L={scrollX:0,scrollY:0},$={pageX:0,pageY:0},I;const[V,H]=Xe(t),[G,rt,z,F,Q]=hn(n,e,s,D,o,()=>b=0),j=()=>{nt(t,J)},k=a=>{nt(a,xt),o.addSubscriber(a)},_=()=>{if(c(t)){const a=t.querySelector(i);k(a||t)}},Z=()=>{Ne(document.body,[`.${J}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${xt}{pointer-events:auto!important;}`,`.${pe}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Gt}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${Xt}{pointer-events:none!important;}`,`.${Jt}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"]),_(),j()},q=a=>{const g=a==null?void 0:a.querySelector(`.${xt}`),E=g==null?void 0:g.parentElement;return g&&E&&et(E,$t)&&!E.isSameNode(s)?null:g},W=a=>{const g=q(a)??a;g&&c(a)&&(Vt(g,"onmousedown",M("mousemove","mouseup")),Vt(g,"ontouchstart",M("touchmove","touchend")),st(g)),a!=null&&a.isSameNode(g)||Vt(a,"onmousedown",w),nt(s,$t)},st=a=>{const g=a.querySelectorAll("img");Array.from(g).forEach(E=>{E.onmousedown=()=>!1})},it=()=>{if($.pageX==0&&$.pageY==0||!r.current)return;const{droppable:a,config:g}=r.current;V(t,a,$,g.direction),G(t,Ot,L,r.current)},pt=(a,g)=>{g&&b==2&&!(a!=null&&a.droppable.isSameNode(g.droppable))&&G(t,Ot,L,g)},r=new Sn(t,D,s,it,pt),u=a=>{if(!r.current)return;const g=D?Array.from(document.querySelectorAll(ut(D))):[s];for(const E of g)E.classList.toggle(P,!a&&E.isSameNode(r.current.droppable))},d=a=>{r.updateConfig(a);const g=r.isOutside(a);u(g),b===1?ht(a):b===2&&(m(g),Ct(a))},m=(a=!0)=>{if(!r.current)return;const{droppable:g}=r.current;gn(g,s,D,f,a),!a&&kt(t,s,b==1,r.current)},A=a=>{if(It(a)&&a.cancelable)a.preventDefault();else if(It(a))return;const g=Ht(a);d(g)},T=(a,g)=>{a=="touchmove"?I=setTimeout(()=>{g()},200):g()},y=(a,g)=>{const{clientX:E,clientY:mt}=a,ct=document.elementFromPoint(E,mt),At=ct==null?void 0:ct.closest(`.${J}`);return ct&&g&&At&&!g.isSameNode(At)},x=a=>{const g=n.onGetValue(e);return{index:e,element:a,value:g}},M=(a,g)=>E=>{if(y(E,t))return;ot.updateScrolls(s,D);const{scrollX:mt,scrollY:ct}=window;if(L={scrollX:mt,scrollY:ct},b===0){b=1;const At=x(t);At&&S(At),T(a,()=>{a=="touchmove"&&(r.updateConfig(E),u(r.isOutside(E)),ht(E)),document.addEventListener(a,A,{passive:!1})}),lt(s),document.addEventListener(g,X(a),{once:!0})}},w=a=>r.updateConfig(a),X=a=>g=>{u(!0);const E=Ht(g);clearTimeout(I),Mt(r.isOutside(E,!1)),document.removeEventListener(a,A),r.updateConfig(E);const mt=r.getCurrentConfig(E);if(mt){const{droppable:ct}=mt;U(ct)}s.onscroll=null},U=a=>{if(a.onscroll=null,!D)return;const g=Array.from(document.querySelectorAll(ut(D)));for(const E of g)at(E)&&(E.onscroll=null)},ht=a=>{kt(t,s,b==1,r.current),Et(),G(t,ce,L,r.current),Nt(t),H(a,t)},Et=()=>{b=2},Ct=a=>{const{pageX:g,pageY:E}=a;$={pageX:g,pageY:E},it()},lt=a=>oe(a,"onscroll",Zt),Zt=()=>it(),Mt=a=>{if(b!==2){b=0;return}b=3,Pt(t),G(t,_t,L,a?r.initial:r.current,e)},Pt=a=>{Rt(a,f,ae),vt(a,0,0)},Nt=a=>{const{height:g,width:E}=a.getBoundingClientRect();re(a,{fixedHeight:`${g}px`,fixedWidth:`${E}px`}),Q(a,!0),St(a,h,!0),a.style.transition=""},Ft=a=>{if(!r.initial)return;const g=r.initial;a==e&&(nt(t,v),setTimeout(()=>{R(e),Dt(t,v),kt(t,s,b==1,r.initial),rt(a,t,g,E=>{Pt(E),F(t)})},p))},yn=(a,g)=>{(a===e||a===n.onGetLegth()&&e===a-1)&&z(a,t,s,g,()=>{fn(t,b==1,r.initial)})};return Z(),W(t),[Ft,yn]}const bn=(t,e)=>{t&&Se(e,t)};function vn(t,e,n,s="index"){const o=s;let i=[],c=[];const{droppableGroup:l}=t;if(!n)return[i,c];const f=bt(l).map(p=>`droppable-group-${p}`).join(" ");bn(f,n);for(const p of n.children){const h=p.getAttribute(o),v=be(h),R=p;if(R&&v>=0){const[P,S]=Dn(R,v,t,n,e);i.push(P),c.push(S)}}return[i,c]}function Tn(t,e,n,s="index"){let o=[],i=[];const c=he(t,n),l=S=>{for(const D of o)D(S)},f=(S,D)=>{if(c.onGetLegth()===0)t.insertToListEmpty(c,S,D);else for(const L of i)L(S,D)},p=S=>{const[D,b]=vn(c,e,S,s);o=D,i=b},h=S=>{jt(()=>{p(S)},S,{childList:!0})},v=S=>{nt(S,$t)},R=S=>{ot.addConfig(S,c)};return[l,f,S=>{S&&(v(S),R(S),h(S),p(S),ot.removeObsoleteConfigs())}]}Y.dragAndDrop=Tn,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|