gitea_hat/public/js/sortable.b26f479a.js

3 lines
44 KiB
JavaScript

"use strict";(self.webpackChunkgitea=self.webpackChunkgitea||[]).push([["sortable"],{"./node_modules/sortablejs/modular/sortable.esm.js":function(Pn,oe,De){De.r(oe),De.d(oe,{MultiDrag:function(){return Tn},Sortable:function(){return p},Swap:function(){return Cn}});function _e(o,t){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),e.push.apply(e,n)}return e}function V(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?_e(Object(e),!0).forEach(function(n){qe(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):_e(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function Bt(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bt=function(t){return typeof t}:Bt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(o)}function qe(o,t,e){return t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function L(){return L=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},L.apply(this,arguments)}function $e(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 Ve(o,t){if(o==null)return{};var e=$e(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 Ze(o){return Qe(o)||Je(o)||tn(o)||en()}function Qe(o){if(Array.isArray(o))return ie(o)}function Je(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function tn(o,t){if(!!o){if(typeof o=="string")return ie(o,t);var e=Object.prototype.toString.call(o).slice(8,-1);if(e==="Object"&&o.constructor&&(e=o.constructor.name),e==="Map"||e==="Set")return Array.from(o);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ie(o,t)}}function ie(o,t){(t==null||t>o.length)&&(t=o.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=o[e];return n}function en(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var nn="1.15.0";function tt(o){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(o)}var et=tt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),yt=tt(/Edge/i),Ce=tt(/firefox/i),Et=tt(/safari/i)&&!tt(/chrome/i)&&!tt(/android/i),Oe=tt(/iP(ad|od|hone)/i),Te=tt(/chrome/i)&&tt(/android/i),Ae={capture:!1,passive:!1};function y(o,t,e){o.addEventListener(t,e,!et&&Ae)}function w(o,t,e){o.removeEventListener(t,e,!et&&Ae)}function Ht(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(e){return!1}return!1}}function on(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function U(o,t,e,n){if(o){e=e||document;do{if(t!=null&&(t[0]===">"?o.parentNode===e&&Ht(o,t):Ht(o,t))||n&&o===e)return o;if(o===e)break}while(o=on(o))}return null}var Ie=/\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(Ie," ").replace(" "+t+" "," ");o.className=(n+(e?" "+t:"")).replace(Ie," ")}}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 st(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 Ne(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 C(o,t,e,n,i){if(!(!o.getBoundingClientRect&&o!==window)){var r,a,l,s,u,d,f;if(o!==window&&o.parentNode&&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,!et))do if(i&&i.getBoundingClientRect&&(h(i,"transform")!=="none"||e&&h(i,"position")!=="static")){var g=i.getBoundingClientRect();a-=g.top+parseInt(h(i,"border-top-width")),l-=g.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 E=st(i||o),b=E&&E.a,S=E&&E.d;E&&(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 Pe(o,t,e){for(var n=ot(o,!0),i=C(o)[t];n;){var r=C(n)[e],a=void 0;if(e==="top"||e==="left"?a=i>=r:a=i<=r,!a)return n;if(n===Z())break;n=ot(n,!1)}return!1}function pt(o,t,e,n){for(var i=0,r=0,a=o.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==p.ghost&&(n||a[r]!==p.dragged)&&U(a[r],e.draggable,o,!1)){if(i===t)return a[r];i++}r++}return null}function re(o,t){for(var e=o.lastElementChild;e&&(e===p.ghost||h(e,"display")==="none"||t&&!Ht(e,t));)e=e.previousElementSibling;return e||null}function I(o,t){var e=0;if(!o||!o.parentNode)return-1;for(;o=o.previousElementSibling;)o.nodeName.toUpperCase()!=="TEMPLATE"&&o!==p.clone&&(!t||Ht(o,t))&&e++;return e}function Me(o){var t=0,e=0,n=Z();if(o)do{var i=st(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 rn(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 ot(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 an(o,t){if(o&&t)for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o}function ae(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 St;function xe(o,t){return function(){if(!St){var e=arguments,n=this;e.length===1?o.call(n,e[0]):o.apply(n,e),St=setTimeout(function(){St=void 0},t)}}}function ln(){clearTimeout(St),St=void 0}function Fe(o,t,e){o.scrollLeft+=t,o.scrollTop+=e}function le(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 Re(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 se(o){h(o,"position",""),h(o,"top",""),h(o,"left",""),h(o,"width",""),h(o,"height","")}var R="Sortable"+new Date().getTime();function sn(){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===p.ghost)){o.push({target:i,rect:C(i)});var r=V({},o[o.length-1].rect);if(i.thisAnimationDuration){var a=st(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(rn(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=C(u),g=u.prevFromRect,E=u.prevToRect,b=l.rect,S=st(u,!0);S&&(f.top-=S.f,f.left-=S.e),u.toRect=f,u.thisAnimationDuration&&ae(g,f)&&!ae(d,f)&&(b.top-f.top)/(b.left-f.left)===(d.top-f.top)/(d.left-f.left)&&(s=cn(b,g,E,i.options)),ae(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=st(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)"),this.forRepaintDummy=un(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 un(o){return o.offsetWidth}function cn(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 gt=[],ue={initializeByDefault:!0},Dt={mount:function(t){for(var e in ue)ue.hasOwnProperty(e)&&!(e in t)&&(t[e]=ue[e]);gt.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),gt.push(t)},pluginEvent:function(t,e,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var r=t+"Global";gt.forEach(function(a){!e[a.pluginName]||(e[a.pluginName][r]&&e[a.pluginName][r](V({sortable:e},n)),e.options[a.pluginName]&&e[a.pluginName][t]&&e[a.pluginName][t](V({sortable:e},n)))})},initializePlugins:function(t,e,n,i){gt.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,L(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!="undefined"&&(t.options[r]=a)}},getEventProperties:function(t,e){var n={};return gt.forEach(function(i){typeof i.eventProperties=="function"&&L(n,i.eventProperties.call(e[i.pluginName],t))}),n},modifyOption:function(t,e,n){var i;return gt.forEach(function(r){!t[r.pluginName]||r.optionListeners&&typeof r.optionListeners[e]=="function"&&(i=r.optionListeners[e].call(t[r.pluginName],n))}),i}};function _t(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,g=o.originalEvent,E=o.putSortable,b=o.extraEventProperties;if(t=t||e&&e[R],!!t){var S,M=t.options,z="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!et&&!yt?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=g,S.pullMode=E?E.lastPutMode:void 0;var x=V(V({},b),Dt.getEventProperties(n,t));for(var H in x)S[H]=x[H];e&&e.dispatchEvent(S),M[z]&&M[z].call(t,S)}}var fn=["evt"],Y=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,r=Ve(n,fn);Dt.pluginEvent.bind(p)(t,e,V({dragEl:c,parentEl:N,ghostEl:v,rootEl:O,nextEl:ut,lastDownEl:Gt,cloneEl:A,cloneHidden:it,dragStarted:Ot,putSortable:F,activeSortable:p.active,originalEvent:i,oldIndex:mt,oldDraggableIndex:Ct,newIndex:G,newDraggableIndex:rt,hideGhostForTarget:We,unhideGhostForTarget:Ke,cloneNowHidden:function(){it=!0},cloneNowShown:function(){it=!1},dispatchSortableEvent:function(l){X({sortable:e,name:l,originalEvent:i})}},r))};function X(o){_t(V({putSortable:F,cloneEl:A,targetEl:c,rootEl:O,oldIndex:mt,oldDraggableIndex:Ct,newIndex:G,newDraggableIndex:rt},o))}var c,N,v,O,ut,Gt,A,it,mt,G,Ct,rt,Wt,F,vt=!1,Kt=!1,Lt=[],ct,q,ce,fe,ke,Xe,Ot,bt,Tt,At=!1,jt=!1,zt,k,de=[],he=!1,Ut=[],qt=typeof document!="undefined",$t=Oe,Ye=yt||et?"cssFloat":"float",dn=qt&&!Te&&!Oe&&"draggable"in document.createElement("div"),Be=function(){if(!!qt){if(et)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),He=function(t,e){var n=h(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=pt(t,0,e),a=pt(t,1,e),l=r&&h(r),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(r).width,d=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+C(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[Ye]==="none"||a&&n[Ye]==="none"&&u+d>i)?"vertical":"horizontal"},hn=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},pn=function(t,e){var n;return Lt.some(function(i){var r=i[R].options.emptyInsertThreshold;if(!(!r||re(i))){var a=C(i),l=t>=a.left-r&&t<=a.right+r,s=e>=a.top-r&&e<=a.bottom+r;if(l&&s)return n=i}}),n},Ge=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 g=(a?l:s).options.group.name;return r===!0||typeof r=="string"&&r===g||r.join&&r.indexOf(g)>-1}}var n={},i=t.group;(!i||Bt(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},We=function(){!Be&&v&&h(v,"display","none")},Ke=function(){!Be&&v&&h(v,"display","")};qt&&!Te&&document.addEventListener("click",function(o){if(Kt)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),Kt=!1,!1},!0);var ft=function(t){if(c){t=t.touches?t.touches[0]:t;var e=pn(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[R]._onDragOver(n)}}},gn=function(t){c&&c.parentNode[R]._isOutsideThisEl(t.target)};function p(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=L({},t),o[R]=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 He(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:p.supportPointer!==!1&&"PointerEvent"in window&&!Et,emptyInsertThreshold:5};Dt.initializePlugins(this,o,e);for(var n in e)!(n in t)&&(t[n]=e[n]);Ge(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:dn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?y(o,"pointerdown",this._onTapStart):(y(o,"mousedown",this._onTapStart),y(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(o,"dragover",this),y(o,"dragenter",this)),Lt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),L(this,sn())}p.prototype={constructor:p,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(bt=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(Dn(n),!c&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Et&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=U(s,i.draggable,n,!1),!(s&&s.animated)&&Gt!==s)){if(mt=I(s),Ct=I(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(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(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=C(n);if(O=r,c=n,N=c.parentNode,ut=c.nextSibling,Gt=n,Wt=a.group,p.dragged=c,ct={target:c,clientX:(e||t).clientX,clientY:(e||t).clientY},ke=ct.clientX-u.left,Xe=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}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Ce&&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){Ne(c,d.trim(),pe)}),y(l,"dragover",ft),y(l,"mousemove",ft),y(l,"touchmove",ft),y(l,"mouseup",i._onDrop),y(l,"touchend",i._onDrop),y(l,"touchcancel",i._onDrop),Ce&&this.nativeDraggable&&(this.options.touchStartThreshold=4,c.draggable=!0),Y("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(yt||et))){if(p.eventCanceled){this._onDrop();return}y(l,"mouseup",i._disableDelayedDrag),y(l,"touchend",i._disableDelayedDrag),y(l,"touchcancel",i._disableDelayedDrag),y(l,"mousemove",i._delayedDragTouchMoveHandler),y(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&y(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&&pe(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?y(document,"pointermove",this._onTouchMove):e?y(document,"touchmove",this._onTouchMove):y(document,"mousemove",this._onTouchMove):(y(c,"dragend",this),y(O,"dragstart",this._onDragStart));try{document.selection?Zt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(vt=!1,O&&c){Y("dragStarted",this,{evt:e}),this.nativeDraggable&&y(document,"dragover",gn);var n=this.options;!t&&T(c,n.dragClass,!1),T(c,n.ghostClass,!0),p.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,We();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[R]._isOutsideThisEl(t),e)do{if(e[R]){var n=void 0;if(n=e[R]._onDragOver({clientX:q.clientX,clientY:q.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Ke()}},_onTouchMove:function(t){if(ct){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,r=t.touches?t.touches[0]:t,a=v&&st(v,!0),l=v&&a&&a.a,s=v&&a&&a.d,u=$t&&k&&Me(k),d=(r.clientX-ct.clientX+i.x)/(l||1)+(u?u[0]-de[0]:0)/(l||1),f=(r.clientY-ct.clientY+i.y)/(s||1)+(u?u[1]-de[1]:0)/(s||1);if(!p.active&&!vt){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-(ce||0),a.f+=f-(fe||0)):a={a:1,b:0,c:0,d:1,e:d,f};var g="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");h(v,"webkitTransform",g),h(v,"mozTransform",g),h(v,"msTransform",g),h(v,"transform",g),ce=d,fe=f,q=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!v){var t=this.options.fallbackOnBody?document.body:O,e=C(c,!0,$t,!0,t),n=this.options;if($t){for(k=t;h(k,"position")==="static"&&h(k,"transform")==="none"&&k!==document;)k=k.parentNode;k!==document.body&&k!==document.documentElement?(k===document&&(k=Z()),e.top+=k.scrollTop,e.left+=k.scrollLeft):k=Z(),de=Me(k)}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",$t?"absolute":"fixed"),h(v,"zIndex","100000"),h(v,"pointerEvents","none"),p.ghost=v,t.appendChild(v),h(v,"transform-origin",ke/parseInt(v.style.width)*100+"% "+Xe/parseInt(v.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,i=t.dataTransfer,r=n.options;if(Y("dragStart",this,{evt:t}),p.eventCanceled){this._onDrop();return}Y("setupClone",this),p.eventCanceled||(A=le(c),A.removeAttribute("id"),A.draggable=!1,A.style["will-change"]="",this._hideClone(),T(A,this.options.chosenClass,!1),p.clone=A),n.cloneId=Zt(function(){Y("clone",n),!p.eventCanceled&&(n.options.removeCloneOnHide||O.insertBefore(A,c),n._hideClone(),X({sortable:n,name:"clone"}))}),!e&&T(c,r.dragClass,!0),e?(Kt=!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)),y(document,"drop",n),h(c,"transform","translateZ(0)")),vt=!0,n._dragStartId=Zt(n._dragStarted.bind(n,e,t)),y(document,"selectstart",n),Ot=!0,Et&&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=p.active,d=Wt===s,f=l.sort,g=F||u,E,b=this,S=!1;if(he)return;function M(Yt,In){Y(Yt,b,V({evt:t,isOwner:d,axis:E?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:f,fromSortable:g,target:n,completed:x,onMove:function(Ue,Nn){return Vt(O,e,c,i,Ue,C(Ue),t,Nn)},changed:H},In))}function z(){M("dragOverAnimationCapture"),b.captureAnimationState(),b!==g&&g.captureAnimationState()}function x(Yt){return M("dragOverCompleted",{insertion:Yt}),Yt&&(d?u._hideClone():u._showClone(b),b!==g&&(T(c,F?F.options.ghostClass:u.options.ghostClass,!1),T(c,l.ghostClass,!0)),F!==b&&b!==p.active?F=b:b===p.active&&F&&(F=null),g===b&&(b._ignoreWhileAnimating=n),b.animateAll(function(){M("dragOverAnimationComplete"),b._ignoreWhileAnimating=null}),b!==g&&(g.animateAll(),g._ignoreWhileAnimating=null)),(n===c&&!c.animated||n===e&&!n.animated)&&(bt=null),!l.dragoverBubble&&!t.rootEl&&n!==document&&(c.parentNode[R]._isOutsideThisEl(t.target),!Yt&&ft(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),S=!0}function H(){G=I(c),rt=I(c,l.draggable),X({sortable:b,name:"change",toEl:e,newIndex:G,newDraggableIndex:rt,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=U(n,l.draggable,e,!0),M("dragOver"),p.eventCanceled)return S;if(c.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||b._ignoreWhileAnimating===n)return x(!1);if(Kt=!1,u&&!l.disabled&&(d?f||(a=N!==O):F===this||(this.lastPutMode=Wt.checkPull(this,u,c,t))&&s.checkPut(this,u,c,t))){if(E=this._getDirection(t,n)==="vertical",i=C(c),M("dragOverValid"),p.eventCanceled)return S;if(a)return N=O,z(),this._hideClone(),M("revert"),p.eventCanceled||(ut?O.insertBefore(c,ut):O.appendChild(c)),x(!0);var D=re(e,l.draggable);if(!D||wn(t,E,this)&&!D.animated){if(D===c)return x(!1);if(D&&e===t.target&&(n=D),n&&(r=C(n)),Vt(O,e,c,i,n,r,t,!!n)!==!1)return z(),D&&D.nextSibling?e.insertBefore(c,D.nextSibling):e.appendChild(c),N=e,H(),x(!0)}else if(D&&bn(t,E,this)){var Q=pt(e,0,l,!0);if(Q===c)return x(!1);if(n=Q,r=C(n),Vt(O,e,c,i,n,r,t,!1)!==!1)return z(),e.insertBefore(c,Q),N=e,H(),x(!0)}else if(n.parentNode===e){r=C(n);var J=0,dt,Ft=c.parentNode!==e,K=!hn(c.animated&&c.toRect||i,n.animated&&n.toRect||r,E),Rt=E?"top":"left",at=Pe(n,"top","top")||Pe(c,"top","top"),kt=at?at.scrollTop:void 0;bt!==n&&(dt=r[Rt],At=!1,jt=!K&&l.invertSwap||Ft),J=yn(t,n,r,E,K?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,jt,bt===n);var nt;if(J!==0){var ht=I(c);do ht-=J,nt=N.children[ht];while(nt&&(h(nt,"display")==="none"||nt===v))}if(J===0||nt===n)return x(!1);bt=n,Tt=J;var Xt=n.nextElementSibling,lt=!1;lt=J===1;var ne=Vt(O,e,c,i,n,r,t,lt);if(ne!==!1)return(ne===1||ne===-1)&&(lt=ne===1),he=!0,setTimeout(vn,30),z(),lt&&!Xt?e.appendChild(c):n.parentNode.insertBefore(c,lt?Xt:n),at&&Fe(at,0,kt-at.scrollTop),N=c.parentNode,dt!==void 0&&!jt&&(zt=Math.abs(dt-C(n)[Rt])),H(),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(G=I(c),rt=I(c,n.draggable),Y("drop",this,{evt:t}),N=c&&c.parentNode,G=I(c),rt=I(c,n.draggable),p.eventCanceled){this._nulling();return}vt=!1,jt=!1,At=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ge(this.cloneId),ge(this._dragStartId),this.nativeDraggable&&(w(document,"drop",this),w(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Et&&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),(O===N||F&&F.lastPutMode!=="clone")&&A&&A.parentNode&&A.parentNode.removeChild(A),c&&(this.nativeDraggable&&w(c,"dragend",this),pe(c),c.style["will-change"]="",Ot&&!vt&&T(c,F?F.options.ghostClass:this.options.ghostClass,!1),T(c,this.options.chosenClass,!1),X({sortable:this,name:"unchoose",toEl:N,newIndex:null,newDraggableIndex:null,originalEvent:t}),O!==N?(G>=0&&(X({rootEl:N,name:"add",toEl:N,fromEl:O,originalEvent:t}),X({sortable:this,name:"remove",toEl:N,originalEvent:t}),X({rootEl:N,name:"sort",toEl:N,fromEl:O,originalEvent:t}),X({sortable:this,name:"sort",toEl:N,originalEvent:t})),F&&F.save()):G!==mt&&G>=0&&(X({sortable:this,name:"update",toEl:N,originalEvent:t}),X({sortable:this,name:"sort",toEl:N,originalEvent:t})),p.active&&((G==null||G===-1)&&(G=mt,rt=Ct),X({sortable:this,name:"end",toEl:N,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Y("nulling",this),O=c=N=v=ut=A=Gt=it=ct=q=Ot=G=rt=mt=Ct=bt=Tt=F=Wt=p.dragged=p.ghost=p.clone=p.active=null,Ut.forEach(function(t){t.checked=!0}),Ut.length=ce=fe=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":c&&(this._onDragOver(t),mn(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],U(e,a.draggable,this.el,!1)&&t.push(e.getAttribute(a.dataIdAttr)||Sn(e));return t},sort:function(t,e){var n={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];U(l,this.options.draggable,i,!1)&&(n[r]=l)},this),e&&this.captureAnimationState(),t.forEach(function(r){n[r]&&(i.removeChild(n[r]),i.appendChild(n[r]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return U(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=Dt.modifyOption(this,t,e);typeof i!="undefined"?n[t]=i:n[t]=e,t==="group"&&Ge(n)},destroy:function(){Y("destroy",this);var t=this.el;t[R]=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(),Lt.splice(Lt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!it){if(Y("hideClone",this),p.eventCanceled)return;h(A,"display","none"),this.options.removeCloneOnHide&&A.parentNode&&A.parentNode.removeChild(A),it=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(it){if(Y("showClone",this),p.eventCanceled)return;c.parentNode==O&&!this.options.group.revertClone?O.insertBefore(A,c):ut?O.insertBefore(A,ut):O.appendChild(A),this.options.group.revertClone&&this.animate(c,A),h(A,"display",""),it=!1}}};function mn(o){o.dataTransfer&&(o.dataTransfer.dropEffect="move"),o.cancelable&&o.preventDefault()}function Vt(o,t,e,n,i,r,a,l){var s,u=o[R],d=u.options.onMove,f;return window.CustomEvent&&!et&&!yt?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||C(t),s.willInsertAfter=l,s.originalEvent=a,o.dispatchEvent(s),d&&(f=d.call(u,s,a)),f}function pe(o){o.draggable=!1}function vn(){he=!1}function bn(o,t,e){var n=C(pt(e.el,0,e.options,!0)),i=10;return t?o.clientX<n.left-i||o.clientY<n.top&&o.clientX<n.right:o.clientY<n.top-i||o.clientY<n.bottom&&o.clientX<n.left}function wn(o,t,e){var n=C(re(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 yn(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,g=!1;if(!a){if(l&&zt<u*i){if(!At&&(Tt===1?s>d+u*r/2:s<f-u*r/2)&&(At=!0),At)g=!0;else if(Tt===1?s<d+zt:s>f-zt)return-Tt}else if(s>d+u*(1-i)/2&&s<f-u*(1-i)/2)return En(t)}return g=g||a,g&&(s<d+u*r/2||s>f-u*r/2)?s>d+u/2?1:-1:0}function En(o){return I(c)<I(o)?1:-1}function Sn(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 Dn(o){Ut.length=0;for(var t=o.getElementsByTagName("input"),e=t.length;e--;){var n=t[e];n.checked&&Ut.push(n)}}function Zt(o){return setTimeout(o,0)}function ge(o){return clearTimeout(o)}qt&&y(document,"touchmove",function(o){(p.active||vt)&&o.cancelable&&o.preventDefault()}),p.utils={on:y,off:w,css:h,find:Ne,is:function(t,e){return!!U(t,e,t,!1)},extend:an,throttle:xe,closest:U,toggleClass:T,clone:le,index:I,nextTick:Zt,cancelNextTick:ge,detectDirection:He,getChild:pt},p.get=function(o){return o[R]},p.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&&(p.utils=V(V({},p.utils),n.utils)),Dt.mount(n)})},p.create=function(o,t){return new p(o,t)},p.version=nn;var P=[],It,me,ve=!1,be,we,Qt,Nt;function _n(){function o(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,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?y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?y(document,"pointermove",this._handleFallbackAutoScroll):n.touches?y(document,"touchmove",this._handleFallbackAutoScroll):y(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)),Le(),Jt(),ln()},nulling:function(){Qt=me=It=ve=Nt=be=we=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||this.options.forceAutoScrollFallback||yt||et||Et){ye(e,this.options,l,n);var s=ot(l,!0);ve&&(!Nt||r!==be||a!==we)&&(Nt&&Le(),Nt=setInterval(function(){var u=ot(document.elementFromPoint(r,a),!0);u!==s&&(s=u,Jt()),ye(e,i.options,u,n)},10),be=r,we=a)}else{if(!this.options.bubbleScroll||ot(l,!0)===Z()){Jt();return}ye(e,this.options,ot(l,!1),!1)}}},L(o,{pluginName:"scroll",initializeByDefault:!0})}function Jt(){P.forEach(function(o){clearInterval(o.pid)}),P=[]}function Le(){clearInterval(Nt)}var ye=xe(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;me!==e&&(me=e,Jt(),It=t.scroll,d=t.scrollFn,It===!0&&(It=ot(e,!0)));var f=0,g=It;do{var E=g,b=C(E),S=b.top,M=b.bottom,z=b.left,x=b.right,H=b.width,D=b.height,Q=void 0,J=void 0,dt=E.scrollWidth,Ft=E.scrollHeight,K=h(E),Rt=E.scrollLeft,at=E.scrollTop;E===s?(Q=H<dt&&(K.overflowX==="auto"||K.overflowX==="scroll"||K.overflowX==="visible"),J=D<Ft&&(K.overflowY==="auto"||K.overflowY==="scroll"||K.overflowY==="visible")):(Q=H<dt&&(K.overflowX==="auto"||K.overflowX==="scroll"),J=D<Ft&&(K.overflowY==="auto"||K.overflowY==="scroll"));var kt=Q&&(Math.abs(x-i)<=a&&Rt+H<dt)-(Math.abs(z-i)<=a&&!!Rt),nt=J&&(Math.abs(M-r)<=a&&at+D<Ft)-(Math.abs(S-r)<=a&&!!at);if(!P[f])for(var ht=0;ht<=f;ht++)P[ht]||(P[ht]={});(P[f].vx!=kt||P[f].vy!=nt||P[f].el!==E)&&(P[f].el=E,P[f].vx=kt,P[f].vy=nt,clearInterval(P[f].pid),(kt!=0||nt!=0)&&(u=!0,P[f].pid=setInterval(function(){n&&this.layer===0&&p.active._onTouchMove(Qt);var Xt=P[this.layer].vy?P[this.layer].vy*l:0,lt=P[this.layer].vx?P[this.layer].vx*l:0;typeof d=="function"&&d.call(p.dragged.parentNode[R],lt,Xt,o,Qt,P[this.layer].el)!=="continue"||Fe(P[this.layer].el,lt,Xt)}.bind({layer:f}),24))),f++}while(t.bubbleScroll&&g!==s&&(g=ot(g,!1)));ve=u}},30),je=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 Ee(){}Ee.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=pt(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:je},L(Ee,{pluginName:"revertOnSpill"});function Se(){}Se.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:je},L(Se,{pluginName:"removeOnSpill"});var j;function Cn(){function o(){this.defaults={swapClass:"sortable-swap-highlight"}}return o.prototype={dragStart:function(e){var n=e.dragEl;j=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=j;r(i)!==!1?(T(i,d.swapClass,!0),j=i):j=null,f&&f!==j&&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;j&&T(j,l.swapClass,!1),j&&(l.swap||i&&i.options.swap)&&r!==j&&(a.captureAnimationState(),a!==n&&n.captureAnimationState(),On(r,j),a.animateAll(),a!==n&&n.animateAll())},nulling:function(){j=null}},L(o,{pluginName:"swap",eventProperties:function(){return{swapItem:j}}})}function On(o,t){var e=o.parentNode,n=t.parentNode,i,r;!e||!n||e.isEqualNode(t)||n.isEqualNode(o)||(i=I(o),r=I(t),e.isEqualNode(n)&&i<r&&r++,e.insertBefore(t,e.children[i]),n.insertBefore(o,n.children[r]))}var m=[],W=[],Pt,$,Mt=!1,B=!1,wt=!1,_,xt,te;function Tn(){function o(t){for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?y(document,"pointerup",this._deselectMultiDrag):(y(document,"mouseup",this._deselectMultiDrag),y(document,"touchend",this._deselectMultiDrag))),y(document,"keydown",this._checkKeyDown),y(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(i,r){var a="";m.length&&$===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(le(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&&$===n&&(ze(!0,i),r("clone"),a())},showClone:function(e){var n=e.cloneNowShown,i=e.rootEl,r=e.cancel;!this.isMultiDrag||(ze(!1,i),W.forEach(function(a){h(a,"display","")}),n(),te=!1,r())},hideClone:function(e){var n=this,i=e.sortable,r=e.cloneNowHidden,a=e.cancel;!this.isMultiDrag||(W.forEach(function(l){h(l,"display","none"),n.options.removeCloneOnHide&&l.parentNode&&l.parentNode.removeChild(l)}),r(),te=!0,a())},dragStartGlobal:function(e){var n=e.sortable;!this.isMultiDrag&&$&&$.multiDrag._deselectMultiDrag(),m.forEach(function(i){i.sortableIndex=I(i)}),m=m.sort(function(i,r){return i.sortableIndex-r.sortableIndex}),wt=!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=C(_,!1,!0,!0);m.forEach(function(a){a!==_&&Re(a,r)}),B=!0,Mt=!0}i.animateAll(function(){B=!1,Mt=!1,n.options.animation&&m.forEach(function(a){se(a)}),n.options.sort&&ee()})}},dragOver:function(e){var n=e.target,i=e.completed,r=e.cancel;B&&~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:B?C(l):a}),se(l),l.fromRect=a,n.removeAnimationState(l)}),B=!1,An(!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(),Mt=!1,u.animation&&m.length>1&&(B||!i&&!a.options.sort&&!s)){var d=C(_,!1,!0,!0);m.forEach(function(g){g!==_&&(Re(g,d),l.appendChild(g))}),B=!0}if(!i)if(B||ee(),m.length>1){var f=te;a._showClone(n),a.options.animation&&!te&&f&&W.forEach(function(g){a.addAnimationState({target:g,rect:xt}),g.fromRect=xt,g.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){xt=L({},n);var a=st(_,!0);xt.top-=a.f,xt.left-=a.e}},dragOverAnimationComplete:function(){B&&(B=!1,ee())},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,g=r.children;if(!wt)if(f.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),T(_,f.selectedClass,!~m.indexOf(_)),~m.indexOf(_))m.splice(m.indexOf(_),1),Pt=null,_t({sortable:a,rootEl:i,name:"deselect",targetEl:_,originalEvent:n});else{if(m.push(_),_t({sortable:a,rootEl:i,name:"select",targetEl:_,originalEvent:n}),n.shiftKey&&Pt&&a.el.contains(Pt)){var E=I(Pt),b=I(_);if(~E&&~b&&E!==b){var S,M;for(b>E?(M=E,S=b):(M=b,S=E+1);M<S;M++)~m.indexOf(g[M])||(T(g[M],f.selectedClass,!0),m.push(g[M]),_t({sortable:a,rootEl:i,name:"select",targetEl:g[M],originalEvent:n}))}}else Pt=_;$=d}if(wt&&this.isMultiDrag){if(B=!1,(r[R].options.sort||r!==i)&&m.length>1){var z=C(_),x=I(_,":not(."+this.options.selectedClass+")");if(!Mt&&f.animation&&(_.thisAnimationDuration=null),d.captureAnimationState(),!Mt&&(f.animation&&(_.fromRect=z,m.forEach(function(D){if(D.thisAnimationDuration=null,D!==_){var Q=B?C(D):z;D.fromRect=Q,d.addAnimationState({target:D,rect:Q})}})),ee(),m.forEach(function(D){g[x]?r.insertBefore(D,g[x]):r.appendChild(D),x++}),s===I(_))){var H=!1;m.forEach(function(D){if(D.sortableIndex!==I(D)){H=!0;return}}),H&&l("update")}m.forEach(function(D){se(D)}),d.animateAll()}$=d}(i===r||u&&u.lastPutMode!=="clone")&&W.forEach(function(D){D.parentNode&&D.parentNode.removeChild(D)})}},nullingGlobal:function(){this.isMultiDrag=wt=!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 wt!="undefined"&&wt)&&$===this.sortable&&!(e&&U(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(),_t({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:n,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},L(o,{pluginName:"multiDrag",utils:{select:function(e){var n=e.parentNode[R];!n||!n.options.multiDrag||~m.indexOf(e)||($&&$!==n&&($.multiDrag._deselectMultiDrag(),$=n),T(e,n.options.selectedClass,!0),m.push(e))},deselect:function(e){var n=e.parentNode[R],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;B&&r!==_?a=-1:B?a=I(r,":not(."+e.options.selectedClass+")"):a=I(r),i.push({multiDragElement:r,index:a})}),{items:Ze(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 An(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 ze(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 ee(){m.forEach(function(o){o!==_&&o.parentNode&&o.parentNode.removeChild(o)})}p.mount(new _n),p.mount(Se,Ee),oe.default=p}}]);