@kvass/widgets 1.8.40 → 1.8.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -2032,4 +2032,4 @@ ${r.vertexSource}`;const g=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost(
|
|
|
2032
2032
|
* @author RubaXa <trash@rubaxa.org>
|
|
2033
2033
|
* @author owenm <owen23355@gmail.com>
|
|
2034
2034
|
* @license MIT
|
|
2035
|
-
*/function sT(h,d){var m=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);d&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(h,T).enumerable})),m.push.apply(m,x)}return m}function tn(h){for(var d=1;d<arguments.length;d++){var m=arguments[d]!=null?arguments[d]:{};d%2?sT(Object(m),!0).forEach(function(x){UO(h,x,m[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(m)):sT(Object(m)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(m,x))})}return h}function pd(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pd=function(d){return typeof d}:pd=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},pd(h)}function UO(h,d,m){return d in h?Object.defineProperty(h,d,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[d]=m,h}function kn(){return kn=Object.assign||function(h){for(var d=1;d<arguments.length;d++){var m=arguments[d];for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&(h[x]=m[x])}return h},kn.apply(this,arguments)}function qO(h,d){if(h==null)return{};var m={},x=Object.keys(h),T,I;for(I=0;I<x.length;I++)T=x[I],!(d.indexOf(T)>=0)&&(m[T]=h[T]);return m}function GO(h,d){if(h==null)return{};var m=qO(h,d),x,T;if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(h);for(T=0;T<I.length;T++)x=I[T],!(d.indexOf(x)>=0)&&Object.prototype.propertyIsEnumerable.call(h,x)&&(m[x]=h[x])}return m}var $O="1.14.0";function Cn(h){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(h)}var zn=Cn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Rc=Cn(/Edge/i),aT=Cn(/firefox/i),Sc=Cn(/safari/i)&&!Cn(/chrome/i)&&!Cn(/android/i),PE=Cn(/iP(ad|od|hone)/i),WO=Cn(/chrome/i)&&Cn(/android/i),zE={capture:!1,passive:!1};function _i(h,d,m){h.addEventListener(d,m,!zn&&zE)}function ci(h,d,m){h.removeEventListener(d,m,!zn&&zE)}function Id(h,d){if(d){if(d[0]===">"&&(d=d.substring(1)),h)try{if(h.matches)return h.matches(d);if(h.msMatchesSelector)return h.msMatchesSelector(d);if(h.webkitMatchesSelector)return h.webkitMatchesSelector(d)}catch{return!1}return!1}}function HO(h){return h.host&&h!==document&&h.host.nodeType?h.host:h.parentNode}function Qo(h,d,m,x){if(h){m=m||document;do{if(d!=null&&(d[0]===">"?h.parentNode===m&&Id(h,d):Id(h,d))||x&&h===m)return h;if(h===m)break}while(h=HO(h))}return null}var lT=/\s+/g;function eo(h,d,m){if(h&&d)if(h.classList)h.classList[m?"add":"remove"](d);else{var x=(" "+h.className+" ").replace(lT," ").replace(" "+d+" "," ");h.className=(x+(m?" "+d:"")).replace(lT," ")}}function Lt(h,d,m){var x=h&&h.style;if(x){if(m===void 0)return document.defaultView&&document.defaultView.getComputedStyle?m=document.defaultView.getComputedStyle(h,""):h.currentStyle&&(m=h.currentStyle),d===void 0?m:m[d];!(d in x)&&d.indexOf("webkit")===-1&&(d="-webkit-"+d),x[d]=m+(typeof m=="string"?"":"px")}}function ul(h,d){var m="";if(typeof h=="string")m=h;else do{var x=Lt(h,"transform");x&&x!=="none"&&(m=x+" "+m)}while(!d&&(h=h.parentNode));var T=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return T&&new T(m)}function DE(h,d,m){if(h){var x=h.getElementsByTagName(d),T=0,I=x.length;if(m)for(;T<I;T++)m(x[T],T);return x}return[]}function en(){var h=document.scrollingElement;return h||document.documentElement}function lr(h,d,m,x,T){if(!(!h.getBoundingClientRect&&h!==window)){var I,P,L,C,Z,ee,oe;if(h!==window&&h.parentNode&&h!==en()?(I=h.getBoundingClientRect(),P=I.top,L=I.left,C=I.bottom,Z=I.right,ee=I.height,oe=I.width):(P=0,L=0,C=window.innerHeight,Z=window.innerWidth,ee=window.innerHeight,oe=window.innerWidth),(d||m)&&h!==window&&(T=T||h.parentNode,!zn))do if(T&&T.getBoundingClientRect&&(Lt(T,"transform")!=="none"||m&&Lt(T,"position")!=="static")){var Te=T.getBoundingClientRect();P-=Te.top+parseInt(Lt(T,"border-top-width")),L-=Te.left+parseInt(Lt(T,"border-left-width")),C=P+I.height,Z=L+I.width;break}while(T=T.parentNode);if(x&&h!==window){var Me=ul(T||h),ke=Me&&Me.a,ve=Me&&Me.d;Me&&(P/=ve,L/=ke,oe/=ke,ee/=ve,C=P+ee,Z=L+oe)}return{top:P,left:L,bottom:C,right:Z,width:oe,height:ee}}}function cT(h,d,m){for(var x=ps(h,!0),T=lr(h)[d];x;){var I=lr(x)[m],P=void 0;if(P=T>=I,!P)return x;if(x===en())break;x=ps(x,!1)}return!1}function dl(h,d,m,x){for(var T=0,I=0,P=h.children;I<P.length;){if(P[I].style.display!=="none"&&P[I]!==Ot.ghost&&(x||P[I]!==Ot.dragged)&&Qo(P[I],m.draggable,h,!1)){if(T===d)return P[I];T++}I++}return null}function Eg(h,d){for(var m=h.lastElementChild;m&&(m===Ot.ghost||Lt(m,"display")==="none"||d&&!Id(m,d));)m=m.previousElementSibling;return m||null}function yo(h,d){var m=0;if(!h||!h.parentNode)return-1;for(;h=h.previousElementSibling;)h.nodeName.toUpperCase()!=="TEMPLATE"&&h!==Ot.clone&&(!d||Id(h,d))&&m++;return m}function uT(h){var d=0,m=0,x=en();if(h)do{var T=ul(h),I=T.a,P=T.d;d+=h.scrollLeft*I,m+=h.scrollTop*P}while(h!==x&&(h=h.parentNode));return[d,m]}function ZO(h,d){for(var m in h)if(h.hasOwnProperty(m)){for(var x in d)if(d.hasOwnProperty(x)&&d[x]===h[m][x])return Number(m)}return-1}function ps(h,d){if(!h||!h.getBoundingClientRect)return en();var m=h,x=!1;do if(m.clientWidth<m.scrollWidth||m.clientHeight<m.scrollHeight){var T=Lt(m);if(m.clientWidth<m.scrollWidth&&(T.overflowX=="auto"||T.overflowX=="scroll")||m.clientHeight<m.scrollHeight&&(T.overflowY=="auto"||T.overflowY=="scroll")){if(!m.getBoundingClientRect||m===document.body)return en();if(x||d)return m;x=!0}}while(m=m.parentNode);return en()}function XO(h,d){if(h&&d)for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m]);return h}function F_(h,d){return Math.round(h.top)===Math.round(d.top)&&Math.round(h.left)===Math.round(d.left)&&Math.round(h.height)===Math.round(d.height)&&Math.round(h.width)===Math.round(d.width)}var Ac;function LE(h,d){return function(){if(!Ac){var m=arguments,x=this;m.length===1?h.call(x,m[0]):h.apply(x,m),Ac=setTimeout(function(){Ac=void 0},d)}}}function YO(){clearTimeout(Ac),Ac=void 0}function RE(h,d,m){h.scrollLeft+=d,h.scrollTop+=m}function OE(h){var d=window.Polymer,m=window.jQuery||window.Zepto;return d&&d.dom?d.dom(h).cloneNode(!0):m?m(h).clone(!0)[0]:h.cloneNode(!0)}var io="Sortable"+new Date().getTime();function KO(){var h=[],d;return{captureAnimationState:function(){if(h=[],!!this.options.animation){var m=[].slice.call(this.el.children);m.forEach(function(x){if(!(Lt(x,"display")==="none"||x===Ot.ghost)){h.push({target:x,rect:lr(x)});var T=tn({},h[h.length-1].rect);if(x.thisAnimationDuration){var I=ul(x,!0);I&&(T.top-=I.f,T.left-=I.e)}x.fromRect=T}})}},addAnimationState:function(m){h.push(m)},removeAnimationState:function(m){h.splice(ZO(h,{target:m}),1)},animateAll:function(m){var x=this;if(!this.options.animation){clearTimeout(d),typeof m=="function"&&m();return}var T=!1,I=0;h.forEach(function(P){var L=0,C=P.target,Z=C.fromRect,ee=lr(C),oe=C.prevFromRect,Te=C.prevToRect,Me=P.rect,ke=ul(C,!0);ke&&(ee.top-=ke.f,ee.left-=ke.e),C.toRect=ee,C.thisAnimationDuration&&F_(oe,ee)&&!F_(Z,ee)&&(Me.top-ee.top)/(Me.left-ee.left)===(Z.top-ee.top)/(Z.left-ee.left)&&(L=QO(Me,oe,Te,x.options)),F_(ee,Z)||(C.prevFromRect=Z,C.prevToRect=ee,L||(L=x.options.animation),x.animate(C,Me,ee,L)),L&&(T=!0,I=Math.max(I,L),clearTimeout(C.animationResetTimer),C.animationResetTimer=setTimeout(function(){C.animationTime=0,C.prevFromRect=null,C.fromRect=null,C.prevToRect=null,C.thisAnimationDuration=null},L),C.thisAnimationDuration=L)}),clearTimeout(d),T?d=setTimeout(function(){typeof m=="function"&&m()},I):typeof m=="function"&&m(),h=[]},animate:function(m,x,T,I){if(I){Lt(m,"transition",""),Lt(m,"transform","");var P=ul(this.el),L=P&&P.a,C=P&&P.d,Z=(x.left-T.left)/(L||1),ee=(x.top-T.top)/(C||1);m.animatingX=!!Z,m.animatingY=!!ee,Lt(m,"transform","translate3d("+Z+"px,"+ee+"px,0)"),this.forRepaintDummy=JO(m),Lt(m,"transition","transform "+I+"ms"+(this.options.easing?" "+this.options.easing:"")),Lt(m,"transform","translate3d(0,0,0)"),typeof m.animated=="number"&&clearTimeout(m.animated),m.animated=setTimeout(function(){Lt(m,"transition",""),Lt(m,"transform",""),m.animated=!1,m.animatingX=!1,m.animatingY=!1},I)}}}}function JO(h){return h.offsetWidth}function QO(h,d,m,x){return Math.sqrt(Math.pow(d.top-h.top,2)+Math.pow(d.left-h.left,2))/Math.sqrt(Math.pow(d.top-m.top,2)+Math.pow(d.left-m.left,2))*x.animation}var il=[],N_={initializeByDefault:!0},Oc={mount:function(h){for(var d in N_)N_.hasOwnProperty(d)&&!(d in h)&&(h[d]=N_[d]);il.forEach(function(m){if(m.pluginName===h.pluginName)throw"Sortable: Cannot mount plugin ".concat(h.pluginName," more than once")}),il.push(h)},pluginEvent:function(h,d,m){var x=this;this.eventCanceled=!1,m.cancel=function(){x.eventCanceled=!0};var T=h+"Global";il.forEach(function(I){d[I.pluginName]&&(d[I.pluginName][T]&&d[I.pluginName][T](tn({sortable:d},m)),d.options[I.pluginName]&&d[I.pluginName][h]&&d[I.pluginName][h](tn({sortable:d},m)))})},initializePlugins:function(h,d,m,x){il.forEach(function(P){var L=P.pluginName;if(!(!h.options[L]&&!P.initializeByDefault)){var C=new P(h,d,h.options);C.sortable=h,C.options=h.options,h[L]=C,kn(m,C.defaults)}});for(var T in h.options)if(h.options.hasOwnProperty(T)){var I=this.modifyOption(h,T,h.options[T]);typeof I<"u"&&(h.options[T]=I)}},getEventProperties:function(h,d){var m={};return il.forEach(function(x){typeof x.eventProperties=="function"&&kn(m,x.eventProperties.call(d[x.pluginName],h))}),m},modifyOption:function(h,d,m){var x;return il.forEach(function(T){h[T.pluginName]&&T.optionListeners&&typeof T.optionListeners[d]=="function"&&(x=T.optionListeners[d].call(h[T.pluginName],m))}),x}};function eB(h){var d=h.sortable,m=h.rootEl,x=h.name,T=h.targetEl,I=h.cloneEl,P=h.toEl,L=h.fromEl,C=h.oldIndex,Z=h.newIndex,ee=h.oldDraggableIndex,oe=h.newDraggableIndex,Te=h.originalEvent,Me=h.putSortable,ke=h.extraEventProperties;if(d=d||m&&m[io],!!d){var ve,Ze=d.options,mt="on"+x.charAt(0).toUpperCase()+x.substr(1);window.CustomEvent&&!zn&&!Rc?ve=new CustomEvent(x,{bubbles:!0,cancelable:!0}):(ve=document.createEvent("Event"),ve.initEvent(x,!0,!0)),ve.to=P||m,ve.from=L||m,ve.item=T||m,ve.clone=I,ve.oldIndex=C,ve.newIndex=Z,ve.oldDraggableIndex=ee,ve.newDraggableIndex=oe,ve.originalEvent=Te,ve.pullMode=Me?Me.lastPutMode:void 0;var et=tn(tn({},ke),Oc.getEventProperties(x,d));for(var xt in et)ve[xt]=et[xt];m&&m.dispatchEvent(ve),Ze[mt]&&Ze[mt].call(d,ve)}}var tB=["evt"],Wr=function(h,d){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x=m.evt,T=GO(m,tB);Oc.pluginEvent.bind(Ot)(h,d,tn({dragEl:$e,parentEl:Hi,ghostEl:Gt,rootEl:Vi,nextEl:Qs,lastDownEl:fd,cloneEl:Zi,cloneHidden:hs,dragStarted:bc,putSortable:fr,activeSortable:Ot.active,originalEvent:x,oldIndex:al,oldDraggableIndex:Mc,newIndex:to,newDraggableIndex:us,hideGhostForTarget:jE,unhideGhostForTarget:VE,cloneNowHidden:function(){hs=!0},cloneNowShown:function(){hs=!1},dispatchSortableEvent:function(I){Mr({sortable:d,name:I,originalEvent:x})}},T))};function Mr(h){eB(tn({putSortable:fr,cloneEl:Zi,targetEl:$e,rootEl:Vi,oldIndex:al,oldDraggableIndex:Mc,newIndex:to,newDraggableIndex:us},h))}var $e,Hi,Gt,Vi,Qs,fd,Zi,hs,al,to,Mc,us,od,fr,nl=!1,Cd=!1,kd=[],Ys,Po,j_,V_,hT,dT,bc,rl,Ic,Cc=!1,nd=!1,md,yr,U_=[],ng=!1,Pd=[],jd=typeof document<"u",sd=PE,pT=Rc||zn?"cssFloat":"float",iB=jd&&!WO&&!PE&&"draggable"in document.createElement("div"),BE=function(){if(jd){if(zn)return!1;var h=document.createElement("x");return h.style.cssText="pointer-events:auto",h.style.pointerEvents==="auto"}}(),FE=function(h,d){var m=Lt(h),x=parseInt(m.width)-parseInt(m.paddingLeft)-parseInt(m.paddingRight)-parseInt(m.borderLeftWidth)-parseInt(m.borderRightWidth),T=dl(h,0,d),I=dl(h,1,d),P=T&&Lt(T),L=I&&Lt(I),C=P&&parseInt(P.marginLeft)+parseInt(P.marginRight)+lr(T).width,Z=L&&parseInt(L.marginLeft)+parseInt(L.marginRight)+lr(I).width;if(m.display==="flex")return m.flexDirection==="column"||m.flexDirection==="column-reverse"?"vertical":"horizontal";if(m.display==="grid")return m.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(T&&P.float&&P.float!=="none"){var ee=P.float==="left"?"left":"right";return I&&(L.clear==="both"||L.clear===ee)?"vertical":"horizontal"}return T&&(P.display==="block"||P.display==="flex"||P.display==="table"||P.display==="grid"||C>=x&&m[pT]==="none"||I&&m[pT]==="none"&&C+Z>x)?"vertical":"horizontal"},rB=function(h,d,m){var x=m?h.left:h.top,T=m?h.right:h.bottom,I=m?h.width:h.height,P=m?d.left:d.top,L=m?d.right:d.bottom,C=m?d.width:d.height;return x===P||T===L||x+I/2===P+C/2},oB=function(h,d){var m;return kd.some(function(x){var T=x[io].options.emptyInsertThreshold;if(!(!T||Eg(x))){var I=lr(x),P=h>=I.left-T&&h<=I.right+T,L=d>=I.top-T&&d<=I.bottom+T;if(P&&L)return m=x}}),m},NE=function(h){function d(T,I){return function(P,L,C,Z){var ee=P.options.group.name&&L.options.group.name&&P.options.group.name===L.options.group.name;if(T==null&&(I||ee))return!0;if(T==null||T===!1)return!1;if(I&&T==="clone")return T;if(typeof T=="function")return d(T(P,L,C,Z),I)(P,L,C,Z);var oe=(I?P:L).options.group.name;return T===!0||typeof T=="string"&&T===oe||T.join&&T.indexOf(oe)>-1}}var m={},x=h.group;(!x||pd(x)!="object")&&(x={name:x}),m.name=x.name,m.checkPull=d(x.pull,!0),m.checkPut=d(x.put),m.revertClone=x.revertClone,h.group=m},jE=function(){!BE&&Gt&&Lt(Gt,"display","none")},VE=function(){!BE&&Gt&&Lt(Gt,"display","")};jd&&document.addEventListener("click",function(h){if(Cd)return h.preventDefault(),h.stopPropagation&&h.stopPropagation(),h.stopImmediatePropagation&&h.stopImmediatePropagation(),Cd=!1,!1},!0);var Ks=function(h){if($e){h=h.touches?h.touches[0]:h;var d=oB(h.clientX,h.clientY);if(d){var m={};for(var x in h)h.hasOwnProperty(x)&&(m[x]=h[x]);m.target=m.rootEl=d,m.preventDefault=void 0,m.stopPropagation=void 0,d[io]._onDragOver(m)}}},nB=function(h){$e&&$e.parentNode[io]._isOutsideThisEl(h.target)};function Ot(h,d){if(!(h&&h.nodeType&&h.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(h));this.el=h,this.options=d=kn({},d),h[io]=this;var m={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(h.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return FE(h,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(I,P){I.setData("Text",P.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:Ot.supportPointer!==!1&&"PointerEvent"in window&&!Sc,emptyInsertThreshold:5};Oc.initializePlugins(this,h,m);for(var x in m)!(x in d)&&(d[x]=m[x]);NE(d);for(var T in this)T.charAt(0)==="_"&&typeof this[T]=="function"&&(this[T]=this[T].bind(this));this.nativeDraggable=d.forceFallback?!1:iB,this.nativeDraggable&&(this.options.touchStartThreshold=1),d.supportPointer?_i(h,"pointerdown",this._onTapStart):(_i(h,"mousedown",this._onTapStart),_i(h,"touchstart",this._onTapStart)),this.nativeDraggable&&(_i(h,"dragover",this),_i(h,"dragenter",this)),kd.push(this.el),d.store&&d.store.get&&this.sort(d.store.get(this)||[]),kn(this,KO())}Ot.prototype={constructor:Ot,_isOutsideThisEl:function(h){!this.el.contains(h)&&h!==this.el&&(rl=null)},_getDirection:function(h,d){return typeof this.options.direction=="function"?this.options.direction.call(this,h,d,$e):this.options.direction},_onTapStart:function(h){if(h.cancelable){var d=this,m=this.el,x=this.options,T=x.preventOnFilter,I=h.type,P=h.touches&&h.touches[0]||h.pointerType&&h.pointerType==="touch"&&h,L=(P||h).target,C=h.target.shadowRoot&&(h.path&&h.path[0]||h.composedPath&&h.composedPath()[0])||L,Z=x.filter;if(pB(m),!$e&&!(/mousedown|pointerdown/.test(I)&&h.button!==0||x.disabled)&&!C.isContentEditable&&!(!this.nativeDraggable&&Sc&&L&&L.tagName.toUpperCase()==="SELECT")&&(L=Qo(L,x.draggable,m,!1),!(L&&L.animated)&&fd!==L)){if(al=yo(L),Mc=yo(L,x.draggable),typeof Z=="function"){if(Z.call(this,h,L,this)){Mr({sortable:d,rootEl:C,name:"filter",targetEl:L,toEl:m,fromEl:m}),Wr("filter",d,{evt:h}),T&&h.cancelable&&h.preventDefault();return}}else if(Z&&(Z=Z.split(",").some(function(ee){if(ee=Qo(C,ee.trim(),m,!1),ee)return Mr({sortable:d,rootEl:ee,name:"filter",targetEl:L,fromEl:m,toEl:m}),Wr("filter",d,{evt:h}),!0}),Z)){T&&h.cancelable&&h.preventDefault();return}x.handle&&!Qo(C,x.handle,m,!1)||this._prepareDragStart(h,P,L)}}},_prepareDragStart:function(h,d,m){var x=this,T=x.el,I=x.options,P=T.ownerDocument,L;if(m&&!$e&&m.parentNode===T){var C=lr(m);if(Vi=T,$e=m,Hi=$e.parentNode,Qs=$e.nextSibling,fd=m,od=I.group,Ot.dragged=$e,Ys={target:$e,clientX:(d||h).clientX,clientY:(d||h).clientY},hT=Ys.clientX-C.left,dT=Ys.clientY-C.top,this._lastX=(d||h).clientX,this._lastY=(d||h).clientY,$e.style["will-change"]="all",L=function(){if(Wr("delayEnded",x,{evt:h}),Ot.eventCanceled){x._onDrop();return}x._disableDelayedDragEvents(),!aT&&x.nativeDraggable&&($e.draggable=!0),x._triggerDragStart(h,d),Mr({sortable:x,name:"choose",originalEvent:h}),eo($e,I.chosenClass,!0)},I.ignore.split(",").forEach(function(Z){DE($e,Z.trim(),q_)}),_i(P,"dragover",Ks),_i(P,"mousemove",Ks),_i(P,"touchmove",Ks),_i(P,"mouseup",x._onDrop),_i(P,"touchend",x._onDrop),_i(P,"touchcancel",x._onDrop),aT&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$e.draggable=!0),Wr("delayStart",this,{evt:h}),I.delay&&(!I.delayOnTouchOnly||d)&&(!this.nativeDraggable||!(Rc||zn))){if(Ot.eventCanceled){this._onDrop();return}_i(P,"mouseup",x._disableDelayedDrag),_i(P,"touchend",x._disableDelayedDrag),_i(P,"touchcancel",x._disableDelayedDrag),_i(P,"mousemove",x._delayedDragTouchMoveHandler),_i(P,"touchmove",x._delayedDragTouchMoveHandler),I.supportPointer&&_i(P,"pointermove",x._delayedDragTouchMoveHandler),x._dragStartTimer=setTimeout(L,I.delay)}else L()}},_delayedDragTouchMoveHandler:function(h){var d=h.touches?h.touches[0]:h;Math.max(Math.abs(d.clientX-this._lastX),Math.abs(d.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$e&&q_($e),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var h=this.el.ownerDocument;ci(h,"mouseup",this._disableDelayedDrag),ci(h,"touchend",this._disableDelayedDrag),ci(h,"touchcancel",this._disableDelayedDrag),ci(h,"mousemove",this._delayedDragTouchMoveHandler),ci(h,"touchmove",this._delayedDragTouchMoveHandler),ci(h,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(h,d){d=d||h.pointerType=="touch"&&h,!this.nativeDraggable||d?this.options.supportPointer?_i(document,"pointermove",this._onTouchMove):d?_i(document,"touchmove",this._onTouchMove):_i(document,"mousemove",this._onTouchMove):(_i($e,"dragend",this),_i(Vi,"dragstart",this._onDragStart));try{document.selection?_d(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(h,d){if(nl=!1,Vi&&$e){Wr("dragStarted",this,{evt:d}),this.nativeDraggable&&_i(document,"dragover",nB);var m=this.options;!h&&eo($e,m.dragClass,!1),eo($e,m.ghostClass,!0),Ot.active=this,h&&this._appendGhost(),Mr({sortable:this,name:"start",originalEvent:d})}else this._nulling()},_emulateDragOver:function(){if(Po){this._lastX=Po.clientX,this._lastY=Po.clientY,jE();for(var h=document.elementFromPoint(Po.clientX,Po.clientY),d=h;h&&h.shadowRoot&&(h=h.shadowRoot.elementFromPoint(Po.clientX,Po.clientY),h!==d);)d=h;if($e.parentNode[io]._isOutsideThisEl(h),d)do{if(d[io]){var m=void 0;if(m=d[io]._onDragOver({clientX:Po.clientX,clientY:Po.clientY,target:h,rootEl:d}),m&&!this.options.dragoverBubble)break}h=d}while(d=d.parentNode);VE()}},_onTouchMove:function(h){if(Ys){var d=this.options,m=d.fallbackTolerance,x=d.fallbackOffset,T=h.touches?h.touches[0]:h,I=Gt&&ul(Gt,!0),P=Gt&&I&&I.a,L=Gt&&I&&I.d,C=sd&&yr&&uT(yr),Z=(T.clientX-Ys.clientX+x.x)/(P||1)+(C?C[0]-U_[0]:0)/(P||1),ee=(T.clientY-Ys.clientY+x.y)/(L||1)+(C?C[1]-U_[1]:0)/(L||1);if(!Ot.active&&!nl){if(m&&Math.max(Math.abs(T.clientX-this._lastX),Math.abs(T.clientY-this._lastY))<m)return;this._onDragStart(h,!0)}if(Gt){I?(I.e+=Z-(j_||0),I.f+=ee-(V_||0)):I={a:1,b:0,c:0,d:1,e:Z,f:ee};var oe="matrix(".concat(I.a,",").concat(I.b,",").concat(I.c,",").concat(I.d,",").concat(I.e,",").concat(I.f,")");Lt(Gt,"webkitTransform",oe),Lt(Gt,"mozTransform",oe),Lt(Gt,"msTransform",oe),Lt(Gt,"transform",oe),j_=Z,V_=ee,Po=T}h.cancelable&&h.preventDefault()}},_appendGhost:function(){if(!Gt){var h=this.options.fallbackOnBody?document.body:Vi,d=lr($e,!0,sd,!0,h),m=this.options;if(sd){for(yr=h;Lt(yr,"position")==="static"&&Lt(yr,"transform")==="none"&&yr!==document;)yr=yr.parentNode;yr!==document.body&&yr!==document.documentElement?(yr===document&&(yr=en()),d.top+=yr.scrollTop,d.left+=yr.scrollLeft):yr=en(),U_=uT(yr)}Gt=$e.cloneNode(!0),eo(Gt,m.ghostClass,!1),eo(Gt,m.fallbackClass,!0),eo(Gt,m.dragClass,!0),Lt(Gt,"transition",""),Lt(Gt,"transform",""),Lt(Gt,"box-sizing","border-box"),Lt(Gt,"margin",0),Lt(Gt,"top",d.top),Lt(Gt,"left",d.left),Lt(Gt,"width",d.width),Lt(Gt,"height",d.height),Lt(Gt,"opacity","0.8"),Lt(Gt,"position",sd?"absolute":"fixed"),Lt(Gt,"zIndex","100000"),Lt(Gt,"pointerEvents","none"),Ot.ghost=Gt,h.appendChild(Gt),Lt(Gt,"transform-origin",hT/parseInt(Gt.style.width)*100+"% "+dT/parseInt(Gt.style.height)*100+"%")}},_onDragStart:function(h,d){var m=this,x=h.dataTransfer,T=m.options;if(Wr("dragStart",this,{evt:h}),Ot.eventCanceled){this._onDrop();return}Wr("setupClone",this),Ot.eventCanceled||(Zi=OE($e),Zi.draggable=!1,Zi.style["will-change"]="",this._hideClone(),eo(Zi,this.options.chosenClass,!1),Ot.clone=Zi),m.cloneId=_d(function(){Wr("clone",m),!Ot.eventCanceled&&(m.options.removeCloneOnHide||Vi.insertBefore(Zi,$e),m._hideClone(),Mr({sortable:m,name:"clone"}))}),!d&&eo($e,T.dragClass,!0),d?(Cd=!0,m._loopId=setInterval(m._emulateDragOver,50)):(ci(document,"mouseup",m._onDrop),ci(document,"touchend",m._onDrop),ci(document,"touchcancel",m._onDrop),x&&(x.effectAllowed="move",T.setData&&T.setData.call(m,x,$e)),_i(document,"drop",m),Lt($e,"transform","translateZ(0)")),nl=!0,m._dragStartId=_d(m._dragStarted.bind(m,d,h)),_i(document,"selectstart",m),bc=!0,Sc&&Lt(document.body,"user-select","none")},_onDragOver:function(h){var d=this.el,m=h.target,x,T,I,P=this.options,L=P.group,C=Ot.active,Z=od===L,ee=P.sort,oe=fr||C,Te,Me=this,ke=!1;if(ng)return;function ve(rn,on){Wr(rn,Me,tn({evt:h,isOwner:Z,axis:Te?"vertical":"horizontal",revert:I,dragRect:x,targetRect:T,canSort:ee,fromSortable:oe,target:m,completed:mt,onMove:function(Lo,kr){return ad(Vi,d,$e,x,Lo,lr(Lo),h,kr)},changed:et},on))}function Ze(){ve("dragOverAnimationCapture"),Me.captureAnimationState(),Me!==oe&&oe.captureAnimationState()}function mt(rn){return ve("dragOverCompleted",{insertion:rn}),rn&&(Z?C._hideClone():C._showClone(Me),Me!==oe&&(eo($e,fr?fr.options.ghostClass:C.options.ghostClass,!1),eo($e,P.ghostClass,!0)),fr!==Me&&Me!==Ot.active?fr=Me:Me===Ot.active&&fr&&(fr=null),oe===Me&&(Me._ignoreWhileAnimating=m),Me.animateAll(function(){ve("dragOverAnimationComplete"),Me._ignoreWhileAnimating=null}),Me!==oe&&(oe.animateAll(),oe._ignoreWhileAnimating=null)),(m===$e&&!$e.animated||m===d&&!m.animated)&&(rl=null),!P.dragoverBubble&&!h.rootEl&&m!==document&&($e.parentNode[io]._isOutsideThisEl(h.target),!rn&&Ks(h)),!P.dragoverBubble&&h.stopPropagation&&h.stopPropagation(),ke=!0}function et(){to=yo($e),us=yo($e,P.draggable),Mr({sortable:Me,name:"change",toEl:d,newIndex:to,newDraggableIndex:us,originalEvent:h})}if(h.preventDefault!==void 0&&h.cancelable&&h.preventDefault(),m=Qo(m,P.draggable,d,!0),ve("dragOver"),Ot.eventCanceled)return ke;if($e.contains(h.target)||m.animated&&m.animatingX&&m.animatingY||Me._ignoreWhileAnimating===m)return mt(!1);if(Cd=!1,C&&!P.disabled&&(Z?ee||(I=Hi!==Vi):fr===this||(this.lastPutMode=od.checkPull(this,C,$e,h))&&L.checkPut(this,C,$e,h))){if(Te=this._getDirection(h,m)==="vertical",x=lr($e),ve("dragOverValid"),Ot.eventCanceled)return ke;if(I)return Hi=Vi,Ze(),this._hideClone(),ve("revert"),Ot.eventCanceled||(Qs?Vi.insertBefore($e,Qs):Vi.appendChild($e)),mt(!0);var xt=Eg(d,P.draggable);if(!xt||cB(h,Te,this)&&!xt.animated){if(xt===$e)return mt(!1);if(xt&&d===h.target&&(m=xt),m&&(T=lr(m)),ad(Vi,d,$e,x,m,T,h,!!m)!==!1)return Ze(),d.appendChild($e),Hi=d,et(),mt(!0)}else if(xt&&lB(h,Te,this)){var _t=dl(d,0,P,!0);if(_t===$e)return mt(!1);if(m=_t,T=lr(m),ad(Vi,d,$e,x,m,T,h,!1)!==!1)return Ze(),d.insertBefore($e,_t),Hi=d,et(),mt(!0)}else if(m.parentNode===d){T=lr(m);var lt=0,qe,$t=$e.parentNode!==d,pi=!rB($e.animated&&$e.toRect||x,m.animated&&m.toRect||T,Te),X=Te?"top":"left",at=cT(m,"top","top")||cT($e,"top","top"),Dn=at?at.scrollTop:void 0;rl!==m&&(qe=T[X],Cc=!1,nd=!pi&&P.invertSwap||$t),lt=uB(h,m,T,Te,pi?1:P.swapThreshold,P.invertedSwapThreshold==null?P.swapThreshold:P.invertedSwapThreshold,nd,rl===m);var cr;if(lt!==0){var it=yo($e);do it-=lt,cr=Hi.children[it];while(cr&&(Lt(cr,"display")==="none"||cr===Gt))}if(lt===0||cr===m)return mt(!1);rl=m,Ic=lt;var wi=m.nextElementSibling,no=!1;no=lt===1;var Cr=ad(Vi,d,$e,x,m,T,h,no);if(Cr!==!1)return(Cr===1||Cr===-1)&&(no=Cr===1),ng=!0,setTimeout(aB,30),Ze(),no&&!wi?d.appendChild($e):m.parentNode.insertBefore($e,no?wi:m),at&&RE(at,0,Dn-at.scrollTop),Hi=$e.parentNode,qe!==void 0&&!nd&&(md=Math.abs(qe-lr(m)[X])),et(),mt(!0)}if(d.contains($e))return mt(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){ci(document,"mousemove",this._onTouchMove),ci(document,"touchmove",this._onTouchMove),ci(document,"pointermove",this._onTouchMove),ci(document,"dragover",Ks),ci(document,"mousemove",Ks),ci(document,"touchmove",Ks)},_offUpEvents:function(){var h=this.el.ownerDocument;ci(h,"mouseup",this._onDrop),ci(h,"touchend",this._onDrop),ci(h,"pointerup",this._onDrop),ci(h,"touchcancel",this._onDrop),ci(document,"selectstart",this)},_onDrop:function(h){var d=this.el,m=this.options;if(to=yo($e),us=yo($e,m.draggable),Wr("drop",this,{evt:h}),Hi=$e&&$e.parentNode,to=yo($e),us=yo($e,m.draggable),Ot.eventCanceled){this._nulling();return}nl=!1,nd=!1,Cc=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),sg(this.cloneId),sg(this._dragStartId),this.nativeDraggable&&(ci(document,"drop",this),ci(d,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Sc&&Lt(document.body,"user-select",""),Lt($e,"transform",""),h&&(bc&&(h.cancelable&&h.preventDefault(),!m.dropBubble&&h.stopPropagation()),Gt&&Gt.parentNode&&Gt.parentNode.removeChild(Gt),(Vi===Hi||fr&&fr.lastPutMode!=="clone")&&Zi&&Zi.parentNode&&Zi.parentNode.removeChild(Zi),$e&&(this.nativeDraggable&&ci($e,"dragend",this),q_($e),$e.style["will-change"]="",bc&&!nl&&eo($e,fr?fr.options.ghostClass:this.options.ghostClass,!1),eo($e,this.options.chosenClass,!1),Mr({sortable:this,name:"unchoose",toEl:Hi,newIndex:null,newDraggableIndex:null,originalEvent:h}),Vi!==Hi?(to>=0&&(Mr({rootEl:Hi,name:"add",toEl:Hi,fromEl:Vi,originalEvent:h}),Mr({sortable:this,name:"remove",toEl:Hi,originalEvent:h}),Mr({rootEl:Hi,name:"sort",toEl:Hi,fromEl:Vi,originalEvent:h}),Mr({sortable:this,name:"sort",toEl:Hi,originalEvent:h})),fr&&fr.save()):to!==al&&to>=0&&(Mr({sortable:this,name:"update",toEl:Hi,originalEvent:h}),Mr({sortable:this,name:"sort",toEl:Hi,originalEvent:h})),Ot.active&&((to==null||to===-1)&&(to=al,us=Mc),Mr({sortable:this,name:"end",toEl:Hi,originalEvent:h}),this.save()))),this._nulling()},_nulling:function(){Wr("nulling",this),Vi=$e=Hi=Gt=Qs=Zi=fd=hs=Ys=Po=bc=to=us=al=Mc=rl=Ic=fr=od=Ot.dragged=Ot.ghost=Ot.clone=Ot.active=null,Pd.forEach(function(h){h.checked=!0}),Pd.length=j_=V_=0},handleEvent:function(h){switch(h.type){case"drop":case"dragend":this._onDrop(h);break;case"dragenter":case"dragover":$e&&(this._onDragOver(h),sB(h));break;case"selectstart":h.preventDefault();break}},toArray:function(){for(var h=[],d,m=this.el.children,x=0,T=m.length,I=this.options;x<T;x++)d=m[x],Qo(d,I.draggable,this.el,!1)&&h.push(d.getAttribute(I.dataIdAttr)||dB(d));return h},sort:function(h,d){var m={},x=this.el;this.toArray().forEach(function(T,I){var P=x.children[I];Qo(P,this.options.draggable,x,!1)&&(m[T]=P)},this),d&&this.captureAnimationState(),h.forEach(function(T){m[T]&&(x.removeChild(m[T]),x.appendChild(m[T]))}),d&&this.animateAll()},save:function(){var h=this.options.store;h&&h.set&&h.set(this)},closest:function(h,d){return Qo(h,d||this.options.draggable,this.el,!1)},option:function(h,d){var m=this.options;if(d===void 0)return m[h];var x=Oc.modifyOption(this,h,d);typeof x<"u"?m[h]=x:m[h]=d,h==="group"&&NE(m)},destroy:function(){Wr("destroy",this);var h=this.el;h[io]=null,ci(h,"mousedown",this._onTapStart),ci(h,"touchstart",this._onTapStart),ci(h,"pointerdown",this._onTapStart),this.nativeDraggable&&(ci(h,"dragover",this),ci(h,"dragenter",this)),Array.prototype.forEach.call(h.querySelectorAll("[draggable]"),function(d){d.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),kd.splice(kd.indexOf(this.el),1),this.el=h=null},_hideClone:function(){if(!hs){if(Wr("hideClone",this),Ot.eventCanceled)return;Lt(Zi,"display","none"),this.options.removeCloneOnHide&&Zi.parentNode&&Zi.parentNode.removeChild(Zi),hs=!0}},_showClone:function(h){if(h.lastPutMode!=="clone"){this._hideClone();return}if(hs){if(Wr("showClone",this),Ot.eventCanceled)return;$e.parentNode==Vi&&!this.options.group.revertClone?Vi.insertBefore(Zi,$e):Qs?Vi.insertBefore(Zi,Qs):Vi.appendChild(Zi),this.options.group.revertClone&&this.animate($e,Zi),Lt(Zi,"display",""),hs=!1}}};function sB(h){h.dataTransfer&&(h.dataTransfer.dropEffect="move"),h.cancelable&&h.preventDefault()}function ad(h,d,m,x,T,I,P,L){var C,Z=h[io],ee=Z.options.onMove,oe;return window.CustomEvent&&!zn&&!Rc?C=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(C=document.createEvent("Event"),C.initEvent("move",!0,!0)),C.to=d,C.from=h,C.dragged=m,C.draggedRect=x,C.related=T||d,C.relatedRect=I||lr(d),C.willInsertAfter=L,C.originalEvent=P,h.dispatchEvent(C),ee&&(oe=ee.call(Z,C,P)),oe}function q_(h){h.draggable=!1}function aB(){ng=!1}function lB(h,d,m){var x=lr(dl(m.el,0,m.options,!0)),T=10;return d?h.clientX<x.left-T||h.clientY<x.top&&h.clientX<x.right:h.clientY<x.top-T||h.clientY<x.bottom&&h.clientX<x.left}function cB(h,d,m){var x=lr(Eg(m.el,m.options.draggable)),T=10;return d?h.clientX>x.right+T||h.clientX<=x.right&&h.clientY>x.bottom&&h.clientX>=x.left:h.clientX>x.right&&h.clientY>x.top||h.clientX<=x.right&&h.clientY>x.bottom+T}function uB(h,d,m,x,T,I,P,L){var C=x?h.clientY:h.clientX,Z=x?m.height:m.width,ee=x?m.top:m.left,oe=x?m.bottom:m.right,Te=!1;if(!P){if(L&&md<Z*T){if(!Cc&&(Ic===1?C>ee+Z*I/2:C<oe-Z*I/2)&&(Cc=!0),Cc)Te=!0;else if(Ic===1?C<ee+md:C>oe-md)return-Ic}else if(C>ee+Z*(1-T)/2&&C<oe-Z*(1-T)/2)return hB(d)}return Te=Te||P,Te&&(C<ee+Z*I/2||C>oe-Z*I/2)?C>ee+Z/2?1:-1:0}function hB(h){return yo($e)<yo(h)?1:-1}function dB(h){for(var d=h.tagName+h.className+h.src+h.href+h.textContent,m=d.length,x=0;m--;)x+=d.charCodeAt(m);return x.toString(36)}function pB(h){Pd.length=0;for(var d=h.getElementsByTagName("input"),m=d.length;m--;){var x=d[m];x.checked&&Pd.push(x)}}function _d(h){return setTimeout(h,0)}function sg(h){return clearTimeout(h)}jd&&_i(document,"touchmove",function(h){(Ot.active||nl)&&h.cancelable&&h.preventDefault()});Ot.utils={on:_i,off:ci,css:Lt,find:DE,is:function(h,d){return!!Qo(h,d,h,!1)},extend:XO,throttle:LE,closest:Qo,toggleClass:eo,clone:OE,index:yo,nextTick:_d,cancelNextTick:sg,detectDirection:FE,getChild:dl};Ot.get=function(h){return h[io]};Ot.mount=function(){for(var h=arguments.length,d=new Array(h),m=0;m<h;m++)d[m]=arguments[m];d[0].constructor===Array&&(d=d[0]),d.forEach(function(x){if(!x.prototype||!x.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(x));x.utils&&(Ot.utils=tn(tn({},Ot.utils),x.utils)),Oc.mount(x)})};Ot.create=function(h,d){return new Ot(h,d)};Ot.version=$O;var nr=[],wc,ag,lg=!1,G_,$_,zd,Tc;function fB(){function h(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var d in this)d.charAt(0)==="_"&&typeof this[d]=="function"&&(this[d]=this[d].bind(this))}return h.prototype={dragStarted:function(d){var m=d.originalEvent;this.sortable.nativeDraggable?_i(document,"dragover",this._handleAutoScroll):this.options.supportPointer?_i(document,"pointermove",this._handleFallbackAutoScroll):m.touches?_i(document,"touchmove",this._handleFallbackAutoScroll):_i(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(d){var m=d.originalEvent;!this.options.dragOverBubble&&!m.rootEl&&this._handleAutoScroll(m)},drop:function(){this.sortable.nativeDraggable?ci(document,"dragover",this._handleAutoScroll):(ci(document,"pointermove",this._handleFallbackAutoScroll),ci(document,"touchmove",this._handleFallbackAutoScroll),ci(document,"mousemove",this._handleFallbackAutoScroll)),fT(),gd(),YO()},nulling:function(){zd=ag=wc=lg=Tc=G_=$_=null,nr.length=0},_handleFallbackAutoScroll:function(d){this._handleAutoScroll(d,!0)},_handleAutoScroll:function(d,m){var x=this,T=(d.touches?d.touches[0]:d).clientX,I=(d.touches?d.touches[0]:d).clientY,P=document.elementFromPoint(T,I);if(zd=d,m||this.options.forceAutoScrollFallback||Rc||zn||Sc){W_(d,this.options,P,m);var L=ps(P,!0);lg&&(!Tc||T!==G_||I!==$_)&&(Tc&&fT(),Tc=setInterval(function(){var C=ps(document.elementFromPoint(T,I),!0);C!==L&&(L=C,gd()),W_(d,x.options,C,m)},10),G_=T,$_=I)}else{if(!this.options.bubbleScroll||ps(P,!0)===en()){gd();return}W_(d,this.options,ps(P,!1),!1)}}},kn(h,{pluginName:"scroll",initializeByDefault:!0})}function gd(){nr.forEach(function(h){clearInterval(h.pid)}),nr=[]}function fT(){clearInterval(Tc)}var W_=LE(function(h,d,m,x){if(d.scroll){var T=(h.touches?h.touches[0]:h).clientX,I=(h.touches?h.touches[0]:h).clientY,P=d.scrollSensitivity,L=d.scrollSpeed,C=en(),Z=!1,ee;ag!==m&&(ag=m,gd(),wc=d.scroll,ee=d.scrollFn,wc===!0&&(wc=ps(m,!0)));var oe=0,Te=wc;do{var Me=Te,ke=lr(Me),ve=ke.top,Ze=ke.bottom,mt=ke.left,et=ke.right,xt=ke.width,_t=ke.height,lt=void 0,qe=void 0,$t=Me.scrollWidth,pi=Me.scrollHeight,X=Lt(Me),at=Me.scrollLeft,Dn=Me.scrollTop;Me===C?(lt=xt<$t&&(X.overflowX==="auto"||X.overflowX==="scroll"||X.overflowX==="visible"),qe=_t<pi&&(X.overflowY==="auto"||X.overflowY==="scroll"||X.overflowY==="visible")):(lt=xt<$t&&(X.overflowX==="auto"||X.overflowX==="scroll"),qe=_t<pi&&(X.overflowY==="auto"||X.overflowY==="scroll"));var cr=lt&&(Math.abs(et-T)<=P&&at+xt<$t)-(Math.abs(mt-T)<=P&&!!at),it=qe&&(Math.abs(Ze-I)<=P&&Dn+_t<pi)-(Math.abs(ve-I)<=P&&!!Dn);if(!nr[oe])for(var wi=0;wi<=oe;wi++)nr[wi]||(nr[wi]={});(nr[oe].vx!=cr||nr[oe].vy!=it||nr[oe].el!==Me)&&(nr[oe].el=Me,nr[oe].vx=cr,nr[oe].vy=it,clearInterval(nr[oe].pid),(cr!=0||it!=0)&&(Z=!0,nr[oe].pid=setInterval(function(){x&&this.layer===0&&Ot.active._onTouchMove(zd);var no=nr[this.layer].vy?nr[this.layer].vy*L:0,Cr=nr[this.layer].vx?nr[this.layer].vx*L:0;typeof ee=="function"&&ee.call(Ot.dragged.parentNode[io],Cr,no,h,zd,nr[this.layer].el)!=="continue"||RE(nr[this.layer].el,Cr,no)}.bind({layer:oe}),24))),oe++}while(d.bubbleScroll&&Te!==C&&(Te=ps(Te,!1)));lg=Z}},30),UE=function(h){var d=h.originalEvent,m=h.putSortable,x=h.dragEl,T=h.activeSortable,I=h.dispatchSortableEvent,P=h.hideGhostForTarget,L=h.unhideGhostForTarget;if(d){var C=m||T;P();var Z=d.changedTouches&&d.changedTouches.length?d.changedTouches[0]:d,ee=document.elementFromPoint(Z.clientX,Z.clientY);L(),C&&!C.el.contains(ee)&&(I("spill"),this.onSpill({dragEl:x,putSortable:m}))}};function Sg(){}Sg.prototype={startIndex:null,dragStart:function(h){var d=h.oldDraggableIndex;this.startIndex=d},onSpill:function(h){var d=h.dragEl,m=h.putSortable;this.sortable.captureAnimationState(),m&&m.captureAnimationState();var x=dl(this.sortable.el,this.startIndex,this.options);x?this.sortable.el.insertBefore(d,x):this.sortable.el.appendChild(d),this.sortable.animateAll(),m&&m.animateAll()},drop:UE};kn(Sg,{pluginName:"revertOnSpill"});function Ag(){}Ag.prototype={onSpill:function(h){var d=h.dragEl,m=h.putSortable,x=m||this.sortable;x.captureAnimationState(),d.parentNode&&d.parentNode.removeChild(d),x.animateAll()},drop:UE};kn(Ag,{pluginName:"removeOnSpill"});Ot.mount(new fB);Ot.mount(Ag,Sg);const mB=["Start","Add","Remove","Update","End"],_B=["Choose","Unchoose","Sort","Filter","Clone"],mT={manageAndEmit:mB,emit:_B};[...[...mT.manageAndEmit,...mT.emit].map(h=>h.toLowerCase())];var yd=(h,d=[])=>({parts:(...m)=>{if(gB(d))return yd(h,m);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...m)=>yd(h,[...d,...m]),rename:m=>yd(m,d),keys:()=>d,build:()=>[...new Set(d)].reduce((m,x)=>Object.assign(m,{[x]:{selector:[`&[data-scope="${ol(h)}"][data-part="${ol(x)}"]`,`& [data-scope="${ol(h)}"][data-part="${ol(x)}"]`].join(", "),attrs:{"data-scope":ol(h),"data-part":ol(x)}}}),{})}),ol=h=>h.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),gB=h=>h.length===0,yB=h=>h.nodeType===Node.DOCUMENT_NODE?h:h.ownerDocument??document;function vB(h){const d={getRootNode:m=>{var x;return((x=m.getRootNode)==null?void 0:x.call(m))??document},getDoc:m=>yB(d.getRootNode(m)),getWin:m=>d.getDoc(m).defaultView??window,getActiveElement:m=>d.getDoc(m).activeElement,isActiveElement:(m,x)=>x===d.getActiveElement(m),focus(m,x){x!=null&&(d.isActiveElement(m,x)||x.focus({preventScroll:!0}))},getById:(m,x)=>d.getRootNode(m).getElementById(x),setValue:(m,x)=>{if(m==null||x==null)return;const T=x.toString();m.value!==T&&(m.value=x.toString())}};return{...d,...h}}var xB=yd("switch").parts("root","label","control","thumb");xB.build();var _T=vB({getRootId:h=>{var d;return((d=h.ids)==null?void 0:d.root)??`switch:${h.id}`},getLabelId:h=>{var d;return((d=h.ids)==null?void 0:d.label)??`switch:${h.id}:label`},getThumbId:h=>{var d;return((d=h.ids)==null?void 0:d.thumb)??`switch:${h.id}:thumb`},getControlId:h=>{var d;return((d=h.ids)==null?void 0:d.control)??`switch:${h.id}:control`},getHiddenInputId:h=>{var d;return((d=h.ids)==null?void 0:d.input)??`switch:${h.id}:input`},getHiddenInputEl:h=>_T.getById(h,_T.getHiddenInputId(h))});const wB=Pn({__name:"Selector",props:{coordinates:{},aspectRatio:{default:"2/1"},mapOptions:{},zoom:{default:12},label:{},mapSelector:{type:Boolean,default:!0},showWarning:{type:Boolean,default:!0},showSelected:{type:Boolean,default:!0},language:{},modelValue:{},placeholder:{},searchFilter:{}},emits:["update:modelValue"],setup(h,{emit:d}){const m=h,x=d,T=zo(),I=zo(),P=zo(),L=zo(),C=zo(!1),Z={location:{},postcode:"0",county:"",city:"",street:"",formatted:""},ee=zo({...Z}),oe={warning:{nb:`Posisjon er ikke gyldig, ${m.mapSelector?"dra markøren eller":""} søk opp posisjon`,en:`Position is not valid, ${m.mapSelector?"drag the cursor or":""} search for position`},placeholder:{nb:"Hent posisjon fra kart",en:"Retrieve position from map"},selectedPosition:{nb:"Valgt posisjon",en:"Selected position"}},Te=[10.738616,59.906103],Me=Hr(()=>({center:ee.value?.location?.coordinates||Te,zoom:m.zoom,dragPan:!0,scrollZoom:!1,dragRotate:!1,cooperativeGestures:!1,...m.mapOptions})),ke=Hr(()=>m.language||document.querySelector("html")?.getAttribute("lang")||"auto"),ve=Hr(()=>m.searchFilter||"no");gT(()=>ee.value,lt=>{if(!I.value||!P.value)return;const qe=ee.value?.location?.coordinates||Te;I.value.setLngLat(qe),P.value.flyTo({center:qe}),x("update:modelValue",C.value?Z:ee.value),C.value&&(C.value=!1)},{immediate:!0,deep:!0});const Ze=Hr(()=>{if(ee?.value?.location?.coordinates?.[0])return ee.value.formatted});async function mt(){fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${ee.value.location?.coordinates?.[0]},${ee.value.location?.coordinates?.[1]}.json?access_token=pk.eyJ1IjoiY3JzdGVuIiwiYSI6ImNrNTZxa3gzMDE3dGszaHBod2RnMXQ0anYifQ.FBWO3jVL_VK4RCznouV-iA&language=${ke.value}`).then(lt=>lt.json()).then(lt=>{const qe=et(lt.features),$t=lt.features.find(pi=>pi.id.startsWith("address"));ee.value.street=`${qe.address} ${$t?.address}`,ee.value.city=qe.place,ee.value.county=qe.region||qe.place,ee.value.postcode=qe.postcode,ee.value.formatted=$t?.place_name}).catch(lt=>console.error(lt))}function et(lt){return lt?.length?Object.fromEntries(lt.map(qe=>[qe.id.split(".")?.[0],qe.text])):{}}function xt(){ee.value={...Z,location:{coordinates:Te}},L.value.clear(),C.value=!0}function _t(){T.value&&(P.value=new H_.Map({container:T.value,...Me.value,language:ke.value}),I.value=new H_.Marker({draggable:!0,color:"var(--kvass-location-selector-primary-color)"}).setLngLat(ee.value.location?.coordinates||Te).addTo(P.value),I.value.on("dragend",lt=>{lt?.target&&(ee.value.location.coordinates=Object.values(lt.target?._lngLat||{}),mt())}),P.value.addControl(new C2.FullscreenControl,"top-left"),P.value.addControl(new C2.NavigationControl,"top-left"),L.value=new zL({accessToken:Me.value.accessToken,zoom:4,placeholder:m.placeholder||oe?.placeholder?.[ke.value],filter:function(lt){return lt.context.some(qe=>{if(ve.value)return qe?.short_code===ve.value})},language:ke.value}),P.value.addControl(L.value),L.value.on("result",lt=>{const qe=lt.result,$t=et(qe.context);ee.value.location.coordinates=qe?.geometry?.coordinates,ee.value.street=`${qe.text} ${qe.address}`,ee.value.city=$t.place,ee.value.county=$t.region,ee.value.postcode=$t.postcode,ee.value.formatted=qe?.place_name}))}return dz(()=>{m.modelValue&&(ee.value=m.modelValue),_t()}),pz(()=>{P.value?.remove(),L.value.clear()}),(lt,qe)=>(mr(),In("div",{class:cg(["kvass-location-selector",{"kvass-location-selector--hide-map":!m.mapSelector}]),style:Dd({"--kvass-location-selector-aspect-ratio":m.aspectRatio})},[sl("div",{ref_key:"mapEl",ref:T,class:"kvass-location-selector__map"},null,512),xd(An(LO),{justify:"space-between"},{default:vd(()=>[(Ze.value?m.showSelected:m.showWarning)?(mr(),fs(An($R),{key:0,class:"",variant:Ze.value?"info":"danger"},{default:vd(()=>[yT(kc(Ze.value?`${oe?.selectedPosition?.[ke.value]}: ${Ze.value}`:oe.warning?.[ke.value]),1)]),_:1},8,["variant"])):Sn("",!0),xd(An(bg),{icon:"fa-pro-light:arrow-rotate-left",onClick:xt})]),_:1})],6))}});export{wB as j};
|
|
2035
|
+
*/function sT(h,d){var m=Object.keys(h);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(h);d&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(h,T).enumerable})),m.push.apply(m,x)}return m}function tn(h){for(var d=1;d<arguments.length;d++){var m=arguments[d]!=null?arguments[d]:{};d%2?sT(Object(m),!0).forEach(function(x){UO(h,x,m[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(m)):sT(Object(m)).forEach(function(x){Object.defineProperty(h,x,Object.getOwnPropertyDescriptor(m,x))})}return h}function pd(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pd=function(d){return typeof d}:pd=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},pd(h)}function UO(h,d,m){return d in h?Object.defineProperty(h,d,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[d]=m,h}function kn(){return kn=Object.assign||function(h){for(var d=1;d<arguments.length;d++){var m=arguments[d];for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&(h[x]=m[x])}return h},kn.apply(this,arguments)}function qO(h,d){if(h==null)return{};var m={},x=Object.keys(h),T,I;for(I=0;I<x.length;I++)T=x[I],!(d.indexOf(T)>=0)&&(m[T]=h[T]);return m}function GO(h,d){if(h==null)return{};var m=qO(h,d),x,T;if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(h);for(T=0;T<I.length;T++)x=I[T],!(d.indexOf(x)>=0)&&Object.prototype.propertyIsEnumerable.call(h,x)&&(m[x]=h[x])}return m}var $O="1.14.0";function Cn(h){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(h)}var zn=Cn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Rc=Cn(/Edge/i),aT=Cn(/firefox/i),Sc=Cn(/safari/i)&&!Cn(/chrome/i)&&!Cn(/android/i),PE=Cn(/iP(ad|od|hone)/i),WO=Cn(/chrome/i)&&Cn(/android/i),zE={capture:!1,passive:!1};function _i(h,d,m){h.addEventListener(d,m,!zn&&zE)}function ci(h,d,m){h.removeEventListener(d,m,!zn&&zE)}function Id(h,d){if(d){if(d[0]===">"&&(d=d.substring(1)),h)try{if(h.matches)return h.matches(d);if(h.msMatchesSelector)return h.msMatchesSelector(d);if(h.webkitMatchesSelector)return h.webkitMatchesSelector(d)}catch{return!1}return!1}}function HO(h){return h.host&&h!==document&&h.host.nodeType?h.host:h.parentNode}function Qo(h,d,m,x){if(h){m=m||document;do{if(d!=null&&(d[0]===">"?h.parentNode===m&&Id(h,d):Id(h,d))||x&&h===m)return h;if(h===m)break}while(h=HO(h))}return null}var lT=/\s+/g;function eo(h,d,m){if(h&&d)if(h.classList)h.classList[m?"add":"remove"](d);else{var x=(" "+h.className+" ").replace(lT," ").replace(" "+d+" "," ");h.className=(x+(m?" "+d:"")).replace(lT," ")}}function Lt(h,d,m){var x=h&&h.style;if(x){if(m===void 0)return document.defaultView&&document.defaultView.getComputedStyle?m=document.defaultView.getComputedStyle(h,""):h.currentStyle&&(m=h.currentStyle),d===void 0?m:m[d];!(d in x)&&d.indexOf("webkit")===-1&&(d="-webkit-"+d),x[d]=m+(typeof m=="string"?"":"px")}}function ul(h,d){var m="";if(typeof h=="string")m=h;else do{var x=Lt(h,"transform");x&&x!=="none"&&(m=x+" "+m)}while(!d&&(h=h.parentNode));var T=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return T&&new T(m)}function DE(h,d,m){if(h){var x=h.getElementsByTagName(d),T=0,I=x.length;if(m)for(;T<I;T++)m(x[T],T);return x}return[]}function en(){var h=document.scrollingElement;return h||document.documentElement}function lr(h,d,m,x,T){if(!(!h.getBoundingClientRect&&h!==window)){var I,P,L,C,Z,ee,oe;if(h!==window&&h.parentNode&&h!==en()?(I=h.getBoundingClientRect(),P=I.top,L=I.left,C=I.bottom,Z=I.right,ee=I.height,oe=I.width):(P=0,L=0,C=window.innerHeight,Z=window.innerWidth,ee=window.innerHeight,oe=window.innerWidth),(d||m)&&h!==window&&(T=T||h.parentNode,!zn))do if(T&&T.getBoundingClientRect&&(Lt(T,"transform")!=="none"||m&&Lt(T,"position")!=="static")){var Te=T.getBoundingClientRect();P-=Te.top+parseInt(Lt(T,"border-top-width")),L-=Te.left+parseInt(Lt(T,"border-left-width")),C=P+I.height,Z=L+I.width;break}while(T=T.parentNode);if(x&&h!==window){var Me=ul(T||h),ke=Me&&Me.a,ve=Me&&Me.d;Me&&(P/=ve,L/=ke,oe/=ke,ee/=ve,C=P+ee,Z=L+oe)}return{top:P,left:L,bottom:C,right:Z,width:oe,height:ee}}}function cT(h,d,m){for(var x=ps(h,!0),T=lr(h)[d];x;){var I=lr(x)[m],P=void 0;if(P=T>=I,!P)return x;if(x===en())break;x=ps(x,!1)}return!1}function dl(h,d,m,x){for(var T=0,I=0,P=h.children;I<P.length;){if(P[I].style.display!=="none"&&P[I]!==Ot.ghost&&(x||P[I]!==Ot.dragged)&&Qo(P[I],m.draggable,h,!1)){if(T===d)return P[I];T++}I++}return null}function Eg(h,d){for(var m=h.lastElementChild;m&&(m===Ot.ghost||Lt(m,"display")==="none"||d&&!Id(m,d));)m=m.previousElementSibling;return m||null}function yo(h,d){var m=0;if(!h||!h.parentNode)return-1;for(;h=h.previousElementSibling;)h.nodeName.toUpperCase()!=="TEMPLATE"&&h!==Ot.clone&&(!d||Id(h,d))&&m++;return m}function uT(h){var d=0,m=0,x=en();if(h)do{var T=ul(h),I=T.a,P=T.d;d+=h.scrollLeft*I,m+=h.scrollTop*P}while(h!==x&&(h=h.parentNode));return[d,m]}function ZO(h,d){for(var m in h)if(h.hasOwnProperty(m)){for(var x in d)if(d.hasOwnProperty(x)&&d[x]===h[m][x])return Number(m)}return-1}function ps(h,d){if(!h||!h.getBoundingClientRect)return en();var m=h,x=!1;do if(m.clientWidth<m.scrollWidth||m.clientHeight<m.scrollHeight){var T=Lt(m);if(m.clientWidth<m.scrollWidth&&(T.overflowX=="auto"||T.overflowX=="scroll")||m.clientHeight<m.scrollHeight&&(T.overflowY=="auto"||T.overflowY=="scroll")){if(!m.getBoundingClientRect||m===document.body)return en();if(x||d)return m;x=!0}}while(m=m.parentNode);return en()}function XO(h,d){if(h&&d)for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m]);return h}function F_(h,d){return Math.round(h.top)===Math.round(d.top)&&Math.round(h.left)===Math.round(d.left)&&Math.round(h.height)===Math.round(d.height)&&Math.round(h.width)===Math.round(d.width)}var Ac;function LE(h,d){return function(){if(!Ac){var m=arguments,x=this;m.length===1?h.call(x,m[0]):h.apply(x,m),Ac=setTimeout(function(){Ac=void 0},d)}}}function YO(){clearTimeout(Ac),Ac=void 0}function RE(h,d,m){h.scrollLeft+=d,h.scrollTop+=m}function OE(h){var d=window.Polymer,m=window.jQuery||window.Zepto;return d&&d.dom?d.dom(h).cloneNode(!0):m?m(h).clone(!0)[0]:h.cloneNode(!0)}var io="Sortable"+new Date().getTime();function KO(){var h=[],d;return{captureAnimationState:function(){if(h=[],!!this.options.animation){var m=[].slice.call(this.el.children);m.forEach(function(x){if(!(Lt(x,"display")==="none"||x===Ot.ghost)){h.push({target:x,rect:lr(x)});var T=tn({},h[h.length-1].rect);if(x.thisAnimationDuration){var I=ul(x,!0);I&&(T.top-=I.f,T.left-=I.e)}x.fromRect=T}})}},addAnimationState:function(m){h.push(m)},removeAnimationState:function(m){h.splice(ZO(h,{target:m}),1)},animateAll:function(m){var x=this;if(!this.options.animation){clearTimeout(d),typeof m=="function"&&m();return}var T=!1,I=0;h.forEach(function(P){var L=0,C=P.target,Z=C.fromRect,ee=lr(C),oe=C.prevFromRect,Te=C.prevToRect,Me=P.rect,ke=ul(C,!0);ke&&(ee.top-=ke.f,ee.left-=ke.e),C.toRect=ee,C.thisAnimationDuration&&F_(oe,ee)&&!F_(Z,ee)&&(Me.top-ee.top)/(Me.left-ee.left)===(Z.top-ee.top)/(Z.left-ee.left)&&(L=QO(Me,oe,Te,x.options)),F_(ee,Z)||(C.prevFromRect=Z,C.prevToRect=ee,L||(L=x.options.animation),x.animate(C,Me,ee,L)),L&&(T=!0,I=Math.max(I,L),clearTimeout(C.animationResetTimer),C.animationResetTimer=setTimeout(function(){C.animationTime=0,C.prevFromRect=null,C.fromRect=null,C.prevToRect=null,C.thisAnimationDuration=null},L),C.thisAnimationDuration=L)}),clearTimeout(d),T?d=setTimeout(function(){typeof m=="function"&&m()},I):typeof m=="function"&&m(),h=[]},animate:function(m,x,T,I){if(I){Lt(m,"transition",""),Lt(m,"transform","");var P=ul(this.el),L=P&&P.a,C=P&&P.d,Z=(x.left-T.left)/(L||1),ee=(x.top-T.top)/(C||1);m.animatingX=!!Z,m.animatingY=!!ee,Lt(m,"transform","translate3d("+Z+"px,"+ee+"px,0)"),this.forRepaintDummy=JO(m),Lt(m,"transition","transform "+I+"ms"+(this.options.easing?" "+this.options.easing:"")),Lt(m,"transform","translate3d(0,0,0)"),typeof m.animated=="number"&&clearTimeout(m.animated),m.animated=setTimeout(function(){Lt(m,"transition",""),Lt(m,"transform",""),m.animated=!1,m.animatingX=!1,m.animatingY=!1},I)}}}}function JO(h){return h.offsetWidth}function QO(h,d,m,x){return Math.sqrt(Math.pow(d.top-h.top,2)+Math.pow(d.left-h.left,2))/Math.sqrt(Math.pow(d.top-m.top,2)+Math.pow(d.left-m.left,2))*x.animation}var il=[],N_={initializeByDefault:!0},Oc={mount:function(h){for(var d in N_)N_.hasOwnProperty(d)&&!(d in h)&&(h[d]=N_[d]);il.forEach(function(m){if(m.pluginName===h.pluginName)throw"Sortable: Cannot mount plugin ".concat(h.pluginName," more than once")}),il.push(h)},pluginEvent:function(h,d,m){var x=this;this.eventCanceled=!1,m.cancel=function(){x.eventCanceled=!0};var T=h+"Global";il.forEach(function(I){d[I.pluginName]&&(d[I.pluginName][T]&&d[I.pluginName][T](tn({sortable:d},m)),d.options[I.pluginName]&&d[I.pluginName][h]&&d[I.pluginName][h](tn({sortable:d},m)))})},initializePlugins:function(h,d,m,x){il.forEach(function(P){var L=P.pluginName;if(!(!h.options[L]&&!P.initializeByDefault)){var C=new P(h,d,h.options);C.sortable=h,C.options=h.options,h[L]=C,kn(m,C.defaults)}});for(var T in h.options)if(h.options.hasOwnProperty(T)){var I=this.modifyOption(h,T,h.options[T]);typeof I<"u"&&(h.options[T]=I)}},getEventProperties:function(h,d){var m={};return il.forEach(function(x){typeof x.eventProperties=="function"&&kn(m,x.eventProperties.call(d[x.pluginName],h))}),m},modifyOption:function(h,d,m){var x;return il.forEach(function(T){h[T.pluginName]&&T.optionListeners&&typeof T.optionListeners[d]=="function"&&(x=T.optionListeners[d].call(h[T.pluginName],m))}),x}};function eB(h){var d=h.sortable,m=h.rootEl,x=h.name,T=h.targetEl,I=h.cloneEl,P=h.toEl,L=h.fromEl,C=h.oldIndex,Z=h.newIndex,ee=h.oldDraggableIndex,oe=h.newDraggableIndex,Te=h.originalEvent,Me=h.putSortable,ke=h.extraEventProperties;if(d=d||m&&m[io],!!d){var ve,Ze=d.options,mt="on"+x.charAt(0).toUpperCase()+x.substr(1);window.CustomEvent&&!zn&&!Rc?ve=new CustomEvent(x,{bubbles:!0,cancelable:!0}):(ve=document.createEvent("Event"),ve.initEvent(x,!0,!0)),ve.to=P||m,ve.from=L||m,ve.item=T||m,ve.clone=I,ve.oldIndex=C,ve.newIndex=Z,ve.oldDraggableIndex=ee,ve.newDraggableIndex=oe,ve.originalEvent=Te,ve.pullMode=Me?Me.lastPutMode:void 0;var et=tn(tn({},ke),Oc.getEventProperties(x,d));for(var xt in et)ve[xt]=et[xt];m&&m.dispatchEvent(ve),Ze[mt]&&Ze[mt].call(d,ve)}}var tB=["evt"],Wr=function(h,d){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x=m.evt,T=GO(m,tB);Oc.pluginEvent.bind(Ot)(h,d,tn({dragEl:$e,parentEl:Hi,ghostEl:Gt,rootEl:Vi,nextEl:Qs,lastDownEl:fd,cloneEl:Zi,cloneHidden:hs,dragStarted:bc,putSortable:fr,activeSortable:Ot.active,originalEvent:x,oldIndex:al,oldDraggableIndex:Mc,newIndex:to,newDraggableIndex:us,hideGhostForTarget:jE,unhideGhostForTarget:VE,cloneNowHidden:function(){hs=!0},cloneNowShown:function(){hs=!1},dispatchSortableEvent:function(I){Mr({sortable:d,name:I,originalEvent:x})}},T))};function Mr(h){eB(tn({putSortable:fr,cloneEl:Zi,targetEl:$e,rootEl:Vi,oldIndex:al,oldDraggableIndex:Mc,newIndex:to,newDraggableIndex:us},h))}var $e,Hi,Gt,Vi,Qs,fd,Zi,hs,al,to,Mc,us,od,fr,nl=!1,Cd=!1,kd=[],Ys,Po,j_,V_,hT,dT,bc,rl,Ic,Cc=!1,nd=!1,md,yr,U_=[],ng=!1,Pd=[],jd=typeof document<"u",sd=PE,pT=Rc||zn?"cssFloat":"float",iB=jd&&!WO&&!PE&&"draggable"in document.createElement("div"),BE=function(){if(jd){if(zn)return!1;var h=document.createElement("x");return h.style.cssText="pointer-events:auto",h.style.pointerEvents==="auto"}}(),FE=function(h,d){var m=Lt(h),x=parseInt(m.width)-parseInt(m.paddingLeft)-parseInt(m.paddingRight)-parseInt(m.borderLeftWidth)-parseInt(m.borderRightWidth),T=dl(h,0,d),I=dl(h,1,d),P=T&&Lt(T),L=I&&Lt(I),C=P&&parseInt(P.marginLeft)+parseInt(P.marginRight)+lr(T).width,Z=L&&parseInt(L.marginLeft)+parseInt(L.marginRight)+lr(I).width;if(m.display==="flex")return m.flexDirection==="column"||m.flexDirection==="column-reverse"?"vertical":"horizontal";if(m.display==="grid")return m.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(T&&P.float&&P.float!=="none"){var ee=P.float==="left"?"left":"right";return I&&(L.clear==="both"||L.clear===ee)?"vertical":"horizontal"}return T&&(P.display==="block"||P.display==="flex"||P.display==="table"||P.display==="grid"||C>=x&&m[pT]==="none"||I&&m[pT]==="none"&&C+Z>x)?"vertical":"horizontal"},rB=function(h,d,m){var x=m?h.left:h.top,T=m?h.right:h.bottom,I=m?h.width:h.height,P=m?d.left:d.top,L=m?d.right:d.bottom,C=m?d.width:d.height;return x===P||T===L||x+I/2===P+C/2},oB=function(h,d){var m;return kd.some(function(x){var T=x[io].options.emptyInsertThreshold;if(!(!T||Eg(x))){var I=lr(x),P=h>=I.left-T&&h<=I.right+T,L=d>=I.top-T&&d<=I.bottom+T;if(P&&L)return m=x}}),m},NE=function(h){function d(T,I){return function(P,L,C,Z){var ee=P.options.group.name&&L.options.group.name&&P.options.group.name===L.options.group.name;if(T==null&&(I||ee))return!0;if(T==null||T===!1)return!1;if(I&&T==="clone")return T;if(typeof T=="function")return d(T(P,L,C,Z),I)(P,L,C,Z);var oe=(I?P:L).options.group.name;return T===!0||typeof T=="string"&&T===oe||T.join&&T.indexOf(oe)>-1}}var m={},x=h.group;(!x||pd(x)!="object")&&(x={name:x}),m.name=x.name,m.checkPull=d(x.pull,!0),m.checkPut=d(x.put),m.revertClone=x.revertClone,h.group=m},jE=function(){!BE&&Gt&&Lt(Gt,"display","none")},VE=function(){!BE&&Gt&&Lt(Gt,"display","")};jd&&document.addEventListener("click",function(h){if(Cd)return h.preventDefault(),h.stopPropagation&&h.stopPropagation(),h.stopImmediatePropagation&&h.stopImmediatePropagation(),Cd=!1,!1},!0);var Ks=function(h){if($e){h=h.touches?h.touches[0]:h;var d=oB(h.clientX,h.clientY);if(d){var m={};for(var x in h)h.hasOwnProperty(x)&&(m[x]=h[x]);m.target=m.rootEl=d,m.preventDefault=void 0,m.stopPropagation=void 0,d[io]._onDragOver(m)}}},nB=function(h){$e&&$e.parentNode[io]._isOutsideThisEl(h.target)};function Ot(h,d){if(!(h&&h.nodeType&&h.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(h));this.el=h,this.options=d=kn({},d),h[io]=this;var m={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(h.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return FE(h,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(I,P){I.setData("Text",P.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:Ot.supportPointer!==!1&&"PointerEvent"in window&&!Sc,emptyInsertThreshold:5};Oc.initializePlugins(this,h,m);for(var x in m)!(x in d)&&(d[x]=m[x]);NE(d);for(var T in this)T.charAt(0)==="_"&&typeof this[T]=="function"&&(this[T]=this[T].bind(this));this.nativeDraggable=d.forceFallback?!1:iB,this.nativeDraggable&&(this.options.touchStartThreshold=1),d.supportPointer?_i(h,"pointerdown",this._onTapStart):(_i(h,"mousedown",this._onTapStart),_i(h,"touchstart",this._onTapStart)),this.nativeDraggable&&(_i(h,"dragover",this),_i(h,"dragenter",this)),kd.push(this.el),d.store&&d.store.get&&this.sort(d.store.get(this)||[]),kn(this,KO())}Ot.prototype={constructor:Ot,_isOutsideThisEl:function(h){!this.el.contains(h)&&h!==this.el&&(rl=null)},_getDirection:function(h,d){return typeof this.options.direction=="function"?this.options.direction.call(this,h,d,$e):this.options.direction},_onTapStart:function(h){if(h.cancelable){var d=this,m=this.el,x=this.options,T=x.preventOnFilter,I=h.type,P=h.touches&&h.touches[0]||h.pointerType&&h.pointerType==="touch"&&h,L=(P||h).target,C=h.target.shadowRoot&&(h.path&&h.path[0]||h.composedPath&&h.composedPath()[0])||L,Z=x.filter;if(pB(m),!$e&&!(/mousedown|pointerdown/.test(I)&&h.button!==0||x.disabled)&&!C.isContentEditable&&!(!this.nativeDraggable&&Sc&&L&&L.tagName.toUpperCase()==="SELECT")&&(L=Qo(L,x.draggable,m,!1),!(L&&L.animated)&&fd!==L)){if(al=yo(L),Mc=yo(L,x.draggable),typeof Z=="function"){if(Z.call(this,h,L,this)){Mr({sortable:d,rootEl:C,name:"filter",targetEl:L,toEl:m,fromEl:m}),Wr("filter",d,{evt:h}),T&&h.cancelable&&h.preventDefault();return}}else if(Z&&(Z=Z.split(",").some(function(ee){if(ee=Qo(C,ee.trim(),m,!1),ee)return Mr({sortable:d,rootEl:ee,name:"filter",targetEl:L,fromEl:m,toEl:m}),Wr("filter",d,{evt:h}),!0}),Z)){T&&h.cancelable&&h.preventDefault();return}x.handle&&!Qo(C,x.handle,m,!1)||this._prepareDragStart(h,P,L)}}},_prepareDragStart:function(h,d,m){var x=this,T=x.el,I=x.options,P=T.ownerDocument,L;if(m&&!$e&&m.parentNode===T){var C=lr(m);if(Vi=T,$e=m,Hi=$e.parentNode,Qs=$e.nextSibling,fd=m,od=I.group,Ot.dragged=$e,Ys={target:$e,clientX:(d||h).clientX,clientY:(d||h).clientY},hT=Ys.clientX-C.left,dT=Ys.clientY-C.top,this._lastX=(d||h).clientX,this._lastY=(d||h).clientY,$e.style["will-change"]="all",L=function(){if(Wr("delayEnded",x,{evt:h}),Ot.eventCanceled){x._onDrop();return}x._disableDelayedDragEvents(),!aT&&x.nativeDraggable&&($e.draggable=!0),x._triggerDragStart(h,d),Mr({sortable:x,name:"choose",originalEvent:h}),eo($e,I.chosenClass,!0)},I.ignore.split(",").forEach(function(Z){DE($e,Z.trim(),q_)}),_i(P,"dragover",Ks),_i(P,"mousemove",Ks),_i(P,"touchmove",Ks),_i(P,"mouseup",x._onDrop),_i(P,"touchend",x._onDrop),_i(P,"touchcancel",x._onDrop),aT&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$e.draggable=!0),Wr("delayStart",this,{evt:h}),I.delay&&(!I.delayOnTouchOnly||d)&&(!this.nativeDraggable||!(Rc||zn))){if(Ot.eventCanceled){this._onDrop();return}_i(P,"mouseup",x._disableDelayedDrag),_i(P,"touchend",x._disableDelayedDrag),_i(P,"touchcancel",x._disableDelayedDrag),_i(P,"mousemove",x._delayedDragTouchMoveHandler),_i(P,"touchmove",x._delayedDragTouchMoveHandler),I.supportPointer&&_i(P,"pointermove",x._delayedDragTouchMoveHandler),x._dragStartTimer=setTimeout(L,I.delay)}else L()}},_delayedDragTouchMoveHandler:function(h){var d=h.touches?h.touches[0]:h;Math.max(Math.abs(d.clientX-this._lastX),Math.abs(d.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$e&&q_($e),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var h=this.el.ownerDocument;ci(h,"mouseup",this._disableDelayedDrag),ci(h,"touchend",this._disableDelayedDrag),ci(h,"touchcancel",this._disableDelayedDrag),ci(h,"mousemove",this._delayedDragTouchMoveHandler),ci(h,"touchmove",this._delayedDragTouchMoveHandler),ci(h,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(h,d){d=d||h.pointerType=="touch"&&h,!this.nativeDraggable||d?this.options.supportPointer?_i(document,"pointermove",this._onTouchMove):d?_i(document,"touchmove",this._onTouchMove):_i(document,"mousemove",this._onTouchMove):(_i($e,"dragend",this),_i(Vi,"dragstart",this._onDragStart));try{document.selection?_d(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(h,d){if(nl=!1,Vi&&$e){Wr("dragStarted",this,{evt:d}),this.nativeDraggable&&_i(document,"dragover",nB);var m=this.options;!h&&eo($e,m.dragClass,!1),eo($e,m.ghostClass,!0),Ot.active=this,h&&this._appendGhost(),Mr({sortable:this,name:"start",originalEvent:d})}else this._nulling()},_emulateDragOver:function(){if(Po){this._lastX=Po.clientX,this._lastY=Po.clientY,jE();for(var h=document.elementFromPoint(Po.clientX,Po.clientY),d=h;h&&h.shadowRoot&&(h=h.shadowRoot.elementFromPoint(Po.clientX,Po.clientY),h!==d);)d=h;if($e.parentNode[io]._isOutsideThisEl(h),d)do{if(d[io]){var m=void 0;if(m=d[io]._onDragOver({clientX:Po.clientX,clientY:Po.clientY,target:h,rootEl:d}),m&&!this.options.dragoverBubble)break}h=d}while(d=d.parentNode);VE()}},_onTouchMove:function(h){if(Ys){var d=this.options,m=d.fallbackTolerance,x=d.fallbackOffset,T=h.touches?h.touches[0]:h,I=Gt&&ul(Gt,!0),P=Gt&&I&&I.a,L=Gt&&I&&I.d,C=sd&&yr&&uT(yr),Z=(T.clientX-Ys.clientX+x.x)/(P||1)+(C?C[0]-U_[0]:0)/(P||1),ee=(T.clientY-Ys.clientY+x.y)/(L||1)+(C?C[1]-U_[1]:0)/(L||1);if(!Ot.active&&!nl){if(m&&Math.max(Math.abs(T.clientX-this._lastX),Math.abs(T.clientY-this._lastY))<m)return;this._onDragStart(h,!0)}if(Gt){I?(I.e+=Z-(j_||0),I.f+=ee-(V_||0)):I={a:1,b:0,c:0,d:1,e:Z,f:ee};var oe="matrix(".concat(I.a,",").concat(I.b,",").concat(I.c,",").concat(I.d,",").concat(I.e,",").concat(I.f,")");Lt(Gt,"webkitTransform",oe),Lt(Gt,"mozTransform",oe),Lt(Gt,"msTransform",oe),Lt(Gt,"transform",oe),j_=Z,V_=ee,Po=T}h.cancelable&&h.preventDefault()}},_appendGhost:function(){if(!Gt){var h=this.options.fallbackOnBody?document.body:Vi,d=lr($e,!0,sd,!0,h),m=this.options;if(sd){for(yr=h;Lt(yr,"position")==="static"&&Lt(yr,"transform")==="none"&&yr!==document;)yr=yr.parentNode;yr!==document.body&&yr!==document.documentElement?(yr===document&&(yr=en()),d.top+=yr.scrollTop,d.left+=yr.scrollLeft):yr=en(),U_=uT(yr)}Gt=$e.cloneNode(!0),eo(Gt,m.ghostClass,!1),eo(Gt,m.fallbackClass,!0),eo(Gt,m.dragClass,!0),Lt(Gt,"transition",""),Lt(Gt,"transform",""),Lt(Gt,"box-sizing","border-box"),Lt(Gt,"margin",0),Lt(Gt,"top",d.top),Lt(Gt,"left",d.left),Lt(Gt,"width",d.width),Lt(Gt,"height",d.height),Lt(Gt,"opacity","0.8"),Lt(Gt,"position",sd?"absolute":"fixed"),Lt(Gt,"zIndex","100000"),Lt(Gt,"pointerEvents","none"),Ot.ghost=Gt,h.appendChild(Gt),Lt(Gt,"transform-origin",hT/parseInt(Gt.style.width)*100+"% "+dT/parseInt(Gt.style.height)*100+"%")}},_onDragStart:function(h,d){var m=this,x=h.dataTransfer,T=m.options;if(Wr("dragStart",this,{evt:h}),Ot.eventCanceled){this._onDrop();return}Wr("setupClone",this),Ot.eventCanceled||(Zi=OE($e),Zi.draggable=!1,Zi.style["will-change"]="",this._hideClone(),eo(Zi,this.options.chosenClass,!1),Ot.clone=Zi),m.cloneId=_d(function(){Wr("clone",m),!Ot.eventCanceled&&(m.options.removeCloneOnHide||Vi.insertBefore(Zi,$e),m._hideClone(),Mr({sortable:m,name:"clone"}))}),!d&&eo($e,T.dragClass,!0),d?(Cd=!0,m._loopId=setInterval(m._emulateDragOver,50)):(ci(document,"mouseup",m._onDrop),ci(document,"touchend",m._onDrop),ci(document,"touchcancel",m._onDrop),x&&(x.effectAllowed="move",T.setData&&T.setData.call(m,x,$e)),_i(document,"drop",m),Lt($e,"transform","translateZ(0)")),nl=!0,m._dragStartId=_d(m._dragStarted.bind(m,d,h)),_i(document,"selectstart",m),bc=!0,Sc&&Lt(document.body,"user-select","none")},_onDragOver:function(h){var d=this.el,m=h.target,x,T,I,P=this.options,L=P.group,C=Ot.active,Z=od===L,ee=P.sort,oe=fr||C,Te,Me=this,ke=!1;if(ng)return;function ve(rn,on){Wr(rn,Me,tn({evt:h,isOwner:Z,axis:Te?"vertical":"horizontal",revert:I,dragRect:x,targetRect:T,canSort:ee,fromSortable:oe,target:m,completed:mt,onMove:function(Lo,kr){return ad(Vi,d,$e,x,Lo,lr(Lo),h,kr)},changed:et},on))}function Ze(){ve("dragOverAnimationCapture"),Me.captureAnimationState(),Me!==oe&&oe.captureAnimationState()}function mt(rn){return ve("dragOverCompleted",{insertion:rn}),rn&&(Z?C._hideClone():C._showClone(Me),Me!==oe&&(eo($e,fr?fr.options.ghostClass:C.options.ghostClass,!1),eo($e,P.ghostClass,!0)),fr!==Me&&Me!==Ot.active?fr=Me:Me===Ot.active&&fr&&(fr=null),oe===Me&&(Me._ignoreWhileAnimating=m),Me.animateAll(function(){ve("dragOverAnimationComplete"),Me._ignoreWhileAnimating=null}),Me!==oe&&(oe.animateAll(),oe._ignoreWhileAnimating=null)),(m===$e&&!$e.animated||m===d&&!m.animated)&&(rl=null),!P.dragoverBubble&&!h.rootEl&&m!==document&&($e.parentNode[io]._isOutsideThisEl(h.target),!rn&&Ks(h)),!P.dragoverBubble&&h.stopPropagation&&h.stopPropagation(),ke=!0}function et(){to=yo($e),us=yo($e,P.draggable),Mr({sortable:Me,name:"change",toEl:d,newIndex:to,newDraggableIndex:us,originalEvent:h})}if(h.preventDefault!==void 0&&h.cancelable&&h.preventDefault(),m=Qo(m,P.draggable,d,!0),ve("dragOver"),Ot.eventCanceled)return ke;if($e.contains(h.target)||m.animated&&m.animatingX&&m.animatingY||Me._ignoreWhileAnimating===m)return mt(!1);if(Cd=!1,C&&!P.disabled&&(Z?ee||(I=Hi!==Vi):fr===this||(this.lastPutMode=od.checkPull(this,C,$e,h))&&L.checkPut(this,C,$e,h))){if(Te=this._getDirection(h,m)==="vertical",x=lr($e),ve("dragOverValid"),Ot.eventCanceled)return ke;if(I)return Hi=Vi,Ze(),this._hideClone(),ve("revert"),Ot.eventCanceled||(Qs?Vi.insertBefore($e,Qs):Vi.appendChild($e)),mt(!0);var xt=Eg(d,P.draggable);if(!xt||cB(h,Te,this)&&!xt.animated){if(xt===$e)return mt(!1);if(xt&&d===h.target&&(m=xt),m&&(T=lr(m)),ad(Vi,d,$e,x,m,T,h,!!m)!==!1)return Ze(),d.appendChild($e),Hi=d,et(),mt(!0)}else if(xt&&lB(h,Te,this)){var _t=dl(d,0,P,!0);if(_t===$e)return mt(!1);if(m=_t,T=lr(m),ad(Vi,d,$e,x,m,T,h,!1)!==!1)return Ze(),d.insertBefore($e,_t),Hi=d,et(),mt(!0)}else if(m.parentNode===d){T=lr(m);var lt=0,qe,$t=$e.parentNode!==d,pi=!rB($e.animated&&$e.toRect||x,m.animated&&m.toRect||T,Te),X=Te?"top":"left",at=cT(m,"top","top")||cT($e,"top","top"),Dn=at?at.scrollTop:void 0;rl!==m&&(qe=T[X],Cc=!1,nd=!pi&&P.invertSwap||$t),lt=uB(h,m,T,Te,pi?1:P.swapThreshold,P.invertedSwapThreshold==null?P.swapThreshold:P.invertedSwapThreshold,nd,rl===m);var cr;if(lt!==0){var it=yo($e);do it-=lt,cr=Hi.children[it];while(cr&&(Lt(cr,"display")==="none"||cr===Gt))}if(lt===0||cr===m)return mt(!1);rl=m,Ic=lt;var wi=m.nextElementSibling,no=!1;no=lt===1;var Cr=ad(Vi,d,$e,x,m,T,h,no);if(Cr!==!1)return(Cr===1||Cr===-1)&&(no=Cr===1),ng=!0,setTimeout(aB,30),Ze(),no&&!wi?d.appendChild($e):m.parentNode.insertBefore($e,no?wi:m),at&&RE(at,0,Dn-at.scrollTop),Hi=$e.parentNode,qe!==void 0&&!nd&&(md=Math.abs(qe-lr(m)[X])),et(),mt(!0)}if(d.contains($e))return mt(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){ci(document,"mousemove",this._onTouchMove),ci(document,"touchmove",this._onTouchMove),ci(document,"pointermove",this._onTouchMove),ci(document,"dragover",Ks),ci(document,"mousemove",Ks),ci(document,"touchmove",Ks)},_offUpEvents:function(){var h=this.el.ownerDocument;ci(h,"mouseup",this._onDrop),ci(h,"touchend",this._onDrop),ci(h,"pointerup",this._onDrop),ci(h,"touchcancel",this._onDrop),ci(document,"selectstart",this)},_onDrop:function(h){var d=this.el,m=this.options;if(to=yo($e),us=yo($e,m.draggable),Wr("drop",this,{evt:h}),Hi=$e&&$e.parentNode,to=yo($e),us=yo($e,m.draggable),Ot.eventCanceled){this._nulling();return}nl=!1,nd=!1,Cc=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),sg(this.cloneId),sg(this._dragStartId),this.nativeDraggable&&(ci(document,"drop",this),ci(d,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Sc&&Lt(document.body,"user-select",""),Lt($e,"transform",""),h&&(bc&&(h.cancelable&&h.preventDefault(),!m.dropBubble&&h.stopPropagation()),Gt&&Gt.parentNode&&Gt.parentNode.removeChild(Gt),(Vi===Hi||fr&&fr.lastPutMode!=="clone")&&Zi&&Zi.parentNode&&Zi.parentNode.removeChild(Zi),$e&&(this.nativeDraggable&&ci($e,"dragend",this),q_($e),$e.style["will-change"]="",bc&&!nl&&eo($e,fr?fr.options.ghostClass:this.options.ghostClass,!1),eo($e,this.options.chosenClass,!1),Mr({sortable:this,name:"unchoose",toEl:Hi,newIndex:null,newDraggableIndex:null,originalEvent:h}),Vi!==Hi?(to>=0&&(Mr({rootEl:Hi,name:"add",toEl:Hi,fromEl:Vi,originalEvent:h}),Mr({sortable:this,name:"remove",toEl:Hi,originalEvent:h}),Mr({rootEl:Hi,name:"sort",toEl:Hi,fromEl:Vi,originalEvent:h}),Mr({sortable:this,name:"sort",toEl:Hi,originalEvent:h})),fr&&fr.save()):to!==al&&to>=0&&(Mr({sortable:this,name:"update",toEl:Hi,originalEvent:h}),Mr({sortable:this,name:"sort",toEl:Hi,originalEvent:h})),Ot.active&&((to==null||to===-1)&&(to=al,us=Mc),Mr({sortable:this,name:"end",toEl:Hi,originalEvent:h}),this.save()))),this._nulling()},_nulling:function(){Wr("nulling",this),Vi=$e=Hi=Gt=Qs=Zi=fd=hs=Ys=Po=bc=to=us=al=Mc=rl=Ic=fr=od=Ot.dragged=Ot.ghost=Ot.clone=Ot.active=null,Pd.forEach(function(h){h.checked=!0}),Pd.length=j_=V_=0},handleEvent:function(h){switch(h.type){case"drop":case"dragend":this._onDrop(h);break;case"dragenter":case"dragover":$e&&(this._onDragOver(h),sB(h));break;case"selectstart":h.preventDefault();break}},toArray:function(){for(var h=[],d,m=this.el.children,x=0,T=m.length,I=this.options;x<T;x++)d=m[x],Qo(d,I.draggable,this.el,!1)&&h.push(d.getAttribute(I.dataIdAttr)||dB(d));return h},sort:function(h,d){var m={},x=this.el;this.toArray().forEach(function(T,I){var P=x.children[I];Qo(P,this.options.draggable,x,!1)&&(m[T]=P)},this),d&&this.captureAnimationState(),h.forEach(function(T){m[T]&&(x.removeChild(m[T]),x.appendChild(m[T]))}),d&&this.animateAll()},save:function(){var h=this.options.store;h&&h.set&&h.set(this)},closest:function(h,d){return Qo(h,d||this.options.draggable,this.el,!1)},option:function(h,d){var m=this.options;if(d===void 0)return m[h];var x=Oc.modifyOption(this,h,d);typeof x<"u"?m[h]=x:m[h]=d,h==="group"&&NE(m)},destroy:function(){Wr("destroy",this);var h=this.el;h[io]=null,ci(h,"mousedown",this._onTapStart),ci(h,"touchstart",this._onTapStart),ci(h,"pointerdown",this._onTapStart),this.nativeDraggable&&(ci(h,"dragover",this),ci(h,"dragenter",this)),Array.prototype.forEach.call(h.querySelectorAll("[draggable]"),function(d){d.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),kd.splice(kd.indexOf(this.el),1),this.el=h=null},_hideClone:function(){if(!hs){if(Wr("hideClone",this),Ot.eventCanceled)return;Lt(Zi,"display","none"),this.options.removeCloneOnHide&&Zi.parentNode&&Zi.parentNode.removeChild(Zi),hs=!0}},_showClone:function(h){if(h.lastPutMode!=="clone"){this._hideClone();return}if(hs){if(Wr("showClone",this),Ot.eventCanceled)return;$e.parentNode==Vi&&!this.options.group.revertClone?Vi.insertBefore(Zi,$e):Qs?Vi.insertBefore(Zi,Qs):Vi.appendChild(Zi),this.options.group.revertClone&&this.animate($e,Zi),Lt(Zi,"display",""),hs=!1}}};function sB(h){h.dataTransfer&&(h.dataTransfer.dropEffect="move"),h.cancelable&&h.preventDefault()}function ad(h,d,m,x,T,I,P,L){var C,Z=h[io],ee=Z.options.onMove,oe;return window.CustomEvent&&!zn&&!Rc?C=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(C=document.createEvent("Event"),C.initEvent("move",!0,!0)),C.to=d,C.from=h,C.dragged=m,C.draggedRect=x,C.related=T||d,C.relatedRect=I||lr(d),C.willInsertAfter=L,C.originalEvent=P,h.dispatchEvent(C),ee&&(oe=ee.call(Z,C,P)),oe}function q_(h){h.draggable=!1}function aB(){ng=!1}function lB(h,d,m){var x=lr(dl(m.el,0,m.options,!0)),T=10;return d?h.clientX<x.left-T||h.clientY<x.top&&h.clientX<x.right:h.clientY<x.top-T||h.clientY<x.bottom&&h.clientX<x.left}function cB(h,d,m){var x=lr(Eg(m.el,m.options.draggable)),T=10;return d?h.clientX>x.right+T||h.clientX<=x.right&&h.clientY>x.bottom&&h.clientX>=x.left:h.clientX>x.right&&h.clientY>x.top||h.clientX<=x.right&&h.clientY>x.bottom+T}function uB(h,d,m,x,T,I,P,L){var C=x?h.clientY:h.clientX,Z=x?m.height:m.width,ee=x?m.top:m.left,oe=x?m.bottom:m.right,Te=!1;if(!P){if(L&&md<Z*T){if(!Cc&&(Ic===1?C>ee+Z*I/2:C<oe-Z*I/2)&&(Cc=!0),Cc)Te=!0;else if(Ic===1?C<ee+md:C>oe-md)return-Ic}else if(C>ee+Z*(1-T)/2&&C<oe-Z*(1-T)/2)return hB(d)}return Te=Te||P,Te&&(C<ee+Z*I/2||C>oe-Z*I/2)?C>ee+Z/2?1:-1:0}function hB(h){return yo($e)<yo(h)?1:-1}function dB(h){for(var d=h.tagName+h.className+h.src+h.href+h.textContent,m=d.length,x=0;m--;)x+=d.charCodeAt(m);return x.toString(36)}function pB(h){Pd.length=0;for(var d=h.getElementsByTagName("input"),m=d.length;m--;){var x=d[m];x.checked&&Pd.push(x)}}function _d(h){return setTimeout(h,0)}function sg(h){return clearTimeout(h)}jd&&_i(document,"touchmove",function(h){(Ot.active||nl)&&h.cancelable&&h.preventDefault()});Ot.utils={on:_i,off:ci,css:Lt,find:DE,is:function(h,d){return!!Qo(h,d,h,!1)},extend:XO,throttle:LE,closest:Qo,toggleClass:eo,clone:OE,index:yo,nextTick:_d,cancelNextTick:sg,detectDirection:FE,getChild:dl};Ot.get=function(h){return h[io]};Ot.mount=function(){for(var h=arguments.length,d=new Array(h),m=0;m<h;m++)d[m]=arguments[m];d[0].constructor===Array&&(d=d[0]),d.forEach(function(x){if(!x.prototype||!x.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(x));x.utils&&(Ot.utils=tn(tn({},Ot.utils),x.utils)),Oc.mount(x)})};Ot.create=function(h,d){return new Ot(h,d)};Ot.version=$O;var nr=[],wc,ag,lg=!1,G_,$_,zd,Tc;function fB(){function h(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var d in this)d.charAt(0)==="_"&&typeof this[d]=="function"&&(this[d]=this[d].bind(this))}return h.prototype={dragStarted:function(d){var m=d.originalEvent;this.sortable.nativeDraggable?_i(document,"dragover",this._handleAutoScroll):this.options.supportPointer?_i(document,"pointermove",this._handleFallbackAutoScroll):m.touches?_i(document,"touchmove",this._handleFallbackAutoScroll):_i(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(d){var m=d.originalEvent;!this.options.dragOverBubble&&!m.rootEl&&this._handleAutoScroll(m)},drop:function(){this.sortable.nativeDraggable?ci(document,"dragover",this._handleAutoScroll):(ci(document,"pointermove",this._handleFallbackAutoScroll),ci(document,"touchmove",this._handleFallbackAutoScroll),ci(document,"mousemove",this._handleFallbackAutoScroll)),fT(),gd(),YO()},nulling:function(){zd=ag=wc=lg=Tc=G_=$_=null,nr.length=0},_handleFallbackAutoScroll:function(d){this._handleAutoScroll(d,!0)},_handleAutoScroll:function(d,m){var x=this,T=(d.touches?d.touches[0]:d).clientX,I=(d.touches?d.touches[0]:d).clientY,P=document.elementFromPoint(T,I);if(zd=d,m||this.options.forceAutoScrollFallback||Rc||zn||Sc){W_(d,this.options,P,m);var L=ps(P,!0);lg&&(!Tc||T!==G_||I!==$_)&&(Tc&&fT(),Tc=setInterval(function(){var C=ps(document.elementFromPoint(T,I),!0);C!==L&&(L=C,gd()),W_(d,x.options,C,m)},10),G_=T,$_=I)}else{if(!this.options.bubbleScroll||ps(P,!0)===en()){gd();return}W_(d,this.options,ps(P,!1),!1)}}},kn(h,{pluginName:"scroll",initializeByDefault:!0})}function gd(){nr.forEach(function(h){clearInterval(h.pid)}),nr=[]}function fT(){clearInterval(Tc)}var W_=LE(function(h,d,m,x){if(d.scroll){var T=(h.touches?h.touches[0]:h).clientX,I=(h.touches?h.touches[0]:h).clientY,P=d.scrollSensitivity,L=d.scrollSpeed,C=en(),Z=!1,ee;ag!==m&&(ag=m,gd(),wc=d.scroll,ee=d.scrollFn,wc===!0&&(wc=ps(m,!0)));var oe=0,Te=wc;do{var Me=Te,ke=lr(Me),ve=ke.top,Ze=ke.bottom,mt=ke.left,et=ke.right,xt=ke.width,_t=ke.height,lt=void 0,qe=void 0,$t=Me.scrollWidth,pi=Me.scrollHeight,X=Lt(Me),at=Me.scrollLeft,Dn=Me.scrollTop;Me===C?(lt=xt<$t&&(X.overflowX==="auto"||X.overflowX==="scroll"||X.overflowX==="visible"),qe=_t<pi&&(X.overflowY==="auto"||X.overflowY==="scroll"||X.overflowY==="visible")):(lt=xt<$t&&(X.overflowX==="auto"||X.overflowX==="scroll"),qe=_t<pi&&(X.overflowY==="auto"||X.overflowY==="scroll"));var cr=lt&&(Math.abs(et-T)<=P&&at+xt<$t)-(Math.abs(mt-T)<=P&&!!at),it=qe&&(Math.abs(Ze-I)<=P&&Dn+_t<pi)-(Math.abs(ve-I)<=P&&!!Dn);if(!nr[oe])for(var wi=0;wi<=oe;wi++)nr[wi]||(nr[wi]={});(nr[oe].vx!=cr||nr[oe].vy!=it||nr[oe].el!==Me)&&(nr[oe].el=Me,nr[oe].vx=cr,nr[oe].vy=it,clearInterval(nr[oe].pid),(cr!=0||it!=0)&&(Z=!0,nr[oe].pid=setInterval(function(){x&&this.layer===0&&Ot.active._onTouchMove(zd);var no=nr[this.layer].vy?nr[this.layer].vy*L:0,Cr=nr[this.layer].vx?nr[this.layer].vx*L:0;typeof ee=="function"&&ee.call(Ot.dragged.parentNode[io],Cr,no,h,zd,nr[this.layer].el)!=="continue"||RE(nr[this.layer].el,Cr,no)}.bind({layer:oe}),24))),oe++}while(d.bubbleScroll&&Te!==C&&(Te=ps(Te,!1)));lg=Z}},30),UE=function(h){var d=h.originalEvent,m=h.putSortable,x=h.dragEl,T=h.activeSortable,I=h.dispatchSortableEvent,P=h.hideGhostForTarget,L=h.unhideGhostForTarget;if(d){var C=m||T;P();var Z=d.changedTouches&&d.changedTouches.length?d.changedTouches[0]:d,ee=document.elementFromPoint(Z.clientX,Z.clientY);L(),C&&!C.el.contains(ee)&&(I("spill"),this.onSpill({dragEl:x,putSortable:m}))}};function Sg(){}Sg.prototype={startIndex:null,dragStart:function(h){var d=h.oldDraggableIndex;this.startIndex=d},onSpill:function(h){var d=h.dragEl,m=h.putSortable;this.sortable.captureAnimationState(),m&&m.captureAnimationState();var x=dl(this.sortable.el,this.startIndex,this.options);x?this.sortable.el.insertBefore(d,x):this.sortable.el.appendChild(d),this.sortable.animateAll(),m&&m.animateAll()},drop:UE};kn(Sg,{pluginName:"revertOnSpill"});function Ag(){}Ag.prototype={onSpill:function(h){var d=h.dragEl,m=h.putSortable,x=m||this.sortable;x.captureAnimationState(),d.parentNode&&d.parentNode.removeChild(d),x.animateAll()},drop:UE};kn(Ag,{pluginName:"removeOnSpill"});Ot.mount(new fB);Ot.mount(Ag,Sg);const mB=["Start","Add","Remove","Update","End"],_B=["Choose","Unchoose","Sort","Filter","Clone"],mT={manageAndEmit:mB,emit:_B};[...[...mT.manageAndEmit,...mT.emit].map(h=>h.toLowerCase())];var yd=(h,d=[])=>({parts:(...m)=>{if(gB(d))return yd(h,m);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...m)=>yd(h,[...d,...m]),rename:m=>yd(m,d),keys:()=>d,build:()=>[...new Set(d)].reduce((m,x)=>Object.assign(m,{[x]:{selector:[`&[data-scope="${ol(h)}"][data-part="${ol(x)}"]`,`& [data-scope="${ol(h)}"][data-part="${ol(x)}"]`].join(", "),attrs:{"data-scope":ol(h),"data-part":ol(x)}}}),{})}),ol=h=>h.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),gB=h=>h.length===0,yB=h=>h.nodeType===Node.DOCUMENT_NODE?h:h.ownerDocument??document;function vB(h){const d={getRootNode:m=>{var x;return((x=m.getRootNode)==null?void 0:x.call(m))??document},getDoc:m=>yB(d.getRootNode(m)),getWin:m=>d.getDoc(m).defaultView??window,getActiveElement:m=>d.getDoc(m).activeElement,isActiveElement:(m,x)=>x===d.getActiveElement(m),focus(m,x){x!=null&&(d.isActiveElement(m,x)||x.focus({preventScroll:!0}))},getById:(m,x)=>d.getRootNode(m).getElementById(x),setValue:(m,x)=>{if(m==null||x==null)return;const T=x.toString();m.value!==T&&(m.value=x.toString())}};return{...d,...h}}var xB=yd("switch").parts("root","label","control","thumb");xB.build();var _T=vB({getRootId:h=>{var d;return((d=h.ids)==null?void 0:d.root)??`switch:${h.id}`},getLabelId:h=>{var d;return((d=h.ids)==null?void 0:d.label)??`switch:${h.id}:label`},getThumbId:h=>{var d;return((d=h.ids)==null?void 0:d.thumb)??`switch:${h.id}:thumb`},getControlId:h=>{var d;return((d=h.ids)==null?void 0:d.control)??`switch:${h.id}:control`},getHiddenInputId:h=>{var d;return((d=h.ids)==null?void 0:d.input)??`switch:${h.id}:input`},getHiddenInputEl:h=>_T.getById(h,_T.getHiddenInputId(h))});const wB=Pn({__name:"Selector",props:{coordinates:{},aspectRatio:{default:"2/1"},mapOptions:{},zoom:{default:12},label:{},mapSelector:{type:Boolean,default:!0},showWarning:{type:Boolean,default:!0},showSelected:{type:Boolean,default:!0},language:{},modelValue:{},placeholder:{},searchFilter:{}},emits:["update:modelValue"],setup(h,{emit:d}){const m=h,x=d,T=zo(),I=zo(),P=zo(),L=zo(),C=zo(!1),Z={location:{},postcode:"0",county:"",city:"",street:"",formatted:""},ee=zo({...Z}),oe={warning:{nb:`Posisjon er ikke gyldig, ${m.mapSelector?"dra markøren eller":""} søk opp posisjon`,en:`Position is not valid, ${m.mapSelector?"drag the cursor or":""} search for position`},placeholder:{nb:"Hent posisjon fra kart",en:"Retrieve position from map"},selectedPosition:{nb:"Valgt posisjon",en:"Selected position"}},Te=[10.738616,59.906103],Me=Hr(()=>({center:ee.value?.location?.coordinates||Te,zoom:m.zoom,dragPan:!0,scrollZoom:!1,dragRotate:!1,cooperativeGestures:!1,...m.mapOptions})),ke=Hr(()=>m.language||document.querySelector("html")?.getAttribute("lang")||"auto"),ve=Hr(()=>m.searchFilter||"no");gT(()=>ee.value,lt=>{if(!I.value||!P.value)return;const qe=ee.value?.location?.coordinates||Te;I.value.setLngLat(qe),P.value.flyTo({center:qe}),x("update:modelValue",C.value?{...Z,location:{}}:ee.value),C.value&&(C.value=!1)},{immediate:!0,deep:!0});const Ze=Hr(()=>{if(ee?.value?.location?.coordinates?.[0])return ee.value.formatted});async function mt(){fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${ee.value.location?.coordinates?.[0]},${ee.value.location?.coordinates?.[1]}.json?access_token=pk.eyJ1IjoiY3JzdGVuIiwiYSI6ImNrNTZxa3gzMDE3dGszaHBod2RnMXQ0anYifQ.FBWO3jVL_VK4RCznouV-iA&language=${ke.value}`).then(lt=>lt.json()).then(lt=>{const qe=et(lt.features),$t=lt.features.find(pi=>pi.id.startsWith("address"));ee.value.street=`${qe.address} ${$t?.address}`,ee.value.city=qe.place,ee.value.county=qe.region||qe.place,ee.value.postcode=qe.postcode,ee.value.formatted=$t?.place_name}).catch(lt=>console.error(lt))}function et(lt){return lt?.length?Object.fromEntries(lt.map(qe=>[qe.id.split(".")?.[0],qe.text])):{}}function xt(){ee.value={...Z,location:{coordinates:Te}},L.value.clear(),C.value=!0}function _t(){T.value&&(P.value=new H_.Map({container:T.value,...Me.value,language:ke.value}),I.value=new H_.Marker({draggable:!0,color:"var(--kvass-location-selector-primary-color)"}).setLngLat(ee.value.location?.coordinates||Te).addTo(P.value),I.value.on("dragend",lt=>{lt?.target&&(ee.value.location.coordinates=Object.values(lt.target?._lngLat||{}),mt())}),P.value.addControl(new C2.FullscreenControl,"top-left"),P.value.addControl(new C2.NavigationControl,"top-left"),L.value=new zL({accessToken:Me.value.accessToken,zoom:4,placeholder:m.placeholder||oe?.placeholder?.[ke.value],filter:function(lt){return lt.context.some(qe=>{if(ve.value)return qe?.short_code===ve.value})},language:ke.value}),P.value.addControl(L.value),L.value.on("result",lt=>{const qe=lt.result,$t=et(qe.context);ee.value.location.coordinates=qe?.geometry?.coordinates,ee.value.street=`${qe.text} ${qe.address}`,ee.value.city=$t.place,ee.value.county=$t.region,ee.value.postcode=$t.postcode,ee.value.formatted=qe?.place_name}))}return dz(()=>{m.modelValue&&(ee.value=m.modelValue),_t()}),pz(()=>{P.value?.remove(),L.value.clear()}),(lt,qe)=>(mr(),In("div",{class:cg(["kvass-location-selector",{"kvass-location-selector--hide-map":!m.mapSelector}]),style:Dd({"--kvass-location-selector-aspect-ratio":m.aspectRatio})},[sl("div",{ref_key:"mapEl",ref:T,class:"kvass-location-selector__map"},null,512),xd(An(LO),{justify:"space-between"},{default:vd(()=>[(Ze.value?m.showSelected:m.showWarning)?(mr(),fs(An($R),{key:0,class:"",variant:Ze.value?"info":"danger"},{default:vd(()=>[yT(kc(Ze.value?`${oe?.selectedPosition?.[ke.value]}: ${Ze.value}`:oe.warning?.[ke.value]),1)]),_:1},8,["variant"])):Sn("",!0),xd(An(bg),{icon:"fa-pro-light:arrow-rotate-left",onClick:xt})]),_:1})],6))}});export{wB as j};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvass/widgets",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.41",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@formkit/auto-animate": "^0.8.2",
|
|
14
14
|
"@img-comparison-slider/vue": "^8.0.0",
|
|
15
|
-
"@kvass/location-selector": "^1.0.
|
|
15
|
+
"@kvass/location-selector": "^1.0.30",
|
|
16
16
|
"@kvass/map": "^1.0.19",
|
|
17
17
|
"@kvass/storage": "^1.1.0",
|
|
18
18
|
"@kvass/ui": "1.6.56",
|