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

react-virtual-drag-list

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtual-drag-list - npm Package Compare versions

Comparing version 2.7.1 to 2.7.3

8

dist/virtual-drag-list.min.js
/*!
* react-virtual-drag-list v2.7.1
* react-virtual-drag-list v2.7.3
* open source under the MIT license
* https://github.com/mfuu/react-virtual-drag-list#readme
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).VirtualList=e(t.React)}(this,(function(t){"use strict";function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n=e(t);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var o,i,r=[],s=!0,l=!1;try{for(n=n.call(t);!(s=(o=n.next()).done)&&(r.push(o.value),!e||r.length!==e);s=!0);}catch(t){l=!0,i=t}finally{try{s||null==n.return||n.return()}finally{if(l)throw i}}return r}(t,e)||c(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function h(t,e){n.useEffect(e,Object.values(t))}function d(t){var e=t.itemClass,o=t.dataKey,i=t.sizeKey,s=t.dragging,l=t.children,a=t.onSizeChange,c=n.useRef(null);n.useLayoutEffect((function(){var t;return void 0!==("undefined"==typeof ResizeObserver?"undefined":r(ResizeObserver))&&(t=new ResizeObserver((function(){var t=c.current[i];a(o,t)})),c.current&&(null==t||t.observe(c.current))),function(){t&&(t.disconnect(),t=null)}}),[c]);var u=n.useMemo((function(){var t=l.props.style||{};return o===s?Object.assign(t,{display:"none"}):t}),[s]);return n.cloneElement(l,{"data-key":o,ref:c,style:u,className:[e,l.props.className].join(" ")})}var f=n.memo(d);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function p(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var m={exports:{}};
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).VirtualList=e(t.React)}(this,(function(t){"use strict";function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n=e(t);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function s(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var o,i,r=[],s=!0,l=!1;try{for(n=n.call(t);!(s=(o=n.next()).done)&&(r.push(o.value),!e||r.length!==e);s=!0);}catch(t){l=!0,i=t}finally{try{s||null==n.return||n.return()}finally{if(l)throw i}}return r}(t,e)||c(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function h(t,e){n.useEffect(e,Object.values(t))}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var f={exports:{}};
/*!
* sortable-dnd v0.6.15
* sortable-dnd v0.6.20
* open source under the MIT license
* https://github.com/mfuu/sortable-dnd#readme
*/!function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=i(/Edge/i),l=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),a=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!a&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!a&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,s,l,a,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,l=o.right,a=o.height,c=o.width):(i=0,r=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();i-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(n,"border-left-width")),s=i+o.height,l=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:s,right:l,width:c,height:a}}}function f(t,e,n,o){if(t){if(n&&!e)for(var i=Array.prototype.slice.call(n.children),r=0,s=i.length;r<s;r++)if(i[r]===t||p(t,i[r]))return i[r];n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function p(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function m(t,e){for(var n=t.lastElementChild;n&&(n===ot.ghost||"none"===w(n,"display")||e&&!S(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!S(t,e)||"none"===w(t,"display")||n++;return n}function v(t,e,n,o){for(var i=0,r=0,s=t.children;i<s.length;){if(s[i]!==ot.ghost&&"none"!==w(s[i],"display")&&f(s[i],n,t,!1)&&(o||s[i]!==ot.dragged)){if(r===e)return s[i];r++}i++}return null}function y(t,e){var n=w(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=v(t,0,e),l=v(t,1,e),a=i&&w(i),c=l&&w(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(l).width,f=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var p="left"===a.float?"left":"right";return!l||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||u>=o&&"none"===n[f]||l&&"none"===n[f]&&u+h>o)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function S(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function w(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function x(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function E(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function O(t){var n=t.sortable,o=t.name,i=t.params,r=n.options[o];"function"==typeof r&&r(e({},i))}!function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"];(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1]}();var I,D,T="Sortable"+Date.now();function _(t){this.options=t,this.autoScrollAnimationFrame=null}function z(t){this.options=t,this.stack=[]}function C(t){this.options=t||{},this.selectedElements=[]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),_.prototype={destroy:function(){this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame((function(){e&&n&&o.autoScroll(t,n),o.update(t,e,n)}))},autoScroll:function(t,e){if(t&&void 0!==e.clientX&&void 0!==e.clientY){var n=d(t);if(n){var o=e.clientX,i=e.clientY,r=n.top,s=n.right,l=n.bottom,a=n.left,c=n.height,u=n.width;if(!(i<r||o>s||i>l||o<a)){var h=this.options,f=h.scrollThreshold,p=h.scrollSpeed,m=t.scrollTop,g=t.scrollLeft,v=t.scrollHeight,y=m>0&&i>=r&&i<=r+f,b=g+u<t.scrollWidth&&o<=s&&o>=s-f,S=m+c<v&&i<=l&&i>=l-f;g>0&&o>=a&&o<=a+f&&(t.scrollLeft+=Math.floor(Math.max(-1,(o-a)/f-1)*p.x)),b&&(t.scrollLeft+=Math.ceil(Math.min(1,(o-s)/f+1)*p.x)),y&&(t.scrollTop+=Math.floor(Math.max(-1,(i-r)/f-1)*p.y)),S&&(t.scrollTop+=Math.ceil(Math.min(1,(i-l)/f+1)*p.y))}}}}},z.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),s=Array.prototype.slice.call(t.children),l=[],a=0,c=s.length;a<=c;a++){var u=s[a];if(u&&u!==ot.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(h.top-h.height>r||h.left-h.width>i)break;l.push({el:u,rect:h})}}}this.stack.push(l)}},animate:function(){for(var t=this.stack.pop(),e=0,n=t.length;e<n;e++){var o=t[e],i=o.el,r=o.rect;this.options.animation&&this._excute(i,r)}},_excute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var o=e.left-n.left,i=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d("+o+"px, "+i+"px, 0)"),t.offsetWidth;var r=this.options,s=r.animation,l=r.easing;w(t,"transition","transform "+s+"ms"+(l?" "+l:"")),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){w(t,"transition",""),w(t,"transform",""),t.animated=null}),s)}}},C.prototype={destroy:function(){I=D=null},active:function(){return!!I},setParams:function(t){t.nodes=I||[],t.clones=D||[]},select:function(t){b(t,this.options.selectedClass,!0),this.selectedElements.push(t),this.selectedElements.sort((function(t,e){return x(t,e)}))},deselect:function(t){var e=this.selectedElements.indexOf(t);e>-1&&(b(t,this.options.selectedClass,!1),this.selectedElements.splice(e,1))},getGhostElement:function(){if(!I)return null;var t=document.createElement("div");return this.selectedElements.forEach((function(e,n){var o=e.cloneNode(!0),i=0===n?1:.5;o.style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(i,";z-index: ").concat(n,";"),t.appendChild(o)})),t},toggleSelected:function(t,e){var n=this;e?t.forEach((function(t){return n.selectedElements.push(t)})):this.selectedElements=this.selectedElements.filter((function(e){return t.indexOf(e)<0}))},toggleClass:function(t){if(I)for(var e=0;e<I.length;e++)b(I[e],this.options.chosenClass,t)},toggleVisible:function(t){if(I)if(t){var e=I.indexOf(ot.dragged);this._viewElements(I,e,ot.dragged)}else this._hideElements(I)},onChoose:function(){!this.options.multiple||!this.selectedElements.length||this.selectedElements.indexOf(ot.dragged)<0||(this.selectedElements.sort((function(t,e){return x(t,e)})),I=this.selectedElements,this.toggleClass(!0))},onDrag:function(t){I&&(t.animator.collect(ot.dragged.parentNode),this._hideElements(I),t.animator.animate(),this.toggleClass(!1))},onDrop:function(t,e,n){if(I){var o=ot.dragged,i=ot.clone,r=I.indexOf(o);e[T].animator.collect(i.parentNode),t!==e&&"clone"===n?(w(i,"display","none"),D=I.map((function(t){return t.cloneNode(!0)})),this._viewElements(D,r,i),this._viewElements(I,r,o)):this._viewElements(I,r,i),e[T].animator.animate(),t!==e&&(e[T].multiplayer.toggleSelected(D||I,!0),"clone"!==n&&t[T].multiplayer.toggleSelected(I,!1))}},onSelect:function(t,e,n){var o=this.selectedElements.indexOf(e);b(e,this.options.selectedClass,o<0);var i={from:n.el,event:t,node:e,index:g(e)};o<0?(this.selectedElements.push(e),O({sortable:n,name:"onSelect",params:i})):(this.selectedElements.splice(o,1),O({sortable:n,name:"onDeselect",params:i})),this.selectedElements.sort((function(t,e){return x(t,e)}))},_viewElements:function(t,e,n){for(var o=0;o<t.length;o++)if(w(t[o],"display",""),o<e)n.parentNode.insertBefore(t[o],n);else{var i=o>0?t[o-1]:n;n.parentNode.insertBefore(t[o],i.nextSibling)}},_hideElements:function(t){for(var e=0;e<t.length;e++)t[e]!=ot.dragged&&w(t[e],"display","none")}};var k,M,A,N,R,j,B,P,F,L,K,H,X,Y,W,q,U,G,V,$,J,Q,Z,tt=[];function et(e){var n={},o=e.group;o&&"object"==t(o)||(o={name:o,pull:!0,put:!0,revertDrag:!0}),n.name=o.name,n.pull=o.pull,n.put=o.put,n.revertDrag=o.revertDrag,e.group=n}function nt(t){var e=q||W;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function ot(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[T]=this,this.el=t,this.options=n=e({},n);var o={store:null,group:"",handle:null,sortable:!0,disabled:!1,multiple:!1,lockAxis:"",direction:"",animation:150,easing:"",draggable:null,selectHandle:null,customGhost:null,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",swapOnDrop:!0,fallbackOnBody:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:-1};for(var i in o)!(i in this.options)&&(this.options[i]=o[i]);for(var r in et(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),tt.push(t),this.autoScroller=new _(this.options),this.multiplayer=new C(this.options),this.animator=new z(this.options)}return ot.prototype={constructor:ot,destroy:function(){this._cancelStart(),this._nulling(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag);var t=tt.indexOf(this.el);t>-1&&tt.splice(t,1),this.el[T]=this.animator=this.multiplayer=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.multiplayer.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&et(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selectedElements},_onDrag:function(t){var e=this;if(!N&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],o=(n||t).target;if(!l||!o||"SELECT"!==o.tagName.toUpperCase()){var i=f(o,this.options.draggable,this.el);if(i&&!i.animated){W={origin:t,clientX:(n||t).clientX,clientY:(n||t).clientY},N=i,c($=n?N:document,"mouseup",this._onDrop),c($,"touchend",this._onDrop),c($,"touchcancel",this._onDrop);var a=this.options,u=a.handle,h=a.selectHandle;if("function"==typeof h&&h(t)||"string"==typeof h&&S(o,h))Z=!0;else if(("function"!=typeof u||u(t))&&("string"!=typeof u||S(o,u))){var d=this.options,p=d.delay,m=d.delayOnTouchOnly;!p||m&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Q=setTimeout((function(){return e._onStart(n,t)}),p)),c(document,"selectstart",E),l&&w(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-W.clientX),Math.abs(e.clientY-W.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Q),u(this.el.ownerDocument,"touchmove",this._delayMoveHandler),u(this.el.ownerDocument,"mousemove",this._delayMoveHandler),u(this.el.ownerDocument,"mouseup",this._cancelStart),u(this.el.ownerDocument,"touchend",this._cancelStart),u(this.el.ownerDocument,"touchcancel",this._cancelStart),u(document,"selectstart",E),l&&w(document.body,"user-select","")},_onStart:function(t,e){var n=g(N);k=this.el,M=this.el,F=N,H=n,X=n,Y=n,G={to:this.el,target:N,newIndex:n,relative:0},V=N,A=this.el,B=N.cloneNode(!0),L=N.parentNode,K=this.options.group.pull,ot.clone=B,ot.active=this,ot.dragged=N,b(N,this.options.chosenClass,!0),this.multiplayer.onChoose(),O({sortable:this,name:"onChoose",params:this._getParams(e)}),c($,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){b(B,this.options.chosenClass,!0),this._appendGhost(),this.multiplayer.onDrag(this),O({sortable:this,name:"onDrag",params:this._getParams(W.origin)}),w(N,"display","none"),b(N,this.options.chosenClass,!1),N.parentNode.insertBefore(B,N)},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selectedElements;return t(e.length?e:[N])}return this.multiplayer.getGhostElement()||N},_appendGhost:function(){if(!P){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(P=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(N),i=e({position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:"100000",opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"translate3d(0px, 0px, 0px)",transition:"none",pointerEvents:"none"},this.options.ghostStyle);for(var r in i)w(P,r,i[r]);ot.ghost=P,t.appendChild(P);var s=(W.clientX-o.left)/parseInt(P.style.width)*100,l=(W.clientY-o.top)/parseInt(P.style.height)*100;w(P,"transform-origin",s+"% "+l+"%"),w(P,"will-change","transform")}},_nearestSortable:function(t){E(t);var e=t.touches&&t.touches[0]||t;if(N&&nt(e)){!q&&this._onStarted();var n=this.options.lockAxis,o="x"===n?W.clientX:e.clientX,i="y"===n?W.clientY:e.clientY,r=document.elementFromPoint(o,i),s=o-W.clientX,l=i-W.clientY;q={origin:t,clientX:o,clientY:i},w(P,"transform","translate3d("+s+"px, "+l+"px, 0)");var a,c,u,f=(a=o,c=i,tt.reduce((function(t,e){var n=e[T].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=a>=o.left-n&&a<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!u||u&&o.left>=u.left&&o.right<=u.right&&o.top>=u.top&&o.bottom<=u.bottom)&&(t=e,u=o),t}}),null));if(f&&f[T]._onMove(t,r),!f||f[T].options.autoScroll){var p=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(o||e)return n;o=!0}}}while(n=n.parentNode);return h()}(r,!0);this.autoScroller.update(p,W,q)}else this.autoScroller.destroy()}},_allowPut:function(){if(A===this.el)return!0;if(this.options.group.put){var t=this.options.group,e=t.name,n=t.put,o=A[T].options.group;return n.join&&n.indexOf(o.name)>-1||o.name&&e&&o.name===e}return!1},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(q.origin,N,this):n:y(L,e)},_allowSwap:function(){var t=d(R),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=R[e?"offsetHeight":"offsetWidth"],r=e?q.clientY:q.clientX,s=r>=t[n]&&r<t[o]-i/2?-1:1,l=v(L,0,this.options.draggable),a=m(L),c=d(l),u=d(a);if(R===L||p(L,R))return B===l&&r<c[n]?(j=R,!0):B===a&&r>u[o]&&(j=R.nextSibling,!0);var h=x(B,R);return j=h<0?R.nextSibling:R,U!==R?(J=s,!0):J!==s&&(J=s,s<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(R=f(e,this.options.draggable,this.el),O({sortable:this,name:"onMove",params:this._getParams(t,{target:R})}),this.options.sortable||this.el!==A)return this.el===M||e!==this.el&&m(this.el)?void(R&&!R.animated&&!p(R,B)&&this._allowSwap()&&(R!==B&&j!==B?(this.el!==M?this._onInsert(t):R!==N&&this._onChange(t),U=R):U=R)):(R=U=null,void this._onInsert(t));M!==A&&(R=U=N,J=0,this._onInsert(t))}},_onInsert:function(t){var e=R||B,n="clone"===K&&this.el!==A&&M===A,o="clone"===K&&this.el===A&&M!==A,i=p(R,document),r=R===N&&!i;k=this.el,H=g(B),F=e,L=i?R.parentNode:this.el,M[T].animator.collect(B.parentNode),this.animator.collect(L),n&&(G.target=V,G.newIndex=H,G.relative=V===N?0:x(B,V),w(N,"display",""),A[T].multiplayer.toggleVisible(!0),A[T].options.group.revertDrag||B.parentNode.insertBefore(N,B)),o&&(H=g(N),w(N,"display","none"),this.multiplayer.toggleVisible(!1)),w(B,"display",r?"none":""),R&&i?L.insertBefore(B,J<0?R:R.nextSibling):L.appendChild(B),X=r?Y:g(B),n&&A[T].options.group.revertDrag&&(G.target=N,G.newIndex=Y,G.relative=0,O({sortable:A[T],name:"onChange",params:this._getParams(t,{to:A,target:N,newIndex:Y,revertDrag:!0})})),n||O({sortable:M[T],name:"onRemove",params:this._getParams(t,{newIndex:-1})}),o&&e!==N&&(V=e,O({sortable:this,name:"onChange",params:this._getParams(t,{from:A,backToOrigin:!0})})),o||O({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),M[T].animator.animate(),this.animator.animate(),M=this.el},_onChange:function(t){H=g(B),L=R.parentNode,F=R,this.el===A&&(V=R),this.animator.collect(L),L.insertBefore(B,j),X=g(B),O({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),M=this.el},_onDrop:function(t){this._cancelStart(),u($,"touchmove",this._nearestSortable),u($,"mousemove",this._nearestSortable),u($,"mouseup",this._onDrop),u($,"touchend",this._onDrop),u($,"touchcancel",this._onDrop),b(N,this.options.chosenClass,!1),A&&(M=A,H=Y,F===B&&(F=N),this.multiplayer.toggleClass(!1),O({sortable:this,name:"onUnchoose",params:this._getParams(t)}),q&&this._onEnd(t));var e=this.options,n=e.multiple,o=e.selectHandle;n&&(o&&Z||!o&&!A)&&!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,N,this),P&&P.parentNode&&P.parentNode.removeChild(P),this.autoScroller.destroy(),this.multiplayer.destroy(),this._nulling()},_onEnd:function(t){var n=this._getParams(t);this.multiplayer.onDrop(M,k,K);var o=this.options.swapOnDrop;"clone"===K&&M!==k||!("function"==typeof o?o(n):o)||L.insertBefore(N,B),"clone"!==K||M===k||this.multiplayer.active()?B&&B.parentNode&&B.parentNode.removeChild(B):b(B,this.options.chosenClass,!1),w(N,"display",""),M!==k&&O({sortable:M[T],name:"onDrop",params:e({},n,"clone"===K?G:{newIndex:-1})}),O({sortable:k[T],name:"onDrop",params:e({},n,M===k?{}:{oldIndex:-1})})},_getParams:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=t,o.to=k,o.from=M,o.node=N,o.clone=B,o.target=F,o.oldIndex=H,o.newIndex=X,o.pullMode=K,this.multiplayer.setParams(o),e(o,n),o.relative=F===N?0:x(B,F),o},_nulling:function(){k=M=A=N=R=j=B=P=F=L=K=H=X=Y=W=q=U=G=V=$=J=Q=Z=ot.clone=ot.ghost=ot.active=ot.dragged=null}},ot.utils={on:c,off:u,css:w,index:g,closest:f,getRect:d,toggleClass:b,detectDirection:y},ot.get=function(t){return t[T]},ot.create=function(t,e){return new ot(t,e)},ot}()}(m);var g=p(m.exports),v=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","fallbackOnBody","scrollThreshold","delayOnTouchOnly"];function y(t,e){this.el=t,this.options=e,this.reRendered=!1,this.installSortable()}function b(t,e){var n=null,o=function(){for(var o=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];n||(e<=0?t.apply(this,r):n=setTimeout((function(){n=void 0,t.apply(o,r)}),e))};return o.cancel=function(){n&&(clearTimeout(n),n=null)},o}function S(t,e){var n=b(t,e),o=function(){n.cancel(),n.apply(this,arguments)};return o.cancel=function(){n.cancel()},o}function w(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce((function(t,e){return(t||{})[e]}),t)}y.prototype={constructor:y,destroy:function(){this.sortable&&this.sortable.destroy(),this.sortable=this.reRendered=null},option:function(t,e){this.options[t]=e,v.includes(t)&&this.sortable.option(t,e)},installSortable:function(){var t=this,e=v.reduce((function(e,n){return e[n]=t.options[n],e}),{});this.sortable=new g(this.el,i(i({},e),{},{emptyInsertThreshold:0,swapOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)},onAdd:function(e){return t.onAdd(e)},onRemove:function(e){return t.onRemove(e)}}))},onAdd:function(t){var e=g.get(t.from).option("store"),n=e.item,o=e.key;this.sortable.option("store",{item:n,key:o}),this.dispatchEvent("onAdd",{item:n,key:o,event:t})},onRemove:function(t){var e=g.get(t.from).option("store"),n=e.item,o=e.key;this.dispatchEvent("onRemove",{item:n,key:o,event:t})},onDrag:function(t){var e=t.node.getAttribute("data-key"),n=this.getIndex(e),o=this.options.list[n];this.sortable.option("store",{item:o,key:e,index:n}),this.dispatchEvent("onDrag",{item:o,key:e,index:n,event:t})},onDrop:function(t){var e,n,o=g.get(t.from).option("store"),i=o.item,r=o.key,s=o.index,l=this.options.list,c={key:r,item:i,list:l,event:t,changed:!1,oldList:a(l),oldIndex:s,newIndex:s};(t.from===t.to&&t.node===t.target||this.getDropParams(c,t,i,r,s,l),this.dispatchEvent("onDrop",c),t.from===this.el&&this.reRendered)&&(null===(e=g.dragged)||void 0===e||e.remove());t.from!==t.to&&"clone"===t.pullMode&&(null===(n=g.clone)||void 0===n||n.remove());this.reRendered=!1},getDropParams:function(t,e,n,o,i,r){var s=e.target.getAttribute("data-key"),l=-1,a=i;e.from===e.to?(((a=this.getIndex(o))<(l=this.getIndex(s))&&-1===e.relative||a>l&&1===e.relative)&&(l+=e.relative),l!==a&&(r.splice(a,1),r.splice(l,0,n))):(e.from===this.el&&(a=this.getIndex(o),r.splice(a,1)),e.to===this.el&&(a=-1,l=this.getIndex(s),0===e.relative?l=r.length:1===e.relative&&(l+=e.relative),r.splice(l,0,n))),t.changed=e.from!==e.to||l!==a,t.list=r,t.oldIndex=a,t.newIndex=l},getIndex:function(t){return this.options.uniqueKeys.indexOf(t)},dispatchEvent:function(t,e){var n=this.options[t];n&&n(e)}};var x=["size","keeps","scroller","direction","debounceTime","throttleTime"],E={INIT:"INIT",FIXED:"FIXED",DYNAMIC:"DYNAMIC"},O="FRONT",I="BEHIND",D="STATIONARY",T={vertical:"top",horizontal:"left"},_={vertical:"scrollTop",horizontal:"scrollLeft"},z={vertical:"scrollHeight",horizontal:"scrollWidth"},C={vertical:"offsetHeight",horizontal:"offsetWidth"};function k(t){this.options=t;var e={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(var n in e)!(n in this.options)&&(this.options[n]=e[n]);this.sizes=new Map,this.range={start:0,end:0,front:0,behind:0},this.offset=0,this.calcType=E.INIT,this.calcSize={average:0,total:0,fixed:0},this.scrollDirection="",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,t.keeps-1)}k.prototype={constructor:k,isFront:function(){return this.scrollDirection===O},isBehind:function(){return this.scrollDirection===I},isFixed:function(){return this.calcType===E.FIXED},getSize:function(t){return this.sizes.get(t)||this.getItemSize()},getOffset:function(){return this.scrollEl[_[this.options.direction]]},getScrollSize:function(){return this.scrollEl[z[this.options.direction]]},getClientSize:function(){return this.scrollEl[C[this.options.direction]]},scrollToOffset:function(t){this.scrollEl[_[this.options.direction]]=t},scrollToIndex:function(t){if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else{var e=this.getOffsetByIndex(t),n=this.getScrollStartOffset();this.scrollToOffset(e+n)}},scrollToBottom:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout((function(){var e=t.getClientSize(),n=t.getScrollSize();t.getOffset()+e+1<n&&t.scrollToBottom()}),5)},option:function(t,e){var n=this,o=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach((function(t,o){e.includes(o)||n.sizes.delete(o)})),"scroller"===t&&(o&&g.utils.off(o,"scroll",this.onScroll),this.updateScrollElement(),this.addScrollEventListener())},updateRange:function(t){if(t)this.handleUpdate(t.start,t.end);else{var e=this.range.start;e=Math.max(e,0),this.handleUpdate(e,this.getEndByStart(e))}},onItemResized:function(t,e){this.sizes.set(t,e),this.calcType===E.INIT?(this.calcType=E.FIXED,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=E.DYNAMIC,this.calcSize.fixed=void 0),this.calcType!==E.FIXED&&(this.calcSize.total=a(this.sizes.values()).reduce((function(t,e){return t+e}),0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))},addScrollEventListener:function(){this.options.scroller&&g.utils.on(this.options.scroller,"scroll",this.onScroll)},removeScrollEventListener:function(){this.options.scroller&&g.utils.off(this.options.scroller,"scroll",this.onScroll)},enableScroll:function(t){var e=this.options.scroller,n=t?g.utils.off:g.utils.on,o="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,o,this.preventDefault),n(e,"touchmove",this.preventDefault),n(e,"keydown",this.preventDefaultForKeyDown)},preventDefault:function(t){t.preventDefault()},preventDefaultForKeyDown:function(t){if({37:1,38:1,39:1,40:1}[t.keyCode])return this.preventDefault(t),!1},updateScrollElement:function(){var t=this.options.scroller;t instanceof Document&&9===t.nodeType||t instanceof Window?this.scrollEl=document.scrollingElement||document.documentElement||document.body:this.scrollEl=t},updateOnScrollFunction:function(){var t=this,e=this.options,n=e.debounceTime,o=e.throttleTime;this.onScroll=n?S((function(){return t.handleScroll()}),n):o?b((function(){return t.handleScroll()}),o):function(){return t.handleScroll()}},handleScroll:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.scrollDirection=D:this.scrollDirection=t<this.offset?O:I,this.offset=t;var o=this.isFront()&&t<=0,i=this.isBehind()&&e+t>=n;this.options.onScroll({top:o,bottom:i,offset:t,direction:this.scrollDirection}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()},handleScrollFront:function(){var t=this.getScrollItems();if(!(t>this.range.start)){var e=Math.max(t-this.options.buffer,0);this.checkIfUpdate(e,this.getEndByStart(e))}},handleScrollBehind:function(){var t=this.getScrollItems();t<this.range.start+this.options.buffer||this.checkIfUpdate(t,this.getEndByStart(t))},getScrollItems:function(){var t=this.offset-this.getScrollStartOffset();if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.calcSize.fixed);for(var e=0,n=this.options.uniqueKeys.length,o=0,i=0;e<=n;){if(o=e+Math.floor((n-e)/2),(i=this.getOffsetByIndex(o))===t)return o;i<t?e=o+1:i>t&&(n=o-1)}return e>0?--e:0},checkIfUpdate:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?(t=0,e=this.getLastIndex()):e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t,e)},handleUpdate:function(t,e){this.range.start=t,this.range.end=e,this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.options.onUpdate(i({},this.range))},getFrontOffset:function(){return this.isFixed()?this.calcSize.fixed*this.range.start:this.getOffsetByIndex(this.range.start)},getBehindOffset:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.calcSize.fixed:(e-t)*this.getItemSize()},getOffsetByIndex:function(t){if(!t)return 0;for(var e=0,n=0;n<t;n++){var o=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof o?o:this.getItemSize()}return e},getEndByStart:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())},getLastIndex:function(){var t=this.options,e=t.uniqueKeys,n=t.keeps;return e.length>0?e.length-1:n-1},getItemSize:function(){return this.isFixed()?this.calcSize.fixed:this.options.size||this.calcSize.average},getScrollStartOffset:function(){var t=0,e=this.options,n=e.wrapper,o=e.scroller,i=e.direction;if(o&&n){var r=o instanceof Window?g.utils.getRect(n):g.utils.getRect(n,!0,o);t=this.offset+r[T[i]]}return t}};var M="onDrag",A="onDrop",N="onTop",R="onBottom";function j(t,e){var o=t.dataKey,i=void 0===o?"":o,r=t.dataSource,s=void 0===r?[]:r,c=t.tableMode,u=void 0!==c&&c,d=t.wrapTag,p=void 0===d?"div":d,m=t.rootTag,g=void 0===m?"div":m,b=t.style,E=void 0===b?{}:b,O=t.className,I=void 0===O?"":O,D=t.wrapStyle,T=void 0===D?{}:D,_=t.wrapClass,z=void 0===_?"":_,C=t.itemClass,j=void 0===C?"virutal-dnd-list-item":C,B=t.size,P=void 0===B?void 0:B,F=t.keeps,L=void 0===F?30:F,K=t.scroller,H=void 0===K?void 0:K,X=t.direction,Y=void 0===X?"vertical":X,W=t.debounceTime,q=void 0===W?0:W,U=t.throttleTime,G=void 0===U?0:U,V=t.delay,$=void 0===V?0:V,J=t.group,Q=void 0===J?"":J,Z=t.handle,tt=void 0===Z?"":Z,et=t.lockAxis,nt=void 0===et?void 0:et,ot=t.disabled,it=void 0!==ot&&ot,rt=t.sortable,st=void 0===rt||rt,lt=t.draggable,at=void 0===lt?".virutal-dnd-list-item":lt,ct=t.animation,ut=void 0===ct?150:ct,ht=t.autoScroll,dt=void 0===ht||ht,ft=t.ghostClass,pt=void 0===ft?"":ft,mt=t.ghostStyle,gt=void 0===mt?void 0:mt,vt=t.chosenClass,yt=void 0===vt?"":vt,bt=t.fallbackOnBody,St=void 0!==bt&&bt,wt=t.scrollThreshold,xt=void 0===wt?55:wt,Et=t.delayOnTouchOnly,Ot=void 0!==Et&&Et,It=l(n.useState({start:0,end:L-1,front:0,behind:0}),2),Dt=It[0],Tt=It[1],_t=n.useRef(""),zt=n.useRef([]),Ct=n.useRef(null),kt=n.useRef(null),Mt=function(t){return Ht.current.getSize(t)},At=function(){return Ht.current.getOffset()},Nt=function(){return Ht.current.getClientSize()},Rt=function(){return Ht.current.getScrollSize()},jt=function(t){Ht.current.scrollToOffset(t)},Bt=function(t){Ht.current.scrollToIndex(t)},Pt=function(t){var e=zt.current.indexOf(t);e>-1&&Ht.current.scrollToIndex(e)},Ft=function(){jt(0)},Lt=function(){Ht.current.scrollToBottom()};n.useImperativeHandle(e,(function(){return{getSize:Mt,getOffset:At,getClientSize:Nt,getScrollSize:Rt,scrollToTop:Ft,scrollToKey:Pt,scrollToIndex:Bt,scrollToOffset:jt,scrollToBottom:Lt}})),n.useEffect((function(){return Gt(),te(),function(){var t,e;null===(t=Ht.current)||void 0===t||t.removeScrollEventListener(),null===(e=$t.current)||void 0===e||e.destroy()}}),[]);var Kt=n.useRef(!1),Ht=n.useRef(void 0),Xt={size:P,keeps:L,scroller:H,direction:Y,debounceTime:q,throttleTime:G},Yt=S((function(){var e;Kt.current=!0,null===(e=t[N])||void 0===e||e.call(t)}),50),Wt=S((function(){var e;null===(e=t[R])||void 0===e||e.call(t)}),50),qt=function(t){Kt.current=!1,t.top?Yt():t.bottom&&Wt()},Ut=function(t){Tt((function(e){return _t.current&&t.start!==e.start&&($t.current.reRendered=!0),t}))},Gt=function(){Ht.current=new k(Object.assign(Object.assign({},Xt),{buffer:Math.round(L/3),wrapper:kt.current,scroller:H||Ct.current,uniqueKeys:zt.current,onScroll:qt,onUpdate:Ut}))};h(Xt,(function(){x.forEach((function(e){var n;void 0!==t[e]&&(null===(n=Ht.current)||void 0===n||n.option(e,t[e]))}))}));var Vt=n.useRef(null);n.useEffect((function(){var e;if(Vt.current&&Kt.current&&t.keepOffset){var n=Math.abs(s.length-Vt.current);n>0&&(null===(e=Ht.current)||void 0===e||e.scrollToIndex(n)),Kt.current=!1}Vt.current=s.length}),[s]);var $t=n.useRef(void 0),Jt={delay:$,group:Q,handle:tt,lockAxis:nt,disabled:it,sortable:st,draggable:at,animation:ut,autoScroll:dt,ghostClass:pt,ghostStyle:gt,chosenClass:yt,fallbackOnBody:St,scrollThreshold:xt,delayOnTouchOnly:Ot},Qt=function(e){var n;_t.current=e.key,st||(Ht.current.enableScroll(!1),$t.current.option("autoScroll",!1)),null===(n=t[M])||void 0===n||n.call(t,e)},Zt=function(e){var n;_t.current="",Ht.current.enableScroll(!0),$t.current.option("autoScroll",t.autoScroll);var o=Object.assign(Object.assign({},e),{list:a(e.list)});null===(n=t[A])||void 0===n||n.call(t,o)},te=function(){$t.current=new y(Ct.current,Object.assign(Object.assign({},Jt),{list:s,uniqueKeys:zt.current,onDrag:Qt,onDrop:Zt}))};h(Jt,(function(){v.forEach((function(e){var n;void 0!==t[e]&&(null===(n=$t.current)||void 0===n||n.option(e,t[e]))}))}));var ee=n.useRef([]);n.useEffect((function(){var t;ne(),oe(ee.current,s),ee.current=s,null===(t=$t.current)||void 0===t||t.option("list",s)}),[s]);var ne=function(){var t,e;zt.current=s.map((function(t){return w(t,i)})),null===(t=Ht.current)||void 0===t||t.option("uniqueKeys",zt.current),null===(e=$t.current)||void 0===e||e.option("uniqueKeys",zt.current)},oe=function(t,e){var n,o=Object.assign({},Dt);t.length&&e.length>t.length&&Dt.end===t.length-1&&ie()&&(o.end++,o.start=Math.max(0,o.end-L)),null===(n=Ht.current)||void 0===n||n.updateRange(o)},ie=function(){return At()+Nt()+1>=Rt()},re=n.useMemo((function(){var t=Dt.front,e=Dt.behind,n="vertical"!==Y,o=n?"auto hidden":"hidden auto",i=n?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px");return{containerStyle:Object.assign(Object.assign({},E),{overflow:u||H?"":o}),wrapperStyle:Object.assign(Object.assign({},T),{padding:u?null:i}),itemSizeKey:n?"offsetWidth":"offsetHeight"}}),[Dt,E,T,H,u,Y]),se=re.containerStyle,le=re.wrapperStyle,ae=re.itemSizeKey,ce=l(n.useMemo((function(){return[u?"table":p,u?"tbody":p]}),[g,p,u]),2),ue=ce[0],he=ce[1],de=function(t){var e=t.list,o=t.start,i=t.end,r=t.dataKey,s=t.sizeKey,l=t.dragging,a=t.children,c=t.itemClass,u=t.onSizeChange;return e.slice(o,i+1).map((function(t,e){var i=o+e,h=w(t,r);return n.createElement(f,{key:h,dataKey:h,sizeKey:s,dragging:l,children:a,itemClass:c,onSizeChange:u},"function"==typeof a?a(t,i,h):a)}))}({list:s,start:Dt.start,end:Dt.end,dataKey:i,sizeKey:ae,children:t.children,dragging:_t.current,itemClass:j,onSizeChange:function(t,e){var n,o,i=null===(n=Ht.current)||void 0===n?void 0:n.sizes.size,r=Math.min(L,s.length);null===(o=Ht.current)||void 0===o||o.onItemResized(t,e),i===r-1&&oe(s,s)}}),fe=function(t){var e={padding:0,border:0,margin:0,height:"".concat(t,"px")};return n.createElement("tr",null,n.createElement("td",{style:e}))};return n.createElement(ue,{ref:Ct,style:se,className:I},t.header,n.createElement(he,{ref:kt,style:le,className:z},u&&fe(Dt.front),de,u&&fe(Dt.behind)),t.footer)}return n.forwardRef(j)}));
*/!function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=i(/Edge/i),l=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),a=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!a&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!a&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,s,l,a,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,l=o.right,a=o.height,c=o.width):(i=0,r=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();i-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(n,"border-left-width")),s=i+o.height,l=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:s,right:l,width:c,height:a}}}function f(t,e,n,o){if(t){if(n&&!e)for(var i=Array.prototype.slice.call(n.children),r=0,s=i.length;r<s;r++)if(i[r]===t||p(t,i[r]))return i[r];n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function p(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function v(t,e){for(var n=t.lastElementChild;n&&(n===ot.ghost||"none"===w(n,"display")||e&&!S(n,e));)n=n.previousElementSibling;return n||null}function m(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!S(t,e)||"none"===w(t,"display")||n++;return n}function g(t,e,n,o){for(var i=0,r=0,s=t.children;i<s.length;){if(s[i]!==ot.ghost&&"none"!==w(s[i],"display")&&f(s[i],n,t,!1)&&(o||s[i]!==ot.dragged)){if(r===e)return s[i];r++}i++}return null}function y(t,e){var n=w(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=g(t,0,e),l=g(t,1,e),a=i&&w(i),c=l&&w(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(l).width,f=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var p="left"===a.float?"left":"right";return!l||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||u>=o&&"none"===n[f]||l&&"none"===n[f]&&u+h>o)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function S(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function w(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function x(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function k(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function O(t){var n=t.sortable,o=t.name,i=t.params,r=n.options[o];"function"==typeof r&&r(e({},i))}!function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"];(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1]}();var T,z,I,C="Sortable"+Date.now();function E(t){this.options=t,this.autoScrollAnimationFrame=null}function D(t){this.options=t,this.stack=[]}function _(t){this.options=t||{},this.selects=[]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),E.prototype={stop:function(){this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},start:function(t,e,n){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame((function(){e&&n&&o.autoScroll(t,n),o.start(t,e,n)}))},autoScroll:function(t,e){if(t&&void 0!==e.clientX&&void 0!==e.clientY){var n=d(t);if(n){var o=e.clientX,i=e.clientY,r=n.top,s=n.right,l=n.bottom,a=n.left,c=n.height,u=n.width;if(!(i<r||o>s||i>l||o<a)){var h=this.options,f=h.scrollThreshold,p=h.scrollSpeed,v=t.scrollTop,m=t.scrollLeft,g=t.scrollHeight,y=v>0&&i>=r&&i<=r+f,b=m+u<t.scrollWidth&&o<=s&&o>=s-f,S=v+c<g&&i<=l&&i>=l-f;m>0&&o>=a&&o<=a+f&&(t.scrollLeft+=Math.floor(Math.max(-1,(o-a)/f-1)*p.x)),b&&(t.scrollLeft+=Math.ceil(Math.min(1,(o-s)/f+1)*p.x)),y&&(t.scrollTop+=Math.floor(Math.max(-1,(i-r)/f-1)*p.y)),S&&(t.scrollTop+=Math.ceil(Math.min(1,(i-l)/f+1)*p.y))}}}}},D.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),s=Array.prototype.slice.call(t.children),l=[],a=0,c=s.length;a<=c;a++){var u=s[a];if(u&&u!==ot.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(h.top-h.height>r||h.left-h.width>i)break;l.push({el:u,rect:h})}}}this.stack.push(l)}},animate:function(){var t=this.stack.pop();if(t&&this.options.animation)for(var e=0,n=t.length;e<n;e++){var o=t[e],i=o.el,r=o.rect;this._excute(i,r)}},_excute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var o=e.left-n.left,i=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d(".concat(o,"px, ").concat(i,"px, 0)")),t.offsetWidth;var r=this.options,s=r.animation,l=r.easing;w(t,"transition","transform ".concat(s,"ms ").concat(l?" "+l:"")),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){w(t,"transition",""),w(t,"transform",""),t.animated=null}),s)}}},_.prototype={active:function(){return!!T},nulling:function(){T=z=I=null},params:function(){return{nodes:T||[],clones:z||[]}},select:function(t){b(t,this.options.selectedClass,!0),this.selects.push(t),this.selects.sort((function(t,e){return x(t,e)}))},deselect:function(t){var e=this.selects.indexOf(t);e>-1&&(b(t,this.options.selectedClass,!1),this.selects.splice(e,1))},useSelectHandle:function(t,e){var n=this.options.selectHandle;return!!(I="function"==typeof n&&n(t)||"string"==typeof n&&S(e,n))},getGhostElement:function(){if(!T)return null;var t=document.createElement("div");return b(t,this.options.chosenClass,!0),this.selects.forEach((function(e,n){var o=e.cloneNode(!0),i=0===n?1:.5;o.style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(i,";z-index: ").concat(n,";"),t.appendChild(o)})),t},onChoose:function(){!this.options.multiple||0===this.selects.length||this.selects.indexOf(ot.dragged)<0||(this.selects.sort((function(t,e){return x(t,e)})),T=this.selects,this.toggleChosenClass(!0))},onDrop:function(t,e,n){if(T){var o=ot.dragged,i=ot.clone,r=T.indexOf(o);t!==e&&n?(w(i,"display","none"),this.toggleVisible(!0),z=T.map((function(t){return t.cloneNode(!0)})),this._sortElements(z,r,i)):this._sortElements(T,r,i),t!==e&&(e[C].multiplayer.toggleSelected(z||T,!0),!n&&t[C].multiplayer.toggleSelected(T,!1))}},onSelect:function(t,e,n,o){var i=this.options,r=i.multiple,s=i.selectHandle;if(r&&(s&&I||!s&&!n)){var l=this.selects.indexOf(e);b(e,this.options.selectedClass,l<0);var a={from:o.el,event:t,node:e,index:m(e)};l<0?(this.selects.push(e),O({sortable:o,name:"onSelect",params:a})):(this.selects.splice(l,1),O({sortable:o,name:"onDeselect",params:a})),this.selects.sort((function(t,e){return x(t,e)}))}},toggleChosenClass:function(t){if(T)for(var e=0,n=T.length;e<n;e++)b(T[e],this.options.chosenClass,t)},toggleVisible:function(t){if(T)for(var e=0,n=T.length;e<n;e++)T[e]!=ot.dragged&&w(T[e],"display",t?"":"none")},toggleSelected:function(t,e){var n=this;e?t.forEach((function(t){return n.selects.push(t)})):this.selects=this.selects.filter((function(e){return t.indexOf(e)<0}))},_sortElements:function(t,e,n){for(var o=0,i=t.length;o<i;o++)if(w(t[o],"display",""),o<e)n.parentNode.insertBefore(t[o],n);else{var r=o>0?t[o-1]:n;n.parentNode.insertBefore(t[o],r.nextSibling)}}};var M,R,A,N,B,j,F,H,K,L,P,Y,U,W,X,q,V,G,$,J,Q,Z,tt=[];function et(e){var n={},o=e.group;o&&"object"==t(o)||(o={name:o,pull:!0,put:!0,revertDrag:!0}),n.name=o.name,n.pull=o.pull,n.put=o.put,n.revertDrag=o.revertDrag,e.group=n}function nt(t){var e=q||X;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function ot(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[C]=this,this.el=t,this.options=n=e({},n);var o={store:null,group:"",handle:null,sortable:!0,disabled:!1,multiple:!1,lockAxis:"",direction:"",animation:150,easing:"",draggable:null,selectHandle:null,customGhost:null,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",placeholderClass:"",swapOnDrop:!0,removeCloneOnDrop:!0,fallbackOnBody:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:-1};for(var i in o)!(i in this.options)&&(this.options[i]=o[i]);for(var r in et(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),this.autoScroller=new E(this.options),this.multiplayer=new _(this.options),this.animator=new D(this.options),tt.push(t)}return ot.prototype={constructor:ot,_onDrag:function(t){var e=this;if(!N&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],o=(n||t).target;if(!l||!o||"SELECT"!==o.tagName.toUpperCase()){var i=f(o,this.options.draggable,this.el);if(i&&!i.animated&&(X={event:t,clientX:(n||t).clientX,clientY:(n||t).clientY},N=i,c(J=n?N:document,"mouseup",this._onDrop),c(J,"touchend",this._onDrop),c(J,"touchcancel",this._onDrop),!this.multiplayer.useSelectHandle(t,o))){var a=this.options.handle;if(("function"!=typeof a||a(t))&&("string"!=typeof a||S(o,a))){var u=this.options,h=u.delay,d=u.delayOnTouchOnly;!h||d&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Z=setTimeout((function(){return e._onStart(n,t)}),h)),c(document,"selectstart",k),l&&w(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-X.clientX),Math.abs(e.clientY-X.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Z),u(this.el.ownerDocument,"touchmove",this._delayMoveHandler),u(this.el.ownerDocument,"mousemove",this._delayMoveHandler),u(this.el.ownerDocument,"mouseup",this._cancelStart),u(this.el.ownerDocument,"touchend",this._cancelStart),u(this.el.ownerDocument,"touchcancel",this._cancelStart),u(document,"selectstart",k),l&&w(document.body,"user-select","")},_onStart:function(t,e){k(e);var n=m(N);M=this.el,R=this.el,K=N,Y=n,U=n,W=n,G={to:this.el,target:N,newIndex:n,relative:0},$=N,A=this.el,F=N.cloneNode(!0),L=N.parentNode,P=this.options.group.pull,ot.clone=F,ot.active=this,ot.dragged=N,this.multiplayer.onChoose(),b(N,this.options.chosenClass,!0),O({sortable:this,name:"onChoose",params:this._getParams(e)}),c(J,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){this.animator.collect(L),b(F,this.options.chosenClass,!0),b(F,this.options.placeholderClass,!0),this._appendGhost(),this.multiplayer.toggleVisible(!1),w(N,"display","none"),N.parentNode.insertBefore(F,N),O({sortable:this,name:"onDrag",params:this._getParams(X.event)}),this.animator.animate()},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selects;return t(e.length?e:[N])}return this.multiplayer.getGhostElement()||N},_appendGhost:function(){if(!H){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(H=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(N),i=e({position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:"100000",opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"",transition:"",pointerEvents:"none"},this.options.ghostStyle);for(var r in i)w(H,r,i[r]);ot.ghost=H,t.appendChild(H);var s=(X.clientX-o.left)/parseInt(H.style.width)*100,l=(X.clientY-o.top)/parseInt(H.style.height)*100;w(H,"transform-origin","".concat(s,"% ").concat(l,"%")),w(H,"will-change","transform")}},_nearestSortable:function(t){k(t);var e=t.touches&&t.touches[0]||t;if(N&&nt(e)){!q&&this._onStarted();var n=this.options.lockAxis,o="x"===n?X.clientX:e.clientX,i="y"===n?X.clientY:e.clientY,r=document.elementFromPoint(o,i),s=o-X.clientX,l=i-X.clientY;q={event:t,clientX:o,clientY:i},w(H,"transform","translate3d(".concat(s,"px, ").concat(l,"px, 0)"));var a,c,u,f=(a=o,c=i,tt.reduce((function(t,e){var n=e[C].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=a>=o.left-n&&a<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!u||u&&o.left>=u.left&&o.right<=u.right&&o.top>=u.top&&o.bottom<=u.bottom)&&(t=e,u=o),t}}),null));if(f&&f[C]._onMove(t,r),!f||f[C].options.autoScroll){var p=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(o||e)return n;o=!0}}}while(n=n.parentNode);return h()}(r,!0);this.autoScroller.start(p,X,q)}else this.autoScroller.stop()}},_allowPut:function(){if(A===this.el)return!0;if(!this.options.group.put)return!1;var t=this.options.group,e=t.name,n=t.put,o=A[C].options.group;return n.join&&n.indexOf(o.name)>-1||o.name&&e&&o.name===e},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(q.event,F,this):n:y(L,e)},_allowSwap:function(){var t=d(B),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=B[e?"offsetHeight":"offsetWidth"],r=e?q.clientY:q.clientX,s=r>=t[n]&&r<t[o]-i/2?-1:1,l=g(L,0,this.options.draggable),a=v(L),c=d(l),u=d(a);if(B===L||p(L,B))return F===l&&r<c[n]?(j=B,!0):F===a&&r>u[o]&&(j=B.nextSibling,!0);var h=x(F,B);return j=h<0?B.nextSibling:B,V!==B?(Q=s,!0):Q!==s&&(Q=s,s<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(B=f(e,this.options.draggable,this.el),O({sortable:this,name:"onMove",params:this._getParams(t,{target:B})}),this.options.sortable||this.el!==A)return this.el===R||e!==this.el&&v(this.el)?void(B&&!B.animated&&!p(B,F)&&this._allowSwap()&&(B!==F&&j!==F?(this.el!==R?this._onInsert(t):B!==N&&this._onChange(t),V=B):V=B)):(B=V=null,void this._onInsert(t));R!==A&&(B=V=N,Q=0,this._onInsert(t))}},_onInsert:function(t){var e=B||F,n="clone"===P&&this.el!==A&&R===A,o="clone"===P&&this.el===A&&R!==A,i=p(B,document),r=B===N&&!i,s=R[C],l=A[C];M=this.el,Y=m(F),K=e,L=i?B.parentNode:this.el,s.animator.collect(F.parentNode),this.animator.collect(L),n&&(G.target=$,G.newIndex=Y,G.relative=$===N?0:x(F,$),w(N,"display",""),l.multiplayer.toggleVisible(!0),l.options.group.revertDrag||F.parentNode.insertBefore(N,F)),o&&(Y=m(N),w(N,"display","none"),this.multiplayer.toggleVisible(!1)),w(F,"display",r?"none":""),B&&i?L.insertBefore(F,Q<0?B:B.nextSibling):L.appendChild(F),U=r?W:m(F),n&&l.options.group.revertDrag&&(G.target=N,G.newIndex=W,G.relative=0,O({sortable:l,name:"onChange",params:this._getParams(t,{to:A,target:N,newIndex:W,revertDrag:!0})})),n||O({sortable:s,name:"onRemove",params:this._getParams(t,{newIndex:-1})}),o&&e!==N&&($=e,O({sortable:this,name:"onChange",params:this._getParams(t,{from:A,backToOrigin:!0})})),o||O({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),s.animator.animate(),this.animator.animate(),R=this.el},_onChange:function(t){this.animator.collect(L),Y=m(F),L=B.parentNode,K=B,this.el===A&&($=B),L.insertBefore(F,j),U=m(F),O({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),R=this.el},_onDrop:function(t){this._cancelStart(),u(J,"touchmove",this._nearestSortable),u(J,"mousemove",this._nearestSortable),u(J,"mouseup",this._onDrop),u(J,"touchend",this._onDrop),u(J,"touchcancel",this._onDrop),A&&(R=A,Y=W,K===F&&(K=N),this.animator.collect(L),this.multiplayer.toggleChosenClass(!1),b(N,this.options.chosenClass,!1),O({sortable:this,name:"onUnchoose",params:this._getParams(t)}),q&&this._onEnd(t),!q&&this.animator.animate()),!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,N,A,this),H&&H.parentNode&&H.parentNode.removeChild(H),this.autoScroller.stop(),this.multiplayer.nulling(),this._nulling()},_onEnd:function(t){b(F,this.options.chosenClass,!1),b(F,this.options.placeholderClass,!1);var n="clone"===P;this.multiplayer.onDrop(R,M,n);var o=this._getParams(t),i=this.options,r=i.swapOnDrop,s=i.removeCloneOnDrop;n&&R!==M||!("function"==typeof r?r(o):r)||L.insertBefore(N,F),n&&R!==M&&!this.multiplayer.active()||!("function"==typeof s?s(o):s)||F&&F.parentNode&&F.parentNode.removeChild(F),w(N,"display",""),this.animator.animate(),R!==M&&O({sortable:R[C],name:"onDrop",params:e({},o,n?G:{newIndex:-1})}),O({sortable:M[C],name:"onDrop",params:e({},o,R===M?{}:{oldIndex:-1})})},_getParams:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=t,o.to=M,o.from=R,o.node=N,o.clone=F,o.target=K,o.oldIndex=Y,o.newIndex=U,o.pullMode=P,e(o,this.multiplayer.params(),n),o.relative=K===N?0:x(F,K),o},_nulling:function(){M=R=A=N=B=j=F=H=K=L=P=Y=U=W=X=q=V=G=$=J=Q=Z=ot.clone=ot.ghost=ot.active=ot.dragged=null},destroy:function(){this._cancelStart(),this._nulling(),this.multiplayer.nulling(),this.autoScroller.stop(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag);var t=tt.indexOf(this.el);t>-1&&tt.splice(t,1),this.el[C]=this.animator=this.multiplayer=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.multiplayer.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&et(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selects}},ot.utils={on:c,off:u,css:w,index:m,closest:f,getRect:d,toggleClass:b,detectDirection:y},ot.get=function(t){return t[C]},ot.create=function(t,e){return new ot(t,e)},ot}()}(f);var p=d(f.exports);function v(t,e){var n,o=function(){for(var o=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];n||(e<=0?t.apply(this,r):n=setTimeout((function(){n=null,t.apply(o,r)}),e))};return o.cancel=function(){n&&(clearTimeout(n),n=null)},o}function m(t,e){var n=v(t,e),o=function(){n.cancel(),n.apply(this,arguments)};return o.cancel=function(){n.cancel()},o}function g(t,e){return t==e}function y(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce((function(t,e){return(t||{})[e]}),t)}function b(t){return t instanceof Document&&9===t.nodeType||t instanceof Window}var S=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","scrollSpeed","fallbackOnBody","scrollThreshold","delayOnTouchOnly","placeholderClass"],w=function(){function t(e,n){i(this,t),this.el=e,this.options=n,this.reRendered=!1,this.installSortable()}return s(t,[{key:"destroy",value:function(){this.sortable.destroy(),this.reRendered=!1}},{key:"option",value:function(t,e){this.options[t]=e,S.includes(t)&&this.sortable.option(t,e)}},{key:"installSortable",value:function(){var t=this,e=S.reduce((function(e,n){return e[n]=t.options[n],e}),{});this.sortable=new p(this.el,Object.assign(Object.assign({},e),{emptyInsertThreshold:0,swapOnDrop:function(t){return t.from===t.to},removeCloneOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)},onChoose:function(e){return t.onChoose(e)},onUnchoose:function(e){return t.onUnchoose(e)}}))}},{key:"onChoose",value:function(t){this.dispatchEvent("onChoose",t)}},{key:"onUnchoose",value:function(t){this.dispatchEvent("onUnchoose",t)}},{key:"onDrag",value:function(t){var e=t.node.getAttribute("data-key"),n=this.getIndex(e),o=this.options.list[n],i=this.options.uniqueKeys[n];this.sortable.option("store",{item:o,key:i,index:n}),this.dispatchEvent("onDrag",{item:o,key:i,index:n,event:t})}},{key:"onDrop",value:function(t){var e,n,o,i=null===(e=p.get(t.from))||void 0===e?void 0:e.option("store"),r=i.item,s=i.key,l=i.index,c=this.options.list,u={key:s,item:r,list:c,event:t,changed:!1,oldList:a(c),oldIndex:l,newIndex:l};t.from===t.to&&t.node===t.target||this.handleDropEvent(t,u,l),this.dispatchEvent("onDrop",u),t.from===this.el&&this.reRendered&&(null===(n=p.dragged)||void 0===n||n.remove()),t.from!==t.to&&(null===(o=p.clone)||void 0===o||o.remove()),this.reRendered=!1}},{key:"handleDropEvent",value:function(t,e,n){var o=t.target.getAttribute("data-key"),i=-1,r=n;t.from===t.to?(((r=this.getIndex(e.key))<(i=this.getIndex(o))&&-1===t.relative||r>i&&1===t.relative)&&(i+=t.relative),i!==r&&(e.list.splice(r,1),e.list.splice(i,0,e.item))):(t.from===this.el&&(r=this.getIndex(e.key),e.list.splice(r,1)),t.to===this.el&&(r=-1,i=this.getIndex(o),0===t.relative?i=e.list.length:1===t.relative&&(i+=t.relative),e.list.splice(i,0,e.item))),e.changed=t.from!==t.to||i!==r,e.oldIndex=r,e.newIndex=i}},{key:"getIndex",value:function(t){if(null==t)return-1;for(var e=this.options.uniqueKeys,n=0,o=e.length;n<o;n++)if(g(e[n],t))return n;return-1}},{key:"dispatchEvent",value:function(t,e){var n=this.options[t];n&&n(e)}}]),t}(),x=["size","keeps","scroller","direction","debounceTime","throttleTime"],k=function(){function t(e){i(this,t),this.options=e;var n={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(var o in n)!(o in this.options)&&(this.options[o]=n[o]);this.sizes=new Map,this.sizeType="INIT",this.fixedSize=0,this.averageSize=0,this.range={start:0,end:0,front:0,behind:0,total:0},this.offset=0,this.direction="STATIONARY",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,e.keeps-1)}return s(t,[{key:"isFixed",value:function(){return"FIXED"===this.sizeType}},{key:"isFront",value:function(){return"FRONT"===this.direction}},{key:"isBehind",value:function(){return"BEHIND"===this.direction}},{key:"isHorizontal",value:function(){return"horizontal"===this.options.direction}},{key:"getSize",value:function(t){return this.sizes.get(t)||this.getItemSize()}},{key:"getOffset",value:function(){var t=this.isHorizontal()?"scrollLeft":"scrollTop";return this.scrollEl[t]}},{key:"getScrollSize",value:function(){var t=this.isHorizontal()?"scrollWidth":"scrollHeight";return this.scrollEl[t]}},{key:"getClientSize",value:function(){var t=this.isHorizontal()?"offsetWidth":"offsetHeight";return this.scrollEl[t]}},{key:"scrollToOffset",value:function(t){var e=this.isHorizontal()?"scrollLeft":"scrollTop";this.scrollEl[e]=t}},{key:"scrollToIndex",value:function(t){if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else{var e=this.getOffsetByRange(0,t),n=this.getScrollStartOffset();this.scrollToOffset(e+n)}}},{key:"scrollToBottom",value:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout((function(){var e=t.getClientSize(),n=t.getScrollSize();t.getOffset()+e+1<n&&t.scrollToBottom()}),5)}},{key:"option",value:function(t,e){var n=this,o=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach((function(t,o){e.includes(o)||n.sizes.delete(o)})),"scroller"===t&&(o&&p.utils.off(o,"scroll",this.onScroll),this.updateScrollElement(),this.addScrollEventListener())}},{key:"updateRange",value:function(t){if(t)this.handleUpdate(t.start);else{var e=this.range.start;e=Math.max(e,0),this.handleUpdate(e)}}},{key:"onItemResized",value:function(t,e){e&&this.sizes.get(t)!==e&&(this.sizes.set(t,e),"INIT"===this.sizeType?(this.sizeType="FIXED",this.fixedSize=e):this.isFixed()&&this.fixedSize!==e&&(this.sizeType="DYNAMIC",this.fixedSize=0),this.averageSize||"DYNAMIC"!==this.sizeType||this.sizes.size!==this.options.keeps||this.updateAverageSize())}},{key:"updateAverageSize",value:function(){var t=a(this.sizes.values()).reduce((function(t,e){return t+e}),0);this.averageSize=Math.round(t/this.sizes.size)}},{key:"addScrollEventListener",value:function(){this.options.scroller&&p.utils.on(this.options.scroller,"scroll",this.onScroll)}},{key:"removeScrollEventListener",value:function(){this.options.scroller&&p.utils.off(this.options.scroller,"scroll",this.onScroll)}},{key:"enableScroll",value:function(t){var e=this.options.scroller,n=t?p.utils.off:p.utils.on,o="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,o,this.preventDefault),n(e,"touchmove",this.preventDefault),n(e,"keydown",this.preventDefaultForKeyDown)}},{key:"preventDefault",value:function(t){t.preventDefault()}},{key:"preventDefaultForKeyDown",value:function(t){if({37:1,38:1,39:1,40:1}[t.keyCode])return this.preventDefault(t),!1}},{key:"updateScrollElement",value:function(){var t=this.options.scroller;if(b(t)){var e=document.scrollingElement||document.documentElement||document.body;this.scrollEl=e}else this.scrollEl=t}},{key:"updateOnScrollFunction",value:function(){var t=this,e=this.options,n=e.debounceTime,o=e.throttleTime;this.onScroll=n?m((function(){return t.handleScroll()}),n):o?v((function(){return t.handleScroll()}),o):function(){return t.handleScroll()}}},{key:"handleScroll",value:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.direction="STATIONARY":this.direction=t<this.offset?"FRONT":"BEHIND",this.offset=t;var o=this.isFront()&&t<=0,i=this.isBehind()&&e+t+1>=n;this.options.onScroll({top:o,bottom:i,offset:t,direction:this.direction}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()}},{key:"handleScrollFront",value:function(){var t=this.getScrollItems();if(!(t>=this.range.start)){var e=Math.max(t-this.options.buffer,0);this.checkIfUpdate(e,this.getEndByStart(e))}}},{key:"handleScrollBehind",value:function(){var t=this.getScrollItems();t<this.range.start+this.options.buffer||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"getScrollItems",value:function(){var t=this.offset-this.getScrollStartOffset();if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.fixedSize);for(var e=0,n=this.options.uniqueKeys.length,o=0,i=0;e<=n;){if(o=e+Math.floor((n-e)/2),(i=this.getOffsetByRange(0,o))===t)return o;i<t?e=o+1:i>t&&(n=o-1)}return e>0?--e:0}},{key:"checkIfUpdate",value:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?t=0:e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t)}},{key:"handleUpdate",value:function(t){this.range.start=t,this.range.end=this.getEndByStart(t),this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.range.total=this.getTotalOffset(),this.options.onUpdate(Object.assign({},this.range))}},{key:"getTotalOffset",value:function(){var t=this.range.front+this.range.behind;return t+=this.getOffsetByRange(this.range.start,this.range.end+1)}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.fixedSize*this.range.start:this.getOffsetByRange(0,this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.fixedSize:(e-t)*this.getItemSize()}},{key:"getOffsetByRange",value:function(t,e){if(t>=e)return 0;for(var n=0,o=t;o<e;o++){var i=this.sizes.get(this.options.uniqueKeys[o]);n+="number"==typeof i?i:this.getItemSize()}return n}},{key:"getEndByStart",value:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())}},{key:"getLastIndex",value:function(){var t=this.options,e=t.uniqueKeys,n=t.keeps;return e.length>0?e.length-1:n-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.fixedSize:this.options.size||this.averageSize}},{key:"getScrollStartOffset",value:function(){var t=this.options,e=t.wrapper,n=t.scroller;if(n===e)return 0;var o=0;if(n&&e){var i=this.isHorizontal()?"left":"top",r=b(n)?p.utils.getRect(e):p.utils.getRect(e,!0,n);o=this.offset+r[i]}return o}}]),t}();function O(t){var e=t.itemClass,i=t.dataKey,r=t.sizeKey,s=t.dragging,l=t.chosenKey,a=t.children,c=t.onSizeChange,u=n.useRef(null);n.useLayoutEffect((function(){var t;return void 0!==("undefined"==typeof ResizeObserver?"undefined":o(ResizeObserver))&&(t=new ResizeObserver((function(){var t=u.current[r];c(i,t)})),u.current&&(null==t||t.observe(u.current))),function(){t&&(t.disconnect(),t=null)}}),[u]);var h=n.useMemo((function(){var t=a.props.style||{},e=g(i,l);return s&&e?Object.assign(t,{display:"none"}):t}),[l,s]);return n.cloneElement(a,{"data-key":i,ref:u,style:h,className:[e,a.props.className].join(" ")})}var T=n.memo(O);var z="onDrag",I="onDrop",C="onTop",E="onBottom";function D(t,e){var o=t.dataKey,i=void 0===o?"":o,r=t.dataSource,s=void 0===r?[]:r,c=t.tableMode,u=void 0!==c&&c,d=t.wrapTag,f=void 0===d?"div":d,p=t.rootTag,v=void 0===p?"div":p,b=t.style,O=void 0===b?{}:b,D=t.className,_=void 0===D?"":D,M=t.wrapStyle,R=void 0===M?{}:M,A=t.wrapClass,N=void 0===A?"":A,B=t.itemClass,j=void 0===B?"virutal-dnd-list-item":B,F=t.size,H=void 0===F?void 0:F,K=t.keeps,L=void 0===K?30:K,P=t.scroller,Y=void 0===P?void 0:P,U=t.direction,W=void 0===U?"vertical":U,X=t.debounceTime,q=void 0===X?0:X,V=t.throttleTime,G=void 0===V?0:V,$=t.delay,J=void 0===$?0:$,Q=t.group,Z=void 0===Q?"":Q,tt=t.handle,et=void 0===tt?"":tt,nt=t.lockAxis,ot=void 0===nt?void 0:nt,it=t.disabled,rt=void 0!==it&&it,st=t.sortable,lt=void 0===st||st,at=t.draggable,ct=void 0===at?".virutal-dnd-list-item":at,ut=t.animation,ht=void 0===ut?150:ut,dt=t.autoScroll,ft=void 0===dt||dt,pt=t.scrollSpeed,vt=void 0===pt?{x:10,y:10}:pt,mt=t.ghostClass,gt=void 0===mt?"":mt,yt=t.ghostStyle,bt=void 0===yt?void 0:yt,St=t.chosenClass,wt=void 0===St?"":St,xt=t.placeholderClass,kt=void 0===xt?"":xt,Ot=t.fallbackOnBody,Tt=void 0!==Ot&&Ot,zt=t.scrollThreshold,It=void 0===zt?55:zt,Ct=t.delayOnTouchOnly,Et=void 0!==Ct&&Ct,Dt=l(n.useState({start:0,end:L-1,front:0,behind:0,total:0}),2),_t=Dt[0],Mt=Dt[1],Rt=n.useRef(!1),At=n.useRef(""),Nt=n.useRef([]),Bt=n.useRef(),jt=n.useRef(),Ft=function(t){return Vt.current.getSize(t)},Ht=function(){return Vt.current.getOffset()},Kt=function(){return Vt.current.getClientSize()},Lt=function(){return Vt.current.getScrollSize()},Pt=function(t){var e;null===(e=Vt.current)||void 0===e||e.scrollToOffset(t)},Yt=function(t){var e;null===(e=Vt.current)||void 0===e||e.scrollToIndex(t)},Ut=function(t){var e,n=Nt.current.indexOf(t);n>-1&&(null===(e=Vt.current)||void 0===e||e.scrollToIndex(n))},Wt=function(){Pt(0)},Xt=function(){var t;null===(t=Vt.current)||void 0===t||t.scrollToBottom()};n.useImperativeHandle(e,(function(){return{getSize:Ft,getOffset:Ht,getClientSize:Kt,getScrollSize:Lt,scrollToTop:Wt,scrollToKey:Ut,scrollToIndex:Yt,scrollToOffset:Pt,scrollToBottom:Xt}})),n.useEffect((function(){return te(),ae(),function(){var t,e;null===(t=Vt.current)||void 0===t||t.removeScrollEventListener(),null===(e=ne.current)||void 0===e||e.destroy()}}),[]);var qt=n.useRef(!1),Vt=n.useRef(),Gt={size:H,keeps:L,scroller:Y,direction:W,debounceTime:q,throttleTime:G},$t=m((function(){var e;qt.current=!0,null===(e=t[C])||void 0===e||e.call(t)}),50),Jt=m((function(){var e;null===(e=t[E])||void 0===e||e.call(t)}),50),Qt=function(t){qt.current=!1,t.top?$t():t.bottom&&Jt()},Zt=function(t){Mt((function(e){return ne.current&&Rt.current&&t.start!==e.start&&(ne.current.reRendered=!0),t}))},te=function(){Vt.current=new k(Object.assign(Object.assign({},Gt),{buffer:Math.round(L/3),wrapper:jt.current,scroller:Y||Bt.current,uniqueKeys:Nt.current,onScroll:Qt,onUpdate:Zt}))};h(Gt,(function(){x.forEach((function(e){var n;void 0!==t[e]&&(null===(n=Vt.current)||void 0===n||n.option(e,t[e]))}))}));var ee=n.useRef(0);n.useEffect((function(){var e;if(ee.current&&qt.current&&t.keepOffset){var n=Math.abs(s.length-ee.current);n>0&&(null===(e=Vt.current)||void 0===e||e.scrollToIndex(n)),qt.current=!1}ee.current=s.length}),[s]);var ne=n.useRef(),oe={delay:J,group:Z,handle:et,lockAxis:ot,disabled:rt,sortable:lt,draggable:ct,animation:ht,autoScroll:ft,ghostClass:gt,ghostStyle:bt,chosenClass:wt,scrollSpeed:vt,fallbackOnBody:Tt,scrollThreshold:It,delayOnTouchOnly:Et,placeholderClass:kt},ie=function(t){At.current=t.node.getAttribute("data-key")},re=function(){At.current=""},se=function(e){var n,o,i;Rt.current=!0,lt||(null===(n=Vt.current)||void 0===n||n.enableScroll(!1),null===(o=ne.current)||void 0===o||o.option("autoScroll",!1)),null===(i=t[z])||void 0===i||i.call(t,e)},le=function(e){var n,o,i;Rt.current=!1,null===(n=Vt.current)||void 0===n||n.enableScroll(!0),null===(o=ne.current)||void 0===o||o.option("autoScroll",t.autoScroll);var r=Object.assign(Object.assign({},e),{list:a(e.list)});null===(i=t[I])||void 0===i||i.call(t,r)},ae=function(){ne.current=new w(Bt.current,Object.assign(Object.assign({},oe),{list:s,uniqueKeys:Nt.current,onDrag:se,onDrop:le,onChoose:ie,onUnchoose:re}))};h(oe,(function(){S.forEach((function(e){var n;void 0!==t[e]&&(null===(n=ne.current)||void 0===n||n.option(e,t[e]))}))}));var ce=n.useRef([]);n.useEffect((function(){var t;ue(),he(ce.current,s),ce.current=s,null===(t=ne.current)||void 0===t||t.option("list",s)}),[s]);var ue=function(){var t,e;Nt.current=s.map((function(t){return y(t,i)})),null===(t=Vt.current)||void 0===t||t.option("uniqueKeys",Nt.current),null===(e=ne.current)||void 0===e||e.option("uniqueKeys",Nt.current)},he=function(t,e){var n;if((t.length||e.length)&&t.length!==e.length){var o=Object.assign({},_t);e.length>t.length&&o.end===t.length-1&&de()&&o.start++,null===(n=Vt.current)||void 0===n||n.updateRange(o)}},de=function(){return Ht()+Kt()+1>=Lt()},fe=n.useMemo((function(){var t=_t.front,e=_t.behind,n="vertical"!==W,o=n?"auto hidden":"hidden auto",i=n?"0px ".concat(e,"px 0px ").concat(t,"px"):"".concat(t,"px 0px ").concat(e,"px");return{containerStyle:Object.assign(Object.assign({},O),{overflow:u||Y?"":o}),wrapperStyle:Object.assign(Object.assign({},R),{padding:u?"":i}),itemSizeKey:n?"offsetWidth":"offsetHeight"}}),[_t,O,R,Y,u,W]),pe=fe.containerStyle,ve=fe.wrapperStyle,me=fe.itemSizeKey,ge=l(n.useMemo((function(){return[u?"table":f,u?"tbody":f]}),[v,f,u]),2),ye=ge[0],be=ge[1],Se=function(t){var e=t.list,o=t.start,i=t.end,r=t.dataKey,s=t.sizeKey,l=t.dragging,a=t.chosenKey,c=t.children,u=t.itemClass,h=t.onSizeChange;return e.slice(o,i+1).map((function(t,e){var i=o+e,d=y(t,r);return n.createElement(T,{key:d,dataKey:d,sizeKey:s,dragging:l,chosenKey:a,itemClass:u,onSizeChange:h},"function"==typeof c?c(t,i,d):c)}))}({list:s,start:_t.start,end:_t.end,dataKey:i,sizeKey:me,children:t.children,dragging:Rt.current,chosenKey:At.current,itemClass:j,onSizeChange:function(t,e){var n,o;if(!g(t,At.current)){var i=null===(n=Vt.current)||void 0===n?void 0:n.sizes.size,r=Math.min(L,s.length);null===(o=Vt.current)||void 0===o||o.onItemResized(t,e),i===r-1&&Vt.current.updateRange(Object.assign({},_t))}}}),we=function(t,e){var o={padding:0,border:0,height:"".concat(t,"px")};return n.createElement("tr",{key:e},n.createElement("td",{style:o}))};return n.createElement(ye,{ref:Bt,style:pe,className:_},[t.header,n.createElement(be,{ref:jt,key:"virtual-table-wrap",style:ve,className:N},[u&&we(_t.front,"virtual-table-front")].concat(a(Se),[u&&we(_t.behind,"virtual-table-behind")])),t.footer])}return n.forwardRef(D)}));
{
"name": "react-virtual-drag-list",
"version": "2.7.1",
"version": "2.7.3",
"description": "A virtual scrolling list component that can be sorted by dragging",

@@ -39,3 +39,3 @@ "main": "dist/virtual-drag-list.js",

"dependencies": {
"sortable-dnd": "0.6.6"
"sortable-dnd": "^0.6.20"
},

@@ -53,2 +53,3 @@ "devDependencies": {

"@rollup/plugin-typescript": "^11.1.6",
"@types/react": "^18.3.12",
"prettier": "^2.8.8",

@@ -55,0 +56,0 @@ "react": "^18.0.0",

@@ -92,3 +92,3 @@ # react-virtual-drag-list

| ------------------ | --------- | ------------------------- | --------------------------------------------------------------------------- |
| `draggable` | `String` | '.virutal-dnd-list-item' | Specifies which items inside the element should be draggable |
| `draggable` | `String` | `.virutal-dnd-list-item` | Specifies which items inside the element should be draggable |
| `sortable` | `Boolean` | `true` | Whether the current list can be sorted by dragging |

@@ -100,2 +100,3 @@ | `lockAxis` | `x \| y` | `-` | Axis on which dragging will be locked |

| `autoScroll` | `Boolean` | `true` | Automatic scrolling when moving to the edge of the container |
| `scrollSpeed` | `Object` | `{ x: 10, y: 10 }` | Vertical&Horizontal scrolling speed (px) |
| `scrollThreshold` | `Number` | `55` | Threshold to trigger autoscroll |

@@ -109,6 +110,7 @@ | `delay` | `Number` | `0` | Time in milliseconds to define when the sorting should start |

| `wrapClass` | `String` | `''` | List wrapper element class |
| `itemClass` | `String` | `'virutal-dnd-list-item'` | List item element class |
| `itemClass` | `String` | `virutal-dnd-list-item` | List item element class |
| `ghostStyle` | `Object` | `{}` | The style of the mask element when dragging |
| `ghostClass` | `String` | `''` | The class of the mask element when dragging |
| `chosenClass` | `String` | `''` | The class of the selected element when dragging |
| `chosenClass` | `String` | `''` | Class name for the chosen item |
| `placeholderClass` | `String` | `''` | Class name for the drop placeholder |

@@ -115,0 +117,0 @@ ## Methods

@@ -1,15 +0,8 @@

import React from 'react';
import { SortableEvent } from 'sortable-dnd';
import * as React from 'react';
import { SortableEvent, Group, ScrollSpeed } from 'sortable-dnd';
declare type RenderFunc<T> = (item: T, index: number, key: string | number) => React.ReactNode;
interface Group {
name: string;
put: boolean | string[];
pull: boolean | 'clone';
revertDrag: boolean;
}
interface DragEvent<T> {
item: T;
key: string | number;
item: T;
index: number;
index?: number;
event: SortableEvent;

@@ -22,3 +15,3 @@ }

event: SortableEvent;
changed: false;
changed: boolean;
oldList: T[];

@@ -28,6 +21,8 @@ oldIndex: number;

}
declare type RenderFunc<T> = (item: T, index: number, key: string | number) => React.ReactElement;
interface VirtualProps<T> {
dataKey: string;
dataSource: T[];
children: RenderFunc<T>;
children: React.ReactElement | RenderFunc<T>;
tableMode?: boolean;

@@ -50,2 +45,3 @@ keeps?: number;

autoScroll?: boolean;
scrollSpeed?: ScrollSpeed;
fallbackOnBody?: boolean;

@@ -64,2 +60,3 @@ scrollThreshold?: number;

chosenClass?: string;
placeholderClass?: string;
header?: React.ReactNode;

@@ -72,7 +69,25 @@ footer?: React.ReactNode;

}
interface VirtualComponentRef {
getSize: (key: string | number) => number;
getOffset: () => number;
getClientSize: () => number;
getScrollSize: () => number;
scrollToTop: () => void;
scrollToKey: (key: string | number) => void;
scrollToIndex: (index: number) => void;
scrollToOffset: (offset: number) => void;
scrollToBottom: () => void;
}
declare function VirtualList<T>(props: VirtualProps<T>, ref: React.ForwardedRef<VirtualComponentRef>): React.ReactElement<{
ref: React.MutableRefObject<HTMLElement | undefined>;
style: {
overflow: string;
};
className: string;
}, string | React.JSXElementConstructor<any>>;
declare const _default: <T>(props: VirtualProps<T> & {
ref?: any;
}) => any;
ref?: React.ForwardedRef<VirtualComponentRef> | undefined;
}) => ReturnType<typeof VirtualList>;
export { _default as default };

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

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