mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
8 lines
46 KiB
JavaScript
8 lines
46 KiB
JavaScript
import{S as _t,a as sn}from"./sortable.esm-e674cde8.js";import{b as ye,an as un,d as Rt,L as wt,n as Xt,r as Ke,o as cn,c as dn,w as A,e as Ze,h as L,g as yt,f as W,u as Fe,ao as fn,E as Me,j as Et,k as hn,F as pn,p as mn,q as gn,_ as vn}from"./index-17f10454.js";import{u as Dt}from"./app-ae41b391.js";import{u as bn}from"./hooks-d9c4064e.js";/**!
|
|
* Sortable 1.14.0
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*/function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function $(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?St(Object(n),!0).forEach(function(o){_n(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Ve(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ve=function(e){return typeof e}:Ve=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ve(t)}function _n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Z(){return Z=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Z.apply(this,arguments)}function wn(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}function yn(t,e){if(t==null)return{};var n=wn(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var En="1.14.0";function K(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Q=K(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ae=K(/Edge/i),Ct=K(/firefox/i),Ce=K(/safari/i)&&!K(/chrome/i)&&!K(/android/i),Vt=K(/iP(ad|od|hone)/i),Dn=K(/chrome/i)&&K(/android/i),Bt={capture:!1,passive:!1};function w(t,e,n){t.addEventListener(e,n,!Q&&Bt)}function b(t,e,n){t.removeEventListener(e,n,!Q&&Bt)}function We(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Sn(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function G(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&We(t,e):We(t,e))||o&&t===n)return t;if(t===n)break}while(t=Sn(t))}return null}var xt=/\s+/g;function M(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(xt," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(xt," ")}}function h(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function pe(t,e){var n="";if(typeof t=="string")n=t;else do{var o=h(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function Yt(t,e,n){if(t){var o=t.getElementsByTagName(e),r=0,i=o.length;if(n)for(;r<i;r++)n(o[r],r);return o}return[]}function z(){var t=document.scrollingElement;return t||document.documentElement}function x(t,e,n,o,r){if(!(!t.getBoundingClientRect&&t!==window)){var i,a,l,s,u,d,f;if(t!==window&&t.parentNode&&t!==z()?(i=t.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,u=i.right,d=i.height,f=i.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(e||n)&&t!==window&&(r=r||t.parentNode,!Q))do if(r&&r.getBoundingClientRect&&(h(r,"transform")!=="none"||n&&h(r,"position")!=="static")){var m=r.getBoundingClientRect();a-=m.top+parseInt(h(r,"border-top-width")),l-=m.left+parseInt(h(r,"border-left-width")),s=a+i.height,u=l+i.width;break}while(r=r.parentNode);if(o&&t!==window){var _=pe(r||t),v=_&&_.a,y=_&&_.d;_&&(a/=y,l/=v,f/=v,d/=y,s=a+d,u=l+f)}return{top:a,left:l,bottom:s,right:u,width:f,height:d}}}function Tt(t,e,n){for(var o=oe(t,!0),r=x(t)[e];o;){var i=x(o)[n],a=void 0;if(n==="top"||n==="left"?a=r>=i:a=r<=i,!a)return o;if(o===z())break;o=oe(o,!1)}return!1}function me(t,e,n,o){for(var r=0,i=0,a=t.children;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==p.ghost&&(o||a[i]!==p.dragged)&&G(a[i],n.draggable,t,!1)){if(r===e)return a[i];r++}i++}return null}function pt(t,e){for(var n=t.lastElementChild;n&&(n===p.ghost||h(n,"display")==="none"||e&&!We(n,e));)n=n.previousElementSibling;return n||null}function X(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==p.clone&&(!e||We(t,e))&&n++;return n}function It(t){var e=0,n=0,o=z();if(t)do{var r=pe(t),i=r.a,a=r.d;e+=t.scrollLeft*i,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function Cn(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function oe(t,e){if(!t||!t.getBoundingClientRect)return z();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=h(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return z();if(o||e)return n;o=!0}}while(n=n.parentNode);return z()}function xn(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Qe(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var xe;function Ht(t,e){return function(){if(!xe){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),xe=setTimeout(function(){xe=void 0},e)}}}function Tn(){clearTimeout(xe),xe=void 0}function jt(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Wt(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}var R="Sortable"+new Date().getTime();function In(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!(h(r,"display")==="none"||r===p.ghost)){t.push({target:r,rect:x(r)});var i=$({},t[t.length-1].rect);if(r.thisAnimationDuration){var a=pe(r,!0);a&&(i.top-=a.f,i.left-=a.e)}r.fromRect=i}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(Cn(t,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var i=!1,a=0;t.forEach(function(l){var s=0,u=l.target,d=u.fromRect,f=x(u),m=u.prevFromRect,_=u.prevToRect,v=l.rect,y=pe(u,!0);y&&(f.top-=y.f,f.left-=y.e),u.toRect=f,u.thisAnimationDuration&&Qe(m,f)&&!Qe(d,f)&&(v.top-f.top)/(v.left-f.left)===(d.top-f.top)/(d.left-f.left)&&(s=An(v,m,_,r.options)),Qe(f,d)||(u.prevFromRect=d,u.prevToRect=f,s||(s=r.options.animation),r.animate(u,v,f,s)),s&&(i=!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(e),i?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,r,i,a){if(a){h(o,"transition",""),h(o,"transform","");var l=pe(this.el),s=l&&l.a,u=l&&l.d,d=(r.left-i.left)/(s||1),f=(r.top-i.top)/(u||1);o.animatingX=!!d,o.animatingY=!!f,h(o,"transform","translate3d("+d+"px,"+f+"px,0)"),this.forRepaintDummy=On(o),h(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),h(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){h(o,"transition",""),h(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function On(t){return t.offsetWidth}function An(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var ce=[],Je={initializeByDefault:!0},Pe={mount:function(e){for(var n in Je)Je.hasOwnProperty(n)&&!(n in e)&&(e[n]=Je[n]);ce.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),ce.push(e)},pluginEvent:function(e,n,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=e+"Global";ce.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][i]&&n[a.pluginName][i]($({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e]($({sortable:n},o)))})},initializePlugins:function(e,n,o,r){ce.forEach(function(l){var s=l.pluginName;if(!(!e.options[s]&&!l.initializeByDefault)){var u=new l(e,n,e.options);u.sortable=e,u.options=e.options,e[s]=u,Z(o,u.defaults)}});for(var i in e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);typeof a<"u"&&(e.options[i]=a)}},getEventProperties:function(e,n){var o={};return ce.forEach(function(r){typeof r.eventProperties=="function"&&Z(o,r.eventProperties.call(n[r.pluginName],e))}),o},modifyOption:function(e,n,o){var r;return ce.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(r=i.optionListeners[n].call(e[i.pluginName],o))}),r}};function Pn(t){var e=t.sortable,n=t.rootEl,o=t.name,r=t.targetEl,i=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,u=t.newIndex,d=t.oldDraggableIndex,f=t.newDraggableIndex,m=t.originalEvent,_=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[R],!!e){var y,V=e.options,U="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!Q&&!Ae?y=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(o,!0,!0)),y.to=a||n,y.from=l||n,y.item=r||n,y.clone=i,y.oldIndex=s,y.newIndex=u,y.oldDraggableIndex=d,y.newDraggableIndex=f,y.originalEvent=m,y.pullMode=_?_.lastPutMode:void 0;var O=$($({},v),Pe.getEventProperties(o,e));for(var B in O)y[B]=O[B];n&&n.dispatchEvent(y),V[U]&&V[U].call(e,y)}}var Nn=["evt"],N=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=yn(o,Nn);Pe.pluginEvent.bind(p)(e,n,$({dragEl:c,parentEl:D,ghostEl:g,rootEl:E,nextEl:ue,lastDownEl:Be,cloneEl:S,cloneHidden:ne,dragStarted:Ee,putSortable:T,activeSortable:p.active,originalEvent:r,oldIndex:he,oldDraggableIndex:Te,newIndex:k,newDraggableIndex:te,hideGhostForTarget:Ut,unhideGhostForTarget:qt,cloneNowHidden:function(){ne=!0},cloneNowShown:function(){ne=!1},dispatchSortableEvent:function(l){P({sortable:n,name:l,originalEvent:r})}},i))};function P(t){Pn($({putSortable:T,cloneEl:S,targetEl:c,rootEl:E,oldIndex:he,oldDraggableIndex:Te,newIndex:k,newDraggableIndex:te},t))}var c,D,g,E,ue,Be,S,ne,he,k,Te,te,ke,T,fe=!1,Ge=!1,ze=[],le,Y,et,tt,Ot,At,Ee,de,Ie,Oe=!1,Le=!1,Ye,I,nt=[],ut=!1,$e=[],qe=typeof document<"u",Re=Vt,Pt=Ae||Q?"cssFloat":"float",Fn=qe&&!Dn&&!Vt&&"draggable"in document.createElement("div"),Gt=function(){if(qe){if(Q)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),zt=function(e,n){var o=h(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=me(e,0,n),a=me(e,1,n),l=i&&h(i),s=a&&h(a),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+x(i).width,d=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+x(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===f)?"vertical":"horizontal"}return i&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=r&&o[Pt]==="none"||a&&o[Pt]==="none"&&u+d>r)?"vertical":"horizontal"},Mn=function(e,n,o){var r=o?e.left:e.top,i=o?e.right:e.bottom,a=o?e.width:e.height,l=o?n.left:n.top,s=o?n.right:n.bottom,u=o?n.width:n.height;return r===l||i===s||r+a/2===l+u/2},kn=function(e,n){var o;return ze.some(function(r){var i=r[R].options.emptyInsertThreshold;if(!(!i||pt(r))){var a=x(r),l=e>=a.left-i&&e<=a.right+i,s=n>=a.top-i&&n<=a.bottom+i;if(l&&s)return o=r}}),o},$t=function(e){function n(i,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(i==null&&(a||f))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return n(i(l,s,u,d),a)(l,s,u,d);var m=(a?l:s).options.group.name;return i===!0||typeof i=="string"&&i===m||i.join&&i.indexOf(m)>-1}}var o={},r=e.group;(!r||Ve(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=n(r.pull,!0),o.checkPut=n(r.put),o.revertClone=r.revertClone,e.group=o},Ut=function(){!Gt&&g&&h(g,"display","none")},qt=function(){!Gt&&g&&h(g,"display","")};qe&&document.addEventListener("click",function(t){if(Ge)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ge=!1,!1},!0);var se=function(e){if(c){e=e.touches?e.touches[0]:e;var n=kn(e.clientX,e.clientY);if(n){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[R]._onDragOver(o)}}},Ln=function(e){c&&c.parentNode[R]._isOutsideThisEl(e.target)};function p(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Z({},e),t[R]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zt(t,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&&!Ce,emptyInsertThreshold:5};Pe.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);$t(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:Fn,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?w(t,"pointerdown",this._onTapStart):(w(t,"mousedown",this._onTapStart),w(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(t,"dragover",this),w(t,"dragenter",this)),ze.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Z(this,In())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(de=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,c):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,r=this.options,i=r.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(l||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,d=r.filter;if(Wn(o),!c&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Ce&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=G(s,r.draggable,o,!1),!(s&&s.animated)&&Be!==s)){if(he=X(s),Te=X(s,r.draggable),typeof d=="function"){if(d.call(this,e,s,this)){P({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:o,fromEl:o}),N("filter",n,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(f){if(f=G(u,f.trim(),o,!1),f)return P({sortable:n,rootEl:f,name:"filter",targetEl:s,fromEl:o,toEl:o}),N("filter",n,{evt:e}),!0}),d)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!G(u,r.handle,o,!1)||this._prepareDragStart(e,l,s)}}},_prepareDragStart:function(e,n,o){var r=this,i=r.el,a=r.options,l=i.ownerDocument,s;if(o&&!c&&o.parentNode===i){var u=x(o);if(E=i,c=o,D=c.parentNode,ue=c.nextSibling,Be=o,ke=a.group,p.dragged=c,le={target:c,clientX:(n||e).clientX,clientY:(n||e).clientY},Ot=le.clientX-u.left,At=le.clientY-u.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,c.style["will-change"]="all",s=function(){if(N("delayEnded",r,{evt:e}),p.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Ct&&r.nativeDraggable&&(c.draggable=!0),r._triggerDragStart(e,n),P({sortable:r,name:"choose",originalEvent:e}),M(c,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){Yt(c,d.trim(),ot)}),w(l,"dragover",se),w(l,"mousemove",se),w(l,"touchmove",se),w(l,"mouseup",r._onDrop),w(l,"touchend",r._onDrop),w(l,"touchcancel",r._onDrop),Ct&&this.nativeDraggable&&(this.options.touchStartThreshold=4,c.draggable=!0),N("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Ae||Q))){if(p.eventCanceled){this._onDrop();return}w(l,"mouseup",r._disableDelayedDrag),w(l,"touchend",r._disableDelayedDrag),w(l,"touchcancel",r._disableDelayedDrag),w(l,"mousemove",r._delayedDragTouchMoveHandler),w(l,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&w(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;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(){c&&ot(c),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):n?w(document,"touchmove",this._onTouchMove):w(document,"mousemove",this._onTouchMove):(w(c,"dragend",this),w(E,"dragstart",this._onDragStart));try{document.selection?He(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(fe=!1,E&&c){N("dragStarted",this,{evt:n}),this.nativeDraggable&&w(document,"dragover",Ln);var o=this.options;!e&&M(c,o.dragClass,!1),M(c,o.ghostClass,!0),p.active=this,e&&this._appendGhost(),P({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Y){this._lastX=Y.clientX,this._lastY=Y.clientY,Ut();for(var e=document.elementFromPoint(Y.clientX,Y.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Y.clientX,Y.clientY),e!==n);)n=e;if(c.parentNode[R]._isOutsideThisEl(e),n)do{if(n[R]){var o=void 0;if(o=n[R]._onDragOver({clientX:Y.clientX,clientY:Y.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=n.parentNode);qt()}},_onTouchMove:function(e){if(le){var n=this.options,o=n.fallbackTolerance,r=n.fallbackOffset,i=e.touches?e.touches[0]:e,a=g&&pe(g,!0),l=g&&a&&a.a,s=g&&a&&a.d,u=Re&&I&&It(I),d=(i.clientX-le.clientX+r.x)/(l||1)+(u?u[0]-nt[0]:0)/(l||1),f=(i.clientY-le.clientY+r.y)/(s||1)+(u?u[1]-nt[1]:0)/(s||1);if(!p.active&&!fe){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(g){a?(a.e+=d-(et||0),a.f+=f-(tt||0)):a={a:1,b:0,c:0,d:1,e:d,f};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),et=d,tt=f,Y=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!g){var e=this.options.fallbackOnBody?document.body:E,n=x(c,!0,Re,!0,e),o=this.options;if(Re){for(I=e;h(I,"position")==="static"&&h(I,"transform")==="none"&&I!==document;)I=I.parentNode;I!==document.body&&I!==document.documentElement?(I===document&&(I=z()),n.top+=I.scrollTop,n.left+=I.scrollLeft):I=z(),nt=It(I)}g=c.cloneNode(!0),M(g,o.ghostClass,!1),M(g,o.fallbackClass,!0),M(g,o.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",Re?"absolute":"fixed"),h(g,"zIndex","100000"),h(g,"pointerEvents","none"),p.ghost=g,e.appendChild(g),h(g,"transform-origin",Ot/parseInt(g.style.width)*100+"% "+At/parseInt(g.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,r=e.dataTransfer,i=o.options;if(N("dragStart",this,{evt:e}),p.eventCanceled){this._onDrop();return}N("setupClone",this),p.eventCanceled||(S=Wt(c),S.draggable=!1,S.style["will-change"]="",this._hideClone(),M(S,this.options.chosenClass,!1),p.clone=S),o.cloneId=He(function(){N("clone",o),!p.eventCanceled&&(o.options.removeCloneOnHide||E.insertBefore(S,c),o._hideClone(),P({sortable:o,name:"clone"}))}),!n&&M(c,i.dragClass,!0),n?(Ge=!0,o._loopId=setInterval(o._emulateDragOver,50)):(b(document,"mouseup",o._onDrop),b(document,"touchend",o._onDrop),b(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(o,r,c)),w(document,"drop",o),h(c,"transform","translateZ(0)")),fe=!0,o._dragStartId=He(o._dragStarted.bind(o,n,e)),w(document,"selectstart",o),Ee=!0,Ce&&h(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,r,i,a,l=this.options,s=l.group,u=p.active,d=ke===s,f=l.sort,m=T||u,_,v=this,y=!1;if(ut)return;function V(we,an){N(we,v,$({evt:e,isOwner:d,axis:_?"vertical":"horizontal",revert:a,dragRect:r,targetRect:i,canSort:f,fromSortable:m,target:o,completed:O,onMove:function(bt,ln){return Xe(E,n,c,r,bt,x(bt),e,ln)},changed:B},an))}function U(){V("dragOverAnimationCapture"),v.captureAnimationState(),v!==m&&m.captureAnimationState()}function O(we){return V("dragOverCompleted",{insertion:we}),we&&(d?u._hideClone():u._showClone(v),v!==m&&(M(c,T?T.options.ghostClass:u.options.ghostClass,!1),M(c,l.ghostClass,!0)),T!==v&&v!==p.active?T=v:v===p.active&&T&&(T=null),m===v&&(v._ignoreWhileAnimating=o),v.animateAll(function(){V("dragOverAnimationComplete"),v._ignoreWhileAnimating=null}),v!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(o===c&&!c.animated||o===n&&!o.animated)&&(de=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(c.parentNode[R]._isOutsideThisEl(e.target),!we&&se(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),y=!0}function B(){k=X(c),te=X(c,l.draggable),P({sortable:v,name:"change",toEl:n,newIndex:k,newDraggableIndex:te,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=G(o,l.draggable,n,!0),V("dragOver"),p.eventCanceled)return y;if(c.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||v._ignoreWhileAnimating===o)return O(!1);if(Ge=!1,u&&!l.disabled&&(d?f||(a=D!==E):T===this||(this.lastPutMode=ke.checkPull(this,u,c,e))&&s.checkPut(this,u,c,e))){if(_=this._getDirection(e,o)==="vertical",r=x(c),V("dragOverValid"),p.eventCanceled)return y;if(a)return D=E,U(),this._hideClone(),V("revert"),p.eventCanceled||(ue?E.insertBefore(c,ue):E.appendChild(c)),O(!0);var H=pt(n,l.draggable);if(!H||Bn(e,_,this)&&!H.animated){if(H===c)return O(!1);if(H&&n===e.target&&(o=H),o&&(i=x(o)),Xe(E,n,c,r,o,i,e,!!o)!==!1)return U(),n.appendChild(c),D=n,B(),O(!0)}else if(H&&Vn(e,_,this)){var re=me(n,0,l,!0);if(re===c)return O(!1);if(o=re,i=x(o),Xe(E,n,c,r,o,i,e,!1)!==!1)return U(),n.insertBefore(c,re),D=n,B(),O(!0)}else if(o.parentNode===n){i=x(o);var j=0,ie,ge=c.parentNode!==n,F=!Mn(c.animated&&c.toRect||r,o.animated&&o.toRect||i,_),ve=_?"top":"left",J=Tt(o,"top","top")||Tt(c,"top","top"),be=J?J.scrollTop:void 0;de!==o&&(ie=i[ve],Oe=!1,Le=!F&&l.invertSwap||ge),j=Yn(e,o,i,_,F?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Le,de===o);var q;if(j!==0){var ae=X(c);do ae-=j,q=D.children[ae];while(q&&(h(q,"display")==="none"||q===g))}if(j===0||q===o)return O(!1);de=o,Ie=j;var _e=o.nextElementSibling,ee=!1;ee=j===1;var Ne=Xe(E,n,c,r,o,i,e,ee);if(Ne!==!1)return(Ne===1||Ne===-1)&&(ee=Ne===1),ut=!0,setTimeout(Xn,30),U(),ee&&!_e?n.appendChild(c):o.parentNode.insertBefore(c,ee?_e:o),J&&jt(J,0,be-J.scrollTop),D=c.parentNode,ie!==void 0&&!Le&&(Ye=Math.abs(ie-x(o)[ve])),B(),O(!0)}if(n.contains(c))return O(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){b(document,"mousemove",this._onTouchMove),b(document,"touchmove",this._onTouchMove),b(document,"pointermove",this._onTouchMove),b(document,"dragover",se),b(document,"mousemove",se),b(document,"touchmove",se)},_offUpEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._onDrop),b(e,"touchend",this._onDrop),b(e,"pointerup",this._onDrop),b(e,"touchcancel",this._onDrop),b(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(k=X(c),te=X(c,o.draggable),N("drop",this,{evt:e}),D=c&&c.parentNode,k=X(c),te=X(c,o.draggable),p.eventCanceled){this._nulling();return}fe=!1,Le=!1,Oe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ct(this.cloneId),ct(this._dragStartId),this.nativeDraggable&&(b(document,"drop",this),b(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ce&&h(document.body,"user-select",""),h(c,"transform",""),e&&(Ee&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),g&&g.parentNode&&g.parentNode.removeChild(g),(E===D||T&&T.lastPutMode!=="clone")&&S&&S.parentNode&&S.parentNode.removeChild(S),c&&(this.nativeDraggable&&b(c,"dragend",this),ot(c),c.style["will-change"]="",Ee&&!fe&&M(c,T?T.options.ghostClass:this.options.ghostClass,!1),M(c,this.options.chosenClass,!1),P({sortable:this,name:"unchoose",toEl:D,newIndex:null,newDraggableIndex:null,originalEvent:e}),E!==D?(k>=0&&(P({rootEl:D,name:"add",toEl:D,fromEl:E,originalEvent:e}),P({sortable:this,name:"remove",toEl:D,originalEvent:e}),P({rootEl:D,name:"sort",toEl:D,fromEl:E,originalEvent:e}),P({sortable:this,name:"sort",toEl:D,originalEvent:e})),T&&T.save()):k!==he&&k>=0&&(P({sortable:this,name:"update",toEl:D,originalEvent:e}),P({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((k==null||k===-1)&&(k=he,te=Te),P({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){N("nulling",this),E=c=D=g=ue=S=Be=ne=le=Y=Ee=k=te=he=Te=de=Ie=T=ke=p.dragged=p.ghost=p.clone=p.active=null,$e.forEach(function(e){e.checked=!0}),$e.length=et=tt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":c&&(this._onDragOver(e),Rn(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,r=0,i=o.length,a=this.options;r<i;r++)n=o[r],G(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||jn(n));return e},sort:function(e,n){var o={},r=this.el;this.toArray().forEach(function(i,a){var l=r.children[a];G(l,this.options.draggable,r,!1)&&(o[i]=l)},this),n&&this.captureAnimationState(),e.forEach(function(i){o[i]&&(r.removeChild(o[i]),r.appendChild(o[i]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return G(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var r=Pe.modifyOption(this,e,n);typeof r<"u"?o[e]=r:o[e]=n,e==="group"&&$t(o)},destroy:function(){N("destroy",this);var e=this.el;e[R]=null,b(e,"mousedown",this._onTapStart),b(e,"touchstart",this._onTapStart),b(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(b(e,"dragover",this),b(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),ze.splice(ze.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ne){if(N("hideClone",this),p.eventCanceled)return;h(S,"display","none"),this.options.removeCloneOnHide&&S.parentNode&&S.parentNode.removeChild(S),ne=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ne){if(N("showClone",this),p.eventCanceled)return;c.parentNode==E&&!this.options.group.revertClone?E.insertBefore(S,c):ue?E.insertBefore(S,ue):E.appendChild(S),this.options.group.revertClone&&this.animate(c,S),h(S,"display",""),ne=!1}}};function Rn(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Xe(t,e,n,o,r,i,a,l){var s,u=t[R],d=u.options.onMove,f;return window.CustomEvent&&!Q&&!Ae?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=r||e,s.relatedRect=i||x(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),d&&(f=d.call(u,s,a)),f}function ot(t){t.draggable=!1}function Xn(){ut=!1}function Vn(t,e,n){var o=x(me(n.el,0,n.options,!0)),r=10;return e?t.clientX<o.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<o.top-r||t.clientY<o.bottom&&t.clientX<o.left}function Bn(t,e,n){var o=x(pt(n.el,n.options.draggable)),r=10;return e?t.clientX>o.right+r||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+r}function Yn(t,e,n,o,r,i,a,l){var s=o?t.clientY:t.clientX,u=o?n.height:n.width,d=o?n.top:n.left,f=o?n.bottom:n.right,m=!1;if(!a){if(l&&Ye<u*r){if(!Oe&&(Ie===1?s>d+u*i/2:s<f-u*i/2)&&(Oe=!0),Oe)m=!0;else if(Ie===1?s<d+Ye:s>f-Ye)return-Ie}else if(s>d+u*(1-r)/2&&s<f-u*(1-r)/2)return Hn(e)}return m=m||a,m&&(s<d+u*i/2||s>f-u*i/2)?s>d+u/2?1:-1:0}function Hn(t){return X(c)<X(t)?1:-1}function jn(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Wn(t){$e.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&$e.push(o)}}function He(t){return setTimeout(t,0)}function ct(t){return clearTimeout(t)}qe&&w(document,"touchmove",function(t){(p.active||fe)&&t.cancelable&&t.preventDefault()});p.utils={on:w,off:b,css:h,find:Yt,is:function(e,n){return!!G(e,n,e,!1)},extend:xn,throttle:Ht,closest:G,toggleClass:M,clone:Wt,index:X,nextTick:He,cancelNextTick:ct,detectDirection:zt,getChild:me};p.get=function(t){return t[R]};p.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(p.utils=$($({},p.utils),o.utils)),Pe.mount(o)})};p.create=function(t,e){return new p(t,e)};p.version=En;var C=[],De,dt,ft=!1,rt,it,Ue,Se;function Gn(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):this.options.supportPointer?w(document,"pointermove",this._handleFallbackAutoScroll):o.touches?w(document,"touchmove",this._handleFallbackAutoScroll):w(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?b(document,"dragover",this._handleAutoScroll):(b(document,"pointermove",this._handleFallbackAutoScroll),b(document,"touchmove",this._handleFallbackAutoScroll),b(document,"mousemove",this._handleFallbackAutoScroll)),Nt(),je(),Tn()},nulling:function(){Ue=dt=De=ft=Se=rt=it=null,C.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var r=this,i=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(i,a);if(Ue=n,o||this.options.forceAutoScrollFallback||Ae||Q||Ce){at(n,this.options,l,o);var s=oe(l,!0);ft&&(!Se||i!==rt||a!==it)&&(Se&&Nt(),Se=setInterval(function(){var u=oe(document.elementFromPoint(i,a),!0);u!==s&&(s=u,je()),at(n,r.options,u,o)},10),rt=i,it=a)}else{if(!this.options.bubbleScroll||oe(l,!0)===z()){je();return}at(n,this.options,oe(l,!1),!1)}}},Z(t,{pluginName:"scroll",initializeByDefault:!0})}function je(){C.forEach(function(t){clearInterval(t.pid)}),C=[]}function Nt(){clearInterval(Se)}var at=Ht(function(t,e,n,o){if(e.scroll){var r=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,s=z(),u=!1,d;dt!==n&&(dt=n,je(),De=e.scroll,d=e.scrollFn,De===!0&&(De=oe(n,!0)));var f=0,m=De;do{var _=m,v=x(_),y=v.top,V=v.bottom,U=v.left,O=v.right,B=v.width,H=v.height,re=void 0,j=void 0,ie=_.scrollWidth,ge=_.scrollHeight,F=h(_),ve=_.scrollLeft,J=_.scrollTop;_===s?(re=B<ie&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),j=H<ge&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(re=B<ie&&(F.overflowX==="auto"||F.overflowX==="scroll"),j=H<ge&&(F.overflowY==="auto"||F.overflowY==="scroll"));var be=re&&(Math.abs(O-r)<=a&&ve+B<ie)-(Math.abs(U-r)<=a&&!!ve),q=j&&(Math.abs(V-i)<=a&&J+H<ge)-(Math.abs(y-i)<=a&&!!J);if(!C[f])for(var ae=0;ae<=f;ae++)C[ae]||(C[ae]={});(C[f].vx!=be||C[f].vy!=q||C[f].el!==_)&&(C[f].el=_,C[f].vx=be,C[f].vy=q,clearInterval(C[f].pid),(be!=0||q!=0)&&(u=!0,C[f].pid=setInterval(function(){o&&this.layer===0&&p.active._onTouchMove(Ue);var _e=C[this.layer].vy?C[this.layer].vy*l:0,ee=C[this.layer].vx?C[this.layer].vx*l:0;typeof d=="function"&&d.call(p.dragged.parentNode[R],ee,_e,t,Ue,C[this.layer].el)!=="continue"||jt(C[this.layer].el,ee,_e)}.bind({layer:f}),24))),f++}while(e.bubbleScroll&&m!==s&&(m=oe(m,!1)));ft=u}},30),Kt=function(e){var n=e.originalEvent,o=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(n){var u=o||i;l();var d=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,f=document.elementFromPoint(d.clientX,d.clientY);s(),u&&!u.el.contains(f)&&(a("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function mt(){}mt.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=me(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(n,r):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:Kt};Z(mt,{pluginName:"revertOnSpill"});function gt(){}gt.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable,r=o||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:Kt};Z(gt,{pluginName:"removeOnSpill"});p.mount(new Gn);p.mount(gt,mt);function lt(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Ft(t,e,n){const o=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}function zn(){return typeof window<"u"?window.console:global.console}const $n=zn();function Un(t){const e=Object.create(null);return function(o){return e[o]||(e[o]=t(o))}}const qn=/-(\w)/g,Kn=Un(t=>t.replace(qn,(e,n)=>n.toUpperCase())),Zt=["Start","Add","Remove","Update","End"],Qt=["Choose","Unchoose","Sort","Filter","Clone"],Jt=["Move"],Zn=[Jt,Zt,Qt].flatMap(t=>t).map(t=>`on${t}`),ht={manage:Jt,manageAndEmit:Zt,emit:Qt};function Qn(t){return Zn.indexOf(t)!==-1}const Jn=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function eo(t){return Jn.includes(t)}function to(t){return["transition-group","TransitionGroup"].includes(t)}function en(t){return["id","class","role","style"].includes(t)||t.startsWith("data-")||t.startsWith("aria-")||t.startsWith("on")}function tn(t){return t.reduce((e,[n,o])=>(e[n]=o,e),{})}function no({$attrs:t,componentData:e={}}){return{...tn(Object.entries(t).filter(([o,r])=>en(o))),...e}}function oo({$attrs:t,callBackBuilder:e}){const n=tn(nn(t));Object.entries(e).forEach(([r,i])=>{ht[r].forEach(a=>{n[`on${a}`]=i(a)})});const o=`[data-draggable]${n.draggable||""}`;return{...n,draggable:o}}function nn(t){return Object.entries(t).filter(([e,n])=>!en(e)).map(([e,n])=>[Kn(e),n]).filter(([e,n])=>!Qn(e))}const Mt=({el:t})=>t,ro=(t,e)=>t.__draggable_context=e,kt=t=>t.__draggable_context;class io{constructor({nodes:{header:e,default:n,footer:o},root:r,realList:i}){this.defaultNodes=n,this.children=[...e,...n,...o],this.externalComponent=r.externalComponent,this.rootTransition=r.transition,this.tag=r.tag,this.realList=i}get _isRootComponent(){return this.externalComponent||this.rootTransition}render(e,n){const{tag:o,children:r,_isRootComponent:i}=this;return e(o,n,i?{default:()=>r}:r)}updated(){const{defaultNodes:e,realList:n}=this;e.forEach((o,r)=>{ro(Mt(o),{element:n[r],index:r})})}getUnderlyingVm(e){return kt(e)}getVmIndexFromDomIndex(e,n){const{defaultNodes:o}=this,{length:r}=o,i=n.children,a=i.item(e);if(a===null)return r;const l=kt(a);if(l)return l.index;if(r===0)return 0;const s=Mt(o[0]),u=[...i].findIndex(d=>d===s);return e<u?0:r}}function ao(t,e){const n=t[e];return n?n():[]}function lo({$slots:t,realList:e,getKey:n}){const o=e||[],[r,i]=["header","footer"].map(s=>ao(t,s)),{item:a}=t;if(!a)throw new Error("draggable element must have an item slot");const l=o.flatMap((s,u)=>a({element:s,index:u}).map(d=>(d.key=n(s),d.props={...d.props||{},"data-draggable":!0},d)));if(l.length!==o.length)throw new Error("Item slot must have only one child");return{header:r,footer:i,default:l}}function so(t){const e=to(t),n=!eo(t)&&!e;return{transition:e,externalComponent:n,tag:n?ye(t):e?un:t}}function uo({$slots:t,tag:e,realList:n,getKey:o}){const r=lo({$slots:t,realList:n,getKey:o}),i=so(e);return new io({nodes:r,root:i,realList:n})}function on(t,e){Xt(()=>this.$emit(t.toLowerCase(),e))}function rn(t){return(e,n)=>{if(this.realList!==null)return this[`onDrag${t}`](e,n)}}function co(t){const e=rn.call(this,t);return(n,o)=>{e.call(this,n,o),on.call(this,t,n)}}let st=null;const fo={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},ho=["update:modelValue","change",...[...ht.manageAndEmit,...ht.emit].map(t=>t.toLowerCase())],Lt=Rt({name:"draggable",inheritAttrs:!1,props:fo,emits:ho,data(){return{error:!1}},render(){try{this.error=!1;const{$slots:t,$attrs:e,tag:n,componentData:o,realList:r,getKey:i}=this,a=uo({$slots:t,tag:n,realList:r,getKey:i});this.componentStructure=a;const l=no({$attrs:e,componentData:o});return a.render(wt,l)}catch(t){return this.error=!0,wt("pre",{style:{color:"red"}},t.stack)}},created(){this.list!==null&&this.modelValue!==null&&$n.error("modelValue and list props are mutually exclusive! Please set one or another.")},mounted(){if(this.error)return;const{$attrs:t,$el:e,componentStructure:n}=this;n.updated();const o=oo({$attrs:t,callBackBuilder:{manageAndEmit:i=>co.call(this,i),emit:i=>on.bind(this,i),manage:i=>rn.call(this,i)}}),r=e.nodeType===1?e:e.parentElement;this._sortable=new p(r,o),this.targetDomElement=r,r.__draggable_component__=this},updated(){this.componentStructure.updated()},beforeUnmount(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList(){const{list:t}=this;return t||this.modelValue},getKey(){const{itemKey:t}=this;return typeof t=="function"?t:e=>e[t]}},watch:{$attrs:{handler(t){const{_sortable:e}=this;e&&nn(t).forEach(([n,o])=>{e.option(n,o)})},deep:!0}},methods:{getUnderlyingVm(t){return this.componentStructure.getUnderlyingVm(t)||null},getUnderlyingPotencialDraggableComponent(t){return t.__draggable_component__},emitChanges(t){Xt(()=>this.$emit("change",t))},alterList(t){if(this.list){t(this.list);return}const e=[...this.modelValue];t(e),this.$emit("update:modelValue",e)},spliceList(){const t=e=>e.splice(...arguments);this.alterList(t)},updatePosition(t,e){const n=o=>o.splice(e,0,o.splice(t,1)[0]);this.alterList(n)},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};const o=n.realList,r={list:o,component:n};return t!==e&&o?{...n.getUnderlyingVm(e)||{},...r}:r},getVmIndexFromDomIndex(t){return this.componentStructure.getVmIndexFromDomIndex(t,this.targetDomElement)},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),st=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(e===void 0)return;lt(t.item);const n=this.getVmIndexFromDomIndex(t.newIndex);this.spliceList(n,0,e);const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(Ft(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){lt(t.clone);return}const{index:e,element:n}=this.context;this.spliceList(e,1);const o={element:n,oldIndex:e};this.emitChanges({removed:o})},onDragUpdate(t){lt(t.item),Ft(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndexFromDomIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter(a=>a.style.display!=="none"),o=n.indexOf(e.related),r=t.component.getVmIndexFromDomIndex(o);return n.indexOf(st)!==-1||!e.willInsertAfter?r:r+1},onDragMove(t,e){const{move:n,realList:o}=this;if(!n||!o)return!0;const r=this.getRelatedContextFromMoveEvent(t),i=this.computeFutureIndex(r,t),a={...this.context,futureIndex:i},l={...t,relatedContext:r,draggedContext:a};return n(l,e)},onDragEnd(){st=null}}}),po={width:1024,height:1024,body:'<path fill="currentColor" d="m186.496 544l41.408 41.344a32 32 0 1 1-45.248 45.312l-96-96a32 32 0 0 1 0-45.312l96-96a32 32 0 1 1 45.248 45.312L186.496 480h290.816V186.432l-41.472 41.472a32 32 0 1 1-45.248-45.184l96-96.128a32 32 0 0 1 45.312 0l96 96.064a32 32 0 0 1-45.248 45.184l-41.344-41.28V480H832l-41.344-41.344a32 32 0 0 1 45.248-45.312l96 96a32 32 0 0 1 0 45.312l-96 96a32 32 0 0 1-45.248-45.312L832 544H541.312v293.44l41.344-41.28a32 32 0 1 1 45.248 45.248l-96 96a32 32 0 0 1-45.312 0l-96-96a32 32 0 1 1 45.312-45.248l41.408 41.408V544H186.496z"/>'},vt=t=>(mn("data-v-3f26dabd"),t=t(),gn(),t),mo={class:"card-header"},go={class:"font-medium"},vo={class:"drag-container"},bo=vt(()=>L("div",{class:"card-header"},[L("span",null,"grid列表拖拽")],-1)),_o=vt(()=>L("div",{class:"card-header"},[L("span",null,"单列拖拽")],-1)),wo={class:"item-single"},yo=vt(()=>L("div",{class:"card-header"},[L("span",null,"拖拽实现元素位置交换")],-1)),Eo={class:"cut-container"},Do=Rt({name:"Draggable",__name:"index",setup(t){const{setSortSwap:e}=Dt(),n=Ke([{grid:"cn",num:1},{grid:"cn",num:2},{grid:"cn",num:3},{grid:"cn",num:4},{grid:"cn",num:5},{grid:"cn",num:6},{grid:"cn",num:7},{grid:"cn",num:8},{grid:"cn",num:9}]),o=Ke([{people:"cn",id:1,name:"www.itxst.com"},{people:"cn",id:2,name:"www.baidu.com"},{people:"cn",id:3,name:"www.taobao.com"},{people:"cn",id:4,name:"www.google.com"}]),r=Ke([{people:"cn",id:1,name:"cut1"},{people:"cn",id:2,name:"cut2"},{people:"cn",id:3,name:"cut3"},{people:"cn",id:4,name:"cut4"}]),i=a=>{};return cn(()=>{Dt().sortSwap||_t.mount(new sn),e(!0),new _t(document.querySelector(".cut-container"),{swap:!0,forceFallback:!0,chosenClass:"chosen",swapClass:"highlight",animation:300})}),(a,l)=>{const s=ye("el-link"),u=ye("el-card"),d=ye("el-col"),f=ye("el-row");return Ze(),dn(u,{shadow:"never"},{header:A(()=>[L("div",mo,[L("span",go,[yt(" 拖拽组件,采用开源的 "),W(s,{href:"https://sortablejs.github.io/vue.draggable.next/#/simple",target:"_blank",icon:Fe(bn)(Fe(po)),style:{margin:"0 4px 5px","font-size":"16px"}},{default:A(()=>[yt(" vuedraggable ")]),_:1},8,["icon"])])])]),default:A(()=>[L("div",vo,[W(f,{gutter:25},{default:A(()=>[W(d,{xs:25,sm:8,md:8,lg:8},{default:A(()=>[W(u,{shadow:"never"},{header:A(()=>[bo]),default:A(()=>[W(Fe(Lt),{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=m=>n.value=m),class:"grid-container","item-key":"grid",animation:"300",chosenClass:"chosen",forceFallback:"true"},{item:A(({element:m})=>[L("div",{class:fn("item item-"+m.num)},Me(m.num),3)]),_:1},8,["modelValue"])]),_:1})]),_:1}),W(d,{xs:25,sm:8,md:8,lg:8},{default:A(()=>[W(u,{shadow:"never"},{header:A(()=>[_o]),default:A(()=>[W(Fe(Lt),{modelValue:o.value,"onUpdate:modelValue":l[1]||(l[1]=m=>o.value=m),"item-key":"name",onChange:i,"chosen-class":"chosen","force-fallback":"true",animation:"300"},{item:A(({element:m,index:_})=>[L("div",wo,Me(m.name)+" "+Me(_),1)]),_:1},8,["modelValue"])]),_:1})]),_:1}),W(d,{xs:25,sm:8,md:8,lg:8},{default:A(()=>[W(u,{shadow:"never"},{header:A(()=>[yo]),default:A(()=>[L("div",Eo,[(Ze(!0),Et(pn,null,hn(r.value,(m,_)=>(Ze(),Et("div",{class:"item-cut",key:_},[L("p",null,Me(m.name),1)]))),128))])]),_:1})]),_:1})]),_:1})])]),_:1})}}});const Oo=vn(Do,[["__scopeId","data-v-3f26dabd"]]);export{Oo as default};
|
|
//# sourceMappingURL=index-1b2df62d.js.map
|