index-5422c6cd.js 50 KB

1234567891011
  1. import{d as e,A as t,r as n,_ as o,o as i,j as r,w as a,c as l,F as s,q as u,x as c,ab as d,k as h,m as p,p as f,e as v,a as m,f as g,ak as b,b as y,al as w,v as x,t as _,S,s as E,am as D,a1 as C,X as I,Y as T}from"./index-9807a5c1.js";/* empty css *//* empty css *//*!
  2. * vue-draggable-next v2.2.0
  3. * (c) 2023 Anish George
  4. * @license MIT
  5. */
  6. /**!
  7. * Sortable 1.14.0
  8. * @author RubaXa <trash@rubaxa.org>
  9. * @author owenm <owen23355@gmail.com>
  10. * @license MIT
  11. */function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(){return N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},N.apply(this,arguments)}function P(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function X(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var R=X(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Y=X(/Edge/i),j=X(/firefox/i),F=X(/safari/i)&&!X(/chrome/i)&&!X(/android/i),L=X(/iP(ad|od|hone)/i),B=X(/chrome/i)&&X(/android/i),V={capture:!1,passive:!1};function U(e,t,n){e.addEventListener(t,n,!R&&V)}function $(e,t,n){e.removeEventListener(t,n,!R&&V)}function H(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(n){return!1}return!1}}function W(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function z(e,t,n,o){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&H(e,t):H(e,t))||o&&e===n)return e;if(e===n)break}while(e=W(e))}return null}var G,q=/\s+/g;function Z(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(q," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(q," ")}}function K(e,t,n){var o=e&&e.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in o||-1!==t.indexOf("webkit")||(t="-webkit-"+t),o[t]=n+("string"==typeof n?"":"px")}}function Q(e,t){var n="";if("string"==typeof e)n=e;else do{var o=K(e,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function J(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 ee(){var e=document.scrollingElement;return e||document.documentElement}function te(e,t,n,o,i){if(e.getBoundingClientRect||e===window){var r,a,l,s,u,c,d;if(e!==window&&e.parentNode&&e!==ee()?(a=(r=e.getBoundingClientRect()).top,l=r.left,s=r.bottom,u=r.right,c=r.height,d=r.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!R))do{if(i&&i.getBoundingClientRect&&("none"!==K(i,"transform")||n&&"static"!==K(i,"position"))){var h=i.getBoundingClientRect();a-=h.top+parseInt(K(i,"border-top-width")),l-=h.left+parseInt(K(i,"border-left-width")),s=a+r.height,u=l+r.width;break}}while(i=i.parentNode);if(o&&e!==window){var p=Q(i||e),f=p&&p.a,v=p&&p.d;p&&(s=(a/=v)+(c/=v),u=(l/=f)+(d/=f))}return{top:a,left:l,bottom:s,right:u,width:d,height:c}}}function ne(e,t,n){for(var o=le(e,!0),i=te(e)[t];o;){var r=te(o)[n];if(!("top"===n||"left"===n?i>=r:i<=r))return o;if(o===ee())break;o=le(o,!1)}return!1}function oe(e,t,n,o){for(var i=0,r=0,a=e.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==ct.ghost&&(o||a[r]!==ct.dragged)&&z(a[r],n.draggable,e,!1)){if(i===t)return a[r];i++}r++}return null}function ie(e,t){for(var n=e.lastElementChild;n&&(n===ct.ghost||"none"===K(n,"display")||t&&!H(n,t));)n=n.previousElementSibling;return n||null}function re(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===ct.clone||t&&!H(e,t)||n++;return n}function ae(e){var t=0,n=0,o=ee();if(e)do{var i=Q(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 le(e,t){if(!e||!e.getBoundingClientRect)return ee();var n=e,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=K(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 ee();if(o||t)return n;o=!0}}}while(n=n.parentNode);return ee()}function se(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)}function ue(e,t){return function(){if(!G){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),G=setTimeout((function(){G=void 0}),t)}}}function ce(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function de(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var he="Sortable"+(new Date).getTime();function pe(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(e){if("none"!==K(e,"display")&&e!==ct.ghost){t.push({target:e,rect:te(e)});var n=k({},t[t.length-1].rect);if(e.thisAnimationDuration){var o=Q(e,!0);o&&(n.top-=o.f,n.left-=o.e)}e.fromRect=n}}))},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n);return-1}(t,{target:e}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof n&&n());var i=!1,r=0;t.forEach((function(e){var t=0,n=e.target,a=n.fromRect,l=te(n),s=n.prevFromRect,u=n.prevToRect,c=e.rect,d=Q(n,!0);d&&(l.top-=d.f,l.left-=d.e),n.toRect=l,n.thisAnimationDuration&&se(s,l)&&!se(a,l)&&(c.top-l.top)/(c.left-l.left)==(a.top-l.top)/(a.left-l.left)&&(t=function(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}(c,s,u,o.options)),se(l,a)||(n.prevFromRect=a,n.prevToRect=l,t||(t=o.options.animation),o.animate(n,c,l,t)),t&&(i=!0,r=Math.max(r,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(e),i?e=setTimeout((function(){"function"==typeof n&&n()}),r):"function"==typeof n&&n(),t=[]},animate:function(e,t,n,o){if(o){K(e,"transition",""),K(e,"transform","");var i=Q(this.el),r=i&&i.a,a=i&&i.d,l=(t.left-n.left)/(r||1),s=(t.top-n.top)/(a||1);e.animatingX=!!l,e.animatingY=!!s,K(e,"transform","translate3d("+l+"px,"+s+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),K(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),K(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){K(e,"transition",""),K(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),o)}}}}var fe=[],ve={initializeByDefault:!0},me={mount:function(e){for(var t in ve)ve.hasOwnProperty(t)&&!(t in e)&&(e[t]=ve[t]);fe.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),fe.push(e)},pluginEvent:function(e,t,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=e+"Global";fe.forEach((function(o){t[o.pluginName]&&(t[o.pluginName][i]&&t[o.pluginName][i](k({sortable:t},n)),t.options[o.pluginName]&&t[o.pluginName][e]&&t[o.pluginName][e](k({sortable:t},n)))}))},initializePlugins:function(e,t,n,o){for(var i in fe.forEach((function(o){var i=o.pluginName;if(e.options[i]||o.initializeByDefault){var r=new o(e,t,e.options);r.sortable=e,r.options=e.options,e[i]=r,N(n,r.defaults)}})),e.options)if(e.options.hasOwnProperty(i)){var r=this.modifyOption(e,i,e.options[i]);void 0!==r&&(e.options[i]=r)}},getEventProperties:function(e,t){var n={};return fe.forEach((function(o){"function"==typeof o.eventProperties&&N(n,o.eventProperties.call(t[o.pluginName],e))})),n},modifyOption:function(e,t,n){var o;return fe.forEach((function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(o=i.optionListeners[t].call(e[i.pluginName],n))})),o}};var ge=["evt"],be=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=P(n,ge);me.pluginEvent.bind(ct)(e,t,k({dragEl:we,parentEl:xe,ghostEl:_e,rootEl:Se,nextEl:Ee,lastDownEl:De,cloneEl:Ce,cloneHidden:Ie,dragStarted:Le,putSortable:Ne,activeSortable:ct.active,originalEvent:o,oldIndex:Te,oldDraggableIndex:ke,newIndex:Ae,newDraggableIndex:Me,hideGhostForTarget:at,unhideGhostForTarget:lt,cloneNowHidden:function(){Ie=!0},cloneNowShown:function(){Ie=!1},dispatchSortableEvent:function(e){ye({sortable:t,name:e,originalEvent:o})}},i))};function ye(e){!function(e){var t=e.sortable,n=e.rootEl,o=e.name,i=e.targetEl,r=e.cloneEl,a=e.toEl,l=e.fromEl,s=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||n&&n[he]){var v,m=t.options,g="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||R||Y?(v=document.createEvent("Event")).initEvent(o,!0,!0):v=new CustomEvent(o,{bubbles:!0,cancelable:!0}),v.to=a||n,v.from=l||n,v.item=i||n,v.clone=r,v.oldIndex=s,v.newIndex=u,v.oldDraggableIndex=c,v.newDraggableIndex=d,v.originalEvent=h,v.pullMode=p?p.lastPutMode:void 0;var b=k(k({},f),me.getEventProperties(o,t));for(var y in b)v[y]=b[y];n&&n.dispatchEvent(v),m[g]&&m[g].call(t,v)}}(k({putSortable:Ne,cloneEl:Ce,targetEl:we,rootEl:Se,oldIndex:Te,oldDraggableIndex:ke,newIndex:Ae,newDraggableIndex:Me},e))}var we,xe,_e,Se,Ee,De,Ce,Ie,Te,Ae,ke,Me,Oe,Ne,Pe,Xe,Re,Ye,je,Fe,Le,Be,Ve,Ue,$e,He=!1,We=!1,ze=[],Ge=!1,qe=!1,Ze=[],Ke=!1,Qe=[],Je="undefined"!=typeof document,et=L,tt=Y||R?"cssFloat":"float",nt=Je&&!B&&!L&&"draggable"in document.createElement("div"),ot=function(){if(Je){if(R)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),it=function(e,t){var n=K(e),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=oe(e,0,t),r=oe(e,1,t),a=i&&K(i),l=r&&K(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+te(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+te(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 c="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==c?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[tt]||r&&"none"===n[tt]&&s+u>o)?"vertical":"horizontal"},rt=function(e){function t(e,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==e&&(n||l))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===e||"string"==typeof e&&e===s||e.join&&e.indexOf(s)>-1}}var n={},o=e.group;o&&"object"==M(o)||(o={name:o}),n.name=o.name,n.checkPull=t(o.pull,!0),n.checkPut=t(o.put),n.revertClone=o.revertClone,e.group=n},at=function(){!ot&&_e&&K(_e,"display","none")},lt=function(){!ot&&_e&&K(_e,"display","")};Je&&document.addEventListener("click",(function(e){if(We)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),We=!1,!1}),!0);var st=function(e){if(we){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,r=e.clientY,ze.some((function(e){var t=e[he].options.emptyInsertThreshold;if(t&&!ie(e)){var n=te(e),o=i>=n.left-t&&i<=n.right+t,l=r>=n.top-t&&r<=n.bottom+t;return o&&l?a=e:void 0}})),a);if(t){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[he]._onDragOver(n)}}var i,r,a},ut=function(e){we&&we.parentNode[he]._isOutsideThisEl(e.target)};function ct(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=N({},t),e[he]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return it(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.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!==ct.supportPointer&&"PointerEvent"in window&&!F,emptyInsertThreshold:5};for(var o in me.initializePlugins(this,e,n),n)!(o in t)&&(t[o]=n[o]);for(var i in rt(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&nt,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?U(e,"pointerdown",this._onTapStart):(U(e,"mousedown",this._onTapStart),U(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(U(e,"dragover",this),U(e,"dragenter",this)),ze.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),N(this,pe())}function dt(e,t,n,o,i,r,a,l){var s,u,c=e[he],d=c.options.onMove;return!window.CustomEvent||R||Y?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=n,s.draggedRect=o,s.related=i||t,s.relatedRect=r||te(t),s.willInsertAfter=l,s.originalEvent=a,e.dispatchEvent(s),d&&(u=d.call(c,s,a)),u}function ht(e){e.draggable=!1}function pt(){Ke=!1}function ft(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function vt(e){return setTimeout(e,0)}function mt(e){return clearTimeout(e)}ct.prototype={constructor:ct,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Be=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,we):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,o=this.options,i=o.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=o.filter;if(function(e){Qe.length=0;var t=e.getElementsByTagName("input"),n=t.length;for(;n--;){var o=t[n];o.checked&&Qe.push(o)}}(n),!we&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!F||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=z(l,o.draggable,n,!1))&&l.animated||De===l)){if(Te=re(l),ke=re(l,o.draggable),"function"==typeof u){if(u.call(this,e,l,this))return ye({sortable:t,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),be("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(u&&(u=u.split(",").some((function(o){if(o=z(s,o.trim(),n,!1))return ye({sortable:t,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),be("filter",t,{evt:e}),!0}))))return void(i&&e.cancelable&&e.preventDefault());o.handle&&!z(s,o.handle,n,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!we&&n.parentNode===r){var s=te(n);if(Se=r,xe=(we=n).parentNode,Ee=we.nextSibling,De=n,Oe=a.group,ct.dragged=we,Pe={target:we,clientX:(t||e).clientX,clientY:(t||e).clientY},je=Pe.clientX-s.left,Fe=Pe.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,we.style["will-change"]="all",o=function(){be("delayEnded",i,{evt:e}),ct.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!j&&i.nativeDraggable&&(we.draggable=!0),i._triggerDragStart(e,t),ye({sortable:i,name:"choose",originalEvent:e}),Z(we,a.chosenClass,!0))},a.ignore.split(",").forEach((function(e){J(we,e.trim(),ht)})),U(l,"dragover",st),U(l,"mousemove",st),U(l,"touchmove",st),U(l,"mouseup",i._onDrop),U(l,"touchend",i._onDrop),U(l,"touchcancel",i._onDrop),j&&this.nativeDraggable&&(this.options.touchStartThreshold=4,we.draggable=!0),be("delayStart",this,{evt:e}),!a.delay||a.delayOnTouchOnly&&!t||this.nativeDraggable&&(Y||R))o();else{if(ct.eventCanceled)return void this._onDrop();U(l,"mouseup",i._disableDelayedDrag),U(l,"touchend",i._disableDelayedDrag),U(l,"touchcancel",i._disableDelayedDrag),U(l,"mousemove",i._delayedDragTouchMoveHandler),U(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&U(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){we&&ht(we),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;$(e,"mouseup",this._disableDelayedDrag),$(e,"touchend",this._disableDelayedDrag),$(e,"touchcancel",this._disableDelayedDrag),$(e,"mousemove",this._delayedDragTouchMoveHandler),$(e,"touchmove",this._delayedDragTouchMoveHandler),$(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?U(document,"pointermove",this._onTouchMove):U(document,t?"touchmove":"mousemove",this._onTouchMove):(U(we,"dragend",this),U(Se,"dragstart",this._onDragStart));try{document.selection?vt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(e,t){if(He=!1,Se&&we){be("dragStarted",this,{evt:t}),this.nativeDraggable&&U(document,"dragover",ut);var n=this.options;!e&&Z(we,n.dragClass,!1),Z(we,n.ghostClass,!0),ct.active=this,e&&this._appendGhost(),ye({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Xe){this._lastX=Xe.clientX,this._lastY=Xe.clientY,at();for(var e=document.elementFromPoint(Xe.clientX,Xe.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Xe.clientX,Xe.clientY))!==t;)t=e;if(we.parentNode[he]._isOutsideThisEl(e),t)do{if(t[he]){if(t[he]._onDragOver({clientX:Xe.clientX,clientY:Xe.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);lt()}},_onTouchMove:function(e){if(Pe){var t=this.options,n=t.fallbackTolerance,o=t.fallbackOffset,i=e.touches?e.touches[0]:e,r=_e&&Q(_e,!0),a=_e&&r&&r.a,l=_e&&r&&r.d,s=et&&$e&&ae($e),u=(i.clientX-Pe.clientX+o.x)/(a||1)+(s?s[0]-Ze[0]:0)/(a||1),c=(i.clientY-Pe.clientY+o.y)/(l||1)+(s?s[1]-Ze[1]:0)/(l||1);if(!ct.active&&!He){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(_e){r?(r.e+=u-(Re||0),r.f+=c-(Ye||0)):r={a:1,b:0,c:0,d:1,e:u,f:c};var d="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");K(_e,"webkitTransform",d),K(_e,"mozTransform",d),K(_e,"msTransform",d),K(_e,"transform",d),Re=u,Ye=c,Xe=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!_e){var e=this.options.fallbackOnBody?document.body:Se,t=te(we,!0,et,!0,e),n=this.options;if(et){for($e=e;"static"===K($e,"position")&&"none"===K($e,"transform")&&$e!==document;)$e=$e.parentNode;$e!==document.body&&$e!==document.documentElement?($e===document&&($e=ee()),t.top+=$e.scrollTop,t.left+=$e.scrollLeft):$e=ee(),Ze=ae($e)}Z(_e=we.cloneNode(!0),n.ghostClass,!1),Z(_e,n.fallbackClass,!0),Z(_e,n.dragClass,!0),K(_e,"transition",""),K(_e,"transform",""),K(_e,"box-sizing","border-box"),K(_e,"margin",0),K(_e,"top",t.top),K(_e,"left",t.left),K(_e,"width",t.width),K(_e,"height",t.height),K(_e,"opacity","0.8"),K(_e,"position",et?"absolute":"fixed"),K(_e,"zIndex","100000"),K(_e,"pointerEvents","none"),ct.ghost=_e,e.appendChild(_e),K(_e,"transform-origin",je/parseInt(_e.style.width)*100+"% "+Fe/parseInt(_e.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,o=e.dataTransfer,i=n.options;be("dragStart",this,{evt:e}),ct.eventCanceled?this._onDrop():(be("setupClone",this),ct.eventCanceled||((Ce=de(we)).draggable=!1,Ce.style["will-change"]="",this._hideClone(),Z(Ce,this.options.chosenClass,!1),ct.clone=Ce),n.cloneId=vt((function(){be("clone",n),ct.eventCanceled||(n.options.removeCloneOnHide||Se.insertBefore(Ce,we),n._hideClone(),ye({sortable:n,name:"clone"}))})),!t&&Z(we,i.dragClass,!0),t?(We=!0,n._loopId=setInterval(n._emulateDragOver,50)):($(document,"mouseup",n._onDrop),$(document,"touchend",n._onDrop),$(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,we)),U(document,"drop",n),K(we,"transform","translateZ(0)")),He=!0,n._dragStartId=vt(n._dragStarted.bind(n,t,e)),U(document,"selectstart",n),Le=!0,F&&K(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,o,i,r=this.el,a=e.target,l=this.options,s=l.group,u=ct.active,c=Oe===s,d=l.sort,h=Ne||u,p=this,f=!1;if(!Ke){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),a=z(a,l.draggable,r,!0),A("dragOver"),ct.eventCanceled)return f;if(we.contains(e.target)||a.animated&&a.animatingX&&a.animatingY||p._ignoreWhileAnimating===a)return O(!1);if(We=!1,u&&!l.disabled&&(c?d||(o=xe!==Se):Ne===this||(this.lastPutMode=Oe.checkPull(this,u,we,e))&&s.checkPut(this,u,we,e))){if(i="vertical"===this._getDirection(e,a),t=te(we),A("dragOverValid"),ct.eventCanceled)return f;if(o)return xe=Se,M(),this._hideClone(),A("revert"),ct.eventCanceled||(Ee?Se.insertBefore(we,Ee):Se.appendChild(we)),O(!0);var v=ie(r,l.draggable);if(!v||function(e,t,n){var o=te(ie(n.el,n.options.draggable)),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}(e,i,this)&&!v.animated){if(v===we)return O(!1);if(v&&r===e.target&&(a=v),a&&(n=te(a)),!1!==dt(Se,r,we,t,a,n,e,!!a))return M(),r.appendChild(we),xe=r,N(),O(!0)}else if(v&&function(e,t,n){var o=te(oe(n.el,0,n.options,!0)),i=10;return t?e.clientX<o.left-i||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-i||e.clientY<o.bottom&&e.clientX<o.left}(e,i,this)){var m=oe(r,0,l,!0);if(m===we)return O(!1);if(n=te(a=m),!1!==dt(Se,r,we,t,a,n,e,!1))return M(),r.insertBefore(we,m),xe=r,N(),O(!0)}else if(a.parentNode===r){n=te(a);var g,b,y,w=we.parentNode!==r,x=!function(e,t,n){var o=n?e.left:e.top,i=n?e.right:e.bottom,r=n?e.width:e.height,a=n?t.left:t.top,l=n?t.right:t.bottom,s=n?t.width:t.height;return o===a||i===l||o+r/2===a+s/2}(we.animated&&we.toRect||t,a.animated&&a.toRect||n,i),_=i?"top":"left",S=ne(a,"top","top")||ne(we,"top","top"),E=S?S.scrollTop:void 0;if(Be!==a&&(b=n[_],Ge=!1,qe=!x&&l.invertSwap||w),g=function(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,d=o?n.bottom:n.right,h=!1;if(!a)if(l&&Ue<u*i){if(!Ge&&(1===Ve?s>c+u*r/2:s<d-u*r/2)&&(Ge=!0),Ge)h=!0;else if(1===Ve?s<c+Ue:s>d-Ue)return-Ve}else if(s>c+u*(1-i)/2&&s<d-u*(1-i)/2)return function(e){return re(we)<re(e)?1:-1}(t);if((h=h||a)&&(s<c+u*r/2||s>d-u*r/2))return s>c+u/2?1:-1;return 0}(e,a,n,i,x?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,qe,Be===a),0!==g){var D=re(we);do{D-=g,y=xe.children[D]}while(y&&("none"===K(y,"display")||y===_e))}if(0===g||y===a)return O(!1);Be=a,Ve=g;var C=a.nextElementSibling,I=!1,T=dt(Se,r,we,t,a,n,e,I=1===g);if(!1!==T)return 1!==T&&-1!==T||(I=1===T),Ke=!0,setTimeout(pt,30),M(),I&&!C?r.appendChild(we):a.parentNode.insertBefore(we,I?C:a),S&&ce(S,0,E-S.scrollTop),xe=we.parentNode,void 0===b||qe||(Ue=Math.abs(b-te(a)[_])),N(),O(!0)}if(r.contains(we))return O(!1)}return!1}function A(l,s){be(l,p,k({evt:e,isOwner:c,axis:i?"vertical":"horizontal",revert:o,dragRect:t,targetRect:n,canSort:d,fromSortable:h,target:a,completed:O,onMove:function(n,o){return dt(Se,r,we,t,n,te(n),e,o)},changed:N},s))}function M(){A("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function O(t){return A("dragOverCompleted",{insertion:t}),t&&(c?u._hideClone():u._showClone(p),p!==h&&(Z(we,Ne?Ne.options.ghostClass:u.options.ghostClass,!1),Z(we,l.ghostClass,!0)),Ne!==p&&p!==ct.active?Ne=p:p===ct.active&&Ne&&(Ne=null),h===p&&(p._ignoreWhileAnimating=a),p.animateAll((function(){A("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(a===we&&!we.animated||a===r&&!a.animated)&&(Be=null),l.dragoverBubble||e.rootEl||a===document||(we.parentNode[he]._isOutsideThisEl(e.target),!t&&st(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function N(){Ae=re(we),Me=re(we,l.draggable),ye({sortable:p,name:"change",toEl:r,newIndex:Ae,newDraggableIndex:Me,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){$(document,"mousemove",this._onTouchMove),$(document,"touchmove",this._onTouchMove),$(document,"pointermove",this._onTouchMove),$(document,"dragover",st),$(document,"mousemove",st),$(document,"touchmove",st)},_offUpEvents:function(){var e=this.el.ownerDocument;$(e,"mouseup",this._onDrop),$(e,"touchend",this._onDrop),$(e,"pointerup",this._onDrop),$(e,"touchcancel",this._onDrop),$(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;Ae=re(we),Me=re(we,n.draggable),be("drop",this,{evt:e}),xe=we&&we.parentNode,Ae=re(we),Me=re(we,n.draggable),ct.eventCanceled||(He=!1,qe=!1,Ge=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),mt(this.cloneId),mt(this._dragStartId),this.nativeDraggable&&($(document,"drop",this),$(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),F&&K(document.body,"user-select",""),K(we,"transform",""),e&&(Le&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),_e&&_e.parentNode&&_e.parentNode.removeChild(_e),(Se===xe||Ne&&"clone"!==Ne.lastPutMode)&&Ce&&Ce.parentNode&&Ce.parentNode.removeChild(Ce),we&&(this.nativeDraggable&&$(we,"dragend",this),ht(we),we.style["will-change"]="",Le&&!He&&Z(we,Ne?Ne.options.ghostClass:this.options.ghostClass,!1),Z(we,this.options.chosenClass,!1),ye({sortable:this,name:"unchoose",toEl:xe,newIndex:null,newDraggableIndex:null,originalEvent:e}),Se!==xe?(Ae>=0&&(ye({rootEl:xe,name:"add",toEl:xe,fromEl:Se,originalEvent:e}),ye({sortable:this,name:"remove",toEl:xe,originalEvent:e}),ye({rootEl:xe,name:"sort",toEl:xe,fromEl:Se,originalEvent:e}),ye({sortable:this,name:"sort",toEl:xe,originalEvent:e})),Ne&&Ne.save()):Ae!==Te&&Ae>=0&&(ye({sortable:this,name:"update",toEl:xe,originalEvent:e}),ye({sortable:this,name:"sort",toEl:xe,originalEvent:e})),ct.active&&(null!=Ae&&-1!==Ae||(Ae=Te,Me=ke),ye({sortable:this,name:"end",toEl:xe,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){be("nulling",this),Se=we=xe=_e=Ee=Ce=De=Ie=Pe=Xe=Le=Ae=Me=Te=ke=Be=Ve=Ne=Oe=ct.dragged=ct.ghost=ct.clone=ct.active=null,Qe.forEach((function(e){e.checked=!0})),Qe.length=Re=Ye=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":we&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)z(e=n[o],r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||ft(e));return t},sort:function(e,t){var n={},o=this.el;this.toArray().forEach((function(e,t){var i=o.children[t];z(i,this.options.draggable,o,!1)&&(n[e]=i)}),this),t&&this.captureAnimationState(),e.forEach((function(e){n[e]&&(o.removeChild(n[e]),o.appendChild(n[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return z(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var o=me.modifyOption(this,e,t);n[e]=void 0!==o?o:t,"group"===e&&rt(n)},destroy:function(){be("destroy",this);var e=this.el;e[he]=null,$(e,"mousedown",this._onTapStart),$(e,"touchstart",this._onTapStart),$(e,"pointerdown",this._onTapStart),this.nativeDraggable&&($(e,"dragover",this),$(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),ze.splice(ze.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ie){if(be("hideClone",this),ct.eventCanceled)return;K(Ce,"display","none"),this.options.removeCloneOnHide&&Ce.parentNode&&Ce.parentNode.removeChild(Ce),Ie=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(Ie){if(be("showClone",this),ct.eventCanceled)return;we.parentNode!=Se||this.options.group.revertClone?Ee?Se.insertBefore(Ce,Ee):Se.appendChild(Ce):Se.insertBefore(Ce,we),this.options.group.revertClone&&this.animate(we,Ce),K(Ce,"display",""),Ie=!1}}else this._hideClone()}},Je&&U(document,"touchmove",(function(e){(ct.active||He)&&e.cancelable&&e.preventDefault()})),ct.utils={on:U,off:$,css:K,find:J,is:function(e,t){return!!z(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:ue,closest:z,toggleClass:Z,clone:de,index:re,nextTick:vt,cancelNextTick:mt,detectDirection:it,getChild:oe},ct.get=function(e){return e[he]},ct.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(ct.utils=k(k({},ct.utils),e.utils)),me.mount(e)}))},ct.create=function(e,t){return new ct(e,t)},ct.version="1.14.0";var gt,bt,yt,wt,xt,_t,St=[],Et=!1;function Dt(){St.forEach((function(e){clearInterval(e.pid)})),St=[]}function Ct(){clearInterval(_t)}var It=ue((function(e,t,n,o){if(t.scroll){var i,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,u=ee(),c=!1;bt!==n&&(bt=n,Dt(),gt=t.scroll,i=t.scrollFn,!0===gt&&(gt=le(n,!0)));var d=0,h=gt;do{var p=h,f=te(p),v=f.top,m=f.bottom,g=f.left,b=f.right,y=f.width,w=f.height,x=void 0,_=void 0,S=p.scrollWidth,E=p.scrollHeight,D=K(p),C=p.scrollLeft,I=p.scrollTop;p===u?(x=y<S&&("auto"===D.overflowX||"scroll"===D.overflowX||"visible"===D.overflowX),_=w<E&&("auto"===D.overflowY||"scroll"===D.overflowY||"visible"===D.overflowY)):(x=y<S&&("auto"===D.overflowX||"scroll"===D.overflowX),_=w<E&&("auto"===D.overflowY||"scroll"===D.overflowY));var T=x&&(Math.abs(b-r)<=l&&C+y<S)-(Math.abs(g-r)<=l&&!!C),A=_&&(Math.abs(m-a)<=l&&I+w<E)-(Math.abs(v-a)<=l&&!!I);if(!St[d])for(var k=0;k<=d;k++)St[k]||(St[k]={});St[d].vx==T&&St[d].vy==A&&St[d].el===p||(St[d].el=p,St[d].vx=T,St[d].vy=A,clearInterval(St[d].pid),0==T&&0==A||(c=!0,St[d].pid=setInterval(function(){o&&0===this.layer&&ct.active._onTouchMove(xt);var t=St[this.layer].vy?St[this.layer].vy*s:0,n=St[this.layer].vx?St[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(ct.dragged.parentNode[he],n,t,e,xt,St[this.layer].el)||ce(St[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==u&&(h=le(h,!1)));Et=c}}),30),Tt=function(e){var t=e.originalEvent,n=e.putSortable,o=e.dragEl,i=e.activeSortable,r=e.dispatchSortableEvent,a=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var s=n||i;a();var u=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(u.clientX,u.clientY);l(),s&&!s.el.contains(c)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function At(){}function kt(){}At.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=oe(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Tt},N(At,{pluginName:"revertOnSpill"}),kt.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Tt},N(kt,{pluginName:"removeOnSpill"}),ct.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?U(document,"dragover",this._handleAutoScroll):this.options.supportPointer?U(document,"pointermove",this._handleFallbackAutoScroll):t.touches?U(document,"touchmove",this._handleFallbackAutoScroll):U(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?$(document,"dragover",this._handleAutoScroll):($(document,"pointermove",this._handleFallbackAutoScroll),$(document,"touchmove",this._handleFallbackAutoScroll),$(document,"mousemove",this._handleFallbackAutoScroll)),Ct(),Dt(),clearTimeout(G),G=void 0},nulling:function(){xt=bt=gt=Et=_t=yt=wt=null,St.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(o,i);if(xt=e,t||this.options.forceAutoScrollFallback||Y||R||F){It(e,this.options,r,t);var a=le(r,!0);!Et||_t&&o===yt&&i===wt||(_t&&Ct(),_t=setInterval((function(){var r=le(document.elementFromPoint(o,i),!0);r!==a&&(a=r,Dt()),It(e,n.options,r,t)}),10),yt=o,wt=i)}else{if(!this.options.bubbleScroll||le(r,!0)===ee())return void Dt();It(e,this.options,le(r,!1),!1)}}},N(e,{pluginName:"scroll",initializeByDefault:!0})}),ct.mount(kt,At);const Mt="undefined"!=typeof window?window.console:global.console;const Ot=/-(\w)/g,Nt=function(e){const t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}((e=>e.replace(Ot,((e,t)=>t?t.toUpperCase():""))));function Pt(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function Xt(e,t,n){const o=0===n?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,o)}function Rt(e,t){this.$nextTick((()=>this.$emit(e.toLowerCase(),t)))}function Yt(e){return t=>{null!==this.realList&&this["onDrag"+e](t),Rt.call(this,e,t)}}const jt=["Start","Add","Remove","Update","End"],Ft=["Choose","Unchoose","Sort","Filter","Clone"],Lt=["Move",...jt,...Ft].map((e=>"on"+e));let Bt=null;const Vt={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},Ut=e({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...jt.map((e=>e.toLowerCase())),...Ft.map((e=>e.toLowerCase()))],props:Vt,data:()=>({transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}),render(){const e=this.$slots.default?this.$slots.default():null,n=(o=this.$attrs,(i=this.componentData)?{...i.props,...i.attrs}:o);var o,i;return e?(this.transitionMode=function(e){if(!e||1!==e.length)return!1;const[{type:t}]=e;return!!t&&(n=t.name,["transition-group","TransitionGroup"].includes(n));var n}(e),t(this.getTag(),n,e)):t(this.getTag(),n,[])},created(){null!==this.list&&null!==this.modelValue&&Mt.error("list props are mutually exclusive! Please set one.")},mounted(){const e={};jt.forEach((t=>{e["on"+t]=Yt.call(this,t)})),Ft.forEach((t=>{e["on"+t]=Rt.bind(this,t)}));const t=Object.keys(this.$attrs).reduce(((e,t)=>(e[Nt(t)]=this.$attrs[t],e)),{}),n=Object.assign({},t,e,{onMove:(e,t)=>this.onDragMove(e,t)});!("draggable"in n)&&(n.draggable=">*");const o=1===this.$el.nodeType?this.$el:this.$el.parentElement;this._sortable=new ct(o,n),o.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{void 0!==this._sortable&&this._sortable.destroy()}catch(e){}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(e){this.updateOptions(e)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?n(this.component):this.tag},updateOptions(e){for(var t in e){const n=Nt(t);-1===Lt.indexOf(n)&&this._sortable.option(n,e[t])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick((()=>{this.visibleIndexes=function(e,t,n,o){if(!e)return[];const i=Object.values(e),r=t.length-o;return[...t].map(((e,t)=>t>=r?i.length:i.indexOf(e)))}(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)}))},getUnderlyingVm(e){const t=function(e,t){return Object.values(e).indexOf(t)}(this.getChildrenNodes()||[],e);if(-1===t)return null;return{index:t,element:this.realList[t]}},emitChanges(e){this.$nextTick((()=>{this.$emit("change",e)}))},alterList(e){if(this.list)return void e(this.list);const t=[...this.modelValue];e(t),this.$emit("update:modelValue",t)},spliceList(){this.alterList((e=>e.splice(...arguments)))},updatePosition(e,t){this.alterList((n=>n.splice(t,0,n.splice(e,1)[0])))},getVmIndex(e){const t=this.visibleIndexes,n=t.length;return e>n-1?n:t[e]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(e){if(!this.noTransitionOnDrag||!this.transitionMode)return;this.getChildrenNodes()[e].data=null;const t=this.getComponent();t.children=[],t.kept=void 0},onDragStart(e){this.computeIndexes(),this.context=this.getUnderlyingVm(e.item),this.context&&(e.item._underlying_vm_=this.clone(this.context.element),Bt=e.item)},onDragAdd(e){const t=e.item._underlying_vm_;if(void 0===t)return;Pt(e.item);const n=this.getVmIndex(e.newIndex);this.spliceList(n,0,t),this.computeIndexes();const o={element:t,newIndex:n};this.emitChanges({added:o})},onDragRemove(e){if(Xt(this.$el,e.item,e.oldIndex),"clone"===e.pullMode)return void Pt(e.clone);if(!this.context)return;const t=this.context.index;this.spliceList(t,1);const n={element:this.context.element,oldIndex:t};this.resetTransitionData(t),this.emitChanges({removed:n})},onDragUpdate(e){Pt(e.item),Xt(e.from,e.item,e.oldIndex);const t=this.context.index,n=this.getVmIndex(e.newIndex);this.updatePosition(t,n);const o={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:o})},updateProperty(e,t){e.hasOwnProperty(t)&&(e[t]+=this.headerOffset)},onDragMove(e,t){const n=this.move;if(!n||!this.realList)return!0;const o=this.getRelatedContextFromMoveEvent(e),i=this.context,r=this.computeFutureIndex(o,e);Object.assign(i,{futureIndex:r});return n(Object.assign({},e,{relatedContext:o,draggedContext:i}),t)},onDragEnd(){this.computeIndexes(),Bt=null},getTrargetedComponent:e=>e.__draggable_component__,getRelatedContextFromMoveEvent({to:e,related:t}){const n=this.getTrargetedComponent(e);if(!n)return{component:n};const o=n.realList,i={list:o,component:n};if(e!==t&&o&&n.getUnderlyingVm){const e=n.getUnderlyingVm(t);if(e)return Object.assign(e,i)}return i},computeFutureIndex(e,t){const n=[...t.to.children].filter((e=>"none"!==e.style.display));if(0===n.length)return 0;const o=n.indexOf(t.related),i=e.component.getVmIndex(o);return-1!==n.indexOf(Bt)||!t.willInsertAfter?i:i+1}}});const $t=o(e({components:{draggable:Ut},props:{headerText:{type:String,default:"header"},list:{type:Array,default:()=>[]},classString:{type:String,default:"board-column-content"},disabled:{type:Boolean,default:!1},options:{type:Object,default:()=>null}},setup:(e,{emit:t})=>({onEnd:e=>{t("end",e)}})}),[["render",function(e,t,o,h,p,f){const v=n("draggable");return i(),r(v,d({list:e.list},e.$attrs,{class:e.classString,disabled:e.disabled,onEnd:e.onEnd}),{default:a((()=>[(i(!0),l(s,null,u(e.list,((t,n)=>c(e.$slots,"default",{key:t.id,item:t,index:n},void 0,!0))),128))])),_:3},16,["list","class","disabled","onEnd"])}],["__scopeId","data-v-1b54743e"]]),Ht=e=>(I("data-v-14d84d1b"),e=e(),T(),e),Wt={class:"custom-menu"},zt={class:"menu-container"},Gt={class:"device-wrap"},qt={class:"device device-iphone-x"},Zt={class:"device-frame"},Kt={class:"device-content"},Qt={class:"wechat-header"},Jt={class:"header-inner"},en={class:"wechat-menu"},tn=["onClick"],nn={key:0,class:"children-menu-items"},on=["onClick"],rn=D('<div class="device-stripe" data-v-14d84d1b></div><div class="device-header" data-v-14d84d1b></div><div class="device-sensors" data-v-14d84d1b></div><div class="device-btns" data-v-14d84d1b></div><div class="device-power" data-v-14d84d1b></div>',5),an={class:"edit-wrap"},ln={key:0},sn={class:"edit-content-wrap"},un={class:"edit-title"},cn={key:0,class:"notice-text"},dn={class:"edit-form"},hn={key:0},pn={key:1},fn=Ht((()=>v("span",{style:{color:"#fd555d","padding-left":"10px"}},"受微信限制,如您发现微信显示有问题,请减少内容",-1))),vn={key:0},mn={key:1},gn=[Ht((()=>v("p",{class:"no-init"},"点击左侧菜单进行编辑操作",-1)))],bn={class:"menu-save"},yn=o(e({__name:"index",setup(e){const t=h(3),o=h({curActiveIndex:null,curSubActiveIndex:null,clickSubMenu:!1,init:!1,buttons:[]}),s=e=>e.showChildMenu,u=p((()=>{var e,t,n,i,r,a,l,s,u,c;return(null==(r=null==(i=null==(t=o.value)?void 0:t.buttons[null==(e=o.value)?void 0:e.curActiveIndex])?void 0:i.sub_button[null==(n=o.value)?void 0:n.curSubActiveIndex])?void 0:r.name)||(null==(c=null==(u=null==(l=o.value)?void 0:l.buttons[null==(a=o.value)?void 0:a.curActiveIndex])?void 0:u.sub_button[null==(s=o.value)?void 0:s.curSubActiveIndex])?void 0:c.type)})),c=h(!0),d=e=>{o.value.init=!0,o.value.clickSubMenu=!1,o.value.curSubActiveIndex=null,o.value.curActiveIndex=e.newDraggableIndex,o.value.buttons.forEach((e=>e.showChildMenu=!1)),o.value.buttons[e.newDraggableIndex].showChildMenu=!0},D=e=>{o.value.curSubActiveIndex=e.newDraggableIndex},I=()=>{o.value.init=!0,o.value.clickSubMenu=!0;let e=o.value.curActiveIndex;o.value.buttons[e].sub_button.push({name:"子菜单名称",url:"",url2:"",key:"",type:"link",keyword:"",linkcontent:"",imgUrl:"",sendMsgType:"template",sendCustomUrl:""}),o.value.curSubActiveIndex=o.value.buttons[e].sub_button.length-1,o.value.buttons[e].hasChild=!0},T=()=>{o.value.curActiveIndex=null,o.value.curSubActiveIndex=null,o.value.init=!1};return f((()=>{o.value={curActiveIndex:0,curSubActiveIndex:null,clickSubMenu:!1,init:!0,buttons:[{name:"签到",hasChild:!1,showChildMenu:!0,type:"link",url:"",url2:"",key:"daily_sign",sub_button:[],keyword:"",linkcontent:"",imgUrl:"",sendMsgType:"template"},{name:"最近阅读",hasChild:!1,showChildMenu:!1,type:"event",url:"",url2:"",key:"recent_read",sub_button:[],keyword:"",linkcontent:"",imgUrl:"",sendMsgType:"template"},{name:"菜单名称3",hasChild:!0,showChildMenu:!1,type:"link",url:"",url2:"",key:"",keyword:"",linkcontent:"",imgUrl:"",sendMsgType:"template",sendCustomUrl:"",sub_button:[{key:"",type:"link",name:"子菜单名称",url:"http://sitexyvz5mexll52mzn4.pre.aizhuishu.com/recent",url2:"",keyword:"",linkcontent:"",sendMsgType:"template",imgUrl:""}]}]}})),(e,h)=>{var p,f,A,k,M,O,N;const P=n("el-icon"),X=$t,R=n("el-input"),Y=n("el-form-item"),j=n("el-radio"),F=n("el-radio-group"),L=n("el-form"),B=n("el-button");return i(),l("div",Wt,[v("div",zt,[v("div",Gt,[v("div",qt,[v("div",Zt,[v("div",Kt,[v("div",Qt,[v("div",Jt,[m(P,{class:"ml-3"},{default:a((()=>[m(g(b))])),_:1}),y(" 公众号 "),m(P,{class:"mr-3"},{default:a((()=>[m(g(w))])),_:1})])]),v("div",en,[m(X,{list:g(o).buttons,classString:"flex-warpper",onEnd:d},{default:a((({item:e,index:n})=>{var r;return[(i(),l("div",{class:"wechat-menu-item",key:n},[v("p",{class:x(["menu-name",{"cur-menu":n===g(o).curActiveIndex}]),onClick:e=>(e=>{o.value.init=!0,o.value.clickSubMenu=!1,o.value.curSubActiveIndex=null;let n=o.value.buttons;if(e===o.value.curActiveIndex)return;if(null!==o.value.curActiveIndex&&o.value.buttons[o.value.curActiveIndex]&&(o.value.buttons[o.value.curActiveIndex].showChildMenu=!1),o.value.curActiveIndex=e,n[e])return void(o.value.buttons[o.value.curActiveIndex]&&(o.value.buttons[o.value.curActiveIndex].showChildMenu=!0));if(n.length>=t.value)return;o.value.buttons.push({name:"菜单名称",hasChild:!1,showChildMenu:!0,type:"link",url:"",url2:"",key:"",keyword:"",linkcontent:"",imgUrl:"",sendMsgType:"template",sendCustomUrl:"",sub_button:[]})})(n)},_(e.name),11,tn),s(e)?(i(),l("div",nn,[m(X,{list:e.sub_button,onEnd:D},{default:a((({item:e,index:t})=>[(i(),l("div",{class:"children-menu-item",key:t,onClick:e=>{var n;(n=t)!==o.value.curSubActiveIndex&&(o.value.init=!0,o.value.clickSubMenu=!0,o.value.curSubActiveIndex=n)}},[v("p",{class:x(["menu-name",{"cur-name":g(o).curSubActiveIndex===t}])},_(e.name),3)],8,on))])),_:2},1032,["list"]),(null==(r=null==e?void 0:e.sub_button)?void 0:r.length)<5?(i(),l("div",{key:0,class:"children-menu-item",onClick:I},[m(P,null,{default:a((()=>[m(g(S))])),_:1})])):E("",!0)])):E("",!0)]))]})),_:1},8,["list"])])])]),rn])]),v("div",an,[g(o).init?(i(),l("div",ln,[v("div",sn,[v("p",un,[y(_(g(o).clickSubMenu?null==(A=null==(f=null==(p=g(o))?void 0:p.buttons[g(o).curActiveIndex])?void 0:f.sub_button[g(o).curSubActiveIndex])?void 0:A.name:null==(M=null==(k=g(o))?void 0:k.buttons[g(o).curActiveIndex])?void 0:M.name)+" ",1),v("span",{class:"del-menu",onClick:h[0]||(h[0]=e=>(e=>{let t=o.value.curActiveIndex,n=o.value.curSubActiveIndex;C.confirm(e?"删除后“子菜单名称”菜单下设置的内容将被删除":"删除后“菜单名称”菜单下设置的内容将被删除","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{e?(o.value.buttons[t].sub_button.splice(n,1),o.value.buttons[t].hasChild=o.value.buttons[t].sub_button.length>0,o.value.curSubActiveIndex=null,o.value.init=!1):(o.value.buttons.splice(t,1),o.value.buttons.length||(c.value=!0),T())})).catch((()=>{}))})(g(o).clickSubMenu))}," 删除"+_(g(o).clickSubMenu?"子菜单":"菜单"),1)]),g(o).buttons[g(o).curActiveIndex].hasChild&&!g(o).clickSubMenu?(i(),l("p",cn," 已添加子菜单,仅可设置菜单名称。 ")):E("",!0),v("div",dn,[g(o).clickSubMenu?(i(),l("div",hn,[m(L,{model:g(o).buttons[g(o).curActiveIndex].sub_button[g(o).curSubActiveIndex],"label-width":"100px","label-position":"left"},{default:a((()=>[g(u)?(i(),r(Y,{key:0,label:"子菜单名称",prop:"title"},{default:a((()=>[m(R,{modelValue:g(o).buttons[g(o).curActiveIndex].sub_button[g(o).curSubActiveIndex].name,"onUpdate:modelValue":h[1]||(h[1]=e=>g(o).buttons[g(o).curActiveIndex].sub_button[g(o).curSubActiveIndex].name=e),style:{width:"260px"}},null,8,["modelValue"])])),_:1})):E("",!0),g(u)?(i(),r(Y,{key:1,label:"子菜单内容"},{default:a((()=>[m(F,{modelValue:g(o).buttons[g(o).curActiveIndex].sub_button[g(o).curSubActiveIndex].type,"onUpdate:modelValue":h[2]||(h[2]=e=>g(o).buttons[g(o).curActiveIndex].sub_button[g(o).curSubActiveIndex].type=e)},{default:a((()=>[m(j,{class:"radio",label:"link"},{default:a((()=>[y("跳转网页")])),_:1}),m(j,{class:"radio",label:"event"},{default:a((()=>[y("发送消息")])),_:1}),m(j,{class:"radio",label:"hdlink"},{default:a((()=>[y("互动链")])),_:1})])),_:1},8,["modelValue"])])),_:1})):E("",!0)])),_:1},8,["model"])])):(i(),l("div",pn,[m(L,{model:null==(N=g(o))?void 0:N.buttons[null==(O=g(o))?void 0:O.curActiveIndex],"label-width":"100px","label-position":"left"},{default:a((()=>[m(Y,{label:"菜单名称",prop:"title"},{default:a((()=>[m(R,{modelValue:g(o).buttons[g(o).curActiveIndex].name,"onUpdate:modelValue":h[3]||(h[3]=e=>g(o).buttons[g(o).curActiveIndex].name=e),style:{width:"260px"},maxlength:10,placeholder:"请输入菜单名称(最多10个字符)"},null,8,["modelValue"]),fn])),_:1}),g(o).buttons[g(o).curActiveIndex].sub_button.length?E("",!0):(i(),l("div",vn,[m(Y,{label:"菜单内容"},{default:a((()=>[m(F,{modelValue:g(o).buttons[g(o).curActiveIndex].type,"onUpdate:modelValue":h[4]||(h[4]=e=>g(o).buttons[g(o).curActiveIndex].type=e)},{default:a((()=>[m(j,{class:"radio",label:"link"},{default:a((()=>[y("跳转网页")])),_:1}),m(j,{class:"radio",label:"event"},{default:a((()=>[y("发送消息")])),_:1}),m(j,{class:"radio",label:"hdlink"},{default:a((()=>[y("互动链")])),_:1})])),_:1},8,["modelValue"])])),_:1})]))])),_:1},8,["model"])]))])])])):(i(),l("div",mn,gn))])]),v("div",bn,[m(B,{type:"primary",disabled:g(c)},{default:a((()=>[y("保存")])),_:1},8,["disabled"])])])}}}),[["__scopeId","data-v-14d84d1b"]]);export{yn as default};