UNPKG

ll-package

Version:

7 lines (6 loc) 43.5 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});/**! * Sortable 1.10.2 * @author RubaXa <trash@rubaxa.org> * @author owenm <owen23355@gmail.com> * @license MIT */function Lt(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lt=function(t){return typeof t}:Lt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(o)}function Ke(o,t,e){return t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function j(){return j=Object.assign||function(o){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n])}return o},j.apply(this,arguments)}function at(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach(function(i){Ke(o,i,e[i])})}return o}function ze(o,t){if(o==null)return{};var e={},n=Object.keys(o),i,r;for(r=0;r<n.length;r++)i=n[r],!(t.indexOf(i)>=0)&&(e[i]=o[i]);return e}function je(o,t){if(o==null)return{};var e=ze(o,t),n,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);for(i=0;i<r.length;i++)n=r[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(o,n)&&(e[n]=o[n])}return e}function Ue(o){return qe(o)||Ve(o)||$e()}function qe(o){if(Array.isArray(o)){for(var t=0,e=new Array(o.length);t<o.length;t++)e[t]=o[t];return e}}function Ve(o){if(Symbol.iterator in Object(o)||Object.prototype.toString.call(o)==="[object Arguments]")return Array.from(o)}function $e(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var Ze="1.10.2";function J(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var tt=J(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ft=J(/Edge/i),ye=J(/firefox/i),fe=J(/safari/i)&&!J(/chrome/i)&&!J(/android/i),Me=J(/iP(ad|od|hone)/i),Qe=J(/chrome/i)&&J(/android/i),Pe={capture:!1,passive:!1};function E(o,t,e){o.addEventListener(t,e,!tt&&Pe)}function w(o,t,e){o.removeEventListener(t,e,!tt&&Pe)}function Ut(o,t){if(t){if(t[0]===">"&&(t=t.substring(1)),o)try{if(o.matches)return o.matches(t);if(o.msMatchesSelector)return o.msMatchesSelector(t);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(t)}catch{return!1}return!1}}function Je(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function $(o,t,e,n){if(o){e=e||document;do{if(t!=null&&(t[0]===">"?o.parentNode===e&&Ut(o,t):Ut(o,t))||n&&o===e)return o;if(o===e)break}while(o=Je(o))}return null}var Se=/\s+/g;function T(o,t,e){if(o&&t)if(o.classList)o.classList[e?"add":"remove"](t);else{var n=(" "+o.className+" ").replace(Se," ").replace(" "+t+" "," ");o.className=(n+(e?" "+t:"")).replace(Se," ")}}function h(o,t,e){var n=o&&o.style;if(n){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(e=o.currentStyle),t===void 0?e:e[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=e+(typeof e=="string"?"":"px")}}function ht(o,t){var e="";if(typeof o=="string")e=o;else do{var n=h(o,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(o=o.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(e)}function xe(o,t,e){if(o){var n=o.getElementsByTagName(t),i=0,r=n.length;if(e)for(;i<r;i++)e(n[i],i);return n}return[]}function Z(){var o=document.scrollingElement;return o||document.documentElement}function I(o,t,e,n,i){if(!(!o.getBoundingClientRect&&o!==window)){var r,a,l,s,u,d,f;if(o!==window&&o!==Z()?(r=o.getBoundingClientRect(),a=r.top,l=r.left,s=r.bottom,u=r.right,d=r.height,f=r.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(t||e)&&o!==window&&(i=i||o.parentNode,!tt))do if(i&&i.getBoundingClientRect&&(h(i,"transform")!=="none"||e&&h(i,"position")!=="static")){var p=i.getBoundingClientRect();a-=p.top+parseInt(h(i,"border-top-width")),l-=p.left+parseInt(h(i,"border-left-width")),s=a+r.height,u=l+r.width;break}while(i=i.parentNode);if(n&&o!==window){var y=ht(i||o),b=y&&y.a,S=y&&y.d;y&&(a/=S,l/=b,f/=b,d/=S,s=a+d,u=l+f)}return{top:a,left:l,bottom:s,right:u,width:f,height:d}}}function De(o,t,e){for(var n=rt(o,!0),i=I(o)[t];n;){var r=I(n)[e],a=void 0;if(e==="top"||e==="left"?a=i>=r:a=i<=r,!a)return n;if(n===Z())break;n=rt(n,!1)}return!1}function qt(o,t,e){for(var n=0,i=0,r=o.children;i<r.length;){if(r[i].style.display!=="none"&&r[i]!==g.ghost&&r[i]!==g.dragged&&$(r[i],e.draggable,o,!1)){if(n===t)return r[i];n++}i++}return null}function me(o,t){for(var e=o.lastElementChild;e&&(e===g.ghost||h(e,"display")==="none"||t&&!Ut(e,t));)e=e.previousElementSibling;return e||null}function A(o,t){var e=0;if(!o||!o.parentNode)return-1;for(;o=o.previousElementSibling;)o.nodeName.toUpperCase()!=="TEMPLATE"&&o!==g.clone&&(!t||Ut(o,t))&&e++;return e}function _e(o){var t=0,e=0,n=Z();if(o)do{var i=ht(o),r=i.a,a=i.d;t+=o.scrollLeft*r,e+=o.scrollTop*a}while(o!==n&&(o=o.parentNode));return[t,e]}function tn(o,t){for(var e in o)if(o.hasOwnProperty(e)){for(var n in t)if(t.hasOwnProperty(n)&&t[n]===o[e][n])return Number(e)}return-1}function rt(o,t){if(!o||!o.getBoundingClientRect)return Z();var e=o,n=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var i=h(e);if(e.clientWidth<e.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return Z();if(n||t)return e;n=!0}}while(e=e.parentNode);return Z()}function en(o,t){if(o&&t)for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o}function te(o,t){return Math.round(o.top)===Math.round(t.top)&&Math.round(o.left)===Math.round(t.left)&&Math.round(o.height)===Math.round(t.height)&&Math.round(o.width)===Math.round(t.width)}var Nt;function Fe(o,t){return function(){if(!Nt){var e=arguments,n=this;e.length===1?o.call(n,e[0]):o.apply(n,e),Nt=setTimeout(function(){Nt=void 0},t)}}}function nn(){clearTimeout(Nt),Nt=void 0}function Re(o,t,e){o.scrollLeft+=t,o.scrollTop+=e}function ve(o){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(o).cloneNode(!0):e?e(o).clone(!0)[0]:o.cloneNode(!0)}function Ce(o,t){h(o,"position","absolute"),h(o,"top",t.top),h(o,"left",t.left),h(o,"width",t.width),h(o,"height",t.height)}function ee(o){h(o,"position",""),h(o,"top",""),h(o,"left",""),h(o,"width",""),h(o,"height","")}var k="Sortable"+new Date().getTime();function on(){var o=[],t;return{captureAnimationState:function(){if(o=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(i){if(!(h(i,"display")==="none"||i===g.ghost)){o.push({target:i,rect:I(i)});var r=at({},o[o.length-1].rect);if(i.thisAnimationDuration){var a=ht(i,!0);a&&(r.top-=a.f,r.left-=a.e)}i.fromRect=r}})}},addAnimationState:function(n){o.push(n)},removeAnimationState:function(n){o.splice(tn(o,{target:n}),1)},animateAll:function(n){var i=this;if(!this.options.animation){clearTimeout(t),typeof n=="function"&&n();return}var r=!1,a=0;o.forEach(function(l){var s=0,u=l.target,d=u.fromRect,f=I(u),p=u.prevFromRect,y=u.prevToRect,b=l.rect,S=ht(u,!0);S&&(f.top-=S.f,f.left-=S.e),u.toRect=f,u.thisAnimationDuration&&te(p,f)&&!te(d,f)&&(b.top-f.top)/(b.left-f.left)===(d.top-f.top)/(d.left-f.left)&&(s=an(b,p,y,i.options)),te(f,d)||(u.prevFromRect=d,u.prevToRect=f,s||(s=i.options.animation),i.animate(u,b,f,s)),s&&(r=!0,a=Math.max(a,s),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},s),u.thisAnimationDuration=s)}),clearTimeout(t),r?t=setTimeout(function(){typeof n=="function"&&n()},a):typeof n=="function"&&n(),o=[]},animate:function(n,i,r,a){if(a){h(n,"transition",""),h(n,"transform","");var l=ht(this.el),s=l&&l.a,u=l&&l.d,d=(i.left-r.left)/(s||1),f=(i.top-r.top)/(u||1);n.animatingX=!!d,n.animatingY=!!f,h(n,"transform","translate3d("+d+"px,"+f+"px,0)"),rn(n),h(n,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),h(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){h(n,"transition",""),h(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},a)}}}}function rn(o){return o.offsetWidth}function an(o,t,e,n){return Math.sqrt(Math.pow(t.top-o.top,2)+Math.pow(t.left-o.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*n.animation}var St=[],ne={initializeByDefault:!0},Rt={mount:function(t){for(var e in ne)ne.hasOwnProperty(e)&&!(e in t)&&(t[e]=ne[e]);St.push(t)},pluginEvent:function(t,e,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var r=t+"Global";St.forEach(function(a){e[a.pluginName]&&(e[a.pluginName][r]&&e[a.pluginName][r](at({sortable:e},n)),e.options[a.pluginName]&&e[a.pluginName][t]&&e[a.pluginName][t](at({sortable:e},n)))})},initializePlugins:function(t,e,n,i){St.forEach(function(l){var s=l.pluginName;if(!(!t.options[s]&&!l.initializeByDefault)){var u=new l(t,e,t.options);u.sortable=t,u.options=t.options,t[s]=u,j(n,u.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);typeof a<"u"&&(t.options[r]=a)}},getEventProperties:function(t,e){var n={};return St.forEach(function(i){typeof i.eventProperties=="function"&&j(n,i.eventProperties.call(e[i.pluginName],t))}),n},modifyOption:function(t,e,n){var i;return St.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[e]=="function"&&(i=r.optionListeners[e].call(t[r.pluginName],n))}),i}};function Tt(o){var t=o.sortable,e=o.rootEl,n=o.name,i=o.targetEl,r=o.cloneEl,a=o.toEl,l=o.fromEl,s=o.oldIndex,u=o.newIndex,d=o.oldDraggableIndex,f=o.newDraggableIndex,p=o.originalEvent,y=o.putSortable,b=o.extraEventProperties;if(t=t||e&&e[k],!!t){var S,N=t.options,U="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!tt&&!Ft?S=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(S=document.createEvent("Event"),S.initEvent(n,!0,!0)),S.to=a||e,S.from=l||e,S.item=i||e,S.clone=r,S.oldIndex=s,S.newIndex=u,S.oldDraggableIndex=d,S.newDraggableIndex=f,S.originalEvent=p,S.pullMode=y?y.lastPutMode:void 0;var x=at({},b,Rt.getEventProperties(n,t));for(var B in x)S[B]=x[B];e&&e.dispatchEvent(S),N[U]&&N[U].call(t,S)}}var Y=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,r=je(n,["evt"]);Rt.pluginEvent.bind(g)(t,e,at({dragEl:c,parentEl:M,ghostEl:v,rootEl:C,nextEl:dt,lastDownEl:Wt,cloneEl:O,cloneHidden:it,dragStarted:Ot,putSortable:F,activeSortable:g.active,originalEvent:i,oldIndex:wt,oldDraggableIndex:Mt,newIndex:K,newDraggableIndex:ot,hideGhostForTarget:Be,unhideGhostForTarget:He,cloneNowHidden:function(){it=!0},cloneNowShown:function(){it=!1},dispatchSortableEvent:function(l){X({sortable:e,name:l,originalEvent:i})}},r))};function X(o){Tt(at({putSortable:F,cloneEl:O,targetEl:c,rootEl:C,oldIndex:wt,oldDraggableIndex:Mt,newIndex:K,newDraggableIndex:ot},o))}var c,M,v,C,dt,Wt,O,it,wt,K,Mt,ot,Xt,F,bt=!1,Vt=!1,$t=[],ct,q,oe,ie,Te,Oe,Ot,mt,Pt,xt=!1,Yt=!1,Kt,R,re=[],de=!1,Zt=[],Jt=typeof document<"u",Bt=Me,Ae=Ft||tt?"cssFloat":"float",ln=Jt&&!Qe&&!Me&&"draggable"in document.createElement("div"),ke=function(){if(Jt){if(tt)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),Xe=function(t,e){var n=h(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=qt(t,0,e),a=qt(t,1,e),l=r&&h(r),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+I(r).width,d=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+I(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===f)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=i&&n[Ae]==="none"||a&&n[Ae]==="none"&&u+d>i)?"vertical":"horizontal"},sn=function(t,e,n){var i=n?t.left:t.top,r=n?t.right:t.bottom,a=n?t.width:t.height,l=n?e.left:e.top,s=n?e.right:e.bottom,u=n?e.width:e.height;return i===l||r===s||i+a/2===l+u/2},un=function(t,e){var n;return $t.some(function(i){if(!me(i)){var r=I(i),a=i[k].options.emptyInsertThreshold,l=t>=r.left-a&&t<=r.right+a,s=e>=r.top-a&&e<=r.bottom+a;if(a&&l&&s)return n=i}}),n},Ye=function(t){function e(r,a){return function(l,s,u,d){var f=l.options.group.name&&s.options.group.name&&l.options.group.name===s.options.group.name;if(r==null&&(a||f))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return e(r(l,s,u,d),a)(l,s,u,d);var p=(a?l:s).options.group.name;return r===!0||typeof r=="string"&&r===p||r.join&&r.indexOf(p)>-1}}var n={},i=t.group;(!i||Lt(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=e(i.pull,!0),n.checkPut=e(i.put),n.revertClone=i.revertClone,t.group=n},Be=function(){!ke&&v&&h(v,"display","none")},He=function(){!ke&&v&&h(v,"display","")};Jt&&document.addEventListener("click",function(o){if(Vt)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),Vt=!1,!1},!0);var ft=function(t){if(c){t=t.touches?t.touches[0]:t;var e=un(t.clientX,t.clientY);if(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[k]._onDragOver(n)}}},cn=function(t){c&&c.parentNode[k]._isOutsideThisEl(t.target)};function g(o,t){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=t=j({},t),o[k]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xe(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:g.supportPointer!==!1&&"PointerEvent"in window,emptyInsertThreshold:5};Rt.initializePlugins(this,o,e);for(var n in e)!(n in t)&&(t[n]=e[n]);Ye(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:ln,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(o,"pointerdown",this._onTapStart):(E(o,"mousedown",this._onTapStart),E(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(o,"dragover",this),E(o,"dragenter",this)),$t.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),j(this,on())}g.prototype={constructor:g,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(mt=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,c):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,r=i.preventOnFilter,a=t.type,l=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,s=(l||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,d=i.filter;if(vn(n),!c&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||i.disabled)&&!u.isContentEditable&&(s=$(s,i.draggable,n,!1),!(s&&s.animated)&&Wt!==s)){if(wt=A(s),Mt=A(s,i.draggable),typeof d=="function"){if(d.call(this,t,s,this)){X({sortable:e,rootEl:u,name:"filter",targetEl:s,toEl:n,fromEl:n}),Y("filter",e,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(f){if(f=$(u,f.trim(),n,!1),f)return X({sortable:e,rootEl:f,name:"filter",targetEl:s,fromEl:n,toEl:n}),Y("filter",e,{evt:t}),!0}),d)){r&&t.cancelable&&t.preventDefault();return}i.handle&&!$(u,i.handle,n,!1)||this._prepareDragStart(t,l,s)}}},_prepareDragStart:function(t,e,n){var i=this,r=i.el,a=i.options,l=r.ownerDocument,s;if(n&&!c&&n.parentNode===r){var u=I(n);if(C=r,c=n,M=c.parentNode,dt=c.nextSibling,Wt=n,Xt=a.group,g.dragged=c,ct={target:c,clientX:(e||t).clientX,clientY:(e||t).clientY},Te=ct.clientX-u.left,Oe=ct.clientY-u.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,c.style["will-change"]="all",s=function(){if(Y("delayEnded",i,{evt:t}),g.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!ye&&i.nativeDraggable&&(c.draggable=!0),i._triggerDragStart(t,e),X({sortable:i,name:"choose",originalEvent:t}),T(c,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){xe(c,d.trim(),le)}),E(l,"dragover",ft),E(l,"mousemove",ft),E(l,"touchmove",ft),E(l,"mouseup",i._onDrop),E(l,"touchend",i._onDrop),E(l,"touchcancel",i._onDrop),ye&&this.nativeDraggable&&(this.options.touchStartThreshold=4,c.draggable=!0),Y("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Ft||tt))){if(g.eventCanceled){this._onDrop();return}E(l,"mouseup",i._disableDelayedDrag),E(l,"touchend",i._disableDelayedDrag),E(l,"touchcancel",i._disableDelayedDrag),E(l,"mousemove",i._delayedDragTouchMoveHandler),E(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&E(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){c&&le(c),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;w(t,"mouseup",this._disableDelayedDrag),w(t,"touchend",this._disableDelayedDrag),w(t,"touchcancel",this._disableDelayedDrag),w(t,"mousemove",this._delayedDragTouchMoveHandler),w(t,"touchmove",this._delayedDragTouchMoveHandler),w(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):e?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(c,"dragend",this),E(C,"dragstart",this._onDragStart));try{document.selection?zt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(bt=!1,C&&c){Y("dragStarted",this,{evt:e}),this.nativeDraggable&&E(document,"dragover",cn);var n=this.options;!t&&T(c,n.dragClass,!1),T(c,n.ghostClass,!0),g.active=this,t&&this._appendGhost(),X({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(q){this._lastX=q.clientX,this._lastY=q.clientY,Be();for(var t=document.elementFromPoint(q.clientX,q.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(q.clientX,q.clientY),t!==e);)e=t;if(c.parentNode[k]._isOutsideThisEl(t),e)do{if(e[k]){var n=void 0;if(n=e[k]._onDragOver({clientX:q.clientX,clientY:q.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);He()}},_onTouchMove:function(t){if(ct){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,r=t.touches?t.touches[0]:t,a=v&&ht(v,!0),l=v&&a&&a.a,s=v&&a&&a.d,u=Bt&&R&&_e(R),d=(r.clientX-ct.clientX+i.x)/(l||1)+(u?u[0]-re[0]:0)/(l||1),f=(r.clientY-ct.clientY+i.y)/(s||1)+(u?u[1]-re[1]:0)/(s||1);if(!g.active&&!bt){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(v){a?(a.e+=d-(oe||0),a.f+=f-(ie||0)):a={a:1,b:0,c:0,d:1,e:d,f};var p="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(v,"webkitTransform",p),h(v,"mozTransform",p),h(v,"msTransform",p),h(v,"transform",p),oe=d,ie=f,q=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!v){var t=this.options.fallbackOnBody?document.body:C,e=I(c,!0,Bt,!0,t),n=this.options;if(Bt){for(R=t;h(R,"position")==="static"&&h(R,"transform")==="none"&&R!==document;)R=R.parentNode;R!==document.body&&R!==document.documentElement?(R===document&&(R=Z()),e.top+=R.scrollTop,e.left+=R.scrollLeft):R=Z(),re=_e(R)}v=c.cloneNode(!0),T(v,n.ghostClass,!1),T(v,n.fallbackClass,!0),T(v,n.dragClass,!0),h(v,"transition",""),h(v,"transform",""),h(v,"box-sizing","border-box"),h(v,"margin",0),h(v,"top",e.top),h(v,"left",e.left),h(v,"width",e.width),h(v,"height",e.height),h(v,"opacity","0.8"),h(v,"position",Bt?"absolute":"fixed"),h(v,"zIndex","100000"),h(v,"pointerEvents","none"),g.ghost=v,t.appendChild(v),h(v,"transform-origin",Te/parseInt(v.style.width)*100+"% "+Oe/parseInt(v.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,i=t.dataTransfer,r=n.options;if(Y("dragStart",this,{evt:t}),g.eventCanceled){this._onDrop();return}Y("setupClone",this),g.eventCanceled||(O=ve(c),O.draggable=!1,O.style["will-change"]="",this._hideClone(),T(O,this.options.chosenClass,!1),g.clone=O),n.cloneId=zt(function(){Y("clone",n),!g.eventCanceled&&(n.options.removeCloneOnHide||C.insertBefore(O,c),n._hideClone(),X({sortable:n,name:"clone"}))}),!e&&T(c,r.dragClass,!0),e?(Vt=!0,n._loopId=setInterval(n._emulateDragOver,50)):(w(document,"mouseup",n._onDrop),w(document,"touchend",n._onDrop),w(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(n,i,c)),E(document,"drop",n),h(c,"transform","translateZ(0)")),bt=!0,n._dragStartId=zt(n._dragStarted.bind(n,e,t)),E(document,"selectstart",n),Ot=!0,fe&&h(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,n=t.target,i,r,a,l=this.options,s=l.group,u=g.active,d=Xt===s,f=l.sort,p=F||u,y,b=this,S=!1;if(de)return;function N(yt,Le){Y(yt,b,at({evt:t,isOwner:d,axis:y?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:f,fromSortable:p,target:n,completed:x,onMove:function(Ee,We){return ae(C,e,c,i,Ee,I(Ee),t,We)},changed:B},Le))}function U(){N("dragOverAnimationCapture"),b.captureAnimationState(),b!==p&&p.captureAnimationState()}function x(yt){return N("dragOverCompleted",{insertion:yt}),yt&&(d?u._hideClone():u._showClone(b),b!==p&&(T(c,F?F.options.ghostClass:u.options.ghostClass,!1),T(c,l.ghostClass,!0)),F!==b&&b!==g.active?F=b:b===g.active&&F&&(F=null),p===b&&(b._ignoreWhileAnimating=n),b.animateAll(function(){N("dragOverAnimationComplete"),b._ignoreWhileAnimating=null}),b!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(n===c&&!c.animated||n===e&&!n.animated)&&(mt=null),!l.dragoverBubble&&!t.rootEl&&n!==document&&(c.parentNode[k]._isOutsideThisEl(t.target),!yt&&ft(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),S=!0}function B(){K=A(c),ot=A(c,l.draggable),X({sortable:b,name:"change",toEl:e,newIndex:K,newDraggableIndex:ot,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=$(n,l.draggable,e,!0),N("dragOver"),g.eventCanceled)return S;if(c.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||b._ignoreWhileAnimating===n)return x(!1);if(Vt=!1,u&&!l.disabled&&(d?f||(a=!C.contains(c)):F===this||(this.lastPutMode=Xt.checkPull(this,u,c,t))&&s.checkPut(this,u,c,t))){if(y=this._getDirection(t,n)==="vertical",i=I(c),N("dragOverValid"),g.eventCanceled)return S;if(a)return M=C,U(),this._hideClone(),N("revert"),g.eventCanceled||(dt?C.insertBefore(c,dt):C.appendChild(c)),x(!0);var D=me(e,l.draggable);if(!D||hn(t,y,this)&&!D.animated){if(D===c)return x(!1);if(D&&e===t.target&&(n=D),n&&(r=I(n)),ae(C,e,c,i,n,r,t,!!n)!==!1)return U(),e.appendChild(c),M=e,B(),x(!0)}else if(n.parentNode===e){r=I(n);var H=0,lt,Et=c.parentNode!==e,pt=!sn(c.animated&&c.toRect||i,n.animated&&n.toRect||r,y),G=y?"top":"left",et=De(n,"top","top")||De(c,"top","top"),kt=et?et.scrollTop:void 0;mt!==n&&(lt=r[G],xt=!1,Yt=!pt&&l.invertSwap||Et),H=pn(t,n,r,y,pt?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Yt,mt===n);var Q;if(H!==0){var gt=A(c);do gt-=H,Q=M.children[gt];while(Q&&(h(Q,"display")==="none"||Q===v))}if(H===0||Q===n)return x(!1);mt=n,Pt=H;var st=n.nextElementSibling,nt=!1;nt=H===1;var ut=ae(C,e,c,i,n,r,t,nt);if(ut!==!1)return(ut===1||ut===-1)&&(nt=ut===1),de=!0,setTimeout(dn,30),U(),nt&&!st?e.appendChild(c):n.parentNode.insertBefore(c,nt?st:n),et&&Re(et,0,kt-et.scrollTop),M=c.parentNode,lt!==void 0&&!Yt&&(Kt=Math.abs(lt-I(n)[G])),B(),x(!0)}if(e.contains(c))return x(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){w(document,"mousemove",this._onTouchMove),w(document,"touchmove",this._onTouchMove),w(document,"pointermove",this._onTouchMove),w(document,"dragover",ft),w(document,"mousemove",ft),w(document,"touchmove",ft)},_offUpEvents:function(){var t=this.el.ownerDocument;w(t,"mouseup",this._onDrop),w(t,"touchend",this._onDrop),w(t,"pointerup",this._onDrop),w(t,"touchcancel",this._onDrop),w(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(K=A(c),ot=A(c,n.draggable),Y("drop",this,{evt:t}),M=c&&c.parentNode,K=A(c),ot=A(c,n.draggable),g.eventCanceled){this._nulling();return}bt=!1,Yt=!1,xt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),he(this.cloneId),he(this._dragStartId),this.nativeDraggable&&(w(document,"drop",this),w(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),fe&&h(document.body,"user-select",""),h(c,"transform",""),t&&(Ot&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),v&&v.parentNode&&v.parentNode.removeChild(v),(C===M||F&&F.lastPutMode!=="clone")&&O&&O.parentNode&&O.parentNode.removeChild(O),c&&(this.nativeDraggable&&w(c,"dragend",this),le(c),c.style["will-change"]="",Ot&&!bt&&T(c,F?F.options.ghostClass:this.options.ghostClass,!1),T(c,this.options.chosenClass,!1),X({sortable:this,name:"unchoose",toEl:M,newIndex:null,newDraggableIndex:null,originalEvent:t}),C!==M?(K>=0&&(X({rootEl:M,name:"add",toEl:M,fromEl:C,originalEvent:t}),X({sortable:this,name:"remove",toEl:M,originalEvent:t}),X({rootEl:M,name:"sort",toEl:M,fromEl:C,originalEvent:t}),X({sortable:this,name:"sort",toEl:M,originalEvent:t})),F&&F.save()):K!==wt&&K>=0&&(X({sortable:this,name:"update",toEl:M,originalEvent:t}),X({sortable:this,name:"sort",toEl:M,originalEvent:t})),g.active&&((K==null||K===-1)&&(K=wt,ot=Mt),X({sortable:this,name:"end",toEl:M,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Y("nulling",this),C=c=M=v=dt=O=Wt=it=ct=q=Ot=K=ot=wt=Mt=mt=Pt=F=Xt=g.dragged=g.ghost=g.clone=g.active=null,Zt.forEach(function(t){t.checked=!0}),Zt.length=oe=ie=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":c&&(this._onDragOver(t),fn(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,i=0,r=n.length,a=this.options;i<r;i++)e=n[i],$(e,a.draggable,this.el,!1)&&t.push(e.getAttribute(a.dataIdAttr)||mn(e));return t},sort:function(t){var e={},n=this.el;this.toArray().forEach(function(i,r){var a=n.children[r];$(a,this.options.draggable,n,!1)&&(e[i]=a)},this),t.forEach(function(i){e[i]&&(n.removeChild(e[i]),n.appendChild(e[i]))})},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return $(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(e===void 0)return n[t];var i=Rt.modifyOption(this,t,e);typeof i<"u"?n[t]=i:n[t]=e,t==="group"&&Ye(n)},destroy:function(){Y("destroy",this);var t=this.el;t[k]=null,w(t,"mousedown",this._onTapStart),w(t,"touchstart",this._onTapStart),w(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(w(t,"dragover",this),w(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),$t.splice($t.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!it){if(Y("hideClone",this),g.eventCanceled)return;h(O,"display","none"),this.options.removeCloneOnHide&&O.parentNode&&O.parentNode.removeChild(O),it=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(it){if(Y("showClone",this),g.eventCanceled)return;C.contains(c)&&!this.options.group.revertClone?C.insertBefore(O,c):dt?C.insertBefore(O,dt):C.appendChild(O),this.options.group.revertClone&&this.animate(c,O),h(O,"display",""),it=!1}}};function fn(o){o.dataTransfer&&(o.dataTransfer.dropEffect="move"),o.cancelable&&o.preventDefault()}function ae(o,t,e,n,i,r,a,l){var s,u=o[k],d=u.options.onMove,f;return window.CustomEvent&&!tt&&!Ft?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=t,s.from=o,s.dragged=e,s.draggedRect=n,s.related=i||t,s.relatedRect=r||I(t),s.willInsertAfter=l,s.originalEvent=a,o.dispatchEvent(s),d&&(f=d.call(u,s,a)),f}function le(o){o.draggable=!1}function dn(){de=!1}function hn(o,t,e){var n=I(me(e.el,e.options.draggable)),i=10;return t?o.clientX>n.right+i||o.clientX<=n.right&&o.clientY>n.bottom&&o.clientX>=n.left:o.clientX>n.right&&o.clientY>n.top||o.clientX<=n.right&&o.clientY>n.bottom+i}function pn(o,t,e,n,i,r,a,l){var s=n?o.clientY:o.clientX,u=n?e.height:e.width,d=n?e.top:e.left,f=n?e.bottom:e.right,p=!1;if(!a){if(l&&Kt<u*i){if(!xt&&(Pt===1?s>d+u*r/2:s<f-u*r/2)&&(xt=!0),xt)p=!0;else if(Pt===1?s<d+Kt:s>f-Kt)return-Pt}else if(s>d+u*(1-i)/2&&s<f-u*(1-i)/2)return gn(t)}return p=p||a,p&&(s<d+u*r/2||s>f-u*r/2)?s>d+u/2?1:-1:0}function gn(o){return A(c)<A(o)?1:-1}function mn(o){for(var t=o.tagName+o.className+o.src+o.href+o.textContent,e=t.length,n=0;e--;)n+=t.charCodeAt(e);return n.toString(36)}function vn(o){Zt.length=0;for(var t=o.getElementsByTagName("input"),e=t.length;e--;){var n=t[e];n.checked&&Zt.push(n)}}function zt(o){return setTimeout(o,0)}function he(o){return clearTimeout(o)}Jt&&E(document,"touchmove",function(o){(g.active||bt)&&o.cancelable&&o.preventDefault()});g.utils={on:E,off:w,css:h,find:xe,is:function(t,e){return!!$(t,e,t,!1)},extend:en,throttle:Fe,closest:$,toggleClass:T,clone:ve,index:A,nextTick:zt,cancelNextTick:he,detectDirection:Xe,getChild:qt};g.get=function(o){return o[k]};g.mount=function(){for(var o=arguments.length,t=new Array(o),e=0;e<o;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(g.utils=at({},g.utils,n.utils)),Rt.mount(n)})};g.create=function(o,t){return new g(o,t)};g.version=Ze;var P=[],At,pe,ge=!1,se,ue,Qt,It;function bn(){function o(){this.defaults={scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return o.prototype={dragStarted:function(e){var n=e.originalEvent;this.sortable.nativeDraggable?E(document,"dragover",this._handleAutoScroll):this.options.supportPointer?E(document,"pointermove",this._handleFallbackAutoScroll):n.touches?E(document,"touchmove",this._handleFallbackAutoScroll):E(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):(w(document,"pointermove",this._handleFallbackAutoScroll),w(document,"touchmove",this._handleFallbackAutoScroll),w(document,"mousemove",this._handleFallbackAutoScroll)),Ie(),jt(),nn()},nulling:function(){Qt=pe=At=ge=It=se=ue=null,P.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,n){var i=this,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,l=document.elementFromPoint(r,a);if(Qt=e,n||Ft||tt||fe){ce(e,this.options,l,n);var s=rt(l,!0);ge&&(!It||r!==se||a!==ue)&&(It&&Ie(),It=setInterval(function(){var u=rt(document.elementFromPoint(r,a),!0);u!==s&&(s=u,jt()),ce(e,i.options,u,n)},10),se=r,ue=a)}else{if(!this.options.bubbleScroll||rt(l,!0)===Z()){jt();return}ce(e,this.options,rt(l,!1),!1)}}},j(o,{pluginName:"scroll",initializeByDefault:!0})}function jt(){P.forEach(function(o){clearInterval(o.pid)}),P=[]}function Ie(){clearInterval(It)}var ce=Fe(function(o,t,e,n){if(t.scroll){var i=(o.touches?o.touches[0]:o).clientX,r=(o.touches?o.touches[0]:o).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,s=Z(),u=!1,d;pe!==e&&(pe=e,jt(),At=t.scroll,d=t.scrollFn,At===!0&&(At=rt(e,!0)));var f=0,p=At;do{var y=p,b=I(y),S=b.top,N=b.bottom,U=b.left,x=b.right,B=b.width,D=b.height,H=void 0,lt=void 0,Et=y.scrollWidth,pt=y.scrollHeight,G=h(y),et=y.scrollLeft,kt=y.scrollTop;y===s?(H=B<Et&&(G.overflowX==="auto"||G.overflowX==="scroll"||G.overflowX==="visible"),lt=D<pt&&(G.overflowY==="auto"||G.overflowY==="scroll"||G.overflowY==="visible")):(H=B<Et&&(G.overflowX==="auto"||G.overflowX==="scroll"),lt=D<pt&&(G.overflowY==="auto"||G.overflowY==="scroll"));var Q=H&&(Math.abs(x-i)<=a&&et+B<Et)-(Math.abs(U-i)<=a&&!!et),gt=lt&&(Math.abs(N-r)<=a&&kt+D<pt)-(Math.abs(S-r)<=a&&!!kt);if(!P[f])for(var st=0;st<=f;st++)P[st]||(P[st]={});(P[f].vx!=Q||P[f].vy!=gt||P[f].el!==y)&&(P[f].el=y,P[f].vx=Q,P[f].vy=gt,clearInterval(P[f].pid),(Q!=0||gt!=0)&&(u=!0,P[f].pid=setInterval((function(){n&&this.layer===0&&g.active._onTouchMove(Qt);var nt=P[this.layer].vy?P[this.layer].vy*l:0,ut=P[this.layer].vx?P[this.layer].vx*l:0;typeof d=="function"&&d.call(g.dragged.parentNode[k],ut,nt,o,Qt,P[this.layer].el)!=="continue"||Re(P[this.layer].el,ut,nt)}).bind({layer:f}),24))),f++}while(t.bubbleScroll&&p!==s&&(p=rt(p,!1)));ge=u}},30),Ge=function(t){var e=t.originalEvent,n=t.putSortable,i=t.dragEl,r=t.activeSortable,a=t.dispatchSortableEvent,l=t.hideGhostForTarget,s=t.unhideGhostForTarget;if(e){var u=n||r;l();var d=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,f=document.elementFromPoint(d.clientX,d.clientY);s(),u&&!u.el.contains(f)&&(a("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function be(){}be.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var i=qt(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(e,i):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:Ge};j(be,{pluginName:"revertOnSpill"});function we(){}we.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,i=n||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:Ge};j(we,{pluginName:"removeOnSpill"});var z;function wn(){function o(){this.defaults={swapClass:"sortable-swap-highlight"}}return o.prototype={dragStart:function(e){var n=e.dragEl;z=n},dragOverValid:function(e){var n=e.completed,i=e.target,r=e.onMove,a=e.activeSortable,l=e.changed,s=e.cancel;if(a.options.swap){var u=this.sortable.el,d=this.options;if(i&&i!==u){var f=z;r(i)!==!1?(T(i,d.swapClass,!0),z=i):z=null,f&&f!==z&&T(f,d.swapClass,!1)}l(),n(!0),s()}},drop:function(e){var n=e.activeSortable,i=e.putSortable,r=e.dragEl,a=i||this.sortable,l=this.options;z&&T(z,l.swapClass,!1),z&&(l.swap||i&&i.options.swap)&&r!==z&&(a.captureAnimationState(),a!==n&&n.captureAnimationState(),En(r,z),a.animateAll(),a!==n&&n.animateAll())},nulling:function(){z=null}},j(o,{pluginName:"swap",eventProperties:function(){return{swapItem:z}}})}function En(o,t){var e=o.parentNode,n=t.parentNode,i,r;!e||!n||e.isEqualNode(t)||n.isEqualNode(o)||(i=A(o),r=A(t),e.isEqualNode(n)&&i<r&&r++,e.insertBefore(t,e.children[i]),n.insertBefore(o,n.children[r]))}var m=[],W=[],Dt,V,_t=!1,L=!1,vt=!1,_,Ct,Ht;function yn(){function o(t){for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this));t.options.supportPointer?E(document,"pointerup",this._deselectMultiDrag):(E(document,"mouseup",this._deselectMultiDrag),E(document,"touchend",this._deselectMultiDrag)),E(document,"keydown",this._checkKeyDown),E(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(i,r){var a="";m.length&&V===t?m.forEach(function(l,s){a+=(s?", ":"")+l.textContent}):a=r.textContent,i.setData("Text",a)}}}return o.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var n=e.dragEl;_=n},delayEnded:function(){this.isMultiDrag=~m.indexOf(_)},setupClone:function(e){var n=e.sortable,i=e.cancel;if(this.isMultiDrag){for(var r=0;r<m.length;r++)W.push(ve(m[r])),W[r].sortableIndex=m[r].sortableIndex,W[r].draggable=!1,W[r].style["will-change"]="",T(W[r],this.options.selectedClass,!1),m[r]===_&&T(W[r],this.options.chosenClass,!1);n._hideClone(),i()}},clone:function(e){var n=e.sortable,i=e.rootEl,r=e.dispatchSortableEvent,a=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||m.length&&V===n&&(Ne(!0,i),r("clone"),a()))},showClone:function(e){var n=e.cloneNowShown,i=e.rootEl,r=e.cancel;this.isMultiDrag&&(Ne(!1,i),W.forEach(function(a){h(a,"display","")}),n(),Ht=!1,r())},hideClone:function(e){var n=this;e.sortable;var i=e.cloneNowHidden,r=e.cancel;this.isMultiDrag&&(W.forEach(function(a){h(a,"display","none"),n.options.removeCloneOnHide&&a.parentNode&&a.parentNode.removeChild(a)}),i(),Ht=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&V&&V.multiDrag._deselectMultiDrag(),m.forEach(function(n){n.sortableIndex=A(n)}),m=m.sort(function(n,i){return n.sortableIndex-i.sortableIndex}),vt=!0},dragStarted:function(e){var n=this,i=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(i.captureAnimationState(),this.options.animation)){m.forEach(function(a){a!==_&&h(a,"position","absolute")});var r=I(_,!1,!0,!0);m.forEach(function(a){a!==_&&Ce(a,r)}),L=!0,_t=!0}i.animateAll(function(){L=!1,_t=!1,n.options.animation&&m.forEach(function(a){ee(a)}),n.options.sort&&Gt()})}},dragOver:function(e){var n=e.target,i=e.completed,r=e.cancel;L&&~m.indexOf(n)&&(i(!1),r())},revert:function(e){var n=e.fromSortable,i=e.rootEl,r=e.sortable,a=e.dragRect;m.length>1&&(m.forEach(function(l){r.addAnimationState({target:l,rect:L?I(l):a}),ee(l),l.fromRect=a,n.removeAnimationState(l)}),L=!1,Sn(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(e){var n=e.sortable,i=e.isOwner,r=e.insertion,a=e.activeSortable,l=e.parentEl,s=e.putSortable,u=this.options;if(r){if(i&&a._hideClone(),_t=!1,u.animation&&m.length>1&&(L||!i&&!a.options.sort&&!s)){var d=I(_,!1,!0,!0);m.forEach(function(p){p!==_&&(Ce(p,d),l.appendChild(p))}),L=!0}if(!i)if(L||Gt(),m.length>1){var f=Ht;a._showClone(n),a.options.animation&&!Ht&&f&&W.forEach(function(p){a.addAnimationState({target:p,rect:Ct}),p.fromRect=Ct,p.thisAnimationDuration=null})}else a._showClone(n)}},dragOverAnimationCapture:function(e){var n=e.dragRect,i=e.isOwner,r=e.activeSortable;if(m.forEach(function(l){l.thisAnimationDuration=null}),r.options.animation&&!i&&r.multiDrag.isMultiDrag){Ct=j({},n);var a=ht(_,!0);Ct.top-=a.f,Ct.left-=a.e}},dragOverAnimationComplete:function(){L&&(L=!1,Gt())},drop:function(e){var n=e.originalEvent,i=e.rootEl,r=e.parentEl,a=e.sortable,l=e.dispatchSortableEvent,s=e.oldIndex,u=e.putSortable,d=u||this.sortable;if(n){var f=this.options,p=r.children;if(!vt)if(f.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),T(_,f.selectedClass,!~m.indexOf(_)),~m.indexOf(_))m.splice(m.indexOf(_),1),Dt=null,Tt({sortable:a,rootEl:i,name:"deselect",targetEl:_,originalEvt:n});else{if(m.push(_),Tt({sortable:a,rootEl:i,name:"select",targetEl:_,originalEvt:n}),n.shiftKey&&Dt&&a.el.contains(Dt)){var y=A(Dt),b=A(_);if(~y&&~b&&y!==b){var S,N;for(b>y?(N=y,S=b):(N=b,S=y+1);N<S;N++)~m.indexOf(p[N])||(T(p[N],f.selectedClass,!0),m.push(p[N]),Tt({sortable:a,rootEl:i,name:"select",targetEl:p[N],originalEvt:n}))}}else Dt=_;V=d}if(vt&&this.isMultiDrag){if((r[k].options.sort||r!==i)&&m.length>1){var U=I(_),x=A(_,":not(."+this.options.selectedClass+")");if(!_t&&f.animation&&(_.thisAnimationDuration=null),d.captureAnimationState(),!_t&&(f.animation&&(_.fromRect=U,m.forEach(function(D){if(D.thisAnimationDuration=null,D!==_){var H=L?I(D):U;D.fromRect=H,d.addAnimationState({target:D,rect:H})}})),Gt(),m.forEach(function(D){p[x]?r.insertBefore(D,p[x]):r.appendChild(D),x++}),s===A(_))){var B=!1;m.forEach(function(D){if(D.sortableIndex!==A(D)){B=!0;return}}),B&&l("update")}m.forEach(function(D){ee(D)}),d.animateAll()}V=d}(i===r||u&&u.lastPutMode!=="clone")&&W.forEach(function(D){D.parentNode&&D.parentNode.removeChild(D)})}},nullingGlobal:function(){this.isMultiDrag=vt=!1,W.length=0},destroyGlobal:function(){this._deselectMultiDrag(),w(document,"pointerup",this._deselectMultiDrag),w(document,"mouseup",this._deselectMultiDrag),w(document,"touchend",this._deselectMultiDrag),w(document,"keydown",this._checkKeyDown),w(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(typeof vt<"u"&&vt)&&V===this.sortable&&!(e&&$(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;m.length;){var n=m[0];T(n,this.options.selectedClass,!1),m.shift(),Tt({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:n,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},j(o,{pluginName:"multiDrag",utils:{select:function(e){var n=e.parentNode[k];!n||!n.options.multiDrag||~m.indexOf(e)||(V&&V!==n&&(V.multiDrag._deselectMultiDrag(),V=n),T(e,n.options.selectedClass,!0),m.push(e))},deselect:function(e){var n=e.parentNode[k],i=m.indexOf(e);!n||!n.options.multiDrag||!~i||(T(e,n.options.selectedClass,!1),m.splice(i,1))}},eventProperties:function(){var e=this,n=[],i=[];return m.forEach(function(r){n.push({multiDragElement:r,index:r.sortableIndex});var a;L&&r!==_?a=-1:L?a=A(r,":not(."+e.options.selectedClass+")"):a=A(r),i.push({multiDragElement:r,index:a})}),{items:Ue(m),clones:[].concat(W),oldIndicies:n,newIndicies:i}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function Sn(o,t){m.forEach(function(e,n){var i=t.children[e.sortableIndex+(o?Number(n):0)];i?t.insertBefore(e,i):t.appendChild(e)})}function Ne(o,t){W.forEach(function(e,n){var i=t.children[e.sortableIndex+(o?Number(n):0)];i?t.insertBefore(e,i):t.appendChild(e)})}function Gt(){m.forEach(function(o){o!==_&&o.parentNode&&o.parentNode.removeChild(o)})}g.mount(new bn);g.mount(we,be);exports.MultiDrag=yn;exports.Sortable=g;exports.Swap=wn;exports.default=g;