text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.VueSlicksort={})}(this,function(t){"use strict";var e={inject:["manager"],props:{index:{type:Number,required:!0},collection:{type:[String,Number],default:"default"},disabled:{type:Boolean,default:!1}},mounted:function(){var t=this.$props,e=t.collection,i=t.disabled,n=t.index;i||this.setDraggable(e,n)},watch:{index:function(t){this.$el&&this.$el.sortableInfo&&(this.$el.sortableInfo.index=t)},disabled:function(t){t?this.removeDraggable(this.collection):this.setDraggable(this.collection,this.index)},collection:function(t,e){this.removeDraggable(e),this.setDraggable(t,this.index)}},beforeDestroy:function(){var t=this.collection;this.disabled||this.removeDraggable(t)},methods:{setDraggable:function(t,e){var i=this.$el;i.sortableInfo={index:e,collection:t,manager:this.manager},this.ref={node:i},this.manager.add(t,this.ref)},removeDraggable:function(t){this.manager.remove(t,this.ref)}}},i=function(){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}}(),g=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var i=[],n=!0,s=!1,o=void 0;try{for(var r,a=t[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(t){s=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(s)throw o}}return i}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},w=function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},n=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.refs={}}return i(t,[{key:"add",value:function(t,e){this.refs[t]||(this.refs[t]=[]),this.refs[t].push(e)}},{key:"remove",value:function(t,e){var i=this.getIndex(t,e);-1!==i&&this.refs[t].splice(i,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find(function(t){return t.node.sortableInfo.index==e.active.index})}},{key:"getIndex",value:function(t,e){return this.refs[t].indexOf(e)}},{key:"getOrderedRefs",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[t].sort(function(t,e){return t.node.sortableInfo.index-e.node.sortableInfo.index})}}]),t}();function h(t,e,i){var n=t.slice(0);if(i>=n.length)for(var s=i-n.length;1+s--;)n.push(void 0);return n.splice(i,0,n.splice(e,1)[0]),n}var b={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},O=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],e=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1];switch(e){case"ms":return"ms";default:return e&&e.length?e[0].toUpperCase()+e.substr(1):""}}();function f(t,e){for(;t;){if(e(t))return t;t=t.parentNode}}function p(t,e,i){return i<t?t:e<i?e:i}function I(t){return"px"===t.substr(-2)?parseFloat(t):0}var s={data:function(){return{sorting:!1,sortingIndex:null,manager:new n,events:{start:this.handleStart,move:this.handleMove,end:this.handleEnd}}},props:{value:{type:Array,required:!0},axis:{type:String,default:"y"},distance:{type:Number,default:0},pressDelay:{type:Number,default:0},pressThreshold:{type:Number,default:5},useDragHandle:{type:Boolean,default:!1},useWindowAsScrollContainer:{type:Boolean,default:!1},hideSortableGhost:{type:Boolean,default:!0},lockToContainerEdges:{type:Boolean,default:!1},lockOffset:{type:[String,Number,Array],default:"50%"},transitionDuration:{type:Number,default:300},lockAxis:String,helperClass:String,contentWindow:Object,shouldCancelStart:{type:Function,default:function(t){return-1!==["input","textarea","select","option","button"].indexOf(t.target.tagName.toLowerCase())}},getHelperDimensions:{type:Function,default:function(t){var e=t.node;return{width:e.offsetWidth,height:e.offsetHeight}}}},provide:function(){return{manager:this.manager}},mounted:function(){var i=this;this.container=this.$el,this.document=this.container.ownerDocument||document,this._window=this.contentWindow||window,this.scrollContainer=this.useWindowAsScrollContainer?this.document.body:this.container;var t=function(e){i.events.hasOwnProperty(e)&&b[e].forEach(function(t){return i.container.addEventListener(t,i.events[e],!1)})};for(var e in this.events)t(e)},beforeDestroy:function(){var i=this,t=function(e){i.events.hasOwnProperty(e)&&b[e].forEach(function(t){return i.container.removeEventListener(t,i.events[e])})};for(var e in this.events)t(e)},methods:{handleStart:function(t){var e=this,i=this.$props,n=i.distance,s=i.shouldCancelStart;if(2===t.button||s(t))return!1;this._touched=!0,this._pos={x:t.pageX,y:t.pageY};var o=f(t.target,function(t){return null!=t.sortableInfo});if(o&&o.sortableInfo&&this.nodeIsChild(o)&&!this.sorting){var r=this.$props.useDragHandle,a=o.sortableInfo,h=a.index,l=a.collection;if(r&&!f(t.target,function(t){return null!=t.sortableHandle}))return;this.manager.active={index:h,collection:l},"a"===t.target.tagName.toLowerCase()&&t.preventDefault(),n||(0===this.$props.pressDelay?this.handlePress(t):this.pressTimer=setTimeout(function(){return e.handlePress(t)},this.$props.pressDelay))}},nodeIsChild:function(t){return t.sortableInfo.manager===this.manager},handleMove:function(t){var e=this.$props,i=e.distance,n=e.pressThreshold;if(!this.sorting&&this._touched){this._delta={x:this._pos.x-t.pageX,y:this._pos.y-t.pageY};var s=Math.abs(this._delta.x)+Math.abs(this._delta.y);i||n&&!(n&&n<=s)?i&&i<=s&&this.manager.isActive()&&this.handlePress(t):(clearTimeout(this.cancelTimer),this.cancelTimer=setTimeout(this.cancel,0))}},handleEnd:function(){var t=this.$props.distance;this._touched=!1,t||this.cancel()},cancel:function(){this.sorting||(clearTimeout(this.pressTimer),this.manager.active=null)},handlePress:function(t){var e,i,n=this,s=this.manager.getActive();if(s){var o=this.$props,r=o.axis,a=o.getHelperDimensions,h=o.helperClass,l=o.hideSortableGhost,f=o.useWindowAsScrollContainer,d=s.node,c=s.collection,u=d.sortableInfo.index,g=(e=d,{top:I((i=window.getComputedStyle(e)).marginTop),right:I(i.marginRight),bottom:I(i.marginBottom),left:I(i.marginLeft)}),p=this.container.getBoundingClientRect(),x=a({index:u,node:d,collection:c});this.node=d,this.margin=g,this.width=x.width,this.height=x.height,this.marginOffset={x:this.margin.left+this.margin.right,y:Math.max(this.margin.top,this.margin.bottom)},this.boundingClientRect=d.getBoundingClientRect(),this.containerBoundingRect=p,this.index=u,this.newIndex=u,this._axis={x:0<=r.indexOf("x"),y:0<=r.indexOf("y")},this.offsetEdge=this.getEdgeOffset(d),this.initialOffset=this.getOffset(t),this.initialScroll={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},this.initialWindowScroll={top:window.pageYOffset,left:window.pageXOffset};var y,m=d.querySelectorAll("input, textarea, select"),v=d.cloneNode(!0);if([].concat(w(v.querySelectorAll("input, textarea, select"))).forEach(function(t,e){"file"!==t.type&&m[e]&&(t.value=m[e].value)}),this.helper=this.document.body.appendChild(v),this.helper.style.position="fixed",this.helper.style.top=this.boundingClientRect.top-g.top+"px",this.helper.style.left=this.boundingClientRect.left-g.left+"px",this.helper.style.width=this.width+"px",this.helper.style.height=this.height+"px",this.helper.style.boxSizing="border-box",this.helper.style.pointerEvents="none",l&&((this.sortableGhost=d).style.visibility="hidden",d.style.opacity=0),this.minTranslate={},this.maxTranslate={},this._axis.x&&(this.minTranslate.x=(f?0:p.left)-this.boundingClientRect.left-this.width/2,this.maxTranslate.x=(f?this._window.innerWidth:p.left+p.width)-this.boundingClientRect.left-this.width/2),this._axis.y&&(this.minTranslate.y=(f?0:p.top)-this.boundingClientRect.top-this.height/2,this.maxTranslate.y=(f?this._window.innerHeight:p.top+p.height)-this.boundingClientRect.top-this.height/2),h)(y=this.helper.classList).add.apply(y,w(h.split(" ")));this.listenerNode=t.touches?d:this._window,b.move.forEach(function(t){return n.listenerNode.addEventListener(t,n.handleSortMove,!1)}),b.end.forEach(function(t){return n.listenerNode.addEventListener(t,n.handleSortEnd,!1)}),this.sorting=!0,this.sortingIndex=u,this.$emit("sortStart",{event:t,node:d,index:u,collection:c})}},handleSortMove:function(t){t.preventDefault(),this.updatePosition(t),this.animateNodes(),this.autoscroll(),this.$emit("sortMove",{event:t})},handleSortEnd:function(t){var e=this,i=this.manager.active.collection;this.listenerNode&&(b.move.forEach(function(t){return e.listenerNode.removeEventListener(t,e.handleSortMove)}),b.end.forEach(function(t){return e.listenerNode.removeEventListener(t,e.handleSortEnd)})),this.helper.parentNode.removeChild(this.helper),this.hideSortableGhost&&this.sortableGhost&&(this.sortableGhost.style.visibility="",this.sortableGhost.style.opacity="");for(var n=this.manager.refs[i],s=0,o=n.length;s<o;s++){var r=n[s],a=r.node;r.edgeOffset=null,a.style[O+"Transform"]="",a.style[O+"TransitionDuration"]=""}clearInterval(this.autoscrollInterval),this.autoscrollInterval=null,this.manager.active=null,this.sorting=!1,this.sortingIndex=null,this.$emit("sortEnd",{event:t,oldIndex:this.index,newIndex:this.newIndex,collection:i}),this.$emit("input",h(this.value,this.index,this.newIndex)),this._touched=!1},getEdgeOffset:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{top:0,left:0};if(t){var i={top:e.top+t.offsetTop,left:e.left+t.offsetLeft};return t.parentNode!==this.container?this.getEdgeOffset(t.parentNode,i):i}},getOffset:function(t){return{x:t.touches?t.touches[0].pageX:t.pageX,y:t.touches?t.touches[0].pageY:t.pageY}},getLockPixelOffsets:function(){var t=this.$props.lockOffset;if(Array.isArray(this.lockOffset)||(t=[t,t]),2!==t.length)throw new Error("lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given "+t);var e=g(t,2),i=e[0],n=e[1];return[this.getLockPixelOffset(i),this.getLockPixelOffset(n)]},getLockPixelOffset:function(t){var e=t,i=t,n="px";if("string"==typeof t){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);if(null===s)throw new Error('lockOffset value should be a number or a string of a number followed by "px" or "%". Given '+t);e=i=parseFloat(t),n=s[1]}if(!isFinite(e)||!isFinite(i))throw new Error("lockOffset value should be a finite. Given "+t);return"%"===n&&(e=e*this.width/100,i=i*this.height/100),{x:e,y:i}},updatePosition:function(t){var e=this.$props,i=e.lockAxis,n=e.lockToContainerEdges,s=this.getOffset(t),o={x:s.x-this.initialOffset.x,y:s.y-this.initialOffset.y};if(o.y-=window.pageYOffset-this.initialWindowScroll.top,o.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=o,n){var r=this.getLockPixelOffsets(),a=g(r,2),h=a[0],l=a[1],f=this.width/2-h.x,d=this.height/2-h.y,c=this.width/2-l.x,u=this.height/2-l.y;o.x=p(this.minTranslate.x+f,this.maxTranslate.x-c,o.x),o.y=p(this.minTranslate.y+d,this.maxTranslate.y-u,o.y)}"x"===i?o.y=0:"y"===i&&(o.x=0),this.helper.style[O+"Transform"]="translate3d("+o.x+"px,"+o.y+"px, 0)"},animateNodes:function(){var t=this.$props,e=t.transitionDuration,i=t.hideSortableGhost,n=this.manager.getOrderedRefs(),s=this.scrollContainer.scrollLeft-this.initialScroll.left,o=this.scrollContainer.scrollTop-this.initialScroll.top,r=this.offsetEdge.left+this.translate.x+s,a=this.offsetEdge.top+this.translate.y+o,h=window.pageYOffset-this.initialWindowScroll.top,l=window.pageXOffset-this.initialWindowScroll.left;this.newIndex=null;for(var f=0,d=n.length;f<d;f++){var c=n[f].node,u=c.sortableInfo.index,g=c.offsetWidth,p=c.offsetHeight,x=this.width>g?g/2:this.width/2,y=this.height>p?p/2:this.height/2,m={x:0,y:0},v=n[f].edgeOffset;v||(n[f].edgeOffset=v=this.getEdgeOffset(c));var w=f<n.length-1&&n[f+1],b=0<f&&n[f-1];w&&!w.edgeOffset&&(w.edgeOffset=this.getEdgeOffset(w.node)),u!==this.index?(e&&(c.style[O+"TransitionDuration"]=e+"ms"),this._axis.x?this._axis.y?u<this.index&&(r+l-x<=v.left&&a+h<=v.top+y||a+h+y<=v.top)?(m.x=this.width+this.marginOffset.x,v.left+m.x>this.containerBoundingRect.width-x&&(m.x=w.edgeOffset.left-v.left,m.y=w.edgeOffset.top-v.top),null===this.newIndex&&(this.newIndex=u)):u>this.index&&(r+l+x>=v.left&&a+h+y>=v.top||a+h+y>=v.top+p)&&(m.x=-(this.width+this.marginOffset.x),v.left+m.x<this.containerBoundingRect.left+x&&(m.x=b.edgeOffset.left-v.left,m.y=b.edgeOffset.top-v.top),this.newIndex=u):u>this.index&&r+l+x>=v.left?(m.x=-(this.width+this.marginOffset.x),this.newIndex=u):u<this.index&&r+l<=v.left+x&&(m.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=u)):this._axis.y&&(u>this.index&&a+h+y>=v.top?(m.y=-(this.height+this.marginOffset.y),this.newIndex=u):u<this.index&&a+h<=v.top+y&&(m.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=u))),c.style[O+"Transform"]="translate3d("+m.x+"px,"+m.y+"px,0)"):i&&((this.sortableGhost=c).style.visibility="hidden",c.style.opacity=0)}null==this.newIndex&&(this.newIndex=this.index)},autoscroll:function(){var i=this,t=this.translate,n={x:0,y:0},s={x:1,y:1},e=10,o=10;t.y>=this.maxTranslate.y-this.height/2?(n.y=1,s.y=o*Math.abs((this.maxTranslate.y-this.height/2-t.y)/this.height)):t.x>=this.maxTranslate.x-this.width/2?(n.x=1,s.x=e*Math.abs((this.maxTranslate.x-this.width/2-t.x)/this.width)):t.y<=this.minTranslate.y+this.height/2?(n.y=-1,s.y=o*Math.abs((t.y-this.height/2-this.minTranslate.y)/this.height)):t.x<=this.minTranslate.x+this.width/2&&(n.x=-1,s.x=e*Math.abs((t.x-this.width/2-this.minTranslate.x)/this.width)),this.autoscrollInterval&&(clearInterval(this.autoscrollInterval),this.autoscrollInterval=null,this.isAutoScrolling=!1),0===n.x&&0===n.y||(this.autoscrollInterval=setInterval(function(){i.isAutoScrolling=!0;var t=1*s.x*n.x,e=1*s.y*n.y;i.scrollContainer.scrollTop+=e,i.scrollContainer.scrollLeft+=t,i.translate.x+=t,i.translate.y+=e,i.animateNodes()},5))}}},o={name:"slick-list",mixins:[s],render:function(t){return t("div",this.$slots.default)}},r={name:"slick-item",mixins:[e],render:function(t){return t("div",this.$slots.default)}};t.ElementMixin=e,t.ContainerMixin=s,t.HandleDirective={bind:function(t){t.sortableHandle=!0}},t.SlickList=o,t.SlickItem=r,t.arrayMove=h,Object.defineProperty(t,"__esModule",{value:!0})});
  //# sourceMappingURL=vue-slicksort.min.js.map
  