Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dnd-kit/core

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dnd-kit/core - npm Package Compare versions

Comparing version 6.0.0-next-2022418215814 to 6.0.0-next-202241914636

17

CHANGELOG.md
# @dnd-kit/core
## 6.0.0-next-2022418215814
## 6.0.0-next-202241914636

@@ -157,2 +157,15 @@ ### Major Changes

- [#745](https://github.com/clauderic/dnd-kit/pull/745) [`5f3c700`](https://github.com/clauderic/dnd-kit/commit/5f3c7009698d15936fd20f30f11ad3b23cd7886f) Thanks [@clauderic](https://github.com/clauderic)! - The keyboard sensor now keeps track of the initial coordinates of the collision rect to provide a translate delta when move events are dispatched.
This is a breaking change that may affect consumers that had created custom keyboard coordinate getters.
Previously the keyboard sensor would measure the initial rect of the active node and store its top and left properties as its initial coordinates it would then compare all subsequent move coordinates to calculate the delta.
This approach suffered from the following issues:
- It didn't respect the measuring configuration defined on the `<DndContext>` for the draggable node
- Some consumers re-render the active node after dragging begins, which would lead to stale measurements
- An error had to be thrown if there was no active node during the activation phase of the keyboard sensor. This shouldn't be a concern of the keyboard sensor.
- The `currentCoordinates` passed to the coordinate getter were often stale and not an accurate representation of the current position of the collision rect, which can be affected by a number of different variables, such as modifiers.
### Minor Changes

@@ -237,3 +250,3 @@

- Updated dependencies [[`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc)]:
- @dnd-kit/utilities@3.2.0-next-2022418215814
- @dnd-kit/utilities@3.2.0-next-202241914636

@@ -240,0 +253,0 @@ ## 5.0.3

2

dist/core.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-dom"),o=require("@dnd-kit/utilities"),i=require("@dnd-kit/accessibility");const a={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},s={onDragStart:e=>`Picked up draggable item ${e}.`,onDragOver:(e,t)=>t?`Draggable item ${e} was moved over droppable area ${t}.`:`Draggable item ${e} is no longer over a droppable area.`,onDragEnd:(e,t)=>t?`Draggable item ${e} was dropped over droppable area ${t}`:`Draggable item ${e} was dropped.`,onDragCancel:e=>`Dragging was cancelled. Draggable item ${e} was dropped.`};var l;function c(...e){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(l||(l={}));const d=Object.freeze({x:0,y:0});function u(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function g(e,t){const n=o.getEventCoordinates(e);return n?`${(n.x-t.left)/t.width*100}% ${(n.y-t.top)/t.height*100}%`:"0 0"}function f({data:{value:e}},{data:{value:t}}){return e-t}function p({data:{value:e}},{data:{value:t}}){return t-e}function h({left:e,top:t,height:n,width:r}){return[{x:e,y:t},{x:e+r,y:t},{x:e,y:t+n},{x:e+r,y:t+n}]}function v(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function b(e,t=e.left,n=e.top){return{x:t+.5*e.width,y:n+.5*e.height}}function m(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height);if(r<o&&n<i){const a=(o-r)*(i-n);return Number((a/(t.width*t.height+e.width*e.height-a)).toFixed(4))}return 0}const y=({collisionRect:e,droppableRects:t,droppableContainers:n})=>{const r=[];for(const o of n){const{id:n}=o,i=t.get(n);if(i){const t=m(i,e);t>0&&r.push({id:n,data:{droppableContainer:o,value:t}})}}return r.sort(p)};function x(e,t){const{top:n,left:r,bottom:o,right:i}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=i}function w(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:d}function C(e){return function(t,...n){return n.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const D=C(1);function E(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const R={ignoreTransform:!1};function S(e,t=R){let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:t}=o.getWindow(e),{transform:r,transformOrigin:i}=t(e);r&&(n=function(e,t,n){const r=E(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,r,i))}const{top:r,left:i,width:a,height:s,bottom:l,right:c}=n;return{top:r,left:i,width:a,height:s,bottom:l,right:c}}function M(e){return S(e,{ignoreTransform:!0})}function O(e,t){const n=[];return e?function r(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if(o.isDocument(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!o.isHTMLElement(i)||o.isSVGElement(i))return n;if(n.includes(i))return n;const{getComputedStyle:a}=o.getWindow(i),s=a(i);return i!==e&&function(e,t=o.getWindow(e).getComputedStyle(e)){const n=/(auto|scroll|overlay)/;return null!=["overflow","overflowX","overflowY"].find(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(i,s)&&n.push(i),function(e,t=o.getWindow(e).getComputedStyle(e)){return"fixed"===t.position}(i,s)?n:r(i.parentNode)}(e):n}function N(e){const[t]=O(e,1);return null!=t?t:null}function L(e){return o.canUseDOM&&e?o.isWindow(e)?e:o.isNode(e)?o.isDocument(e)||e===o.getOwnerDocument(e).scrollingElement?window:o.isHTMLElement(e)?e:null:null:null}function k(e){return o.isWindow(e)?e.scrollX:e.scrollLeft}function A(e){return o.isWindow(e)?e.scrollY:e.scrollTop}function T(e){return{x:k(e),y:A(e)}}var K;function I(e){return!(!o.canUseDOM||!e)&&e===document.scrollingElement}function B(e){const t={x:0,y:0},n=I(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(K||(K={}));const z={x:.2,y:.2};function P(e,t,{top:n,left:r,right:o,bottom:i},a=10,s=z){const{isTop:l,isBottom:c,isLeft:d,isRight:u}=B(e),g={x:0,y:0},f={x:0,y:0},p=t.height*s.y,h=t.width*s.x;return!l&&n<=t.top+p?(g.y=K.Backward,f.y=a*Math.abs((t.top+p-n)/p)):!c&&i>=t.bottom-p&&(g.y=K.Forward,f.y=a*Math.abs((t.bottom-p-i)/p)),!u&&o>=t.right-h?(g.x=K.Forward,f.x=a*Math.abs((t.right-h-o)/h)):!d&&r<=t.left+h&&(g.x=K.Backward,f.x=a*Math.abs((t.left+h-r)/h)),{direction:g,speed:f}}function W(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function F(e){return e.reduce((e,t)=>o.add(e,T(t)),d)}function U(e,t=S){if(!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);N(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const j=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+k(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+A(t),0)}]];class q{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=O(t),r=F(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of j)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n);return this.rect[i]+(r[e]-t)},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class H{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function X(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Y,$;function V(e){e.preventDefault()}function J(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Y||(Y={})),($=exports.KeyboardCode||(exports.KeyboardCode={})).Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter";const _={start:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter],cancel:[exports.KeyboardCode.Esc],end:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter]},G=(e,{currentCoordinates:t})=>{switch(e.code){case exports.KeyboardCode.Right:return{...t,x:t.x+25};case exports.KeyboardCode.Left:return{...t,x:t.x-25};case exports.KeyboardCode.Down:return{...t,y:t.y+25};case exports.KeyboardCode.Up:return{...t,y:t.y-25}}};class Q{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.coordinates=d,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new H(o.getOwnerDocument(t)),this.windowListeners=new H(o.getWindow(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Y.Resize,this.handleCancel),this.windowListeners.add(Y.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Y.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props;if(!e.node.current)throw new Error("Active draggable node is undefined");U(e.node.current);const n=M(e.node.current),r={x:n.left,y:n.top};this.coordinates=r,t(r)}handleKeyDown(e){if(o.isKeyboardEvent(e)){const{coordinates:t}=this,{active:n,context:r,options:i}=this.props,{keyboardCodes:a=_,coordinateGetter:s=G,scrollBehavior:l="smooth"}=i,{code:c}=e;if(a.end.includes(c))return void this.handleEnd(e);if(a.cancel.includes(c))return void this.handleCancel(e);const d=s(e,{active:n,context:r.current,currentCoordinates:t});if(d){const n={x:0,y:0},{scrollableAncestors:i}=r.current;for(const r of i){const i=e.code,a=o.subtract(d,t),{isTop:s,isRight:c,isLeft:u,isBottom:g,maxScroll:f,minScroll:p}=B(r),h=W(r),v={x:Math.min(i===exports.KeyboardCode.Right?h.right-h.width/2:h.right,Math.max(i===exports.KeyboardCode.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(i===exports.KeyboardCode.Down?h.bottom-h.height/2:h.bottom,Math.max(i===exports.KeyboardCode.Down?h.top:h.top+h.height/2,d.y))},b=i===exports.KeyboardCode.Right&&!c||i===exports.KeyboardCode.Left&&!u,m=i===exports.KeyboardCode.Down&&!g||i===exports.KeyboardCode.Up&&!s;if(b&&v.x!==d.x){const e=r.scrollLeft+a.x;if(i===exports.KeyboardCode.Right&&e<=f.x||i===exports.KeyboardCode.Left&&e>=p.x)return void r.scrollTo({left:e,behavior:l});n.x=i===exports.KeyboardCode.Right?r.scrollLeft-f.x:r.scrollLeft-p.x,r.scrollBy({left:-n.x,behavior:l});break}if(m&&v.y!==d.y){const e=r.scrollTop+a.y;if(i===exports.KeyboardCode.Down&&e<=f.y||i===exports.KeyboardCode.Up&&e>=p.y)return void r.scrollTo({top:e,behavior:l});n.y=i===exports.KeyboardCode.Down?r.scrollTop-f.y:r.scrollTop-p.y,r.scrollBy({top:-n.y,behavior:l});break}}this.handleMove(e,o.add(d,n))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t),this.coordinates=t}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Z(e){return Boolean(e&&"distance"in e)}function ee(e){return Boolean(e&&"delay"in e)}Q.activators=[{eventName:"onKeyDown",handler:(e,{keyboardCodes:t=_,onActivation:n})=>{const{code:r}=e.nativeEvent;return!!t.start.includes(r)&&(e.preventDefault(),null==n||n({event:e.nativeEvent}),!0)}}];class te{constructor(e,t,n=function(e){const{EventTarget:t}=o.getWindow(e);return e instanceof t?e:o.getOwnerDocument(e)}(e.event.target)){var r;this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:a}=i;this.props=e,this.events=t,this.document=o.getOwnerDocument(a),this.documentListeners=new H(this.document),this.listeners=new H(n),this.windowListeners=new H(o.getWindow(a)),this.initialCoordinates=null!=(r=o.getEventCoordinates(i))?r:d,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Y.Resize,this.handleCancel),this.windowListeners.add(Y.DragStart,V),this.windowListeners.add(Y.VisibilityChange,this.handleCancel),this.windowListeners.add(Y.ContextMenu,V),this.documentListeners.add(Y.Keydown,this.handleKeydown),t){if(Z(t))return;if(ee(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Y.Click,J,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Y.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:s}}=i;if(!r)return;const l=null!=(t=o.getEventCoordinates(e))?t:d,c=o.subtract(r,l);if(!n&&s){if(ee(s))return X(c,s.tolerance)?this.handleCancel():void 0;if(Z(s))return null!=s.tolerance&&X(c,s.tolerance)?this.handleCancel():X(c,s.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),a(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===exports.KeyboardCode.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ne={move:{name:"pointermove"},end:{name:"pointerup"}};class re extends te{constructor(e){const{event:t}=e,n=o.getOwnerDocument(t.target);super(e,ne,n)}}re.activators=[{eventName:"onPointerDown",handler:({nativeEvent:e},{onActivation:t})=>!(!e.isPrimary||0!==e.button||(null==t||t({event:e}),0))}];const oe={move:{name:"mousemove"},end:{name:"mouseup"}};var ie;!function(e){e[e.RightClick=2]="RightClick"}(ie||(ie={}));class ae extends te{constructor(e){super(e,oe,o.getOwnerDocument(e.event.target))}}ae.activators=[{eventName:"onMouseDown",handler:({nativeEvent:e},{onActivation:t})=>e.button!==ie.RightClick&&(null==t||t({event:e}),!0)}];const se={move:{name:"touchmove"},end:{name:"touchend"}};class le extends te{constructor(e){super(e,se)}static setup(){return window.addEventListener(se.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(se.move.name,e)};function e(){}}}var ce,de;le.activators=[{eventName:"onTouchStart",handler:({nativeEvent:e},{onActivation:t})=>{const{touches:n}=e;return!(n.length>1||(null==t||t({event:e}),0))}}],(ce=exports.AutoScrollActivator||(exports.AutoScrollActivator={}))[ce.Pointer=0]="Pointer",ce[ce.DraggableRect=1]="DraggableRect",(de=exports.TraversalOrder||(exports.TraversalOrder={}))[de.TreeOrder=0]="TreeOrder",de[de.ReversedTreeOrder=1]="ReversedTreeOrder";const ue={x:{[K.Backward]:!1,[K.Forward]:!1},y:{[K.Backward]:!1,[K.Forward]:!1}};var ge;(ge=exports.MeasuringStrategy||(exports.MeasuringStrategy={}))[ge.Always=0]="Always",ge[ge.BeforeDragging=1]="BeforeDragging",ge[ge.WhileDragging=2]="WhileDragging",(exports.MeasuringFrequency||(exports.MeasuringFrequency={})).Optimized="optimized";const fe=new Map;function pe(e,t){return o.useLazyMemo(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function he({callback:e,disabled:n}){const r=o.useEvent(e),i=t.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return t.useEffect(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function ve(e,n=S,r){const[i,a]=t.useReducer((function(t){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=t?t:r)?o:null;const i=n(e);return JSON.stringify(t)===JSON.stringify(i)?t:i}),null),s=function({callback:e,disabled:n}){const r=o.useEvent(e),i=t.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return t.useEffect(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),l=he({callback:a});return o.useIsomorphicLayoutEffect(()=>{a(),e?(null==l||l.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==s||s.disconnect())},[e]),i}const be=[];function me(e,n=[]){const r=t.useRef(null);return t.useEffect(()=>{r.current=null},n),t.useEffect(()=>{const t=e!==d;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?o.subtract(e,r.current):d}function ye(e){return t.useMemo(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const xe=[];function we(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return o.isHTMLElement(t)?t:e}const Ce=[{sensor:re,options:{}},{sensor:Q,options:{}}],De={current:{}},Ee={draggable:{measure:M},droppable:{measure:M,strategy:exports.MeasuringStrategy.WhileDragging,frequency:exports.MeasuringFrequency.Optimized},dragOverlay:{measure:S}};class Re extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(({disabled:e})=>!e)}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Se={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:{},droppableRects:new Map,droppableContainers:new Re,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:c},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ee,measureDroppableContainers:c,windowRect:null,measuringScheduled:!1},Me={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:c,draggableNodes:{},over:null,measureDroppableContainers:c},Oe=t.createContext(Me),Ne=t.createContext(Se);function Le(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:new Re}}}function ke(e,t){switch(t.type){case l.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case l.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case l.DragEnd:case l.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case l.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Re(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case l.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Re(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case l.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Re(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}const Ae=t.createContext({type:null,event:null});function Te({onDragStart:e,onDragMove:n,onDragOver:r,onDragEnd:o,onDragCancel:i}){const a=t.useContext(Ae),s=t.useRef(a);t.useEffect(()=>{if(a!==s.current){const{type:t,event:c}=a;switch(t){case l.DragStart:null==e||e(c);break;case l.DragMove:null==n||n(c);break;case l.DragOver:null==r||r(c);break;case l.DragCancel:null==i||i(c);break;case l.DragEnd:null==o||o(c)}s.current=a}},[a,e,n,r,o,i])}function Ke({announcements:e=s,hiddenTextDescribedById:a,screenReaderInstructions:l}){const{announce:c,announcement:d}=i.useAnnouncement(),u=o.useUniqueId("DndLiveRegion"),[g,f]=t.useState(!1);return t.useEffect(()=>{f(!0)},[]),Te(t.useMemo(()=>({onDragStart({active:t}){c(e.onDragStart(t.id))},onDragMove({active:t,over:n}){e.onDragMove&&c(e.onDragMove(t.id,null==n?void 0:n.id))},onDragOver({active:t,over:n}){c(e.onDragOver(t.id,null==n?void 0:n.id))},onDragEnd({active:t,over:n}){c(e.onDragEnd(t.id,null==n?void 0:n.id))},onDragCancel({active:t}){c(e.onDragCancel(t.id))}}),[c,e])),g?r.createPortal(n.createElement(n.Fragment,null,n.createElement(i.HiddenText,{id:a,value:l.draggable}),n.createElement(i.LiveRegion,{id:u,announcement:d})),document.body):null}function Ie(e,{transform:t,...n}){return(null==e?void 0:e.length)?e.reduce((e,t)=>t({transform:e,...n}),t):t}const Be=t.createContext({...d,scaleX:1,scaleY:1});var ze;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(ze||(ze={}));const Pe=t.memo((function({id:e,autoScroll:i=!0,announcements:s,children:c,sensors:u=Ce,collisionDetection:g=y,measuring:f,modifiers:p,screenReaderInstructions:h=a,...b}){var m,x,C,E;const R=t.useReducer(ke,void 0,Le),[M,k]=R,[A,B]=t.useState(()=>({type:null,event:null})),[z,W]=t.useState(ze.Uninitialized),U=z===ze.Initialized,{draggable:{active:j,nodes:H,translate:X},droppable:{containers:Y}}=M,$=j?H[j]:null,V=t.useRef({initial:null,translated:null}),J=t.useMemo(()=>{var e;return null!=j?{id:j,data:null!=(e=null==$?void 0:$.data)?e:De,rect:V}:null},[j,$]),_=t.useRef(null),[G,Q]=t.useState(null),[Z,ee]=t.useState(null),te=o.useLatestValue(b,Object.values(b)),ne=o.useUniqueId("DndDescribedBy",e),re=t.useMemo(()=>Y.getEnabled(),[Y]),oe=t.useMemo(()=>({draggable:{...Ee.draggable,...null==ie?void 0:ie.draggable},droppable:{...Ee.droppable,...null==ie?void 0:ie.droppable},dragOverlay:{...Ee.dragOverlay,...null==ie?void 0:ie.dragOverlay}}),[null==(ie=f)?void 0:ie.draggable,null==ie?void 0:ie.droppable,null==ie?void 0:ie.dragOverlay]);var ie;const{droppableRects:ae,measureDroppableContainers:se,measuringScheduled:le}=function(e,{dragging:n,dependencies:r,config:i}){const[a,s]=t.useState(null),l=null!=a,{frequency:c,measure:d,strategy:u}=i,g=t.useRef(e),f=function(){switch(u){case exports.MeasuringStrategy.Always:return!1;case exports.MeasuringStrategy.BeforeDragging:return n;default:return!n}}(),p=o.useLatestValue(f),h=t.useCallback((e=[])=>{p.current||s(t=>t?t.concat(e):e)},[p]),v=t.useRef(null),b=o.useLazyMemo(t=>{if(f&&!n)return fe;const r=a;if(!t||t===fe||g.current!==e||null!=r){const t=new Map;for(let n of e){if(!n)continue;if(r&&r.length>0&&!r.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new q(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,a,n,f,d]);return t.useEffect(()=>{g.current=e},[e]),t.useEffect(()=>{f||requestAnimationFrame(()=>h())},[n,f]),t.useEffect(()=>{l&&s(null)},[l]),t.useEffect(()=>{f||"number"!=typeof c||null!==v.current||(v.current=setTimeout(()=>{h(),v.current=null},c))},[c,f,h,...r]),{droppableRects:b,measureDroppableContainers:h,measuringScheduled:l}}(re,{dragging:U,dependencies:[X.x,X.y],config:oe.droppable}),ce=function(e,t){const n=null!==t?e[t]:void 0,r=n?n.node.current:null;return o.useLazyMemo(e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(H,j),de=t.useMemo(()=>Z?o.getEventCoordinates(Z):null,[Z]),ge=function(){const e=U&&!(!1===(null==G?void 0:G.autoScrollEnabled))&&!("object"==typeof i?!1===i.enabled:!1===i);return"object"==typeof i?{...i,enabled:e}:{enabled:e}}(),Re=function(e,t){return pe(e,t)}(ce,oe.draggable.measure);!function({activeNode:e,measure:n,initialRect:r,config:i=!0}){const a=t.useRef(!1),{x:s,y:l}="boolean"==typeof i?{x:i,y:i}:i;o.useIsomorphicLayoutEffect(()=>{if(!s&&!l||!e)return void(a.current=!1);if(a.current||!r)return;const t=null==e?void 0:e.node.current;if(!t||!1===t.isConnected)return;const o=w(n(t),r);if(s||(o.x=0),l||(o.y=0),a.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const e=N(t);e&&e.scrollBy({top:o.y,left:o.x})}},[e,s,l,r,n])}({activeNode:j?H[j]:null,config:ge.layoutShiftCompensation,initialRect:Re,measure:oe.draggable.measure});const Se=ve(ce,oe.draggable.measure,Re),Me=ve(ce?ce.parentElement:null),Te=t.useRef({active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:Y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Pe=Y.getNodeFor(null==(m=Te.current.over)?void 0:m.id),We=function({measure:e}){const[n,r]=t.useState(null),i=he({callback:t.useCallback(t=>{for(const{target:n}of t)if(o.isHTMLElement(n)){r(t=>{const r=e(n);return t?{...t,width:r.width,height:r.height}:r});break}},[e])}),a=t.useCallback(t=>{const n=we(t);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?e(n):null)},[e,i]),[s,l]=o.useNodeRef(a);return t.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}({measure:oe.dragOverlay.measure}),Fe=null!=(x=We.nodeRef.current)?x:ce,Ue=U?null!=(C=We.rect)?C:Se:null,je=Boolean(We.nodeRef.current&&We.rect),qe=w(He=je?null:Se,pe(He));var He;const Xe=ye(Fe?o.getWindow(Fe):null),Ye=function(e){const n=t.useRef(e),r=o.useLazyMemo(t=>e?t&&e&&n.current&&e.parentNode===n.current.parentNode?t:O(e):be,[e]);return t.useEffect(()=>{n.current=e},[e]),r}(U?null!=Pe?Pe:Fe:null),$e=function(e,n=S){const[r]=e,i=ye(r?o.getWindow(r):null),[a,s]=t.useReducer((function(){return e.length?e.map(e=>I(e)?i:new q(n(e),e)):xe}),xe),l=he({callback:s});return e.length>0&&a===xe&&s(),o.useIsomorphicLayoutEffect(()=>{e.length?e.forEach(e=>null==l?void 0:l.observe(e)):(null==l||l.disconnect(),s())},[e]),a}(Ye),Ve=Ie(p,{transform:{x:X.x-qe.x,y:X.y-qe.y,scaleX:1,scaleY:1},activatorEvent:Z,active:J,activeNodeRect:Se,containerNodeRect:Me,draggingNodeRect:Ue,over:Te.current.over,overlayNodeRect:We.rect,scrollableAncestors:Ye,scrollableAncestorRects:$e,windowRect:Xe}),Je=de?o.add(de,X):null,_e=function(e){const[n,r]=t.useState(null),i=t.useRef(e),a=t.useCallback(e=>{const t=L(e.target);t&&r(e=>e?(e.set(t,T(t)),new Map(e)):null)},[]);return t.useEffect(()=>{const t=i.current;if(e!==t){n(t);const o=e.map(e=>{const t=L(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,T(t)]):null}).filter(e=>null!=e);r(o.length?new Map(o):null),i.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=L(e);null==t||t.removeEventListener("scroll",a)})}},[a,e]),t.useMemo(()=>e.length?n?Array.from(n.values()).reduce((e,t)=>o.add(e,t),d):F(e):d,[e,n])}(Ye),Ge=me(_e),Qe=me(_e,[Se]),Ze=o.add(Ve,Ge),et=Ue?D(Ue,Ve):null,tt=J&&et?g({active:J,collisionRect:et,droppableRects:ae,droppableContainers:re,pointerCoordinates:Je}):null,nt=v(tt,"id"),[rt,ot]=t.useState(null),it=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(je?Ve:o.add(Ve,Qe),null!=(E=null==rt?void 0:rt.rect)?E:null,Se),at=t.useCallback((e,{sensor:t,options:n})=>{if(!_.current)return;const o=H[_.current];if(!o)return;const i=new t({active:_.current,activeNode:o,event:e.nativeEvent,options:n,context:Te,onStart(e){const t=_.current;if(!t)return;const n=H[t];if(!n)return;const{onDragStart:o}=te.current,i={active:{id:t,data:n.data,rect:V}};r.unstable_batchedUpdates(()=>{null==o||o(i),W(ze.Initializing),k({type:l.DragStart,initialCoordinates:e,active:t}),B({type:l.DragStart,event:i})})},onMove(e){k({type:l.DragMove,coordinates:e})},onEnd:a(l.DragEnd),onCancel:a(l.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:i}=Te.current;let a=null;if(t&&i){const{cancelDrop:r}=te.current;a={active:t,collisions:n,delta:i,over:o},e===l.DragEnd&&"function"==typeof r&&await Promise.resolve(r(a))&&(e=l.DragCancel)}_.current=null,r.unstable_batchedUpdates(()=>{if(k({type:e}),W(ze.Uninitialized),ot(null),Q(null),ee(null),a&&B({type:e,event:a}),a){const{onDragCancel:t,onDragEnd:n}=te.current,r=e===l.DragEnd?n:t;null==r||r(a)}})}}r.unstable_batchedUpdates(()=>{Q(i),ee(e.nativeEvent)})},[H]),st=function(e,n){return t.useMemo(()=>e.reduce((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:n(e.handler,t)}))]},[]),[e,n])}(u,t.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent;null!==_.current||o.dndKit||o.defaultPrevented||!0===e(n,t.options)&&(o.dndKit={capturedBy:t.sensor},_.current=r,at(n,t))},[at]));!function(e){t.useEffect(()=>{if(!o.canUseDOM)return;const t=e.map(({sensor:e})=>null==e.setup?void 0:e.setup());return()=>{for(const e of t)null==e||e()}},e.map(({sensor:e})=>e))}(u),o.useIsomorphicLayoutEffect(()=>{Se&&z===ze.Initializing&&W(ze.Initialized)},[Se,z]),t.useEffect(()=>{const{onDragMove:e}=te.current,{active:t,collisions:n,over:r}=Te.current;if(!t)return;const o={active:t,collisions:n,delta:{x:Ze.x,y:Ze.y},over:r};B({type:l.DragMove,event:o}),null==e||e(o)},[Ze.x,Ze.y]),t.useEffect(()=>{const{active:e,collisions:t,droppableContainers:n,scrollAdjustedTranslate:o}=Te.current;if(!e||!_.current||!o)return;const{onDragOver:i}=te.current,a=n.get(nt),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,collisions:t,delta:{x:o.x,y:o.y},over:s};r.unstable_batchedUpdates(()=>{ot(s),B({type:l.DragOver,event:c}),null==i||i(c)})},[nt]),o.useIsomorphicLayoutEffect(()=>{Te.current={active:J,activeNode:ce,collisionRect:et,collisions:tt,droppableRects:ae,draggableNodes:H,draggingNode:Fe,draggingNodeRect:Ue,droppableContainers:Y,over:rt,scrollableAncestors:Ye,scrollAdjustedTranslate:Ze},V.current={initial:Ue,translated:et}},[J,ce,tt,et,H,Fe,Ue,ae,Y,rt,Ye,Ze]),function({acceleration:e,activator:n=exports.AutoScrollActivator.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:s=5,order:l=exports.TraversalOrder.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:g,threshold:f}){const p=function({delta:e,disabled:t}){const n=o.usePrevious(e);return o.useLazyMemo(r=>{if(t||!n||!r)return ue;const o=Math.sign(e.x-n.x),i=Math.sign(e.y-n.y);return{x:{[K.Backward]:r.x[K.Backward]||-1===o,[K.Forward]:r.x[K.Forward]||1===o},y:{[K.Backward]:r.y[K.Backward]||-1===i,[K.Forward]:r.y[K.Forward]||1===i}}},[t,e,n])}({delta:g,disabled:!a}),[h,v]=o.useInterval(),b=t.useRef({x:0,y:0}),m=t.useRef({x:0,y:0}),y=t.useMemo(()=>{switch(n){case exports.AutoScrollActivator.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case exports.AutoScrollActivator.DraggableRect:return i}},[n,i,c]),x=t.useRef(null),w=t.useCallback(()=>{const e=x.current;e&&e.scrollBy(b.current.x*m.current.x,b.current.y*m.current.y)},[]),C=t.useMemo(()=>l===exports.TraversalOrder.TreeOrder?[...d].reverse():d,[l,d]);t.useEffect(()=>{if(a&&d.length&&y){for(const t of C){if(!1===(null==r?void 0:r(t)))continue;const n=d.indexOf(t),o=u[n];if(!o)continue;const{direction:i,speed:a}=P(t,o,y,e,f);if(a.x>0&&p.x[i.x]||a.y>0&&p.y[i.y])return v(),x.current=t,h(w,s),b.current=a,void(m.current=i)}b.current={x:0,y:0},m.current={x:0,y:0},v()}else v()},[e,w,r,v,a,s,JSON.stringify(y),JSON.stringify(p),h,d,C,u,JSON.stringify(f)])}({...ge,delta:X,draggingRect:et,pointerCoordinates:Je,scrollableAncestors:Ye,scrollableAncestorRects:$e});const lt=t.useMemo(()=>({active:J,activeNode:ce,activeNodeRect:Se,activatorEvent:Z,collisions:tt,containerNodeRect:Me,dragOverlay:We,draggableNodes:H,droppableContainers:Y,droppableRects:ae,over:rt,measureDroppableContainers:se,scrollableAncestors:Ye,scrollableAncestorRects:$e,measuringConfiguration:oe,measuringScheduled:le,windowRect:Xe}),[J,ce,Se,Z,tt,Me,We,H,Y,ae,rt,se,Ye,$e,oe,le,Xe]),ct=t.useMemo(()=>({activatorEvent:Z,activators:st,active:J,activeNodeRect:Se,ariaDescribedById:{draggable:ne},dispatch:k,draggableNodes:H,over:rt,measureDroppableContainers:se}),[Z,st,J,Se,k,ne,H,rt,se]);return n.createElement(Ae.Provider,{value:A},n.createElement(Oe.Provider,{value:ct},n.createElement(Ne.Provider,{value:lt},n.createElement(Be.Provider,{value:it},c))),n.createElement(Ke,{announcements:s,hiddenTextDescribedById:ne,screenReaderInstructions:h}))})),We=t.createContext(null),Fe="button";function Ue(){return t.useContext(Ne)}const je={timeout:25};function qe({animation:e,children:r}){const[i,a]=t.useState(null),[s,l]=t.useState(null),c=o.usePrevious(r);return r||i||!c||a(c),o.useIsomorphicLayoutEffect(()=>{if(!s)return;const t=null==i?void 0:i.key;if("string"!=typeof t)return void a(null);const[n]=t.split("-",1),r=t.substring(n.length+1);Promise.resolve(e(r,s)).then(()=>{a(null)})},[e,i,s]),n.createElement(n.Fragment,null,r,i?t.cloneElement(i,{ref:l}):null)}const He={x:0,y:0,scaleX:1,scaleY:1};function Xe({children:e}){return n.createElement(Oe.Provider,{value:Me},n.createElement(Be.Provider,{value:He},e))}const Ye={position:"fixed",touchAction:"none"},$e=e=>o.isKeyboardEvent(e)?"transform 250ms ease":void 0,Ve=t.forwardRef(({as:e,activatorEvent:t,adjustScale:r,children:i,className:a,rect:s,style:l,transform:c,transition:d=$e},u)=>{if(!s)return null;const f=r?c:{...c,scaleX:1,scaleY:1},p={...Ye,width:s.width,height:s.height,top:s.top,left:s.left,transform:o.CSS.Transform.toString(f),transformOrigin:r&&t?g(t,s):void 0,transition:"function"==typeof d?d(t):d,...l};return n.createElement(e,{className:a,style:p,ref:u},i)}),Je=e=>({active:t,dragOverlay:n})=>{const r={},{styles:o,className:i}=e;if(null==o?void 0:o.active)for(const[e,n]of Object.entries(o.active))void 0!==n&&(r[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null==o?void 0:o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return(null==i?void 0:i.active)&&t.node.classList.add(i.active),(null==i?void 0:i.dragOverlay)&&n.node.classList.add(i.dragOverlay),function(){for(const[e,n]of Object.entries(r))t.node.style.setProperty(e,n);(null==i?void 0:i.active)&&t.node.classList.remove(i.active)}},_e={duration:250,easing:"ease",keyframes:({transform:{initial:e,final:t}})=>[{transform:o.CSS.Transform.toString(e)},{transform:o.CSS.Transform.toString(t)}],sideEffects:Je({styles:{active:{opacity:"0"}}})};let Ge=0;function Qe(e){return t.useMemo(()=>{if(null!=e)return Ge++,Ge},[e])}const Ze=n.memo(({adjustScale:e=!1,children:r,dropAnimation:i,style:a,transition:s,modifiers:l,wrapperElement:c="div",className:d,zIndex:u=999})=>{const{activatorEvent:g,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:v,droppableContainers:b,dragOverlay:m,over:y,measuringConfiguration:x,scrollableAncestors:w,scrollableAncestorRects:C,windowRect:D}=Ue(),R=t.useContext(Be),S=Qe(null==f?void 0:f.id),M=Ie(l,{activatorEvent:g,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:y,overlayNodeRect:m.rect,scrollableAncestors:w,scrollableAncestorRects:C,transform:R,windowRect:D}),O=pe(p),N=function({config:e,draggableNodes:t,droppableContainers:n,measuringConfiguration:r}){return o.useEvent((i,a)=>{if(null===e)return;const s=t[i];if(!s)return;const l=s.node.current;if(!l)return;const c=we(a);if(!c)return;const{transform:d}=o.getWindow(a).getComputedStyle(a),u=E(d);if(!u)return;const g="function"==typeof e?e:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={..._e,...e};return({active:e,dragOverlay:i,transform:a,...s})=>{if(!t)return;const l={x:a.x-(i.rect.left-e.rect.left),y:a.y-(i.rect.top-e.rect.top),scaleX:1!==a.scaleX?e.rect.width*a.scaleX/i.rect.width:1,scaleY:1!==a.scaleY?e.rect.height*a.scaleY/i.rect.height:1},c=o({...s,active:e,dragOverlay:i,transform:{initial:a,final:l}}),[d]=c,u=c[c.length-1];if(JSON.stringify(d)===JSON.stringify(u))return;const g=null==r?void 0:r({active:e,dragOverlay:i,...s}),f=i.node.animate(c,{easing:n,duration:t});return new Promise(e=>{f.onfinish=()=>{null==g||g(),e()}})}}(e);return U(l,r.draggable.measure),g({active:{id:i,data:s.data,node:l,rect:r.draggable.measure(l)},draggableNodes:t,dragOverlay:{node:a,rect:r.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:r,transform:u})})}({config:i,draggableNodes:v,droppableContainers:b,measuringConfiguration:x});return n.createElement(Xe,null,n.createElement(qe,{animation:N},f&&S?n.createElement(Ve,{key:`${S}-${f.id}`,ref:O?m.setRef:void 0,as:c,activatorEvent:g,adjustScale:e,className:d,transition:s,rect:O,style:{zIndex:u,...a},transform:M},r):null))});exports.DndContext=Pe,exports.DragOverlay=Ze,exports.KeyboardSensor=Q,exports.MouseSensor=ae,exports.PointerSensor=re,exports.TouchSensor=le,exports.applyModifiers=Ie,exports.closestCenter=({collisionRect:e,droppableRects:t,droppableContainers:n})=>{const r=b(e,e.left,e.top),o=[];for(const e of n){const{id:n}=e,i=t.get(n);if(i){const t=u(b(i),r);o.push({id:n,data:{droppableContainer:e,value:t}})}}return o.sort(f)},exports.closestCorners=({collisionRect:e,droppableRects:t,droppableContainers:n})=>{const r=h(e),o=[];for(const e of n){const{id:n}=e,i=t.get(n);if(i){const t=h(i),a=r.reduce((e,n,r)=>e+u(t[r],n),0),s=Number((a/4).toFixed(4));o.push({id:n,data:{droppableContainer:e,value:s}})}}return o.sort(f)},exports.defaultAnnouncements=s,exports.defaultCoordinates=d,exports.defaultDropAnimation=_e,exports.defaultDropAnimationSideEffects=Je,exports.getClientRect=S,exports.getFirstCollision=v,exports.getScrollableAncestors=O,exports.pointerWithin=({droppableContainers:e,droppableRects:t,pointerCoordinates:n})=>{if(!n)return[];const r=[];for(const o of e){const{id:e}=o,i=t.get(e);if(i&&x(n,i)){const t=h(i).reduce((e,t)=>e+u(n,t),0),a=Number((t/4).toFixed(4));r.push({id:e,data:{droppableContainer:o,value:a}})}}return r.sort(f)},exports.rectIntersection=y,exports.useDndContext=Ue,exports.useDndMonitor=Te,exports.useDraggable=function({id:e,data:n,disabled:r=!1,attributes:i}){const a=o.useUniqueId("Droppable"),{activators:s,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:g,over:f}=t.useContext(Oe),{role:p=Fe,roleDescription:h="draggable",tabIndex:v=0}=null!=i?i:{},b=(null==c?void 0:c.id)===e,m=t.useContext(b?Be:We),[y,x]=o.useNodeRef(),w=function(e,n){return t.useMemo(()=>e.reduce((e,{eventName:t,handler:r})=>(e[t]=e=>{r(e,n)},e),{}),[e,n])}(s,e),C=o.useLatestValue(n);return o.useIsomorphicLayoutEffect(()=>(g[e]={id:e,key:a,node:y,data:C},()=>{const t=g[e];t&&t.key===a&&delete g[e]}),[g,e]),{active:c,activatorEvent:l,activeNodeRect:d,attributes:t.useMemo(()=>({role:p,tabIndex:v,"aria-pressed":!(!b||p!==Fe)||void 0,"aria-roledescription":h,"aria-describedby":u.draggable}),[p,v,b,h,u.draggable]),isDragging:b,listeners:r?void 0:w,node:y,over:f,setNodeRef:x,transform:m}},exports.useDroppable=function({data:e,disabled:n=!1,id:r,resizeObserverConfig:i}){const a=o.useUniqueId("Droppable"),{active:s,dispatch:c,over:d,measureDroppableContainers:u}=t.useContext(Oe),g=t.useRef({disabled:n}),f=t.useRef(!1),p=t.useRef(null),h=t.useRef(null),{disabled:v,updateMeasurementsFor:b,timeout:m}={...je,...i},y=o.useLatestValue(null!=b?b:r),x=he({callback:t.useCallback(()=>{f.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{u("string"==typeof y.current?[y.current]:y.current),h.current=null},m)):f.current=!0},[m]),disabled:v||!s}),w=t.useCallback((e,t)=>{x&&(t&&(x.unobserve(t),f.current=!1),e&&x.observe(e))},[x]),[C,D]=o.useNodeRef(w),E=o.useLatestValue(e);return t.useEffect(()=>{x&&C.current&&(x.disconnect(),f.current=!1,x.observe(C.current))},[C,x]),o.useIsomorphicLayoutEffect(()=>(c({type:l.RegisterDroppable,element:{id:r,key:a,disabled:n,node:C,rect:p,data:E}}),()=>c({type:l.UnregisterDroppable,key:a,id:r})),[r]),t.useEffect(()=>{n!==g.current.disabled&&(c({type:l.SetDroppableDisabled,id:r,key:a,disabled:n}),g.current.disabled=n)},[r,a,n,c]),{active:s,rect:p,isOver:(null==d?void 0:d.id)===r,node:C,over:d,setNodeRef:D}},exports.useSensor=function(e,n){return t.useMemo(()=>({sensor:e,options:null!=n?n:{}}),[e,n])},exports.useSensors=function(...e){return t.useMemo(()=>[...e].filter(e=>null!=e),[...e])};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-dom"),o=require("@dnd-kit/utilities"),i=require("@dnd-kit/accessibility");const a={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},s={onDragStart:e=>`Picked up draggable item ${e}.`,onDragOver:(e,t)=>t?`Draggable item ${e} was moved over droppable area ${t}.`:`Draggable item ${e} is no longer over a droppable area.`,onDragEnd:(e,t)=>t?`Draggable item ${e} was dropped over droppable area ${t}`:`Draggable item ${e} was dropped.`,onDragCancel:e=>`Dragging was cancelled. Draggable item ${e} was dropped.`};var l;function c(...e){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(l||(l={}));const d=Object.freeze({x:0,y:0});function u(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function g(e,t){const n=o.getEventCoordinates(e);return n?`${(n.x-t.left)/t.width*100}% ${(n.y-t.top)/t.height*100}%`:"0 0"}function f({data:{value:e}},{data:{value:t}}){return e-t}function p({data:{value:e}},{data:{value:t}}){return t-e}function h({left:e,top:t,height:n,width:r}){return[{x:e,y:t},{x:e+r,y:t},{x:e,y:t+n},{x:e+r,y:t+n}]}function v(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function b(e,t=e.left,n=e.top){return{x:t+.5*e.width,y:n+.5*e.height}}function m(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height);if(r<o&&n<i){const a=(o-r)*(i-n);return Number((a/(t.width*t.height+e.width*e.height-a)).toFixed(4))}return 0}const y=({collisionRect:e,droppableRects:t,droppableContainers:n})=>{const r=[];for(const o of n){const{id:n}=o,i=t.get(n);if(i){const t=m(i,e);t>0&&r.push({id:n,data:{droppableContainer:o,value:t}})}}return r.sort(p)};function x(e,t){const{top:n,left:r,bottom:o,right:i}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=i}function w(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:d}function C(e){return function(t,...n){return n.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const D=C(1);function E(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const R={ignoreTransform:!1};function S(e,t=R){let n=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:t}=o.getWindow(e),{transform:r,transformOrigin:i}=t(e);r&&(n=function(e,t,n){const r=E(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,r,i))}const{top:r,left:i,width:a,height:s,bottom:l,right:c}=n;return{top:r,left:i,width:a,height:s,bottom:l,right:c}}function M(e){return S(e,{ignoreTransform:!0})}function O(e,t){const n=[];return e?function r(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if(o.isDocument(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!o.isHTMLElement(i)||o.isSVGElement(i))return n;if(n.includes(i))return n;const{getComputedStyle:a}=o.getWindow(i),s=a(i);return i!==e&&function(e,t=o.getWindow(e).getComputedStyle(e)){const n=/(auto|scroll|overlay)/;return null!=["overflow","overflowX","overflowY"].find(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(i,s)&&n.push(i),function(e,t=o.getWindow(e).getComputedStyle(e)){return"fixed"===t.position}(i,s)?n:r(i.parentNode)}(e):n}function N(e){const[t]=O(e,1);return null!=t?t:null}function L(e){return o.canUseDOM&&e?o.isWindow(e)?e:o.isNode(e)?o.isDocument(e)||e===o.getOwnerDocument(e).scrollingElement?window:o.isHTMLElement(e)?e:null:null:null}function k(e){return o.isWindow(e)?e.scrollX:e.scrollLeft}function A(e){return o.isWindow(e)?e.scrollY:e.scrollTop}function T(e){return{x:k(e),y:A(e)}}var K;function I(e){return!(!o.canUseDOM||!e)&&e===document.scrollingElement}function B(e){const t={x:0,y:0},n=I(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(K||(K={}));const z={x:.2,y:.2};function P(e,t,{top:n,left:r,right:o,bottom:i},a=10,s=z){const{isTop:l,isBottom:c,isLeft:d,isRight:u}=B(e),g={x:0,y:0},f={x:0,y:0},p=t.height*s.y,h=t.width*s.x;return!l&&n<=t.top+p?(g.y=K.Backward,f.y=a*Math.abs((t.top+p-n)/p)):!c&&i>=t.bottom-p&&(g.y=K.Forward,f.y=a*Math.abs((t.bottom-p-i)/p)),!u&&o>=t.right-h?(g.x=K.Forward,f.x=a*Math.abs((t.right-h-o)/h)):!d&&r<=t.left+h&&(g.x=K.Backward,f.x=a*Math.abs((t.left+h-r)/h)),{direction:g,speed:f}}function W(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function F(e){return e.reduce((e,t)=>o.add(e,T(t)),d)}function U(e,t=S){if(!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);N(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const j=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+k(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+A(t),0)}]];class q{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=O(t),r=F(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of j)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n);return this.rect[i]+(r[e]-t)},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class H{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function X(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Y,$;function V(e){e.preventDefault()}function J(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Y||(Y={})),($=exports.KeyboardCode||(exports.KeyboardCode={})).Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter";const _={start:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter],cancel:[exports.KeyboardCode.Esc],end:[exports.KeyboardCode.Space,exports.KeyboardCode.Enter]},G=(e,{currentCoordinates:t})=>{switch(e.code){case exports.KeyboardCode.Right:return{...t,x:t.x+25};case exports.KeyboardCode.Left:return{...t,x:t.x-25};case exports.KeyboardCode.Down:return{...t,y:t.y+25};case exports.KeyboardCode.Up:return{...t,y:t.y-25}}};class Q{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new H(o.getOwnerDocument(t)),this.windowListeners=new H(o.getWindow(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Y.Resize,this.handleCancel),this.windowListeners.add(Y.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Y.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&U(n),t(d)}handleKeyDown(e){if(o.isKeyboardEvent(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:i=_,coordinateGetter:a=G,scrollBehavior:s="smooth"}=r,{code:l}=e;if(i.end.includes(l))return void this.handleEnd(e);if(i.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=n.current,u=c?{x:c.left,y:c.top}:d;this.referenceCoordinates||(this.referenceCoordinates=u);const g=a(e,{active:t,context:n.current,currentCoordinates:u});if(g){const t=o.subtract(g,u),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(const n of i){const o=e.code,{isTop:i,isRight:a,isLeft:l,isBottom:c,maxScroll:d,minScroll:u}=B(n),f=W(n),p={x:Math.min(o===exports.KeyboardCode.Right?f.right-f.width/2:f.right,Math.max(o===exports.KeyboardCode.Right?f.left:f.left+f.width/2,g.x)),y:Math.min(o===exports.KeyboardCode.Down?f.bottom-f.height/2:f.bottom,Math.max(o===exports.KeyboardCode.Down?f.top:f.top+f.height/2,g.y))},h=o===exports.KeyboardCode.Right&&!a||o===exports.KeyboardCode.Left&&!l,v=o===exports.KeyboardCode.Down&&!c||o===exports.KeyboardCode.Up&&!i;if(h&&p.x!==g.x){const e=n.scrollLeft+t.x;if(o===exports.KeyboardCode.Right&&e<=d.x||o===exports.KeyboardCode.Left&&e>=u.x)return void n.scrollTo({left:e,behavior:s});r.x=o===exports.KeyboardCode.Right?n.scrollLeft-d.x:n.scrollLeft-u.x,n.scrollBy({left:-r.x,behavior:s});break}if(v&&p.y!==g.y){const e=n.scrollTop+t.y;if(o===exports.KeyboardCode.Down&&e<=d.y||o===exports.KeyboardCode.Up&&e>=u.y)return void n.scrollTo({top:e,behavior:s});r.y=o===exports.KeyboardCode.Down?n.scrollTop-d.y:n.scrollTop-u.y,n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,o.add(o.subtract(g,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Z(e){return Boolean(e&&"distance"in e)}function ee(e){return Boolean(e&&"delay"in e)}Q.activators=[{eventName:"onKeyDown",handler:(e,{keyboardCodes:t=_,onActivation:n})=>{const{code:r}=e.nativeEvent;return!!t.start.includes(r)&&(e.preventDefault(),null==n||n({event:e.nativeEvent}),!0)}}];class te{constructor(e,t,n=function(e){const{EventTarget:t}=o.getWindow(e);return e instanceof t?e:o.getOwnerDocument(e)}(e.event.target)){var r;this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:a}=i;this.props=e,this.events=t,this.document=o.getOwnerDocument(a),this.documentListeners=new H(this.document),this.listeners=new H(n),this.windowListeners=new H(o.getWindow(a)),this.initialCoordinates=null!=(r=o.getEventCoordinates(i))?r:d,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Y.Resize,this.handleCancel),this.windowListeners.add(Y.DragStart,V),this.windowListeners.add(Y.VisibilityChange,this.handleCancel),this.windowListeners.add(Y.ContextMenu,V),this.documentListeners.add(Y.Keydown,this.handleKeydown),t){if(Z(t))return;if(ee(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Y.Click,J,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Y.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:s}}=i;if(!r)return;const l=null!=(t=o.getEventCoordinates(e))?t:d,c=o.subtract(r,l);if(!n&&s){if(ee(s))return X(c,s.tolerance)?this.handleCancel():void 0;if(Z(s))return null!=s.tolerance&&X(c,s.tolerance)?this.handleCancel():X(c,s.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),a(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===exports.KeyboardCode.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ne={move:{name:"pointermove"},end:{name:"pointerup"}};class re extends te{constructor(e){const{event:t}=e,n=o.getOwnerDocument(t.target);super(e,ne,n)}}re.activators=[{eventName:"onPointerDown",handler:({nativeEvent:e},{onActivation:t})=>!(!e.isPrimary||0!==e.button||(null==t||t({event:e}),0))}];const oe={move:{name:"mousemove"},end:{name:"mouseup"}};var ie;!function(e){e[e.RightClick=2]="RightClick"}(ie||(ie={}));class ae extends te{constructor(e){super(e,oe,o.getOwnerDocument(e.event.target))}}ae.activators=[{eventName:"onMouseDown",handler:({nativeEvent:e},{onActivation:t})=>e.button!==ie.RightClick&&(null==t||t({event:e}),!0)}];const se={move:{name:"touchmove"},end:{name:"touchend"}};class le extends te{constructor(e){super(e,se)}static setup(){return window.addEventListener(se.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(se.move.name,e)};function e(){}}}var ce,de;le.activators=[{eventName:"onTouchStart",handler:({nativeEvent:e},{onActivation:t})=>{const{touches:n}=e;return!(n.length>1||(null==t||t({event:e}),0))}}],(ce=exports.AutoScrollActivator||(exports.AutoScrollActivator={}))[ce.Pointer=0]="Pointer",ce[ce.DraggableRect=1]="DraggableRect",(de=exports.TraversalOrder||(exports.TraversalOrder={}))[de.TreeOrder=0]="TreeOrder",de[de.ReversedTreeOrder=1]="ReversedTreeOrder";const ue={x:{[K.Backward]:!1,[K.Forward]:!1},y:{[K.Backward]:!1,[K.Forward]:!1}};var ge;(ge=exports.MeasuringStrategy||(exports.MeasuringStrategy={}))[ge.Always=0]="Always",ge[ge.BeforeDragging=1]="BeforeDragging",ge[ge.WhileDragging=2]="WhileDragging",(exports.MeasuringFrequency||(exports.MeasuringFrequency={})).Optimized="optimized";const fe=new Map;function pe(e,t){return o.useLazyMemo(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function he({callback:e,disabled:n}){const r=o.useEvent(e),i=t.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return t.useEffect(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function ve(e,n=S,r){const[i,a]=t.useReducer((function(t){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=t?t:r)?o:null;const i=n(e);return JSON.stringify(t)===JSON.stringify(i)?t:i}),null),s=function({callback:e,disabled:n}){const r=o.useEvent(e),i=t.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return t.useEffect(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),l=he({callback:a});return o.useIsomorphicLayoutEffect(()=>{a(),e?(null==l||l.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==s||s.disconnect())},[e]),i}const be=[];function me(e,n=[]){const r=t.useRef(null);return t.useEffect(()=>{r.current=null},n),t.useEffect(()=>{const t=e!==d;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?o.subtract(e,r.current):d}function ye(e){return t.useMemo(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const xe=[];function we(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return o.isHTMLElement(t)?t:e}const Ce=[{sensor:re,options:{}},{sensor:Q,options:{}}],De={current:{}},Ee={draggable:{measure:M},droppable:{measure:M,strategy:exports.MeasuringStrategy.WhileDragging,frequency:exports.MeasuringFrequency.Optimized},dragOverlay:{measure:S}};class Re extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(({disabled:e})=>!e)}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Se={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:{},droppableRects:new Map,droppableContainers:new Re,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:c},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ee,measureDroppableContainers:c,windowRect:null,measuringScheduled:!1},Me={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:c,draggableNodes:{},over:null,measureDroppableContainers:c},Oe=t.createContext(Me),Ne=t.createContext(Se);function Le(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:new Re}}}function ke(e,t){switch(t.type){case l.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case l.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case l.DragEnd:case l.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case l.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Re(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case l.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Re(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case l.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Re(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}const Ae=t.createContext({type:null,event:null});function Te({onDragStart:e,onDragMove:n,onDragOver:r,onDragEnd:o,onDragCancel:i}){const a=t.useContext(Ae),s=t.useRef(a);t.useEffect(()=>{if(a!==s.current){const{type:t,event:c}=a;switch(t){case l.DragStart:null==e||e(c);break;case l.DragMove:null==n||n(c);break;case l.DragOver:null==r||r(c);break;case l.DragCancel:null==i||i(c);break;case l.DragEnd:null==o||o(c)}s.current=a}},[a,e,n,r,o,i])}function Ke({announcements:e=s,hiddenTextDescribedById:a,screenReaderInstructions:l}){const{announce:c,announcement:d}=i.useAnnouncement(),u=o.useUniqueId("DndLiveRegion"),[g,f]=t.useState(!1);return t.useEffect(()=>{f(!0)},[]),Te(t.useMemo(()=>({onDragStart({active:t}){c(e.onDragStart(t.id))},onDragMove({active:t,over:n}){e.onDragMove&&c(e.onDragMove(t.id,null==n?void 0:n.id))},onDragOver({active:t,over:n}){c(e.onDragOver(t.id,null==n?void 0:n.id))},onDragEnd({active:t,over:n}){c(e.onDragEnd(t.id,null==n?void 0:n.id))},onDragCancel({active:t}){c(e.onDragCancel(t.id))}}),[c,e])),g?r.createPortal(n.createElement(n.Fragment,null,n.createElement(i.HiddenText,{id:a,value:l.draggable}),n.createElement(i.LiveRegion,{id:u,announcement:d})),document.body):null}function Ie(e,{transform:t,...n}){return(null==e?void 0:e.length)?e.reduce((e,t)=>t({transform:e,...n}),t):t}const Be=t.createContext({...d,scaleX:1,scaleY:1});var ze;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(ze||(ze={}));const Pe=t.memo((function({id:e,autoScroll:i=!0,announcements:s,children:c,sensors:u=Ce,collisionDetection:g=y,measuring:f,modifiers:p,screenReaderInstructions:h=a,...b}){var m,x,C,E;const R=t.useReducer(ke,void 0,Le),[M,k]=R,[A,B]=t.useState(()=>({type:null,event:null})),[z,W]=t.useState(ze.Uninitialized),U=z===ze.Initialized,{draggable:{active:j,nodes:H,translate:X},droppable:{containers:Y}}=M,$=j?H[j]:null,V=t.useRef({initial:null,translated:null}),J=t.useMemo(()=>{var e;return null!=j?{id:j,data:null!=(e=null==$?void 0:$.data)?e:De,rect:V}:null},[j,$]),_=t.useRef(null),[G,Q]=t.useState(null),[Z,ee]=t.useState(null),te=o.useLatestValue(b,Object.values(b)),ne=o.useUniqueId("DndDescribedBy",e),re=t.useMemo(()=>Y.getEnabled(),[Y]),oe=t.useMemo(()=>({draggable:{...Ee.draggable,...null==ie?void 0:ie.draggable},droppable:{...Ee.droppable,...null==ie?void 0:ie.droppable},dragOverlay:{...Ee.dragOverlay,...null==ie?void 0:ie.dragOverlay}}),[null==(ie=f)?void 0:ie.draggable,null==ie?void 0:ie.droppable,null==ie?void 0:ie.dragOverlay]);var ie;const{droppableRects:ae,measureDroppableContainers:se,measuringScheduled:le}=function(e,{dragging:n,dependencies:r,config:i}){const[a,s]=t.useState(null),l=null!=a,{frequency:c,measure:d,strategy:u}=i,g=t.useRef(e),f=function(){switch(u){case exports.MeasuringStrategy.Always:return!1;case exports.MeasuringStrategy.BeforeDragging:return n;default:return!n}}(),p=o.useLatestValue(f),h=t.useCallback((e=[])=>{p.current||s(t=>t?t.concat(e):e)},[p]),v=t.useRef(null),b=o.useLazyMemo(t=>{if(f&&!n)return fe;const r=a;if(!t||t===fe||g.current!==e||null!=r){const t=new Map;for(let n of e){if(!n)continue;if(r&&r.length>0&&!r.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new q(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,a,n,f,d]);return t.useEffect(()=>{g.current=e},[e]),t.useEffect(()=>{f||requestAnimationFrame(()=>h())},[n,f]),t.useEffect(()=>{l&&s(null)},[l]),t.useEffect(()=>{f||"number"!=typeof c||null!==v.current||(v.current=setTimeout(()=>{h(),v.current=null},c))},[c,f,h,...r]),{droppableRects:b,measureDroppableContainers:h,measuringScheduled:l}}(re,{dragging:U,dependencies:[X.x,X.y],config:oe.droppable}),ce=function(e,t){const n=null!==t?e[t]:void 0,r=n?n.node.current:null;return o.useLazyMemo(e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(H,j),de=t.useMemo(()=>Z?o.getEventCoordinates(Z):null,[Z]),ge=function(){const e=U&&!(!1===(null==G?void 0:G.autoScrollEnabled))&&!("object"==typeof i?!1===i.enabled:!1===i);return"object"==typeof i?{...i,enabled:e}:{enabled:e}}(),Re=function(e,t){return pe(e,t)}(ce,oe.draggable.measure);!function({activeNode:e,measure:n,initialRect:r,config:i=!0}){const a=t.useRef(!1),{x:s,y:l}="boolean"==typeof i?{x:i,y:i}:i;o.useIsomorphicLayoutEffect(()=>{if(!s&&!l||!e)return void(a.current=!1);if(a.current||!r)return;const t=null==e?void 0:e.node.current;if(!t||!1===t.isConnected)return;const o=w(n(t),r);if(s||(o.x=0),l||(o.y=0),a.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const e=N(t);e&&e.scrollBy({top:o.y,left:o.x})}},[e,s,l,r,n])}({activeNode:j?H[j]:null,config:ge.layoutShiftCompensation,initialRect:Re,measure:oe.draggable.measure});const Se=ve(ce,oe.draggable.measure,Re),Me=ve(ce?ce.parentElement:null),Te=t.useRef({active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:Y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Pe=Y.getNodeFor(null==(m=Te.current.over)?void 0:m.id),We=function({measure:e}){const[n,r]=t.useState(null),i=he({callback:t.useCallback(t=>{for(const{target:n}of t)if(o.isHTMLElement(n)){r(t=>{const r=e(n);return t?{...t,width:r.width,height:r.height}:r});break}},[e])}),a=t.useCallback(t=>{const n=we(t);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?e(n):null)},[e,i]),[s,l]=o.useNodeRef(a);return t.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}({measure:oe.dragOverlay.measure}),Fe=null!=(x=We.nodeRef.current)?x:ce,Ue=U?null!=(C=We.rect)?C:Se:null,je=Boolean(We.nodeRef.current&&We.rect),qe=w(He=je?null:Se,pe(He));var He;const Xe=ye(Fe?o.getWindow(Fe):null),Ye=function(e){const n=t.useRef(e),r=o.useLazyMemo(t=>e?t&&e&&n.current&&e.parentNode===n.current.parentNode?t:O(e):be,[e]);return t.useEffect(()=>{n.current=e},[e]),r}(U?null!=Pe?Pe:Fe:null),$e=function(e,n=S){const[r]=e,i=ye(r?o.getWindow(r):null),[a,s]=t.useReducer((function(){return e.length?e.map(e=>I(e)?i:new q(n(e),e)):xe}),xe),l=he({callback:s});return e.length>0&&a===xe&&s(),o.useIsomorphicLayoutEffect(()=>{e.length?e.forEach(e=>null==l?void 0:l.observe(e)):(null==l||l.disconnect(),s())},[e]),a}(Ye),Ve=Ie(p,{transform:{x:X.x-qe.x,y:X.y-qe.y,scaleX:1,scaleY:1},activatorEvent:Z,active:J,activeNodeRect:Se,containerNodeRect:Me,draggingNodeRect:Ue,over:Te.current.over,overlayNodeRect:We.rect,scrollableAncestors:Ye,scrollableAncestorRects:$e,windowRect:Xe}),Je=de?o.add(de,X):null,_e=function(e){const[n,r]=t.useState(null),i=t.useRef(e),a=t.useCallback(e=>{const t=L(e.target);t&&r(e=>e?(e.set(t,T(t)),new Map(e)):null)},[]);return t.useEffect(()=>{const t=i.current;if(e!==t){n(t);const o=e.map(e=>{const t=L(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,T(t)]):null}).filter(e=>null!=e);r(o.length?new Map(o):null),i.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{const t=L(e);null==t||t.removeEventListener("scroll",a)})}},[a,e]),t.useMemo(()=>e.length?n?Array.from(n.values()).reduce((e,t)=>o.add(e,t),d):F(e):d,[e,n])}(Ye),Ge=me(_e),Qe=me(_e,[Se]),Ze=o.add(Ve,Ge),et=Ue?D(Ue,Ve):null,tt=J&&et?g({active:J,collisionRect:et,droppableRects:ae,droppableContainers:re,pointerCoordinates:Je}):null,nt=v(tt,"id"),[rt,ot]=t.useState(null),it=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(je?Ve:o.add(Ve,Qe),null!=(E=null==rt?void 0:rt.rect)?E:null,Se),at=t.useCallback((e,{sensor:t,options:n})=>{if(!_.current)return;const o=H[_.current];if(!o)return;const i=new t({active:_.current,activeNode:o,event:e.nativeEvent,options:n,context:Te,onStart(e){const t=_.current;if(!t)return;const n=H[t];if(!n)return;const{onDragStart:o}=te.current,i={active:{id:t,data:n.data,rect:V}};r.unstable_batchedUpdates(()=>{null==o||o(i),W(ze.Initializing),k({type:l.DragStart,initialCoordinates:e,active:t}),B({type:l.DragStart,event:i})})},onMove(e){k({type:l.DragMove,coordinates:e})},onEnd:a(l.DragEnd),onCancel:a(l.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:i}=Te.current;let a=null;if(t&&i){const{cancelDrop:r}=te.current;a={active:t,collisions:n,delta:i,over:o},e===l.DragEnd&&"function"==typeof r&&await Promise.resolve(r(a))&&(e=l.DragCancel)}_.current=null,r.unstable_batchedUpdates(()=>{if(k({type:e}),W(ze.Uninitialized),ot(null),Q(null),ee(null),a&&B({type:e,event:a}),a){const{onDragCancel:t,onDragEnd:n}=te.current,r=e===l.DragEnd?n:t;null==r||r(a)}})}}r.unstable_batchedUpdates(()=>{Q(i),ee(e.nativeEvent)})},[H]),st=function(e,n){return t.useMemo(()=>e.reduce((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:n(e.handler,t)}))]},[]),[e,n])}(u,t.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent;null!==_.current||o.dndKit||o.defaultPrevented||!0===e(n,t.options)&&(o.dndKit={capturedBy:t.sensor},_.current=r,at(n,t))},[at]));!function(e){t.useEffect(()=>{if(!o.canUseDOM)return;const t=e.map(({sensor:e})=>null==e.setup?void 0:e.setup());return()=>{for(const e of t)null==e||e()}},e.map(({sensor:e})=>e))}(u),o.useIsomorphicLayoutEffect(()=>{Se&&z===ze.Initializing&&W(ze.Initialized)},[Se,z]),t.useEffect(()=>{const{onDragMove:e}=te.current,{active:t,collisions:n,over:r}=Te.current;if(!t)return;const o={active:t,collisions:n,delta:{x:Ze.x,y:Ze.y},over:r};B({type:l.DragMove,event:o}),null==e||e(o)},[Ze.x,Ze.y]),t.useEffect(()=>{const{active:e,collisions:t,droppableContainers:n,scrollAdjustedTranslate:o}=Te.current;if(!e||!_.current||!o)return;const{onDragOver:i}=te.current,a=n.get(nt),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,collisions:t,delta:{x:o.x,y:o.y},over:s};r.unstable_batchedUpdates(()=>{ot(s),B({type:l.DragOver,event:c}),null==i||i(c)})},[nt]),o.useIsomorphicLayoutEffect(()=>{Te.current={active:J,activeNode:ce,collisionRect:et,collisions:tt,droppableRects:ae,draggableNodes:H,draggingNode:Fe,draggingNodeRect:Ue,droppableContainers:Y,over:rt,scrollableAncestors:Ye,scrollAdjustedTranslate:Ze},V.current={initial:Ue,translated:et}},[J,ce,tt,et,H,Fe,Ue,ae,Y,rt,Ye,Ze]),function({acceleration:e,activator:n=exports.AutoScrollActivator.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:s=5,order:l=exports.TraversalOrder.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:g,threshold:f}){const p=function({delta:e,disabled:t}){const n=o.usePrevious(e);return o.useLazyMemo(r=>{if(t||!n||!r)return ue;const o=Math.sign(e.x-n.x),i=Math.sign(e.y-n.y);return{x:{[K.Backward]:r.x[K.Backward]||-1===o,[K.Forward]:r.x[K.Forward]||1===o},y:{[K.Backward]:r.y[K.Backward]||-1===i,[K.Forward]:r.y[K.Forward]||1===i}}},[t,e,n])}({delta:g,disabled:!a}),[h,v]=o.useInterval(),b=t.useRef({x:0,y:0}),m=t.useRef({x:0,y:0}),y=t.useMemo(()=>{switch(n){case exports.AutoScrollActivator.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case exports.AutoScrollActivator.DraggableRect:return i}},[n,i,c]),x=t.useRef(null),w=t.useCallback(()=>{const e=x.current;e&&e.scrollBy(b.current.x*m.current.x,b.current.y*m.current.y)},[]),C=t.useMemo(()=>l===exports.TraversalOrder.TreeOrder?[...d].reverse():d,[l,d]);t.useEffect(()=>{if(a&&d.length&&y){for(const t of C){if(!1===(null==r?void 0:r(t)))continue;const n=d.indexOf(t),o=u[n];if(!o)continue;const{direction:i,speed:a}=P(t,o,y,e,f);if(a.x>0&&p.x[i.x]||a.y>0&&p.y[i.y])return v(),x.current=t,h(w,s),b.current=a,void(m.current=i)}b.current={x:0,y:0},m.current={x:0,y:0},v()}else v()},[e,w,r,v,a,s,JSON.stringify(y),JSON.stringify(p),h,d,C,u,JSON.stringify(f)])}({...ge,delta:X,draggingRect:et,pointerCoordinates:Je,scrollableAncestors:Ye,scrollableAncestorRects:$e});const lt=t.useMemo(()=>({active:J,activeNode:ce,activeNodeRect:Se,activatorEvent:Z,collisions:tt,containerNodeRect:Me,dragOverlay:We,draggableNodes:H,droppableContainers:Y,droppableRects:ae,over:rt,measureDroppableContainers:se,scrollableAncestors:Ye,scrollableAncestorRects:$e,measuringConfiguration:oe,measuringScheduled:le,windowRect:Xe}),[J,ce,Se,Z,tt,Me,We,H,Y,ae,rt,se,Ye,$e,oe,le,Xe]),ct=t.useMemo(()=>({activatorEvent:Z,activators:st,active:J,activeNodeRect:Se,ariaDescribedById:{draggable:ne},dispatch:k,draggableNodes:H,over:rt,measureDroppableContainers:se}),[Z,st,J,Se,k,ne,H,rt,se]);return n.createElement(Ae.Provider,{value:A},n.createElement(Oe.Provider,{value:ct},n.createElement(Ne.Provider,{value:lt},n.createElement(Be.Provider,{value:it},c))),n.createElement(Ke,{announcements:s,hiddenTextDescribedById:ne,screenReaderInstructions:h}))})),We=t.createContext(null),Fe="button";function Ue(){return t.useContext(Ne)}const je={timeout:25};function qe({animation:e,children:r}){const[i,a]=t.useState(null),[s,l]=t.useState(null),c=o.usePrevious(r);return r||i||!c||a(c),o.useIsomorphicLayoutEffect(()=>{if(!s)return;const t=null==i?void 0:i.key;if("string"!=typeof t)return void a(null);const[n]=t.split("-",1),r=t.substring(n.length+1);Promise.resolve(e(r,s)).then(()=>{a(null)})},[e,i,s]),n.createElement(n.Fragment,null,r,i?t.cloneElement(i,{ref:l}):null)}const He={x:0,y:0,scaleX:1,scaleY:1};function Xe({children:e}){return n.createElement(Oe.Provider,{value:Me},n.createElement(Be.Provider,{value:He},e))}const Ye={position:"fixed",touchAction:"none"},$e=e=>o.isKeyboardEvent(e)?"transform 250ms ease":void 0,Ve=t.forwardRef(({as:e,activatorEvent:t,adjustScale:r,children:i,className:a,rect:s,style:l,transform:c,transition:d=$e},u)=>{if(!s)return null;const f=r?c:{...c,scaleX:1,scaleY:1},p={...Ye,width:s.width,height:s.height,top:s.top,left:s.left,transform:o.CSS.Transform.toString(f),transformOrigin:r&&t?g(t,s):void 0,transition:"function"==typeof d?d(t):d,...l};return n.createElement(e,{className:a,style:p,ref:u},i)}),Je=e=>({active:t,dragOverlay:n})=>{const r={},{styles:o,className:i}=e;if(null==o?void 0:o.active)for(const[e,n]of Object.entries(o.active))void 0!==n&&(r[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null==o?void 0:o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return(null==i?void 0:i.active)&&t.node.classList.add(i.active),(null==i?void 0:i.dragOverlay)&&n.node.classList.add(i.dragOverlay),function(){for(const[e,n]of Object.entries(r))t.node.style.setProperty(e,n);(null==i?void 0:i.active)&&t.node.classList.remove(i.active)}},_e={duration:250,easing:"ease",keyframes:({transform:{initial:e,final:t}})=>[{transform:o.CSS.Transform.toString(e)},{transform:o.CSS.Transform.toString(t)}],sideEffects:Je({styles:{active:{opacity:"0"}}})};let Ge=0;function Qe(e){return t.useMemo(()=>{if(null!=e)return Ge++,Ge},[e])}const Ze=n.memo(({adjustScale:e=!1,children:r,dropAnimation:i,style:a,transition:s,modifiers:l,wrapperElement:c="div",className:d,zIndex:u=999})=>{const{activatorEvent:g,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:v,droppableContainers:b,dragOverlay:m,over:y,measuringConfiguration:x,scrollableAncestors:w,scrollableAncestorRects:C,windowRect:D}=Ue(),R=t.useContext(Be),S=Qe(null==f?void 0:f.id),M=Ie(l,{activatorEvent:g,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:y,overlayNodeRect:m.rect,scrollableAncestors:w,scrollableAncestorRects:C,transform:R,windowRect:D}),O=pe(p),N=function({config:e,draggableNodes:t,droppableContainers:n,measuringConfiguration:r}){return o.useEvent((i,a)=>{if(null===e)return;const s=t[i];if(!s)return;const l=s.node.current;if(!l)return;const c=we(a);if(!c)return;const{transform:d}=o.getWindow(a).getComputedStyle(a),u=E(d);if(!u)return;const g="function"==typeof e?e:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={..._e,...e};return({active:e,dragOverlay:i,transform:a,...s})=>{if(!t)return;const l={x:a.x-(i.rect.left-e.rect.left),y:a.y-(i.rect.top-e.rect.top),scaleX:1!==a.scaleX?e.rect.width*a.scaleX/i.rect.width:1,scaleY:1!==a.scaleY?e.rect.height*a.scaleY/i.rect.height:1},c=o({...s,active:e,dragOverlay:i,transform:{initial:a,final:l}}),[d]=c,u=c[c.length-1];if(JSON.stringify(d)===JSON.stringify(u))return;const g=null==r?void 0:r({active:e,dragOverlay:i,...s}),f=i.node.animate(c,{easing:n,duration:t});return new Promise(e=>{f.onfinish=()=>{null==g||g(),e()}})}}(e);return U(l,r.draggable.measure),g({active:{id:i,data:s.data,node:l,rect:r.draggable.measure(l)},draggableNodes:t,dragOverlay:{node:a,rect:r.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:r,transform:u})})}({config:i,draggableNodes:v,droppableContainers:b,measuringConfiguration:x});return n.createElement(Xe,null,n.createElement(qe,{animation:N},f&&S?n.createElement(Ve,{key:`${S}-${f.id}`,ref:O?m.setRef:void 0,as:c,activatorEvent:g,adjustScale:e,className:d,transition:s,rect:O,style:{zIndex:u,...a},transform:M},r):null))});exports.DndContext=Pe,exports.DragOverlay=Ze,exports.KeyboardSensor=Q,exports.MouseSensor=ae,exports.PointerSensor=re,exports.TouchSensor=le,exports.applyModifiers=Ie,exports.closestCenter=({collisionRect:e,droppableRects:t,droppableContainers:n})=>{const r=b(e,e.left,e.top),o=[];for(const e of n){const{id:n}=e,i=t.get(n);if(i){const t=u(b(i),r);o.push({id:n,data:{droppableContainer:e,value:t}})}}return o.sort(f)},exports.closestCorners=({collisionRect:e,droppableRects:t,droppableContainers:n})=>{const r=h(e),o=[];for(const e of n){const{id:n}=e,i=t.get(n);if(i){const t=h(i),a=r.reduce((e,n,r)=>e+u(t[r],n),0),s=Number((a/4).toFixed(4));o.push({id:n,data:{droppableContainer:e,value:s}})}}return o.sort(f)},exports.defaultAnnouncements=s,exports.defaultCoordinates=d,exports.defaultDropAnimation=_e,exports.defaultDropAnimationSideEffects=Je,exports.getClientRect=S,exports.getFirstCollision=v,exports.getScrollableAncestors=O,exports.pointerWithin=({droppableContainers:e,droppableRects:t,pointerCoordinates:n})=>{if(!n)return[];const r=[];for(const o of e){const{id:e}=o,i=t.get(e);if(i&&x(n,i)){const t=h(i).reduce((e,t)=>e+u(n,t),0),a=Number((t/4).toFixed(4));r.push({id:e,data:{droppableContainer:o,value:a}})}}return r.sort(f)},exports.rectIntersection=y,exports.useDndContext=Ue,exports.useDndMonitor=Te,exports.useDraggable=function({id:e,data:n,disabled:r=!1,attributes:i}){const a=o.useUniqueId("Droppable"),{activators:s,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:g,over:f}=t.useContext(Oe),{role:p=Fe,roleDescription:h="draggable",tabIndex:v=0}=null!=i?i:{},b=(null==c?void 0:c.id)===e,m=t.useContext(b?Be:We),[y,x]=o.useNodeRef(),w=function(e,n){return t.useMemo(()=>e.reduce((e,{eventName:t,handler:r})=>(e[t]=e=>{r(e,n)},e),{}),[e,n])}(s,e),C=o.useLatestValue(n);return o.useIsomorphicLayoutEffect(()=>(g[e]={id:e,key:a,node:y,data:C},()=>{const t=g[e];t&&t.key===a&&delete g[e]}),[g,e]),{active:c,activatorEvent:l,activeNodeRect:d,attributes:t.useMemo(()=>({role:p,tabIndex:v,"aria-pressed":!(!b||p!==Fe)||void 0,"aria-roledescription":h,"aria-describedby":u.draggable}),[p,v,b,h,u.draggable]),isDragging:b,listeners:r?void 0:w,node:y,over:f,setNodeRef:x,transform:m}},exports.useDroppable=function({data:e,disabled:n=!1,id:r,resizeObserverConfig:i}){const a=o.useUniqueId("Droppable"),{active:s,dispatch:c,over:d,measureDroppableContainers:u}=t.useContext(Oe),g=t.useRef({disabled:n}),f=t.useRef(!1),p=t.useRef(null),h=t.useRef(null),{disabled:v,updateMeasurementsFor:b,timeout:m}={...je,...i},y=o.useLatestValue(null!=b?b:r),x=he({callback:t.useCallback(()=>{f.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{u("string"==typeof y.current?[y.current]:y.current),h.current=null},m)):f.current=!0},[m]),disabled:v||!s}),w=t.useCallback((e,t)=>{x&&(t&&(x.unobserve(t),f.current=!1),e&&x.observe(e))},[x]),[C,D]=o.useNodeRef(w),E=o.useLatestValue(e);return t.useEffect(()=>{x&&C.current&&(x.disconnect(),f.current=!1,x.observe(C.current))},[C,x]),o.useIsomorphicLayoutEffect(()=>(c({type:l.RegisterDroppable,element:{id:r,key:a,disabled:n,node:C,rect:p,data:E}}),()=>c({type:l.UnregisterDroppable,key:a,id:r})),[r]),t.useEffect(()=>{n!==g.current.disabled&&(c({type:l.SetDroppableDisabled,id:r,key:a,disabled:n}),g.current.disabled=n)},[r,a,n,c]),{active:s,rect:p,isOver:(null==d?void 0:d.id)===r,node:C,over:d,setNodeRef:D}},exports.useSensor=function(e,n){return t.useMemo(()=>({sensor:e,options:null!=n?n:{}}),[e,n])},exports.useSensors=function(...e){return t.useMemo(()=>[...e].filter(e=>null!=e),[...e])};
//# sourceMappingURL=core.cjs.production.min.js.map

@@ -15,3 +15,3 @@ import type { SensorInstance, SensorProps, SensorOptions } from '../types';

autoScrollEnabled: boolean;
private coordinates;
private referenceCoordinates;
private listeners;

@@ -18,0 +18,0 @@ private windowListeners;

{
"name": "@dnd-kit/core",
"version": "6.0.0-next-2022418215814",
"version": "6.0.0-next-202241914636",
"description": "dnd kit – a lightweight React library for building performant and accessible drag and drop experiences",

@@ -35,3 +35,3 @@ "author": "Claudéric Demers",

"@dnd-kit/accessibility": "^3.0.0",
"@dnd-kit/utilities": "^3.2.0-next-2022418215814"
"@dnd-kit/utilities": "^3.2.0-next-202241914636"
},

@@ -38,0 +38,0 @@ "publishConfig": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc