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