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