1234 |
- (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vuedraggable"]=e():t["vuedraggable"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({c649:function(t,e,n){"use strict";(function(t){function o(){return"undefined"!==typeof window?window.console:t.console}n.d(e,"c",(function(){return c})),n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return s}));const i=o();function r(t){const e=Object.create(null);return function(n){const o=e[n];return o||(e[n]=t(n))}}const a=/-(\w)/g,l=r(t=>t.replace(a,(t,e)=>e?e.toUpperCase():""));function s(t){null!==t.parentElement&&t.parentElement.removeChild(t)}function c(t,e,n){const o=0===n?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}}).call(this,n("c8ba"))},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(o){"object"===typeof window&&(n=window)}t.exports=n},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(o){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(o.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},fb15:function(t,e,n){"use strict";var o;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(o=window.document.currentScript)&&(o=o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=o[1]));
-
- function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(){return a=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},a.apply(this,arguments)}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),o.forEach((function(e){r(t,e,n[e])}))}return t}function s(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}function c(t,e){if(null==t)return{};var n,o,i=s(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var u="1.10.2";function d(t){if("undefined"!==typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var h=d(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),f=d(/Edge/i),p=d(/firefox/i),g=d(/safari/i)&&!d(/chrome/i)&&!d(/android/i),m=d(/iP(ad|od|hone)/i),v=d(/chrome/i)&&d(/android/i),b={capture:!1,passive:!1};function y(t,e,n){t.addEventListener(e,n,!h&&b)}function w(t,e,n){t.removeEventListener(e,n,!h&&b)}function E(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(n){return!1}return!1}}function _(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function S(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&E(t,e):E(t,e))||o&&t===n)return t;if(t===n)break}while(t=_(t))}return null}var D,x=/\s+/g;function C(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(x," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(x," ")}}function T(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"===typeof n?"":"px")}}function O(t,e){var n="";if("string"===typeof t)n=t;else do{var o=T(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function I(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function M(){var t=document.scrollingElement;return t||document.documentElement}function P(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,c,u,d;if(t!==window&&t!==M()?(r=t.getBoundingClientRect(),a=r.top,l=r.left,s=r.bottom,c=r.right,u=r.height,d=r.width):(a=0,l=0,s=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!h))do{if(i&&i.getBoundingClientRect&&("none"!==T(i,"transform")||n&&"static"!==T(i,"position"))){var f=i.getBoundingClientRect();a-=f.top+parseInt(T(i,"border-top-width")),l-=f.left+parseInt(T(i,"border-left-width")),s=a+r.height,c=l+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=O(i||t),g=p&&p.a,m=p&&p.d;p&&(a/=m,l/=g,d/=g,u/=m,s=a+u,c=l+d)}return{top:a,left:l,bottom:s,right:c,width:d,height:u}}}function N(t,e,n){var o=X(t,!0),i=P(t)[e];while(o){var r=P(o)[n],a=void 0;if(a="top"===n||"left"===n?i>=r:i<=r,!a)return o;if(o===M())break;o=X(o,!1)}return!1}function A(t,e,n){var o=0,i=0,r=t.children;while(i<r.length){if("none"!==r[i].style.display&&r[i]!==zt.ghost&&r[i]!==zt.dragged&&S(r[i],n.draggable,t,!1)){if(o===e)return r[i];o++}i++}return null}function k(t,e){var n=t.lastElementChild;while(n&&(n===zt.ghost||"none"===T(n,"display")||e&&!E(n,e)))n=n.previousElementSibling;return n||null}function j(t,e){var n=0;if(!t||!t.parentNode)return-1;while(t=t.previousElementSibling)"TEMPLATE"===t.nodeName.toUpperCase()||t===zt.clone||e&&!E(t,e)||n++;return n}function F(t){var e=0,n=0,o=M();if(t)do{var i=O(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function R(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 X(t,e){if(!t||!t.getBoundingClientRect)return M();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=T(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return M();if(o||e)return n;o=!0}}}while(n=n.parentNode);return M()}function L(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Y(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)}function $(t,e){return function(){if(!D){var n=arguments,o=this;1===n.length?t.call(o,n[0]):t.apply(o,n),D=setTimeout((function(){D=void 0}),e)}}}function B(){clearTimeout(D),D=void 0}function H(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function W(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 V="Sortable"+(new Date).getTime();function U(){var t,e=[];return{captureAnimationState:function(){if(e=[],this.options.animation){var t=[].slice.call(this.el.children);t.forEach((function(t){if("none"!==T(t,"display")&&t!==zt.ghost){e.push({target:t,rect:P(t)});var n=l({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=O(t,!0);o&&(n.top-=o.f,n.left-=o.e)}t.fromRect=n}}))}},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(R(e,{target:t}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"===typeof n&&n());var i=!1,r=0;e.forEach((function(t){var e=0,n=t.target,a=n.fromRect,l=P(n),s=n.prevFromRect,c=n.prevToRect,u=t.rect,d=O(n,!0);d&&(l.top-=d.f,l.left-=d.e),n.toRect=l,n.thisAnimationDuration&&Y(s,l)&&!Y(a,l)&&(u.top-l.top)/(u.left-l.left)===(a.top-l.top)/(a.left-l.left)&&(e=G(u,s,c,o.options)),Y(l,a)||(n.prevFromRect=a,n.prevToRect=l,e||(e=o.options.animation),o.animate(n,u,l,e)),e&&(i=!0,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),i?t=setTimeout((function(){"function"===typeof n&&n()}),r):"function"===typeof n&&n(),e=[]},animate:function(t,e,n,o){if(o){T(t,"transition",""),T(t,"transform","");var i=O(this.el),r=i&&i.a,a=i&&i.d,l=(e.left-n.left)/(r||1),s=(e.top-n.top)/(a||1);t.animatingX=!!l,t.animatingY=!!s,T(t,"transform","translate3d("+l+"px,"+s+"px,0)"),z(t),T(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),T(t,"transform","translate3d(0,0,0)"),"number"===typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){T(t,"transition",""),T(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}function z(t){return t.offsetWidth}function G(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 q=[],J={initializeByDefault:!0},Z={mount:function(t){for(var e in J)J.hasOwnProperty(e)&&!(e in t)&&(t[e]=J[e]);q.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";q.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](l({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](l({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in q.forEach((function(o){var i=o.pluginName;if(t.options[i]||o.initializeByDefault){var r=new o(t,e,t.options);r.sortable=t,r.options=t.options,t[i]=r,a(n,r.defaults)}})),t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);"undefined"!==typeof r&&(t.options[i]=r)}},getEventProperties:function(t,e){var n={};return q.forEach((function(o){"function"===typeof o.eventProperties&&a(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return q.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"===typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};function K(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,s=t.fromEl,c=t.oldIndex,u=t.newIndex,d=t.oldDraggableIndex,p=t.newDraggableIndex,g=t.originalEvent,m=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[V],e){var b,y=e.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||h||f?(b=document.createEvent("Event"),b.initEvent(o,!0,!0)):b=new CustomEvent(o,{bubbles:!0,cancelable:!0}),b.to=a||n,b.from=s||n,b.item=i||n,b.clone=r,b.oldIndex=c,b.newIndex=u,b.oldDraggableIndex=d,b.newDraggableIndex=p,b.originalEvent=g,b.pullMode=m?m.lastPutMode:void 0;var E=l({},v,Z.getEventProperties(o,e));for(var _ in E)b[_]=E[_];n&&n.dispatchEvent(b),y[w]&&y[w].call(e,b)}}var Q=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=c(n,["evt"]);Z.pluginEvent.bind(zt)(t,e,l({dragEl:et,parentEl:nt,ghostEl:ot,rootEl:it,nextEl:rt,lastDownEl:at,cloneEl:lt,cloneHidden:st,dragStarted:Et,putSortable:pt,activeSortable:zt.active,originalEvent:o,oldIndex:ct,oldDraggableIndex:dt,newIndex:ut,newDraggableIndex:ht,hideGhostForTarget:Ht,unhideGhostForTarget:Wt,cloneNowHidden:function(){st=!0},cloneNowShown:function(){st=!1},dispatchSortableEvent:function(t){tt({sortable:e,name:t,originalEvent:o})}},i))};function tt(t){K(l({putSortable:pt,cloneEl:lt,targetEl:et,rootEl:it,oldIndex:ct,oldDraggableIndex:dt,newIndex:ut,newDraggableIndex:ht},t))}var et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,ft,pt,gt,mt,vt,bt,yt,wt,Et,_t,St,Dt,xt,Ct=!1,Tt=!1,Ot=[],It=!1,Mt=!1,Pt=[],Nt=!1,At=[],kt="undefined"!==typeof document,jt=m,Ft=f||h?"cssFloat":"float",Rt=kt&&!v&&!m&&"draggable"in document.createElement("div"),Xt=function(){if(kt){if(h)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Lt=function(t,e){var n=T(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=A(t,0,e),r=A(t,1,e),a=i&&T(i),l=r&&T(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+P(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+P(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a["float"]&&"none"!==a["float"]){var u="left"===a["float"]?"left":"right";return!r||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[Ft]||r&&"none"===n[Ft]&&s+c>o)?"vertical":"horizontal"},Yt=function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2},$t=function(t,e){var n;return Ot.some((function(o){if(!k(o)){var i=P(o),r=o[V].options.emptyInsertThreshold,a=t>=i.left-r&&t<=i.right+r,l=e>=i.top-r&&e<=i.bottom+r;return r&&a&&l?n=o:void 0}})),n},Bt=function(t){function e(t,n){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||l))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"===typeof t)return e(t(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===t||"string"===typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var n={},o=t.group;o&&"object"==i(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Ht=function(){!Xt&&ot&&T(ot,"display","none")},Wt=function(){!Xt&&ot&&T(ot,"display","")};kt&&document.addEventListener("click",(function(t){if(Tt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Tt=!1,!1}),!0);var Vt=function(t){if(et){t=t.touches?t.touches[0]:t;var e=$t(t.clientX,t.clientY);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[V]._onDragOver(n)}}},Ut=function(t){et&&et.parentNode[V]._isOutsideThisEl(t.target)};function zt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[V]=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 Lt(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(t,e){t.setData("Text",e.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:!1!==zt.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var o in Z.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in Bt(e),this)"_"===i.charAt(0)&&"function"===typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&Rt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?y(t,"pointerdown",this._onTapStart):(y(t,"mousedown",this._onTapStart),y(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(t,"dragover",this),y(t,"dragenter",this)),Ot.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,U())}function Gt(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function qt(t,e,n,o,i,r,a,l){var s,c,u=t[V],d=u.options.onMove;return!window.CustomEvent||h||f?(s=document.createEvent("Event"),s.initEvent("move",!0,!0)):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||P(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),d&&(c=d.call(u,s,a)),c}function Jt(t){t.draggable=!1}function Zt(){Nt=!1}function Kt(t,e,n){var o=P(k(n.el,n.options.draggable)),i=10;return e?t.clientX>o.right+i||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+i}function Qt(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!a)if(l&&Dt<c*i){if(!It&&(1===St?s>u+c*r/2:s<d-c*r/2)&&(It=!0),It)h=!0;else if(1===St?s<u+Dt:s>d-Dt)return-St}else if(s>u+c*(1-i)/2&&s<d-c*(1-i)/2)return te(e);return h=h||a,h&&(s<u+c*r/2||s>d-c*r/2)?s>u+c/2?1:-1:0}function te(t){return j(et)<j(t)?1:-1}function ee(t){var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;while(n--)o+=e.charCodeAt(n);return o.toString(36)}function ne(t){At.length=0;var e=t.getElementsByTagName("input"),n=e.length;while(n--){var o=e[n];o.checked&&At.push(o)}}function oe(t){return setTimeout(t,0)}function ie(t){return clearTimeout(t)}zt.prototype={constructor:zt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(_t=null)},_getDirection:function(t,e){return"function"===typeof this.options.direction?this.options.direction.call(this,t,e,et):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(ne(n),!et&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!s.isContentEditable&&(l=S(l,o.draggable,n,!1),(!l||!l.animated)&&at!==l)){if(ct=j(l),dt=j(l,o.draggable),"function"===typeof c){if(c.call(this,t,l,this))return tt({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),Q("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=S(s,o.trim(),n,!1),o)return tt({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),Q("filter",e,{evt:t}),!0})),c))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!S(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!et&&n.parentNode===r){var s=P(n);if(it=r,et=n,nt=et.parentNode,rt=et.nextSibling,at=n,ft=a.group,zt.dragged=et,gt={target:et,clientX:(e||t).clientX,clientY:(e||t).clientY},yt=gt.clientX-s.left,wt=gt.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,et.style["will-change"]="all",o=function(){Q("delayEnded",i,{evt:t}),zt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!p&&i.nativeDraggable&&(et.draggable=!0),i._triggerDragStart(t,e),tt({sortable:i,name:"choose",originalEvent:t}),C(et,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){I(et,t.trim(),Jt)})),y(l,"dragover",Vt),y(l,"mousemove",Vt),y(l,"touchmove",Vt),y(l,"mouseup",i._onDrop),y(l,"touchend",i._onDrop),y(l,"touchcancel",i._onDrop),p&&this.nativeDraggable&&(this.options.touchStartThreshold=4,et.draggable=!0),Q("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(f||h))o();else{if(zt.eventCanceled)return void this._onDrop();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(o,a.delay)}}},_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(){et&&Jt(et),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||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):y(document,e?"touchmove":"mousemove",this._onTouchMove):(y(et,"dragend",this),y(it,"dragstart",this._onDragStart));try{document.selection?oe((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(Ct=!1,it&&et){Q("dragStarted",this,{evt:e}),this.nativeDraggable&&y(document,"dragover",Ut);var n=this.options;!t&&C(et,n.dragClass,!1),C(et,n.ghostClass,!0),zt.active=this,t&&this._appendGhost(),tt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(mt){this._lastX=mt.clientX,this._lastY=mt.clientY,Ht();var t=document.elementFromPoint(mt.clientX,mt.clientY),e=t;while(t&&t.shadowRoot){if(t=t.shadowRoot.elementFromPoint(mt.clientX,mt.clientY),t===e)break;e=t}if(et.parentNode[V]._isOutsideThisEl(t),e)do{if(e[V]){var n=void 0;if(n=e[V]._onDragOver({clientX:mt.clientX,clientY:mt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Wt()}},_onTouchMove:function(t){if(gt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=ot&&O(ot,!0),a=ot&&r&&r.a,l=ot&&r&&r.d,s=jt&&xt&&F(xt),c=(i.clientX-gt.clientX+o.x)/(a||1)+(s?s[0]-Pt[0]:0)/(a||1),u=(i.clientY-gt.clientY+o.y)/(l||1)+(s?s[1]-Pt[1]:0)/(l||1);if(!zt.active&&!Ct){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(ot){r?(r.e+=c-(vt||0),r.f+=u-(bt||0)):r={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");T(ot,"webkitTransform",d),T(ot,"mozTransform",d),T(ot,"msTransform",d),T(ot,"transform",d),vt=c,bt=u,mt=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ot){var t=this.options.fallbackOnBody?document.body:it,e=P(et,!0,jt,!0,t),n=this.options;if(jt){xt=t;while("static"===T(xt,"position")&&"none"===T(xt,"transform")&&xt!==document)xt=xt.parentNode;xt!==document.body&&xt!==document.documentElement?(xt===document&&(xt=M()),e.top+=xt.scrollTop,e.left+=xt.scrollLeft):xt=M(),Pt=F(xt)}ot=et.cloneNode(!0),C(ot,n.ghostClass,!1),C(ot,n.fallbackClass,!0),C(ot,n.dragClass,!0),T(ot,"transition",""),T(ot,"transform",""),T(ot,"box-sizing","border-box"),T(ot,"margin",0),T(ot,"top",e.top),T(ot,"left",e.left),T(ot,"width",e.width),T(ot,"height",e.height),T(ot,"opacity","0.8"),T(ot,"position",jt?"absolute":"fixed"),T(ot,"zIndex","100000"),T(ot,"pointerEvents","none"),zt.ghost=ot,t.appendChild(ot),T(ot,"transform-origin",yt/parseInt(ot.style.width)*100+"% "+wt/parseInt(ot.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;Q("dragStart",this,{evt:t}),zt.eventCanceled?this._onDrop():(Q("setupClone",this),zt.eventCanceled||(lt=W(et),lt.draggable=!1,lt.style["will-change"]="",this._hideClone(),C(lt,this.options.chosenClass,!1),zt.clone=lt),n.cloneId=oe((function(){Q("clone",n),zt.eventCanceled||(n.options.removeCloneOnHide||it.insertBefore(lt,et),n._hideClone(),tt({sortable:n,name:"clone"}))})),!e&&C(et,i.dragClass,!0),e?(Tt=!0,n._loopId=setInterval(n._emulateDragOver,50)):(w(document,"mouseup",n._onDrop),w(document,"touchend",n._onDrop),w(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,et)),y(document,"drop",n),T(et,"transform","translateZ(0)")),Ct=!0,n._dragStartId=oe(n._dragStarted.bind(n,e,t)),y(document,"selectstart",n),Et=!0,g&&T(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,o,i,r=this.el,a=t.target,s=this.options,c=s.group,u=zt.active,d=ft===c,h=s.sort,f=pt||u,p=this,g=!1;if(!Nt){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),a=S(a,s.draggable,r,!0),F("dragOver"),zt.eventCanceled)return g;if(et.contains(t.target)||a.animated&&a.animatingX&&a.animatingY||p._ignoreWhileAnimating===a)return X(!1);if(Tt=!1,u&&!s.disabled&&(d?h||(o=!it.contains(et)):pt===this||(this.lastPutMode=ft.checkPull(this,u,et,t))&&c.checkPut(this,u,et,t))){if(i="vertical"===this._getDirection(t,a),e=P(et),F("dragOverValid"),zt.eventCanceled)return g;if(o)return nt=it,R(),this._hideClone(),F("revert"),zt.eventCanceled||(rt?it.insertBefore(et,rt):it.appendChild(et)),X(!0);var m=k(r,s.draggable);if(!m||Kt(t,i,this)&&!m.animated){if(m===et)return X(!1);if(m&&r===t.target&&(a=m),a&&(n=P(a)),!1!==qt(it,r,et,e,a,n,t,!!a))return R(),r.appendChild(et),nt=r,L(),X(!0)}else if(a.parentNode===r){n=P(a);var v,b,y=0,w=et.parentNode!==r,E=!Yt(et.animated&&et.toRect||e,a.animated&&a.toRect||n,i),_=i?"top":"left",D=N(a,"top","top")||N(et,"top","top"),x=D?D.scrollTop:void 0;if(_t!==a&&(v=n[_],It=!1,Mt=!E&&s.invertSwap||w),y=Qt(t,a,n,i,E?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Mt,_t===a),0!==y){var O=j(et);do{O-=y,b=nt.children[O]}while(b&&("none"===T(b,"display")||b===ot))}if(0===y||b===a)return X(!1);_t=a,St=y;var I=a.nextElementSibling,M=!1;M=1===y;var A=qt(it,r,et,e,a,n,t,M);if(!1!==A)return 1!==A&&-1!==A||(M=1===A),Nt=!0,setTimeout(Zt,30),R(),M&&!I?r.appendChild(et):a.parentNode.insertBefore(et,M?I:a),D&&H(D,0,x-D.scrollTop),nt=et.parentNode,void 0===v||Mt||(Dt=Math.abs(v-P(a)[_])),L(),X(!0)}if(r.contains(et))return X(!1)}return!1}function F(s,c){Q(s,p,l({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:h,fromSortable:f,target:a,completed:X,onMove:function(n,o){return qt(it,r,et,e,n,P(n),t,o)},changed:L},c))}function R(){F("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function X(e){return F("dragOverCompleted",{insertion:e}),e&&(d?u._hideClone():u._showClone(p),p!==f&&(C(et,pt?pt.options.ghostClass:u.options.ghostClass,!1),C(et,s.ghostClass,!0)),pt!==p&&p!==zt.active?pt=p:p===zt.active&&pt&&(pt=null),f===p&&(p._ignoreWhileAnimating=a),p.animateAll((function(){F("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(a===et&&!et.animated||a===r&&!a.animated)&&(_t=null),s.dragoverBubble||t.rootEl||a===document||(et.parentNode[V]._isOutsideThisEl(t.target),!e&&Vt(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function L(){ut=j(et),ht=j(et,s.draggable),tt({sortable:p,name:"change",toEl:r,newIndex:ut,newDraggableIndex:ht,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){w(document,"mousemove",this._onTouchMove),w(document,"touchmove",this._onTouchMove),w(document,"pointermove",this._onTouchMove),w(document,"dragover",Vt),w(document,"mousemove",Vt),w(document,"touchmove",Vt)},_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;ut=j(et),ht=j(et,n.draggable),Q("drop",this,{evt:t}),nt=et&&et.parentNode,ut=j(et),ht=j(et,n.draggable),zt.eventCanceled||(Ct=!1,Mt=!1,It=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ie(this.cloneId),ie(this._dragStartId),this.nativeDraggable&&(w(document,"drop",this),w(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),g&&T(document.body,"user-select",""),T(et,"transform",""),t&&(Et&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ot&&ot.parentNode&&ot.parentNode.removeChild(ot),(it===nt||pt&&"clone"!==pt.lastPutMode)&<&<.parentNode&<.parentNode.removeChild(lt),et&&(this.nativeDraggable&&w(et,"dragend",this),Jt(et),et.style["will-change"]="",Et&&!Ct&&C(et,pt?pt.options.ghostClass:this.options.ghostClass,!1),C(et,this.options.chosenClass,!1),tt({sortable:this,name:"unchoose",toEl:nt,newIndex:null,newDraggableIndex:null,originalEvent:t}),it!==nt?(ut>=0&&(tt({rootEl:nt,name:"add",toEl:nt,fromEl:it,originalEvent:t}),tt({sortable:this,name:"remove",toEl:nt,originalEvent:t}),tt({rootEl:nt,name:"sort",toEl:nt,fromEl:it,originalEvent:t}),tt({sortable:this,name:"sort",toEl:nt,originalEvent:t})),pt&&pt.save()):ut!==ct&&ut>=0&&(tt({sortable:this,name:"update",toEl:nt,originalEvent:t}),tt({sortable:this,name:"sort",toEl:nt,originalEvent:t})),zt.active&&(null!=ut&&-1!==ut||(ut=ct,ht=dt),tt({sortable:this,name:"end",toEl:nt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Q("nulling",this),it=et=nt=ot=rt=lt=at=st=gt=mt=Et=ut=ht=ct=dt=_t=St=pt=ft=zt.dragged=zt.ghost=zt.clone=zt.active=null,At.forEach((function(t){t.checked=!0})),At.length=vt=bt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":et&&(this._onDragOver(t),Gt(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)t=n[o],S(t,r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||ee(t));return e},sort:function(t){var e={},n=this.el;this.toArray().forEach((function(t,o){var i=n.children[o];S(i,this.options.draggable,n,!1)&&(e[t]=i)}),this),t.forEach((function(t){e[t]&&(n.removeChild(e[t]),n.appendChild(e[t]))}))},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return S(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=Z.modifyOption(this,t,e);n[t]="undefined"!==typeof o?o:e,"group"===t&&Bt(n)},destroy:function(){Q("destroy",this);var t=this.el;t[V]=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(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Ot.splice(Ot.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!st){if(Q("hideClone",this),zt.eventCanceled)return;T(lt,"display","none"),this.options.removeCloneOnHide&<.parentNode&<.parentNode.removeChild(lt),st=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(st){if(Q("showClone",this),zt.eventCanceled)return;it.contains(et)&&!this.options.group.revertClone?it.insertBefore(lt,et):rt?it.insertBefore(lt,rt):it.appendChild(lt),this.options.group.revertClone&&this.animate(et,lt),T(lt,"display",""),st=!1}}else this._hideClone()}},kt&&y(document,"touchmove",(function(t){(zt.active||Ct)&&t.cancelable&&t.preventDefault()})),zt.utils={on:y,off:w,css:T,find:I,is:function(t,e){return!!S(t,e,t,!1)},extend:L,throttle:$,closest:S,toggleClass:C,clone:W,index:j,nextTick:oe,cancelNextTick:ie,detectDirection:Lt,getChild:A},zt.get=function(t){return t[V]},zt.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(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(zt.utils=l({},zt.utils,t.utils)),Z.mount(t)}))},zt.create=function(t,e){return new zt(t,e)},zt.version=u;var re,ae,le,se,ce,ue,de=[],he=!1;function fe(){function t(){for(var t in this.defaults={scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"===typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?y(document,"pointermove",this._handleFallbackAutoScroll):e.touches?y(document,"touchmove",this._handleFallbackAutoScroll):y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},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)),ge(),pe(),B()},nulling:function(){ce=ae=re=he=ue=le=se=null,de.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(ce=t,e||f||h||g){me(t,this.options,r,e);var a=X(r,!0);!he||ue&&o===le&&i===se||(ue&&ge(),ue=setInterval((function(){var r=X(document.elementFromPoint(o,i),!0);r!==a&&(a=r,pe()),me(t,n.options,r,e)}),10),le=o,se=i)}else{if(!this.options.bubbleScroll||X(r,!0)===M())return void pe();me(t,this.options,X(r,!1),!1)}}},a(t,{pluginName:"scroll",initializeByDefault:!0})}function pe(){de.forEach((function(t){clearInterval(t.pid)})),de=[]}function ge(){clearInterval(ue)}var me=$((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,l=e.scrollSensitivity,s=e.scrollSpeed,c=M(),u=!1;ae!==n&&(ae=n,pe(),re=e.scroll,i=e.scrollFn,!0===re&&(re=X(n,!0)));var d=0,h=re;do{var f=h,p=P(f),g=p.top,m=p.bottom,v=p.left,b=p.right,y=p.width,w=p.height,E=void 0,_=void 0,S=f.scrollWidth,D=f.scrollHeight,x=T(f),C=f.scrollLeft,O=f.scrollTop;f===c?(E=y<S&&("auto"===x.overflowX||"scroll"===x.overflowX||"visible"===x.overflowX),_=w<D&&("auto"===x.overflowY||"scroll"===x.overflowY||"visible"===x.overflowY)):(E=y<S&&("auto"===x.overflowX||"scroll"===x.overflowX),_=w<D&&("auto"===x.overflowY||"scroll"===x.overflowY));var I=E&&(Math.abs(b-r)<=l&&C+y<S)-(Math.abs(v-r)<=l&&!!C),N=_&&(Math.abs(m-a)<=l&&O+w<D)-(Math.abs(g-a)<=l&&!!O);if(!de[d])for(var A=0;A<=d;A++)de[A]||(de[A]={});de[d].vx==I&&de[d].vy==N&&de[d].el===f||(de[d].el=f,de[d].vx=I,de[d].vy=N,clearInterval(de[d].pid),0==I&&0==N||(u=!0,de[d].pid=setInterval(function(){o&&0===this.layer&&zt.active._onTouchMove(ce);var e=de[this.layer].vy?de[this.layer].vy*s:0,n=de[this.layer].vx?de[this.layer].vx*s:0;"function"===typeof i&&"continue"!==i.call(zt.dragged.parentNode[V],n,e,t,ce,de[this.layer].el)||H(de[this.layer].el,n,e)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==c&&(h=X(h,!1)));he=u}}),30),ve=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var s=n||i;a();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);l(),s&&!s.el.contains(u)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function be(){}function ye(){}be.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=A(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:ve},a(be,{pluginName:"revertOnSpill"}),ye.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,o=n||this.sortable;o.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),o.animateAll()},drop:ve},a(ye,{pluginName:"removeOnSpill"});zt.mount(new fe),zt.mount(ye,be);var we=zt,Ee=n("c649");function _e(t,e,n){return void 0===n||(t=t||{},t[e]=n),t}function Se(t,e){return t.map(t=>t.elm).indexOf(e)}function De(t,e,n,o){if(!t)return[];const i=t.map(t=>t.elm),r=e.length-o,a=[...e].map((t,e)=>e>=r?i.length:i.indexOf(t));return n?a.filter(t=>-1!==t):a}function xe(t,e){Ee["b"].log("执行。。"),this.$nextTick(()=>this.$emit(t.toLowerCase(),{...e}))}function Ce(t){return e=>{null!==this.realList&&this["onDrag"+t](e),xe.call(this,t,e)}}function Te(t){return["transition-group","TransitionGroup"].includes(t)}function Oe(t){if(!t||1!==t.length)return!1;const[{componentOptions:e}]=t;return!!e&&Te(e.tag)}function Ie(t,e,n){return t[n]||(e[n]?e[n]():void 0)}function Me(t,e,n){let o=0,i=0;const r=Ie(e,n,"header");r&&(o=r.length,t=t?[...r,...t]:[...r]);const a=Ie(e,n,"footer");return a&&(i=a.length,t=t?[...t,...a]:[...a]),{children:t,headerOffset:o,footerOffset:i}}function Pe(t,e){let n=null;const o=(t,e)=>{n=_e(n,t,e)},i=Object.keys(t).filter(t=>"id"===t||t.startsWith("data-")).reduce((e,n)=>(e[n]=t[n],e),{});if(o("attrs",i),!e)return n;const{on:r,props:a,attrs:l}=e;return o("on",r),o("props",a),Object.assign(n.attrs,l),n}const Ne=["Start","Add","Remove","Update","End"],Ae=["Choose","Unchoose","Sort","Filter","Clone"],ke=["Move",...Ne,...Ae].map(t=>"on"+t);var je=null;const Fe={options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},Re={name:"draggable",inheritAttrs:!1,props:Fe,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1}},render(t){const e=this.$slots.default;this.transitionMode=Oe(e);const{children:n,headerOffset:o,footerOffset:i}=Me(e,this.$slots,this.$scopedSlots);this.headerOffset=o,this.footerOffset=i;const r=Pe(this.$attrs,this.componentData);return t(this.getTag(),r,n)},created(){null!==this.list&&null!==this.value&&Ee["b"].error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&Ee["b"].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&Ee["b"].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted(){if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: "+this.getTag());const t={};Ne.forEach(e=>{t["on"+e]=Ce.call(this,e)}),Ae.forEach(e=>{t["on"+e]=xe.bind(this,e)});const e=Object.keys(this.$attrs).reduce((t,e)=>(t[Object(Ee["a"])(e)]=this.$attrs[e],t),{}),n=Object.assign({},this.options,e,t,{onMove:(t,e)=>this.onDragMove(t,e)});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new we(this.rootContainer,n),this.computeIndexes()},beforeDestroy(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer(){return this.transitionMode?this.$el.children[0]:this.$el},realList(){return this.list?this.list:this.value}},watch:{options:{handler(t){this.updateOptions(t)},deep:!0},$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getIsFunctional(){const{fnOptions:t}=this._vnode;return t&&t.functional},getTag(){return this.tag||this.element},updateOptions(t){for(var e in t){const n=Object(Ee["a"])(e);-1===ke.indexOf(n)&&this._sortable.option(n,t[e])}},getChildrenNodes(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;const t=this.$slots.default;return this.transitionMode?t[0].child.$slots.default:t},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=De(this.getChildrenNodes(),this.rootContainer.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(t){const e=Se(this.getChildrenNodes()||[],t);if(-1===e)return null;const n=this.realList[e];return{index:e,element:n}},getUnderlyingPotencialDraggableComponent({__vue__:t}){return t&&t.$options&&Te(t.$options._componentTag)?t.$parent:!("realList"in t)&&1===t.$children.length&&"realList"in t.$children[0]?t.$children[0]:t},emitChanges(t){this.$nextTick(()=>{this.$emit("change",t)})},alterList(t){if(this.list)return void t(this.list);const e=[...this.value];t(e),this.$emit("input",e)},spliceList(){const t=t=>t.splice(...arguments);this.alterList(t)},updatePosition(t,e){const n=n=>n.splice(e,0,n.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,i={list:o,component:n};if(t!==e&&o&&n.getUnderlyingVm){const t=n.getUnderlyingVm(e);if(t)return Object.assign(t,i)}return i},getVmIndex(t){const e=this.visibleIndexes,n=e.length;return t>n-1?n:e[t]},getComponent(){return this.$slots.default[0].componentInstance},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[t].data=null;const n=this.getComponent();n.children=[],n.kept=void 0},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),je=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(void 0===e)return;Object(Ee["d"])(t.item);const n=this.getVmIndex(t.newIndex);this.spliceList(n,0,e),this.computeIndexes();const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(Object(Ee["c"])(this.rootContainer,t.item,t.oldIndex),"clone"===t.pullMode)return void Object(Ee["d"])(t.clone);const e=this.context.index;this.spliceList(e,1);const n={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:n})},onDragUpdate(t){Object(Ee["d"])(t.item),Object(Ee["c"])(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter(t=>"none"!==t.style["display"]),o=n.indexOf(e.related),i=t.component.getVmIndex(o),r=-1!==n.indexOf(je);return r||!e.willInsertAfter?i:i+1},onDragMove(t,e){const n=this.move;if(!n||!this.realList)return!0;const o=this.getRelatedContextFromMoveEvent(t),i=this.context,r=this.computeFutureIndex(o,t);Object.assign(i,{futureIndex:r});const a=Object.assign({},t,{relatedContext:o,draggedContext:i});return n(a,e)},onDragEnd(){this.computeIndexes(),je=null}}};"undefined"!==typeof window&&"Vue"in window&&window.Vue.component("draggable",Re);var Xe=Re;e["default"]=Xe}})}));
- //# sourceMappingURL=vuedraggable.umd.min.js.map
|