UNPKG

@param_tpss/react-dev-notes

Version:

A sticky developer note panel with drag-and-drop tasks and markdown editing, for React apps (dev-only tool).

26 lines 148 kB
(function(c1,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],i):(c1=typeof globalThis<"u"?globalThis:c1||self,i(c1.ReactDevNotes={},c1.React,c1.ReactDOM))})(this,function(c1,i,N1){"use strict";var q1={exports:{}},O1={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var T0;function y3(){if(T0)return O1;T0=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var l in o)l!=="key"&&(s[l]=o[l])}else s=o;return o=s.ref,{$$typeof:n,type:r,key:a,ref:o!==void 0?o:null,props:s}}return O1.Fragment=e,O1.jsx=t,O1.jsxs=t,O1}var _1={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var A0;function x3(){return A0||(A0=1,process.env.NODE_ENV!=="production"&&function(){function n(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===F?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case g:return"Fragment";case x:return"Profiler";case b:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case z:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case m:return"Portal";case w:return(u.displayName||"Context")+".Provider";case D:return(u._context.displayName||"Context")+".Consumer";case M:var y=u.render;return u=u.displayName,u||(u=y.displayName||y.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case k:return y=u.displayName||null,y!==null?y:n(u.type)||"Memo";case S:y=u._payload,u=u._init;try{return n(u(y))}catch{}}return null}function e(u){return""+u}function t(u){try{e(u);var y=!1}catch{y=!0}if(y){y=console;var E=y.error,_=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return E.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",_),e(u)}}function r(u){if(u===g)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===S)return"<...>";try{var y=n(u);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function o(){var u=O.A;return u===null?null:u.getOwner()}function s(){return Error("react-stack-top-frame")}function a(u){if(q.call(u,"key")){var y=Object.getOwnPropertyDescriptor(u,"key").get;if(y&&y.isReactWarning)return!1}return u.key!==void 0}function l(u,y){function E(){C1||(C1=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}E.isReactWarning=!0,Object.defineProperty(u,"key",{get:E,configurable:!0})}function c(){var u=n(this.type);return b1[u]||(b1[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function C(u,y,E,_,B,Y,U,d1){return E=Y.ref,u={$$typeof:p,type:u,key:y,props:Y,_owner:B},(E!==void 0?E:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:c}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:d1}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function f(u,y,E,_,B,Y,U,d1){var I=y.children;if(I!==void 0)if(_)if(G(I)){for(_=0;_<I.length;_++)h(I[_]);Object.freeze&&Object.freeze(I)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(I);if(q.call(y,"key")){I=n(u);var W=Object.keys(y).filter(function(y1){return y1!=="key"});_=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",n1[I+_]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,_,I,W,I),n1[I+_]=!0)}if(I=null,E!==void 0&&(t(E),I=""+E),a(y)&&(t(y.key),I=""+y.key),"key"in y){E={};for(var j in y)j!=="key"&&(E[j]=y[j])}else E=y;return I&&l(E,typeof u=="function"?u.displayName||u.name||"Unknown":u),C(u,I,Y,B,o(),E,U,d1)}function h(u){typeof u=="object"&&u!==null&&u.$$typeof===p&&u._store&&(u._store.validated=1)}var v=i,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),w=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),O=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,G=Array.isArray,H=console.createTask?console.createTask:function(){return null};v={"react-stack-bottom-frame":function(u){return u()}};var C1,b1={},$=v["react-stack-bottom-frame"].bind(v,s)(),m1=H(r(s)),n1={};_1.Fragment=g,_1.jsx=function(u,y,E,_,B){var Y=1e4>O.recentlyCreatedOwnerStacks++;return f(u,y,E,!1,_,B,Y?Error("react-stack-top-frame"):$,Y?H(r(u)):m1)},_1.jsxs=function(u,y,E,_,B){var Y=1e4>O.recentlyCreatedOwnerStacks++;return f(u,y,E,!0,_,B,Y?Error("react-stack-top-frame"):$,Y?H(r(u)):m1)}}()),_1}var j0;function w3(){return j0||(j0=1,process.env.NODE_ENV==="production"?q1.exports=y3():q1.exports=x3()),q1.exports}var d=w3();function E3(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return i.useMemo(()=>r=>{e.forEach(o=>o(r))},e)}const H1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function x1(n){const e=Object.prototype.toString.call(n);return e==="[object Window]"||e==="[object global]"}function i0(n){return"nodeType"in n}function V(n){var e,t;return n?x1(n)?n:i0(n)&&(e=(t=n.ownerDocument)==null?void 0:t.defaultView)!=null?e:window:window}function a0(n){const{Document:e}=V(n);return n instanceof e}function I1(n){return x1(n)?!1:n instanceof V(n).HTMLElement}function N0(n){return n instanceof V(n).SVGElement}function w1(n){return n?x1(n)?n.document:i0(n)?a0(n)?n:I1(n)||N0(n)?n.ownerDocument:document:document:document}const r1=H1?i.useLayoutEffect:i.useEffect;function l0(n){const e=i.useRef(n);return r1(()=>{e.current=n}),i.useCallback(function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}function S3(){const n=i.useRef(null),e=i.useCallback((r,o)=>{n.current=setInterval(r,o)},[]),t=i.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[e,t]}function z1(n,e){e===void 0&&(e=[n]);const t=i.useRef(n);return r1(()=>{t.current!==n&&(t.current=n)},e),t}function F1(n,e){const t=i.useRef();return i.useMemo(()=>{const r=n(t.current);return t.current=r,r},[...e])}function G1(n){const e=l0(n),t=i.useRef(null),r=i.useCallback(o=>{o!==t.current&&e?.(o,t.current),t.current=o},[]);return[t,r]}function c0(n){const e=i.useRef();return i.useEffect(()=>{e.current=n},[n]),e.current}let u0={};function R1(n,e){return i.useMemo(()=>{if(e)return e;const t=u0[n]==null?0:u0[n]+1;return u0[n]=t,n+"-"+t},[n,e])}function O0(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const l=Object.entries(a);for(const[c,C]of l){const f=s[c];f!=null&&(s[c]=f+n*C)}return s},{...e})}}const E1=O0(1),J1=O0(-1);function D3(n){return"clientX"in n&&"clientY"in n}function C0(n){if(!n)return!1;const{KeyboardEvent:e}=V(n.target);return e&&n instanceof e}function k3(n){if(!n)return!1;const{TouchEvent:e}=V(n.target);return e&&n instanceof e}function d0(n){if(k3(n)){if(n.touches&&n.touches.length){const{clientX:e,clientY:t}=n.touches[0];return{x:e,y:t}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:e,clientY:t}=n.changedTouches[0];return{x:e,y:t}}}return D3(n)?{x:n.clientX,y:n.clientY}:null}const L1=Object.freeze({Translate:{toString(n){if(!n)return;const{x:e,y:t}=n;return"translate3d("+(e?Math.round(e):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:e,scaleY:t}=n;return"scaleX("+e+") scaleY("+t+")"}},Transform:{toString(n){if(n)return[L1.Translate.toString(n),L1.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:e,duration:t,easing:r}=n;return e+" "+t+"ms "+r}}}),_0="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function M3(n){return n.matches(_0)?n:n.querySelector(_0)}const T3={display:"none"};function A3(n){let{id:e,value:t}=n;return i.createElement("div",{id:e,style:T3},t)}function j3(n){let{id:e,announcement:t,ariaLiveType:r="assertive"}=n;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return i.createElement("div",{id:e,style:o,role:"status","aria-live":r,"aria-atomic":!0},t)}function N3(){const[n,e]=i.useState("");return{announce:i.useCallback(r=>{r!=null&&e(r)},[]),announcement:n}}const I0=i.createContext(null);function O3(n){const e=i.useContext(I0);i.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(n)},[n,e])}function _3(){const[n]=i.useState(()=>new Set),e=i.useCallback(r=>(n.add(r),()=>n.delete(r)),[n]);return[i.useCallback(r=>{let{type:o,event:s}=r;n.forEach(a=>{var l;return(l=a[o])==null?void 0:l.call(a,s)})},[n]),e]}const I3={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. `},z3={onDragStart(n){let{active:e}=n;return"Picked up draggable item "+e.id+"."},onDragOver(n){let{active:e,over:t}=n;return t?"Draggable item "+e.id+" was moved over droppable area "+t.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(n){let{active:e,over:t}=n;return t?"Draggable item "+e.id+" was dropped over droppable area "+t.id:"Draggable item "+e.id+" was dropped."},onDragCancel(n){let{active:e}=n;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function F3(n){let{announcements:e=z3,container:t,hiddenTextDescribedById:r,screenReaderInstructions:o=I3}=n;const{announce:s,announcement:a}=N3(),l=R1("DndLiveRegion"),[c,C]=i.useState(!1);if(i.useEffect(()=>{C(!0)},[]),O3(i.useMemo(()=>({onDragStart(h){let{active:v}=h;s(e.onDragStart({active:v}))},onDragMove(h){let{active:v,over:p}=h;e.onDragMove&&s(e.onDragMove({active:v,over:p}))},onDragOver(h){let{active:v,over:p}=h;s(e.onDragOver({active:v,over:p}))},onDragEnd(h){let{active:v,over:p}=h;s(e.onDragEnd({active:v,over:p}))},onDragCancel(h){let{active:v,over:p}=h;s(e.onDragCancel({active:v,over:p}))}}),[s,e])),!c)return null;const f=i.createElement(i.Fragment,null,i.createElement(A3,{id:r,value:o.draggable}),i.createElement(j3,{id:l,announcement:a}));return t?N1.createPortal(f,t):f}var R;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(R||(R={}));function K1(){}function R3(n,e){return i.useMemo(()=>({sensor:n,options:{}}),[n,e])}function L3(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return i.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const t1=Object.freeze({x:0,y:0});function P3(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function $3(n,e){let{data:{value:t}}=n,{data:{value:r}}=e;return t-r}function B3(n,e){let{data:{value:t}}=n,{data:{value:r}}=e;return r-t}function Y3(n,e){if(!n||n.length===0)return null;const[t]=n;return t[e]}function z0(n,e,t){return e===void 0&&(e=n.left),t===void 0&&(t=n.top),{x:e+n.width*.5,y:t+n.height*.5}}const U3=n=>{let{collisionRect:e,droppableRects:t,droppableContainers:r}=n;const o=z0(e,e.left,e.top),s=[];for(const a of r){const{id:l}=a,c=t.get(l);if(c){const C=P3(z0(c),o);s.push({id:l,data:{droppableContainer:a,value:C}})}}return s.sort($3)};function W3(n,e){const t=Math.max(e.top,n.top),r=Math.max(e.left,n.left),o=Math.min(e.left+e.width,n.left+n.width),s=Math.min(e.top+e.height,n.top+n.height),a=o-r,l=s-t;if(r<o&&t<s){const c=e.width*e.height,C=n.width*n.height,f=a*l,h=f/(c+C-f);return Number(h.toFixed(4))}return 0}const X3=n=>{let{collisionRect:e,droppableRects:t,droppableContainers:r}=n;const o=[];for(const s of r){const{id:a}=s,l=t.get(a);if(l){const c=W3(l,e);c>0&&o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(B3)};function V3(n,e,t){return{...n,scaleX:e&&t?e.width/t.width:1,scaleY:e&&t?e.height/t.height:1}}function F0(n,e){return n&&e?{x:n.left-e.left,y:n.top-e.top}:t1}function q3(n){return function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((a,l)=>({...a,top:a.top+n*l.y,bottom:a.bottom+n*l.y,left:a.left+n*l.x,right:a.right+n*l.x}),{...t})}}const H3=q3(1);function G3(n){if(n.startsWith("matrix3d(")){const e=n.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(n.startsWith("matrix(")){const e=n.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function J3(n,e,t){const r=G3(e);if(!r)return n;const{scaleX:o,scaleY:s,x:a,y:l}=r,c=n.left-a-(1-o)*parseFloat(t),C=n.top-l-(1-s)*parseFloat(t.slice(t.indexOf(" ")+1)),f=o?n.width/o:n.width,h=s?n.height/s:n.height;return{width:f,height:h,top:C,right:c+f,bottom:C+h,left:c}}const K3={ignoreTransform:!1};function S1(n,e){e===void 0&&(e=K3);let t=n.getBoundingClientRect();if(e.ignoreTransform){const{transform:C,transformOrigin:f}=V(n).getComputedStyle(n);C&&(t=J3(t,C,f))}const{top:r,left:o,width:s,height:a,bottom:l,right:c}=t;return{top:r,left:o,width:s,height:a,bottom:l,right:c}}function R0(n){return S1(n,{ignoreTransform:!0})}function Z3(n){const e=n.innerWidth,t=n.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}function Q3(n,e){return e===void 0&&(e=V(n).getComputedStyle(n)),e.position==="fixed"}function n2(n,e){e===void 0&&(e=V(n).getComputedStyle(n));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=e[o];return typeof s=="string"?t.test(s):!1})}function f0(n,e){const t=[];function r(o){if(e!=null&&t.length>=e||!o)return t;if(a0(o)&&o.scrollingElement!=null&&!t.includes(o.scrollingElement))return t.push(o.scrollingElement),t;if(!I1(o)||N0(o)||t.includes(o))return t;const s=V(n).getComputedStyle(o);return o!==n&&n2(o,s)&&t.push(o),Q3(o,s)?t:r(o.parentNode)}return n?r(n):t}function L0(n){const[e]=f0(n,1);return e??null}function h0(n){return!H1||!n?null:x1(n)?n:i0(n)?a0(n)||n===w1(n).scrollingElement?window:I1(n)?n:null:null}function P0(n){return x1(n)?n.scrollX:n.scrollLeft}function $0(n){return x1(n)?n.scrollY:n.scrollTop}function p0(n){return{x:P0(n),y:$0(n)}}var L;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(L||(L={}));function B0(n){return!H1||!n?!1:n===document.scrollingElement}function Y0(n){const e={x:0,y:0},t=B0(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},r={x:n.scrollWidth-t.width,y:n.scrollHeight-t.height},o=n.scrollTop<=e.y,s=n.scrollLeft<=e.x,a=n.scrollTop>=r.y,l=n.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:a,isRight:l,maxScroll:r,minScroll:e}}const e2={x:.2,y:.2};function t2(n,e,t,r,o){let{top:s,left:a,right:l,bottom:c}=t;r===void 0&&(r=10),o===void 0&&(o=e2);const{isTop:C,isBottom:f,isLeft:h,isRight:v}=Y0(n),p={x:0,y:0},m={x:0,y:0},g={height:e.height*o.y,width:e.width*o.x};return!C&&s<=e.top+g.height?(p.y=L.Backward,m.y=r*Math.abs((e.top+g.height-s)/g.height)):!f&&c>=e.bottom-g.height&&(p.y=L.Forward,m.y=r*Math.abs((e.bottom-g.height-c)/g.height)),!v&&l>=e.right-g.width?(p.x=L.Forward,m.x=r*Math.abs((e.right-g.width-l)/g.width)):!h&&a<=e.left+g.width&&(p.x=L.Backward,m.x=r*Math.abs((e.left+g.width-a)/g.width)),{direction:p,speed:m}}function r2(n){if(n===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:e,left:t,right:r,bottom:o}=n.getBoundingClientRect();return{top:e,left:t,right:r,bottom:o,width:n.clientWidth,height:n.clientHeight}}function U0(n){return n.reduce((e,t)=>E1(e,p0(t)),t1)}function o2(n){return n.reduce((e,t)=>e+P0(t),0)}function s2(n){return n.reduce((e,t)=>e+$0(t),0)}function i2(n,e){if(e===void 0&&(e=S1),!n)return;const{top:t,left:r,bottom:o,right:s}=e(n);L0(n)&&(o<=0||s<=0||t>=window.innerHeight||r>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const a2=[["x",["left","right"],o2],["y",["top","bottom"],s2]];class g0{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 r=f0(t),o=U0(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,a,l]of a2)for(const c of a)Object.defineProperty(this,c,{get:()=>{const C=l(r),f=o[s]-C;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class P1{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...t)})},this.target=e}add(e,t,r){var o;(o=this.target)==null||o.addEventListener(e,t,r),this.listeners.push([e,t,r])}}function l2(n){const{EventTarget:e}=V(n);return n instanceof e?n:w1(n)}function v0(n,e){const t=Math.abs(n.x),r=Math.abs(n.y);return typeof e=="number"?Math.sqrt(t**2+r**2)>e:"x"in e&&"y"in e?t>e.x&&r>e.y:"x"in e?t>e.x:"y"in e?r>e.y:!1}var Q;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Q||(Q={}));function W0(n){n.preventDefault()}function c2(n){n.stopPropagation()}var N;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(N||(N={}));const X0={start:[N.Space,N.Enter],cancel:[N.Esc],end:[N.Space,N.Enter,N.Tab]},u2=(n,e)=>{let{currentCoordinates:t}=e;switch(n.code){case N.Right:return{...t,x:t.x+25};case N.Left:return{...t,x:t.x-25};case N.Down:return{...t,y:t.y+25};case N.Up:return{...t,y:t.y-25}}};class V0{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 P1(w1(t)),this.windowListeners=new P1(V(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Q.Resize,this.handleCancel),this.windowListeners.add(Q.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Q.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,r=e.node.current;r&&i2(r),t(t1)}handleKeyDown(e){if(C0(e)){const{active:t,context:r,options:o}=this.props,{keyboardCodes:s=X0,coordinateGetter:a=u2,scrollBehavior:l="smooth"}=o,{code:c}=e;if(s.end.includes(c)){this.handleEnd(e);return}if(s.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:C}=r.current,f=C?{x:C.left,y:C.top}:t1;this.referenceCoordinates||(this.referenceCoordinates=f);const h=a(e,{active:t,context:r.current,currentCoordinates:f});if(h){const v=J1(h,f),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const g of m){const b=e.code,{isTop:x,isRight:D,isLeft:w,isBottom:M,maxScroll:T,minScroll:A}=Y0(g),k=r2(g),S={x:Math.min(b===N.Right?k.right-k.width/2:k.right,Math.max(b===N.Right?k.left:k.left+k.width/2,h.x)),y:Math.min(b===N.Down?k.bottom-k.height/2:k.bottom,Math.max(b===N.Down?k.top:k.top+k.height/2,h.y))},z=b===N.Right&&!D||b===N.Left&&!w,F=b===N.Down&&!M||b===N.Up&&!x;if(z&&S.x!==h.x){const O=g.scrollLeft+v.x,q=b===N.Right&&O<=T.x||b===N.Left&&O>=A.x;if(q&&!v.y){g.scrollTo({left:O,behavior:l});return}q?p.x=g.scrollLeft-O:p.x=b===N.Right?g.scrollLeft-T.x:g.scrollLeft-A.x,p.x&&g.scrollBy({left:-p.x,behavior:l});break}else if(F&&S.y!==h.y){const O=g.scrollTop+v.y,q=b===N.Down&&O<=T.y||b===N.Up&&O>=A.y;if(q&&!v.x){g.scrollTo({top:O,behavior:l});return}q?p.y=g.scrollTop-O:p.y=b===N.Down?g.scrollTop-T.y:g.scrollTop-A.y,p.y&&g.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(e,E1(J1(h,this.referenceCoordinates),p))}}}handleMove(e,t){const{onMove:r}=this.props;e.preventDefault(),r(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()}}V0.activators=[{eventName:"onKeyDown",handler:(n,e,t)=>{let{keyboardCodes:r=X0,onActivation:o}=e,{active:s}=t;const{code:a}=n.nativeEvent;if(r.start.includes(a)){const l=s.activatorNode.current;return l&&n.target!==l?!1:(n.preventDefault(),o?.({event:n.nativeEvent}),!0)}return!1}}];function q0(n){return!!(n&&"distance"in n)}function H0(n){return!!(n&&"delay"in n)}class b0{constructor(e,t,r){var o;r===void 0&&(r=l2(e.event.target)),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:s}=e,{target:a}=s;this.props=e,this.events=t,this.document=w1(a),this.documentListeners=new P1(this.document),this.listeners=new P1(r),this.windowListeners=new P1(V(a)),this.initialCoordinates=(o=d0(s))!=null?o:t1,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,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Q.Resize,this.handleCancel),this.windowListeners.add(Q.DragStart,W0),this.windowListeners.add(Q.VisibilityChange,this.handleCancel),this.windowListeners.add(Q.ContextMenu,W0),this.documentListeners.add(Q.Keydown,this.handleKeydown),t){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(H0(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(q0(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:r,onPending:o}=this.props;o(r,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Q.Click,c2,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Q.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:l}}=s;if(!o)return;const c=(t=d0(e))!=null?t:t1,C=J1(o,c);if(!r&&l){if(q0(l)){if(l.tolerance!=null&&v0(C,l.tolerance))return this.handleCancel();if(v0(C,l.distance))return this.handleStart()}if(H0(l)&&v0(C,l.tolerance))return this.handleCancel();this.handlePending(l,C);return}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===N.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const C2={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class m0 extends b0{constructor(e){const{event:t}=e,r=w1(t.target);super(e,C2,r)}}m0.activators=[{eventName:"onPointerDown",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;return!t.isPrimary||t.button!==0?!1:(r?.({event:t}),!0)}}];const d2={move:{name:"mousemove"},end:{name:"mouseup"}};var y0;(function(n){n[n.RightClick=2]="RightClick"})(y0||(y0={}));class f2 extends b0{constructor(e){super(e,d2,w1(e.event.target))}}f2.activators=[{eventName:"onMouseDown",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;return t.button===y0.RightClick?!1:(r?.({event:t}),!0)}}];const x0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class h2 extends b0{constructor(e){super(e,x0)}static setup(){return window.addEventListener(x0.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(x0.move.name,e)};function e(){}}}h2.activators=[{eventName:"onTouchStart",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:r}=e;const{touches:o}=t;return o.length>1?!1:(r?.({event:t}),!0)}}];var $1;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})($1||($1={}));var Z1;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Z1||(Z1={}));function p2(n){let{acceleration:e,activator:t=$1.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:l=Z1.TreeOrder,pointerCoordinates:c,scrollableAncestors:C,scrollableAncestorRects:f,delta:h,threshold:v}=n;const p=v2({delta:h,disabled:!s}),[m,g]=S3(),b=i.useRef({x:0,y:0}),x=i.useRef({x:0,y:0}),D=i.useMemo(()=>{switch(t){case $1.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case $1.DraggableRect:return o}},[t,o,c]),w=i.useRef(null),M=i.useCallback(()=>{const A=w.current;if(!A)return;const k=b.current.x*x.current.x,S=b.current.y*x.current.y;A.scrollBy(k,S)},[]),T=i.useMemo(()=>l===Z1.TreeOrder?[...C].reverse():C,[l,C]);i.useEffect(()=>{if(!s||!C.length||!D){g();return}for(const A of T){if(r?.(A)===!1)continue;const k=C.indexOf(A),S=f[k];if(!S)continue;const{direction:z,speed:F}=t2(A,S,D,e,v);for(const O of["x","y"])p[O][z[O]]||(F[O]=0,z[O]=0);if(F.x>0||F.y>0){g(),w.current=A,m(M,a),b.current=F,x.current=z;return}}b.current={x:0,y:0},x.current={x:0,y:0},g()},[e,M,r,g,s,a,JSON.stringify(D),JSON.stringify(p),m,C,T,f,JSON.stringify(v)])}const g2={x:{[L.Backward]:!1,[L.Forward]:!1},y:{[L.Backward]:!1,[L.Forward]:!1}};function v2(n){let{delta:e,disabled:t}=n;const r=c0(e);return F1(o=>{if(t||!r||!o)return g2;const s={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[L.Backward]:o.x[L.Backward]||s.x===-1,[L.Forward]:o.x[L.Forward]||s.x===1},y:{[L.Backward]:o.y[L.Backward]||s.y===-1,[L.Forward]:o.y[L.Forward]||s.y===1}}},[t,e,r])}function b2(n,e){const t=e!=null?n.get(e):void 0,r=t?t.node.current:null;return F1(o=>{var s;return e==null?null:(s=r??o)!=null?s:null},[r,e])}function m2(n,e){return i.useMemo(()=>n.reduce((t,r)=>{const{sensor:o}=r,s=o.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...t,...s]},[]),[n,e])}var B1;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(B1||(B1={}));var w0;(function(n){n.Optimized="optimized"})(w0||(w0={}));const G0=new Map;function y2(n,e){let{dragging:t,dependencies:r,config:o}=e;const[s,a]=i.useState(null),{frequency:l,measure:c,strategy:C}=o,f=i.useRef(n),h=b(),v=z1(h),p=i.useCallback(function(x){x===void 0&&(x=[]),!v.current&&a(D=>D===null?x:D.concat(x.filter(w=>!D.includes(w))))},[v]),m=i.useRef(null),g=F1(x=>{if(h&&!t)return G0;if(!x||x===G0||f.current!==n||s!=null){const D=new Map;for(let w of n){if(!w)continue;if(s&&s.length>0&&!s.includes(w.id)&&w.rect.current){D.set(w.id,w.rect.current);continue}const M=w.node.current,T=M?new g0(c(M),M):null;w.rect.current=T,T&&D.set(w.id,T)}return D}return x},[n,s,t,h,c]);return i.useEffect(()=>{f.current=n},[n]),i.useEffect(()=>{h||p()},[t,h]),i.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),i.useEffect(()=>{h||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},l))},[l,h,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:s!=null};function b(){switch(C){case B1.Always:return!1;case B1.BeforeDragging:return t;default:return!t}}}function J0(n,e){return F1(t=>n?t||(typeof e=="function"?e(n):n):null,[e,n])}function x2(n,e){return J0(n,e)}function w2(n){let{callback:e,disabled:t}=n;const r=l0(e),o=i.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,t]);return i.useEffect(()=>()=>o?.disconnect(),[o]),o}function Q1(n){let{callback:e,disabled:t}=n;const r=l0(e),o=i.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[t]);return i.useEffect(()=>()=>o?.disconnect(),[o]),o}function E2(n){return new g0(S1(n),n)}function K0(n,e,t){e===void 0&&(e=E2);const[r,o]=i.useState(null);function s(){o(c=>{if(!n)return null;if(n.isConnected===!1){var C;return(C=c??t)!=null?C:null}const f=e(n);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const a=w2({callback(c){if(n)for(const C of c){const{type:f,target:h}=C;if(f==="childList"&&h instanceof HTMLElement&&h.contains(n)){s();break}}}}),l=Q1({callback:s});return r1(()=>{s(),n?(l?.observe(n),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[n]),r}function S2(n){const e=J0(n);return F0(n,e)}const Z0=[];function D2(n){const e=i.useRef(n),t=F1(r=>n?r&&r!==Z0&&n&&e.current&&n.parentNode===e.current.parentNode?r:f0(n):Z0,[n]);return i.useEffect(()=>{e.current=n},[n]),t}function k2(n){const[e,t]=i.useState(null),r=i.useRef(n),o=i.useCallback(s=>{const a=h0(s.target);a&&t(l=>l?(l.set(a,p0(a)),new Map(l)):null)},[]);return i.useEffect(()=>{const s=r.current;if(n!==s){a(s);const l=n.map(c=>{const C=h0(c);return C?(C.addEventListener("scroll",o,{passive:!0}),[C,p0(C)]):null}).filter(c=>c!=null);t(l.length?new Map(l):null),r.current=n}return()=>{a(n),a(s)};function a(l){l.forEach(c=>{const C=h0(c);C?.removeEventListener("scroll",o)})}},[o,n]),i.useMemo(()=>n.length?e?Array.from(e.values()).reduce((s,a)=>E1(s,a),t1):U0(n):t1,[n,e])}function Q0(n,e){e===void 0&&(e=[]);const t=i.useRef(null);return i.useEffect(()=>{t.current=null},e),i.useEffect(()=>{const r=n!==t1;r&&!t.current&&(t.current=n),!r&&t.current&&(t.current=null)},[n]),t.current?J1(n,t.current):t1}function M2(n){i.useEffect(()=>{if(!H1)return;const e=n.map(t=>{let{sensor:r}=t;return r.setup==null?void 0:r.setup()});return()=>{for(const t of e)t?.()}},n.map(e=>{let{sensor:t}=e;return t}))}function T2(n,e){return i.useMemo(()=>n.reduce((t,r)=>{let{eventName:o,handler:s}=r;return t[o]=a=>{s(a,e)},t},{}),[n,e])}function n3(n){return i.useMemo(()=>n?Z3(n):null,[n])}const e3=[];function A2(n,e){e===void 0&&(e=S1);const[t]=n,r=n3(t?V(t):null),[o,s]=i.useState(e3);function a(){s(()=>n.length?n.map(c=>B0(c)?r:new g0(e(c),c)):e3)}const l=Q1({callback:a});return r1(()=>{l?.disconnect(),a(),n.forEach(c=>l?.observe(c))},[n]),o}function j2(n){if(!n)return null;if(n.children.length>1)return n;const e=n.children[0];return I1(e)?e:n}function N2(n){let{measure:e}=n;const[t,r]=i.useState(null),o=i.useCallback(C=>{for(const{target:f}of C)if(I1(f)){r(h=>{const v=e(f);return h?{...h,width:v.width,height:v.height}:v});break}},[e]),s=Q1({callback:o}),a=i.useCallback(C=>{const f=j2(C);s?.disconnect(),f&&s?.observe(f),r(f?e(f):null)},[e,s]),[l,c]=G1(a);return i.useMemo(()=>({nodeRef:l,rect:t,setRef:c}),[t,l,c])}const O2=[{sensor:m0,options:{}},{sensor:V0,options:{}}],_2={current:{}},n0={draggable:{measure:R0},droppable:{measure:R0,strategy:B1.WhileDragging,frequency:w0.Optimized},dragOverlay:{measure:S1}};class Y1 extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,r;return(t=(r=this.get(e))==null?void 0:r.node.current)!=null?t:void 0}}const I2={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Y1,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:K1},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:n0,measureDroppableContainers:K1,windowRect:null,measuringScheduled:!1},z2={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:K1,draggableNodes:new Map,over:null,measureDroppableContainers:K1},e0=i.createContext(z2),t3=i.createContext(I2);function F2(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Y1}}}function R2(n,e){switch(e.type){case R.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case R.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:e.coordinates.x-n.draggable.initialCoordinates.x,y:e.coordinates.y-n.draggable.initialCoordinates.y}}};case R.DragEnd:case R.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case R.RegisterDroppable:{const{element:t}=e,{id:r}=t,o=new Y1(n.droppable.containers);return o.set(r,t),{...n,droppable:{...n.droppable,containers:o}}}case R.SetDroppableDisabled:{const{id:t,key:r,disabled:o}=e,s=n.droppable.containers.get(t);if(!s||r!==s.key)return n;const a=new Y1(n.droppable.containers);return a.set(t,{...s,disabled:o}),{...n,droppable:{...n.droppable,containers:a}}}case R.UnregisterDroppable:{const{id:t,key:r}=e,o=n.droppable.containers.get(t);if(!o||r!==o.key)return n;const s=new Y1(n.droppable.containers);return s.delete(t),{...n,droppable:{...n.droppable,containers:s}}}default:return n}}function L2(n){let{disabled:e}=n;const{active:t,activatorEvent:r,draggableNodes:o}=i.useContext(e0),s=c0(r),a=c0(t?.id);return i.useEffect(()=>{if(!e&&!r&&s&&a!=null){if(!C0(s)||document.activeElement===s.target)return;const l=o.get(a);if(!l)return;const{activatorNode:c,node:C}=l;if(!c.current&&!C.current)return;requestAnimationFrame(()=>{for(const f of[c.current,C.current]){if(!f)continue;const h=M3(f);if(h){h.focus();break}}})}},[r,e,o,a,s]),null}function P2(n,e){let{transform:t,...r}=e;return n!=null&&n.length?n.reduce((o,s)=>s({transform:o,...r}),t):t}function $2(n){return i.useMemo(()=>({draggable:{...n0.draggable,...n?.draggable},droppable:{...n0.droppable,...n?.droppable},dragOverlay:{...n0.dragOverlay,...n?.dragOverlay}}),[n?.draggable,n?.droppable,n?.dragOverlay])}function B2(n){let{activeNode:e,measure:t,initialRect:r,config:o=!0}=n;const s=i.useRef(!1),{x:a,y:l}=typeof o=="boolean"?{x:o,y:o}:o;r1(()=>{if(!a&&!l||!e){s.current=!1;return}if(s.current||!r)return;const C=e?.node.current;if(!C||C.isConnected===!1)return;const f=t(C),h=F0(f,r);if(a||(h.x=0),l||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const v=L0(C);v&&v.scrollBy({top:h.y,left:h.x})}},[e,a,l,r,t])}const r3=i.createContext({...t1,scaleX:1,scaleY:1});var u1;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(u1||(u1={}));const Y2=i.memo(function(e){var t,r,o,s;let{id:a,accessibility:l,autoScroll:c=!0,children:C,sensors:f=O2,collisionDetection:h=X3,measuring:v,modifiers:p,...m}=e;const g=i.useReducer(R2,void 0,F2),[b,x]=g,[D,w]=_3(),[M,T]=i.useState(u1.Uninitialized),A=M===u1.Initialized,{draggable:{active:k,nodes:S,translate:z},droppable:{containers:F}}=b,O=k!=null?S.get(k):null,q=i.useRef({initial:null,translated:null}),G=i.useMemo(()=>{var X;return k!=null?{id:k,data:(X=O?.data)!=null?X:_2,rect:q}:null},[k,O]),H=i.useRef(null),[C1,b1]=i.useState(null),[$,m1]=i.useState(null),n1=z1(m,Object.values(m)),u=R1("DndDescribedBy",a),y=i.useMemo(()=>F.getEnabled(),[F]),E=$2(v),{droppableRects:_,measureDroppableContainers:B,measuringScheduled:Y}=y2(y,{dragging:A,dependencies:[z.x,z.y],config:E.droppable}),U=b2(S,k),d1=i.useMemo(()=>$?d0($):null,[$]),I=A9(),W=x2(U,E.draggable.measure);B2({activeNode:k!=null?S.get(k):null,config:I.layoutShiftCompensation,initialRect:W,measure:E.draggable.measure});const j=K0(U,E.draggable.measure,W),y1=K0(U?U.parentElement:null),o1=i.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:_,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),D1=F.getNodeFor((t=o1.current.over)==null?void 0:t.id),a1=N2({measure:E.dragOverlay.measure}),k1=(r=a1.nodeRef.current)!=null?r:U,M1=A?(o=a1.rect)!=null?o:j:null,d3=!!(a1.nodeRef.current&&a1.rect),f3=S2(d3?null:j),D0=n3(k1?V(k1):null),f1=D2(A?D1??U:null),o0=A2(f1),s0=P2(p,{transform:{x:z.x-f3.x,y:z.y-f3.y,scaleX:1,scaleY:1},activatorEvent:$,active:G,activeNodeRect:j,containerNodeRect:y1,draggingNodeRect:M1,over:o1.current.over,overlayNodeRect:a1.rect,scrollableAncestors:f1,scrollableAncestorRects:o0,windowRect:D0}),h3=d1?E1(d1,z):null,p3=k2(f1),w9=Q0(p3),E9=Q0(p3,[j]),T1=E1(s0,w9),A1=M1?H3(M1,s0):null,U1=G&&A1?h({active:G,collisionRect:A1,droppableRects:_,droppableContainers:y,pointerCoordinates:h3}):null,g3=Y3(U1,"id"),[h1,v3]=i.useState(null),S9=d3?s0:E1(s0,E9),D9=V3(S9,(s=h1?.rect)!=null?s:null,j),k0=i.useRef(null),b3=i.useCallback((X,J)=>{let{sensor:K,options:p1}=J;if(H.current==null)return;const e1=S.get(H.current);if(!e1)return;const Z=X.nativeEvent,s1=new K({active:H.current,activeNode:e1,event:Z,options:p1,context:o1,onAbort(P){if(!S.get(P))return;const{onDragAbort:i1}=n1.current,l1={id:P};i1?.(l1),D({type:"onDragAbort",event:l1})},onPending(P,g1,i1,l1){if(!S.get(P))return;const{onDragPending:X1}=n1.current,v1={id:P,constraint:g1,initialCoordinates:i1,offset:l1};X1?.(v1),D({type:"onDragPending",event:v1})},onStart(P){const g1=H.current;if(g1==null)return;const i1=S.get(g1);if(!i1)return;const{onDragStart:l1}=n1.current,W1={activatorEvent:Z,active:{id:g1,data:i1.data,rect:q}};N1.unstable_batchedUpdates(()=>{l1?.(W1),T(u1.Initializing),x({type:R.DragStart,initialCoordinates:P,active:g1}),D({type:"onDragStart",event:W1}),b1(k0.current),m1(Z)})},onMove(P){x({type:R.DragMove,coordinates:P})},onEnd:j1(R.DragEnd),onCancel:j1(R.DragCancel)});k0.current=s1;function j1(P){return async function(){const{active:i1,collisions:l1,over:W1,scrollAdjustedTranslate:X1}=o1.current;let v1=null;if(i1&&X1){const{cancelDrop:V1}=n1.current;v1={activatorEvent:Z,active:i1,collisions:l1,delta:X1,over:W1},P===R.DragEnd&&typeof V1=="function"&&await Promise.resolve(V1(v1))&&(P=R.DragCancel)}H.current=null,N1.unstable_batchedUpdates(()=>{x({type:P}),T(u1.Uninitialized),v3(null),b1(null),m1(null),k0.current=null;const V1=P===R.DragEnd?"onDragEnd":"onDragCancel";if(v1){const M0=n1.current[V1];M0?.(v1),D({type:V1,event:v1})}})}}},[S]),k9=i.useCallback((X,J)=>(K,p1)=>{const e1=K.nativeEvent,Z=S.get(p1);if(H.current!==null||!Z||e1.dndKit||e1.defaultPrevented)return;const s1={active:Z};X(K,J.options,s1)===!0&&(e1.dndKit={capturedBy:J.sensor},H.current=p1,b3(K,J))},[S,b3]),m3=m2(f,k9);M2(f),r1(()=>{j&&M===u1.Initializing&&T(u1.Initialized)},[j,M]),i.useEffect(()=>{const{onDragMove:X}=n1.current,{active:J,activatorEvent:K,collisions:p1,over:e1}=o1.current;if(!J||!K)return;const Z={active:J,activatorEvent:K,collisions:p1,delta:{x:T1.x,y:T1.y},over:e1};N1.unstable_batchedUpdates(()=>{X?.(Z),D({type:"onDragMove",event:Z})})},[T1.x,T1.y]),i.useEffect(()=>{const{active:X,activatorEvent:J,collisions:K,droppableContainers:p1,scrollAdjustedTranslate:e1}=o1.current;if(!X||H.current==null||!J||!e1)return;const{onDragOver:Z}=n1.current,s1=p1.get(g3),j1=s1&&s1.rect.current?{id:s1.id,rect:s1.rect.current,data:s1.data,disabled:s1.disabled}:null,P={active:X,activatorEvent:J,collisions:K,delta:{x:e1.x,y:e1.y},over:j1};N1.unstable_batchedUpdates(()=>{v3(j1),Z?.(P),D({type:"onDragOver",event:P})})},[g3]),r1(()=>{o1.current={activatorEvent:$,active:G,activeNode:U,collisionRect:A1,collisions:U1,droppableRects:_,draggableNodes:S,draggingNode:k1,draggingNodeRect:M1,droppableContainers:F,over:h1,scrollableAncestors:f1,scrollAdjustedTranslate:T1},q.current={initial:M1,translated:A1}},[G,U,U1,A1,S,k1,M1,_,F,h1,f1,T1]),p2({...I,delta:z,draggingRect:A1,pointerCoordinates:h3,scrollableAncestors:f1,scrollableAncestorRects:o0});const M9=i.useMemo(()=>({active:G,activeNode:U,activeNodeRect:j,activatorEvent:$,collisions:U1,containerNodeRect:y1,dragOverlay:a1,draggableNodes:S,droppableContainers:F,droppableRects:_,over:h1,measureDroppableContainers:B,scrollableAncestors:f1,scrollableAncestorRects:o0,measuringConfiguration:E,measuringScheduled:Y,windowRect:D0}),[G,U,j,$,U1,y1,a1,S,F,_,h1,B,f1,o0,E,Y,D0]),T9=i.useMemo(()=>({activatorEvent:$,activators:m3,active:G,activeNodeRect:j,ariaDescribedById:{draggable:u},dispatch:x,draggableNodes:S,over:h1,measureDroppableContainers:B}),[$,m3,G,j,x,u,S,h1,B]);return i.createElement(I0.Provider,{value:w},i.createElement(e0.Provider,{value:T9},i.createElement(t3.Provider,{value:M9},i.createElement(r3.Provider,{value:D9},C)),i.createElement(L2,{disabled:l?.restoreFocus===!1})),i.createElement(F3,{...l,hiddenTextDescribedById:u}));function A9(){const X=C1?.autoScrollEnabled===!1,J=typeof c=="object"?c.enabled===!1:c===!1,K=A&&!X&&!J;return typeof c=="object"?{...c,enabled:K}:{enabled:K}}}),U2=i.createContext(null),o3="button",W2="Draggable";function X2(n){let{id:e,data:t,disabled:r=!1,attributes:o}=n;const s=R1(W2),{activators:a,activatorEvent:l,active:c,activeNodeRect:C,ariaDescribedById:f,draggableNodes:h,over:v}=i.useContext(e0),{role:p=o3,roleDescription:m="draggable",tabIndex:g=0}=o??{},b=c?.id===e,x=i.useContext(b?r3:U2),[D,w]=G1(),[M,T]=G1(),A=T2(a,e),k=z1(t);r1(()=>(h.set(e,{id:e,key:s,node:D,activatorNode:M,data:k}),()=>{const z=h.get(e);z&&z.key===s&&h.delete(e)}),[h,e]);const S=i.useMemo(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":b&&p===o3?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,p,g,b,m,f.draggable]);return{active:c,activatorEvent:l,activeNodeRect:C,attributes:S,isDragging:b,listeners:r?void 0:A,node:D,over:v,setNodeRef:w,setActivatorNodeRef:T,transform:x}}function V2(){return i.useContext(t3)}const q2="Droppable",H2={timeout:25};function G2(n){let{data:e,disabled:t=!1,id:r,resizeObserverConfig:o}=n;const s=R1(q2),{active:a,dispatch:l,over:c,measureDroppableContainers:C}=i.useContext(e0),f=i.useRef({disabled:t}),h=i.useRef(!1),v=i.useRef(null),p=i.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:b}={...H2,...o},x=z1(g??r),D=i.useCallback(()=>{if(!h.current){h.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{C(Array.isArray(x.current)?x.current:[x.current]),p.current=null},b)},[b]),w=Q1({callback:D,disabled:m||!a}),M=i.useCallback((S,z)=>{w&&(z&&(w.unobserve(z),h.current=!1),S&&w.observe(S))},[w]),[T,A]=G1(M),k=z1(e);return i.useEffect(()=>{!w||!T.current||(w.disconnect(),h.current=!1,w.observe(T.current))},[T,w]),i.useEffect(()=>(l({type:R.RegisterDroppable,element:{id:r,key:s,disabled:t,node:T,rect:v,data:k}}),()=>l({type:R.UnregisterDroppable,key:s,id:r})),[r]),i.useEffect(()=>{t!==f.current.disabled&&(l({type:R.SetDroppableDisabled,id:r,key:s,disabled:t}),f.current.disabled=t)},[r,s,t,l]),{active:a,rect:v,isOver:c?.id===r,node:T,over:c,setNodeRef:A}}function E0(n,e,t){const r=n.slice();return r.splice(t<0?r.length+t:t,0,r.splice(e,1)[0]),r}function J2(n,e){return n.reduce((t,r,o)=>{const s=e.get(r);return s&&(t[o]=s),t},Array(n.length))}function t0(n){return n!==null&&n>=0}function K2(n,e){if(n===e)return!0;if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function Z2(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const s3=n=>{let{rects:e,activeIndex:t,overIndex:r,index:o}=n;const s=E0(e,r,t),a=e[o],l=s[o];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},r0={scaleX:1,scaleY:1},Q2=n=>{var e;let{activeIndex:t,activeNodeRect:r,index:o,rects:s,overIndex:a}=n;const l=(e=s[t])!=null?e:r;if(!l)return null;if(o===t){const C=s[a];return C?{x:0,y:t<a?C.top+C.height-(l.top+l.height):C.top-l.top,...r0}:null}const c=n9(s,o,t);return o>t&&o<=a?{x:0,y:-l.height-c,...r0}:o<t&&o>=a?{x:0,y:l.height+c,...r0}:{x:0,y:0,...r0}};function n9(n,e,t){const r=n[e],o=n[e-1],s=n[e+1];return r?t<e?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const i3="Sortable",a3=i.createContext({activeIndex:-1,containerId:i3,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:s3,disabled:{draggable:!1,droppable:!1}});function e9(n){let{children:e,id:t,items:r,strategy:o=s3,disabled:s=!1}=n;const{active:a,dragOverlay:l,droppableRects:c,over:C,measureDroppableContainers:f}=V2(),h=R1(i3,t),v=l.rect!==null,p=i.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),m=a!=null,g=a?p.indexOf(a.id):-1,b=C?p.indexOf(C.id):-1,x=i.useRef(p),D=!K2(p,x.current),w=b!==-1&&g===-1||D,M=Z2(s);r1(()=>{D&&m&&f(p)},[D,p,m,f]),i.useEffect(()=>{x.current=p},[p]);const T=i.useMemo(()=>({activeIndex:g,containerId:h,disabled:M,disableTransforms:w,items:p,overIndex:b,useDragOverlay:v,sortedRects:J2(p,c),strategy:o}),[g,h,M.draggable,M.droppable,w,p,b,c,v,o]);return i.createElement(a3.Provider,{value:T},e)}const t9=n=>{let{id:e,items:t,activeIndex:r,overIndex:o}=n;return E0(t,r,o).indexOf(e)},r9=n=>{let{containerId:e,isSorting:t,wasDragging:r,index:o,items:s,newIndex:a,previousItems:l,previousContainerId:c,transition:C}=n;return!C||!r||l!==s&&o===a?!1:t?!0:a!==o&&e===c},o9={duration:200,easing:"ease"},l3="transform",s9=L1.Transition.toString({property:l3,duration:0,easing:"linear"}),i9={roleDescription:"sortable"};function a9(n){let{disabled:e,index:t,node:r,rect:o}=n;const[s,a]=i.useState(null),l=i.useRef(t);return r1(()=>{if(!e&&t!==l.current&&r.current){const c=o.current;if(c){const C=S1(r.current,{ignoreTransform:!0}),f={x:c.left-C.left,y:c.top-C.top,scaleX:c.width/C.width,scaleY:c.height/C.height};(f.x||f.y)&&a(f)}}t!==l.current&&(l.current=t)},[e,t,r,o]),i.useEffect(()=>{s&&a(null)},[s]),s}function l9(n){let{animateLayoutChanges:e=r9,attributes:t,disabled:r,data:o,getNewIndex:s=t9,id:a,strategy:l,resizeObserverConfig:c,transition:C=o9}=n;const{items:f,containerId:h,activeIndex:v,disabled:p,disableTransforms:m,sortedRects:g,overIndex:b,useDragOverlay:x,strategy:D}=i.useContext(a3),w=c9(r,p),M=f.indexOf(a),T=i.useMemo(()=>({sortable:{containerId:h,index:M,items:f},...o}),[h,o,M,f]),A=i.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:k,node:S,isOver:z,setNodeRef:F}=G2({id:a,data:T,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...c}}),{active:O,activatorEvent:q,activeNodeRect:G,attributes:H,setNodeRef:C1,listeners:b1,isDragging:$,over:m1,setActivatorNodeRef:n1,transform:u}=X2({id:a,data:T,attributes:{...i9,...t},disabled:w.draggable}),y=E3(F,C1),E=!!O,_=E&&!m&&t0(v)&&t0(b),B=!x&&$,Y=B&&_?u:null,d1=_?Y??(l??D)({rects:g,activeNodeRect:G,activeIndex:v,overIndex:b,index:M}):null,I=t0(v)&&t0(b)?s({id:a,items:f,activeIndex:v,overIndex:b}):M,W=O?.id,j=i.useRef({activeId:W,items:f,newIndex:I,containerId:h}),y1=f!==j.current.items,o1=e({active:O,containerId:h,isDragging:$,isSorting:E,id:a,index:M,items:f,newIndex:j.current.newIndex,previousItems:j.current.items,previousContainerId:j.current.containerId,transition:C,wasDragging:j.current.activeId!=null}),D1=a9({disabled:!o1,index:M,node:S,rect:k});return i.useEffect(()=>{E&&j.current.newIndex!==I&&(j.current.newIndex=I),h!==j.current.containerId&&(j.current.containerId=h),f!==j.current.items&&(j.current.items=f)},[E,I,h,f]),i.useEffect(()=>{if(W===j.current.activeId)return;if(W!=null&&j.current.activeId==null){j.current.activeId=W;return}const k1=setTimeout(()=>{j.current.activeId=W},50);return()=>clearTimeout(k1)},[W]),{active:O,activeIndex:v,attributes:H,data:T,rect:k,index:M,newIndex:I,items:f,isOver:z,isSorting:E,isDragging:$,listeners:b1,node:S,overIndex:b,over:m1,setNodeRef:y,setActivatorNodeRef:n1,setDroppableNodeRef:F,setDraggableNodeRef:C1,transform:D1??d1,transition:a1()};function a1(){if(D1||y1&&j.current.newIndex===M)return s9;if(!(B&&!C0(q)||!C)&&(E||o1))return L1.Transition.toString({...C,property:l3})}}function c9(n,e){var t,r;return typeof n=="boolean"?{draggable:n,droppable:!1}:{dra