lithiumlist
Version:
A beautifully engineered sortable and swipeable list that works perfectly on desktop and mobile
6 lines • 39.4 kB
JavaScript
/*!
* lithiumlist v1.2.0 (https://www.lithiumlist.com)
* License https://www.lithiumlist.com/terms
* Copyright Indysoft Pty Ltd
*/
var lithiumlist=function(){var m=[],u={onSortStart:null,onSortEnd:null,onSortAutoScrollStart:null,onSortAutoScrollEnd:null,sortEnabled:!0,sortByLongPress:!0,sortStartDuration:300,sortEndDuration:300,sortOuterClass:"sort-outer",sortListClass:"sort-list",sortCloneClass:"sort-clone",sortCloneBoxShadow:"0 5px 14px rgba(0,0,0,0.15), 0 6px 6px rgba(0,0,0,0.12)",sortCloneScale:"1.02",sortCloneMaxOverhang:"50%",sortItemActiveHide:!0,sortItemActiveClass:"sort-item-active",sortDragHandleClass:"sort-drag-handle",sortMoveStartDelay:400,sortReorderDuration:200,sortScrollEnabled:!0,sortScrollSpeed:3,safariBodyUnselectable:!0,safariAutoOuterOverflow:!0,onLeftStart:null,onLeftSlideOutStart:null,onLeftSlideBackStart:null,onLeftEnd:null,leftEnabled:!0,leftBySwipe:!0,leftOuterClass:"left-outer",leftListClass:"left-list",leftCloneClass:"left-clone",leftCloneSlideOutClass:"left-clone-slide-out",leftCloneSlideBackClass:"left-clone-slide-back",leftItemActiveClass:"left-item-active",leftMasks:[{background:"rgba(252, 13, 27, 1)",classNameDefault:"left-mask",classNameSlideOut:"left-mask-slide-out",classNameSlideBack:"left-mask-slide-back",childNode:null}],leftButtonClass:"left-button",leftSwipeStartThreshold:"20px",leftSwipeEndThreshold:"30%",leftSlideOutDuration:300,leftSlideBackDuration:200,onRightStart:null,onRightSlideOutStart:null,onRightSlideBackStart:null,onRightEnd:null,rightEnabled:!0,rightBySwipe:!0,rightOuterClass:"right-outer",rightListClass:"right-list",rightCloneClass:"right-clone",rightCloneSlideOutClass:"right-clone-slide-out",rightCloneSlideBackClass:"right-clone-slide-back",rightItemActiveClass:"right-item-active",rightMasks:[{background:"rgba(15, 127, 18, 1)",classNameDefault:"right-mask",classNameSlideOut:"right-mask-slide-out",classNameSlideBack:"right-mask-slide-back",childNode:null}],rightButtonClass:"right-button",rightSwipeStartThreshold:"20px",rightSwipeEndThreshold:"30%",rightSlideOutDuration:300,rightSlideBackDuration:200,ignoreOnClick:["input","textarea","select","option","button"]},e=!1;void 0!==window.safari&&(e=!0);var f=function(t){t.leftMasks&&1<t.leftMasks.length&&(t.leftMasks.length=1),t.rightMasks&&1<t.rightMasks.length&&(t.rightMasks.length=1)},c=function(t,e){e.temp.sortDelayTimer&&(clearTimeout(e.temp.sortDelayTimer),e.temp.sortDelayTimer=null)},d=function(t,e){if(null!=e&&!e.temp.ignoreClicks&&(e.props.sortEnabled||e.props.leftEnabled||e.props.rightEnabled)){L(e);for(var o=null,s=0,n=e.temp.items.length;s<n;s++)if(e.temp.items[s]===t.target||e.temp.items[s].contains(t.target)){o=s;break}null!=o&&(e.props.sortEnabled&&mt(t,e.temp.items[o],e.props.sortDragHandleClass)?setTimeout(function(){r(t,o,e),a(e)},1):e.props.leftEnabled&&mt(t,e.temp.items[o],e.props.leftButtonClass)?(e.temp.activeIndex=o,g(e,0),k(e)):e.props.rightEnabled&&mt(t,e.temp.items[o],e.props.rightButtonClass)?(e.temp.activeIndex=o,C(e,0),x(e)):z(e,t.target,e.temp.items[o])||l(t,o,e))}},h=function(t,e){d(t,e)},r=function(t,e,o){var s=ut(t),n=ft(t);o.temp.activeIndex=e,o.temp.origIndex=e,o.temp.startPageX=s,o.temp.startPageY=n,o.temp.lastPageX=s,o.temp.lastPageY=n,o.temp.funcMouseMove=function(t){p(t,o)},o.temp.funcMouseUp=function(t){b(t,o)},o.temp.funcTouchMove=function(t){S(t,o)},o.temp.funcTouchEnd=function(t){O(t,o)},o.isr||gt(o),window.addEventListener("mousemove",o.temp.funcMouseMove),window.addEventListener("mouseup",o.temp.funcMouseUp),i?window.addEventListener("touchmove",o.temp.funcTouchMove,{passive:!1}):window.addEventListener("touchmove",o.temp.funcTouchMove),window.addEventListener("touchend",o.temp.funcTouchEnd)},i=function(){var t=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){t=!0}}))}catch(t){}return t},g=function(t,e){t.temp.ignoreClicks=!0,t.temp.moveType="LEFT",t.temp.activeOrigX=t.temp.items[t.temp.activeIndex].offsetLeft,t.props.onLeftStart&&t.props.onLeftStart(_(t),t.temp.activeIndex),K(t),t.props.leftOuterClass&&It(t.outerCont)&&dt(t.outerCont,t.props.leftOuterClass),t.props.leftListClass&&dt(t.listCont,t.props.leftListClass),t.isr||gt(t),0<t.props.leftMasks.length&&0==t.temp.itemMasks.length&&H(t);var o=t.temp.items[t.temp.activeIndex].offsetTop+"px";if(!t.temp.itemSlideClone){var s=e+t.temp.activeOrigX+"px";N(t,s,o)}t.props.leftItemActiveClass&&dt(t.temp.items[t.temp.activeIndex],t.props.leftItemActiveClass)},C=function(t,e){t.temp.ignoreClicks=!0,t.temp.moveType="RIGHT",t.temp.activeOrigX=t.temp.items[t.temp.activeIndex].offsetLeft,t.props.onRightStart&&t.props.onRightStart(_(t),t.temp.activeIndex),K(t),t.props.rightOuterClass&&It(t.outerCont)&&dt(t.outerCont,t.props.rightOuterClass),t.props.rightListClass&&dt(t.listCont,t.props.rightListClass),t.isr||gt(t),0<t.props.rightMasks.length&&0==t.temp.itemMasks.length&&H(t);var o=t.temp.items[t.temp.activeIndex].offsetTop+"px";if(!t.temp.itemSlideClone){var s=e+t.temp.activeOrigX+"px";N(t,s,o)}t.props.rightItemActiveClass&&dt(t.temp.items[t.temp.activeIndex],t.props.rightItemActiveClass)},l=function(t,e,o){(o.props.sortEnabled&&o.props.sortByLongPress||o.props.leftEnabled&&o.props.leftBySwipe||o.props.rightEnabled&&o.props.rightBySwipe)&&(r(t,e,o),L(o),o.props.sortEnabled&&o.props.sortByLongPress&&(o.temp.sortDelayTimer=setTimeout(function(){a(o)},o.props.sortMoveStartDelay)))},a=function(t){if(t.temp&&null!=t.temp.lastPageX&&null!=t.temp.lastPageY){var e=t.temp.items[t.temp.activeIndex].getBoundingClientRect();if(at(t.temp.lastPageX,t.temp.lastPageY,e)){if(t.temp.ignoreClicks=!0,t.temp.sortDelayTimer=null,t.temp.moveType="SORT",t.temp.activeOrigX=t.temp.items[t.temp.activeIndex].offsetLeft,t.props.onSortStart&&t.props.onSortStart(_(t),t.temp.activeIndex),K(t),t.props.sortOuterClass&&It(t.outerCont)&&dt(t.outerCont,t.props.sortOuterClass),t.props.sortListClass&&dt(t.listCont,t.props.sortListClass),!t.temp.itemSortClone){var o=t.temp.items[t.temp.activeIndex].getBoundingClientRect().left+window.pageXOffset+"px",s=t.temp.items[t.temp.activeIndex].getBoundingClientRect().top+window.pageYOffset+"px";A(t,o,s)}t.props.sortItemActiveHide&&(t.temp.items[t.temp.activeIndex].style.visibility="hidden"),t.props.sortItemActiveClass&&dt(t.temp.items[t.temp.activeIndex],t.props.sortItemActiveClass)}}},p=function(t,e){e.temp&&null!=e.temp.moveType&&t.preventDefault();var o=ut(t),s=ft(t),n=o-e.temp.startPageX;if(e.temp.moveType){if("LEFT"==e.temp.moveType||"RIGHT"==e.temp.moveType){if("LEFT"==e.temp.moveType){if(n<0){var r=n+e.temp.activeOrigX+"px";e.temp.itemSlideClone.style.left=r}}else if(0<n){r=n+e.temp.activeOrigX+"px";e.temp.itemSlideClone.style.left=r}}else if("SORT"==e.temp.moveType){var i=s-e.temp.lastPageY,l=e.temp.itemSortClone.getBoundingClientRect(),a=!1;if(i<0&&l.bottom+window.pageYOffset>s){var p=q(e,!0),m=J(e,!0);0<p&&0<m&&(a=!0),m+i<0&&(i=-1*m),p+i<0&&(i=-1*p)}else if(0<i&&l.top+window.pageYOffset<s){p=q(e,!1),m=J(e,!1);0<p&&0<m&&(a=!0),m-i<0&&(i=m),p-i<0&&(i=p)}if(a&&(e.temp.itemSortClone.style.top=e.temp.itemSortClone.offsetTop+i+"px",w(e),e.props.sortScrollEnabled)){e.temp.outerOverhang=0;var u=$(e);if(i<0){var f=e.temp.itemSortClone.offsetTop-u;e.temp.outerOverhang=0<f?0:f}else{f=e.temp.itemSortClone.offsetTop+e.temp.itemSortClone.offsetHeight-(u+it(e));e.temp.outerOverhang=f<0?0:f}if(0==e.temp.outerOverhang)e.temp.scrollInterval&&(e.props.onSortAutoScrollEnd&&e.props.onSortAutoScrollEnd(_(e),e.temp.origIndex),clearInterval(e.temp.scrollInterval),e.temp.scrollInterval=null,Z(e));else if(bt(e.temp.scrollInterval)){if(e.props.onSortAutoScrollStart){var c=!0;0<e.temp.outerOverhang&&(c=!1),e.props.onSortAutoScrollStart(_(e),e.temp.origIndex,c)}V(e),e.temp.scrollInterval=setInterval(function(){v(e)},10)}}}}else if(e.props.leftEnabled&&e.props.leftBySwipe||e.props.rightEnabled&&e.props.rightBySwipe){var d=e.temp.items[e.temp.activeIndex].getBoundingClientRect();if(at(o,s,d))if(n<0&&e.props.leftEnabled&&e.props.leftBySwipe){var h=pt(e.props.leftSwipeStartThreshold,e.temp.items[e.temp.activeIndex].offsetWidth);Math.abs(n)>h&&(clearTimeout(e.temp.sortDelayTimer),e.temp.sortDelayTimer=null,g(e,n))}else if(0<n&&e.props.rightEnabled&&e.props.rightBySwipe){pt(e.props.rightSwipeStartThreshold,e.temp.items[e.temp.activeIndex].offsetWidth)<n&&(clearTimeout(e.temp.sortDelayTimer),e.temp.sortDelayTimer=null,C(e,n))}}e.temp.lastPageX=o,e.temp.lastPageY=s},S=function(t,e){p(t,e)},v=function(t){if(0==t.temp.outerOverhang||t.temp.outerOverhang<0&&0==nt(t.outerCont)||0<t.temp.outerOverhang&&nt(t.outerCont)>=t.outerCont.scrollHeight-it(t))s(t);else{var e,o=Math.round(t.temp.outerOverhang/t.temp.itemSortClone.offsetHeight*lt(t.props.sortScrollSpeed));if(rt(t.outerCont,nt(t.outerCont)+o),wt(t.outerCont)&&(t.temp.lastPageY=t.temp.lastPageY+o),w(t),wt(t.outerCont)&&(t.temp.itemSortClone.style.top=t.temp.itemSortClone.offsetTop+o+"px"),o<0)(e=J(t,!0))<0&&(t.temp.itemSortClone.style.top=t.temp.itemSortClone.offsetTop-e+"px",e<=0&&s(t));else(e=J(t,!1))<0&&(t.temp.itemSortClone.style.top=t.temp.itemSortClone.offsetTop+e+"px",e<=0&&s(t))}},s=function(t){t.props.onSortAutoScrollEnd&&t.props.onSortAutoScrollEnd(_(t),t.temp.origIndex),t.temp.scrollInterval&&(clearInterval(t.temp.scrollInterval),t.temp.scrollInterval=null),Z(t)},w=function(t){var e=window.getComputedStyle(t.listCont),o=null,s=0;0<t.temp.activeIndex&&(o=t.temp.activeIndex-1,s=t.listCont.getBoundingClientRect().top+ot(e.borderTopWidth)+t.temp.items[o].offsetTop+tt(t.temp.items[o])+t.temp.items[o].offsetHeight/2);var n=null,r=t.listCont.clientHeight;t.temp.activeIndex<t.temp.items.length-1&&(n=t.temp.activeIndex+1,r=t.listCont.getBoundingClientRect().top+ot(e.borderTopWidth)+t.temp.items[n].offsetTop+tt(t.temp.items[n])+t.temp.items[n].offsetHeight/2);var i=t.temp.itemSortClone.offsetTop-window.pageYOffset;if(i<s||i+t.temp.itemSortClone.offsetHeight>r){var l=window.getComputedStyle(t.temp.items[t.temp.activeIndex]);if(null!==o&&i<s){var a,p,m=window.getComputedStyle(t.temp.items[o]);if(0==ot(l.marginTop)&&0==ot(l.marginBottom)&&0==ot(m.marginTop)&&0==ot(m.marginBottom))a=-1*t.temp.items[o].offsetHeight,p=t.temp.items[t.temp.activeIndex].offsetHeight;else a=-1*(d=t.temp.items[t.temp.activeIndex].offsetTop+tt(t.temp.items[t.temp.activeIndex])-(t.temp.items[o].offsetTop+tt(t.temp.items[o])))+(ot(l.marginTop)-ot(m.marginTop)),p=d+(t.temp.items[t.temp.activeIndex].offsetHeight+ot(l.marginBottom)-(t.temp.items[o].offsetHeight+ot(m.marginBottom)));t.temp.items[t.temp.activeIndex].style.transitionDuration=t.props.sortReorderDuration+"ms",et(t.temp.items[t.temp.activeIndex],a),t.temp.items[o].style.transitionDuration=t.props.sortReorderDuration+"ms",et(t.temp.items[o],p);var u=t.temp.items[t.temp.activeIndex];t.temp.items[t.temp.activeIndex]=t.temp.items[o],t.temp.items[o]=u,t.temp.activeIndex=o}else if(null!==n&&i+t.temp.itemSortClone.offsetHeight>r){var f,c,d,h=window.getComputedStyle(t.temp.items[n]);if(0==ot(l.marginTop)&&0==ot(l.marginBottom)&&0==ot(h.marginTop)&&0==ot(h.marginBottom))f=t.temp.items[n].offsetHeight,c=-1*t.temp.items[t.temp.activeIndex].offsetHeight;else f=(d=t.temp.items[n].offsetTop+tt(t.temp.items[n])-(t.temp.items[t.temp.activeIndex].offsetTop+tt(t.temp.items[t.temp.activeIndex])))+(t.temp.items[n].offsetHeight+ot(h.marginBottom)-(t.temp.items[t.temp.activeIndex].offsetHeight+ot(l.marginBottom))),c=-1*d+(ot(h.marginTop)-ot(l.marginTop));t.temp.items[t.temp.activeIndex].style.transitionDuration=t.props.sortReorderDuration+"ms",et(t.temp.items[t.temp.activeIndex],f),t.temp.items[n].style.transitionDuration=t.props.sortReorderDuration+"ms",et(t.temp.items[n],c);u=t.temp.items[t.temp.activeIndex];t.temp.items[t.temp.activeIndex]=t.temp.items[n],t.temp.items[n]=u,t.temp.activeIndex=n}}},b=function(t,e){if(e.temp.sortDelayTimer&&(clearTimeout(e.temp.sortDelayTimer),e.temp.sortDelayTimer=null),e.temp.funcMouseMove&&window.removeEventListener("mousemove",e.temp.funcMouseMove),e.temp.funcMouseUp&&window.removeEventListener("mouseup",e.temp.funcMouseUp),e.temp.funcTouchMove&&window.removeEventListener("touchmove",e.temp.funcTouchMove),e.temp.funcTouchEnd&&window.removeEventListener("touchend",e.temp.funcTouchEnd),e.temp.moveType)if("LEFT"==e.temp.moveType||"RIGHT"==e.temp.moveType){var o=Math.abs(e.temp.itemSlideClone.offsetLeft-e.temp.activeOrigX);if("LEFT"==e.temp.moveType)pt(e.props.leftSwipeEndThreshold,e.temp.items[e.temp.activeIndex].offsetWidth)<o?k(e):n(e);else pt(e.props.rightSwipeEndThreshold,e.temp.items[e.temp.activeIndex].offsetWidth)<o?x(e):I(e)}else"SORT"==e.temp.moveType&&(e.temp.scrollInterval&&(e.props.onSortAutoScrollEnd&&e.props.onSortAutoScrollEnd(_(e),e.temp.origIndex),clearInterval(e.temp.scrollInterval),e.temp.scrollInterval=null,Z(e)),e.temp.itemSortClone.style.top=e.listCont.getBoundingClientRect().top+window.pageYOffset+ot(window.getComputedStyle(e.listCont).borderTopWidth)+e.temp.items[e.temp.activeIndex].offsetTop+tt(e.temp.items[e.temp.activeIndex])+"px",e.props.sortCloneScale?(e.temp.itemSortClone.style[st()]="scale(1)",e.temp.itemSortClone.style.transition="top "+e.props.sortEndDuration+"ms, transform "+e.props.sortEndDuration+"ms"):e.temp.itemSortClone.style.transition="top "+e.props.sortEndDuration+"ms",e.temp.sortEndTimer=setTimeout(function(){B(e)},e.props.sortEndDuration))},O=function(t,e){b(t,e)},k=function(t){t.temp.itemSlideClone.style.transition="left "+t.props.leftSlideOutDuration+"ms ease-in",setTimeout(function(){o(t)},1)},o=function(t){t.props.onLeftSlideOutStart&&t.props.onLeftSlideOutStart(_(t),t.temp.activeIndex),t.props.leftCloneSlideOutClass&&dt(t.temp.itemSlideClone,t.props.leftCloneSlideOutClass);for(var e=0,o=t.props.leftMasks.length;e<o;e++)t.props.leftMasks[e].classNameSlideOut&&t.temp.itemMasks[e]&&dt(t.temp.itemMasks[e],t.props.leftMasks[e].classNameSlideOut);t.temp.itemSlideClone.style.left="-100%",setTimeout(function(){M(t,!0)},t.props.leftSlideOutDuration)},n=function(t){t.temp.itemSlideClone.style.transition="left "+t.props.leftSlideBackDuration+"ms ease-in",setTimeout(function(){y(t)},1)},y=function(t){t.props.onLeftSlideBackStart&&t.props.onLeftSlideBackStart(_(t),t.temp.activeIndex),t.props.leftCloneSlideBackClass&&dt(t.temp.itemSlideClone,t.props.leftCloneSlideBackClass);for(var e=0,o=t.props.leftMasks.length;e<o;e++)t.props.leftMasks[e].classNameSlideBack&&t.temp.itemMasks[e]&&dt(t.temp.itemMasks[e],t.props.leftMasks[e].classNameSlideBack);t.temp.itemSlideClone.style.left=t.temp.activeOrigX+"px",setTimeout(function(){M(t,!1)},t.props.leftSlideBackDuration)},x=function(t){t.temp.itemSlideClone.style.transition="left "+t.props.rightSlideOutDuration+"ms ease-in",setTimeout(function(){T(t)},1)},T=function(t){t.props.onRightSlideOutStart&&t.props.onRightSlideOutStart(_(t),t.temp.activeIndex),t.props.rightCloneSlideOutClass&&dt(t.temp.itemSlideClone,t.props.rightCloneSlideOutClass);for(var e=0,o=t.props.rightMasks.length;e<o;e++)t.props.rightMasks[e].classNameSlideOut&&t.temp.itemMasks[e]&&dt(t.temp.itemMasks[e],t.props.rightMasks[e].classNameSlideOut);t.temp.itemSlideClone.style.left="100%",setTimeout(function(){M(t,!0)},t.props.rightSlideOutDuration)},I=function(t){t.temp.itemSlideClone.style.transition="left "+t.props.rightSlideBackDuration+"ms ease-in",setTimeout(function(){E(t)},1)},E=function(t){t.props.onRightSlideBackStart&&t.props.onRightSlideBackStart(_(t),t.temp.activeIndex),t.props.rightCloneSlideBackClass&&dt(t.temp.itemSlideClone,t.props.rightCloneSlideBackClass);for(var e=0,o=t.props.rightMasks.length;e<o;e++)t.props.rightMasks[e].classNameSlideBack&&t.temp.itemMasks[e]&&dt(t.temp.itemMasks[e],t.props.rightMasks[e].classNameSlideBack);t.temp.itemSlideClone.style.left=t.temp.activeOrigX+"px",setTimeout(function(){M(t,!1)},t.props.rightSlideBackDuration)},M=function(t,e){"LEFT"==t.temp.moveType?(t.temp.items[t.temp.activeIndex]&&t.props.leftItemActiveClass&&ht(t.temp.items[t.temp.activeIndex],t.props.leftItemActiveClass),t.props.leftListClass&&ht(t.listCont,t.props.leftListClass),t.props.leftOuterClass&&It(t.outerCont)&&ht(t.outerCont,t.props.leftOuterClass),D(t),Q(t),t.props.onLeftEnd&&t.props.onLeftEnd(_(t),t.temp.activeIndex,e)):"RIGHT"==t.temp.moveType&&(t.temp.items[t.temp.activeIndex]&&t.props.rightItemActiveClass&&ht(t.temp.items[t.temp.activeIndex],t.props.rightItemActiveClass),t.props.rightListClass&&ht(t.listCont,t.props.rightListClass),t.props.rightOuterClass&&It(t.outerCont)&&ht(t.outerCont,t.props.rightOuterClass),D(t),t.props.onRightEnd&&t.props.onRightEnd(_(t),t.temp.activeIndex,e)),t.temp=P(t.temp)},B=function(t){for(var e=0,o=t.temp.items.length;e<o;e++)t.temp.items[e].style.transitionDuration="",t.temp.items[e].style[st()]="";t.props.sortItemActiveClass&&ht(t.temp.items[t.temp.activeIndex],t.props.sortItemActiveClass),t.props.sortItemActiveHide&&(t.temp.items[t.temp.activeIndex].style.visibility="visible"),t.props.sortListClass&&ht(t.listCont,t.props.sortListClass),t.props.sortOuterClass&&It(t.outerCont)&&ht(t.outerCont,t.props.sortOuterClass),D(t),Q(t),t.props.onSortEnd&&t.props.onSortEnd(_(t),t.temp.origIndex,t.temp.activeIndex),t.temp=P(t.temp)},D=function(t){if(t.temp.itemSlideClone&&(t.listCont.removeChild(t.temp.itemSlideClone),t.temp.itemSlideClone=null),t.temp.itemSortClone&&(document.body.removeChild(t.temp.itemSortClone),t.temp.itemSortClone=null),0<t.temp.itemMasks.length)for(var e=0,o=t.temp.itemMasks.length;e<o;e++)t.listCont.removeChild(t.temp.itemMasks[e]),t.temp.itemMasks[e]=null},L=function(t){t.temp.items=Array.prototype.slice.call(t.listCont.getElementsByClassName(t.listItemClass))},N=function(t,e,o){var s=t.temp.items[t.temp.activeIndex].cloneNode(!0);t.temp.itemSlideClone=t.listCont.appendChild(s),R(t.temp.itemSlideClone,e,o,t.temp.items[t.temp.activeIndex].offsetWidth),"LEFT"==t.temp.moveType?t.props.leftCloneClass&&dt(t.temp.itemSlideClone,t.props.leftCloneClass):"RIGHT"==t.temp.moveType&&t.props.rightCloneClass&&dt(t.temp.itemSlideClone,t.props.rightCloneClass)},A=function(t,e,o){var s=t.temp.items[t.temp.activeIndex].cloneNode(!0);t.temp.itemSortClone=document.body.appendChild(s),R(t.temp.itemSortClone,e,o,t.temp.items[t.temp.activeIndex].offsetWidth),t.props.sortCloneClass&&dt(t.temp.itemSortClone,t.props.sortCloneClass),t.props.sortCloneBoxShadow&&(t.temp.itemSortClone.style.boxShadow=t.props.sortCloneBoxShadow),t.props.sortCloneScale&&(t.temp.itemSortClone.style[st()]="scale("+t.props.sortCloneScale+")",t.temp.itemSortClone.style.transition="transform "+t.props.sortStartDuration+"ms")},R=function(t,e,o,s){t.style.position="absolute",t.style.left=e,t.style.top=o,t.style.width=s+"px",t.style.boxSizing="border-box",t.style.margin="0"},H=function(t){var e=null;if("LEFT"==t.temp.moveType&&0<t.props.leftMasks.length?e=t.props.leftMasks:"RIGHT"==t.temp.moveType&&0<t.props.rightMasks.length&&(e=t.props.rightMasks),e)for(var o=0,s=e.length;o<s;o++){var n=document.createElement("div");t.temp.itemMasks[o]=t.listCont.appendChild(n),t.temp.itemMasks[o].style.position="absolute",t.temp.itemMasks[o].style.left=t.temp.items[t.temp.activeIndex].offsetLeft+"px",t.temp.itemMasks[o].style.top=t.temp.items[t.temp.activeIndex].offsetTop+"px",t.temp.itemMasks[o].style.height=t.temp.items[t.temp.activeIndex].offsetHeight+"px",t.temp.itemMasks[o].style.width=t.temp.items[t.temp.activeIndex].offsetWidth+"px",t.temp.itemMasks[o].style.boxSizing="border-box",e[o].background&&(t.temp.itemMasks[o].style.background=e[o].background),e[o].classNameDefault&&dt(t.temp.itemMasks[o],e[o].classNameDefault),e[o].childNode&&t.temp.itemMasks[o].appendChild(e[o].childNode)}},P=function(t){var e={items:[],moveType:null,ignoreClicks:!1,itemSlideClone:null,itemSortClone:null,itemMasks:[],activeIndex:null,origIndex:null,startPageX:null,startPageY:null,lastPageX:null,lastPageY:null,activeOrigX:null,sortDelayTimer:null,sortEndTimer:null,outerOverhang:0,scrollInterval:null,origouterContOverflow:null,funcMouseMove:null,funcMouseUp:null,funcTouchMove:null,funcTouchEnd:null};return t?(e.funcOnScroll=t.funcOnScroll,e.funcMouseDown=t.funcMouseDown,e.funcTouchStart=t.funcTouchStart):(e.funcOnScroll=null,e.funcMouseDown=null,e.funcTouchStart=null),e},F=function(t){var e=[];if(0<t.length)for(var o=0,s=t.length;o<s;o++){var n=null,r=t[o].replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(0<r.length){var i=r.indexOf(".");if(-1<i){var l=X(r.substr(i+1),[]);n=Y(r.substring(0,i),l)}else n=Y(r,[])}null!=n&&e.push(n)}return e},X=function(t,e){var o=t.indexOf(".");return-1<o?(o<t.length-1&&(e=X(t.substr(o+1),e)),0<t.substring(0,o).length&&e.push(t.substring(0,o))):0<t.length&&e.push(t),e},Y=function(t,e){if("#"!=t.substr(0,1)||1<t.length){var o=!1;return 0==(t="#"==t.substr(0,1)?(o=!0,t.substr(1)):t.toLowerCase()).length&&(t=null),{name:t,isId:o,classNames:e}}return null},z=function(t,e,o){for(var s=!1,n=0,r=t.ignoreObjects.length;n<r;n++){var i=t.ignoreObjects[n];null!=i.name&&0<i.name.length?i.isId?W(i.name,i.classNames,e,o)&&(s=!0):U(i.name,i.classNames,e,o)&&(s=!0):G(i.classNames,e,o)&&(s=!0)}return s},W=function(t,e,o,s){var n=!1;if(o!==s)if(o.id&&o.id==t&&j(o,e))n=!0;else{var r=document.getElementById(t);r&&j(r,e)&&r.contains(o)&&(n=!0)}return n},U=function(t,e,o,s){var n=!1;if(o!==s)if(o.tagName.toLowerCase()==t&&j(o,e))n=!0;else for(var r=s.getElementsByTagName(t),i=0,l=r.length;i<l;i++)if(j(r[i],e)&&r[i].contains(o)){n=!0;break}return n},G=function(t,e,o){var s=!1;if(e!==o)if(j(e,t))s=!0;else if(0<t.length){for(var n="",r=0,i=t.length;r<i;r++)0<r?n=n+" "+t[r]:n+=t[r];var l=o.getElementsByClassName(n);for(r=0,i=l.length;r<i;r++)if(l[r].contains(e)){s=!0;break}}return s},j=function(t,e){for(var o=0,s=e.length;o<s;o++)if(!ct(t,e[o]))return!1;return!0},$=function(t){return wt(t.outerCont)?window.pageYOffset:t.outerCont.getBoundingClientRect().top+window.pageYOffset+ot(window.getComputedStyle(t.outerCont).borderTopWidth)},q=function(t,e){if(bt(t.props.sortCloneMaxOverhang))return 999999;var o=$(t);if(e){var s=o-pt(t.props.sortCloneMaxOverhang,t.temp.itemSortClone.offsetHeight);return t.temp.itemSortClone.offsetTop-s}return(s=o+it(t)+pt(t.props.sortCloneMaxOverhang,t.temp.itemSortClone.offsetHeight))-(t.temp.itemSortClone.offsetTop+t.temp.itemSortClone.offsetHeight)},J=function(t,e){if(bt(t.props.sortCloneMaxOverhang))return 999999;var o=window.getComputedStyle(t.listCont),s=t.listCont.getBoundingClientRect().top+window.pageYOffset+ot(o.borderTopWidth);if(e){var n=s-pt(t.props.sortCloneMaxOverhang,t.temp.itemSortClone.offsetHeight);return t.temp.itemSortClone.offsetTop-n}return(n=s+t.listCont.clientHeight+pt(t.props.sortCloneMaxOverhang,t.temp.itemSortClone.offsetHeight))-(t.temp.itemSortClone.offsetTop+t.temp.itemSortClone.offsetHeight)},_=function(t){return{outerCont:t.outerCont,listCont:t.listCont,listItemClass:t.listItemClass,props:t.props}},K=function(t){e&&t.props.safariBodyUnselectable&&(document.body.style["-webkit-user-select"]="none",document.body.style["user-select"]="none")},Q=function(t){e&&t.props.safariBodyUnselectable&&(document.body.style["-webkit-user-select"]=null,document.body.style["user-select"]=null)},V=function(t){e&&!wt(t.outerCont)&&t.props.safariAutoOuterOverflow&&(t.outerCont.style&&t.outerCont.style.overflow&&(t.temp.origouterContOverflow=t.outerCont.style.overflow),t.outerCont.style.overflow="hidden")},Z=function(t){e&&!wt(t.outerCont)&&t.props.safariAutoOuterOverflow&&(t.temp.origouterContOverflow?(t.outerCont.style.overflow=t.temp.origouterContOverflow,t.temp.origouterContOverflow=null):t.outerCont.style.overflow=null,t.outerCont.style&&0!=t.outerCont.style.length||t.outerCont.removeAttribute("style"))},tt=function(t){var e=0;if(t.style&&t.style[st()]){var o=t.style[st()].indexOf("px");-1<o&&(e=parseInt(t.style[st()].substring(11,o)))}return e},et=function(t,e){var o=tt(t),s=0;s=0!=o?o+e:e,t.style[st()]=0!=s?"translateY("+s+"px)":"translateY(0px)"},ot=function(t){var e=0;if(null!=t){var o=t.indexOf("px");-1<o&&(e=parseInt(t.substring(0,o)))}return e},st=function(){return t()+"Transform"},t=function(){var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],e=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink)[1];switch(e){case"ms":return"ms";default:return e&&e.length?e[0].toUpperCase()+e.substr(1):""}},nt=function(t){return wt(t)?t.pageYOffset:t.scrollTop},rt=function(t,e){wt(t)?t.scrollTo(t.pageXOffset,e):t.scrollTop=e},it=function(t){return wt(t.outerCont)?t.outerCont.innerHeight:t.outerCont.clientHeight},lt=function(t){switch(t){case 1:return 4;case 2:return 10;case 4:return 22;case 5:return 28;default:return 16}},at=function(t,e,o){return t>=o.left+window.pageXOffset&&t<=o.right+window.pageXOffset&&e>=o.top+window.pageYOffset&&e<=o.bottom+window.pageYOffset},pt=function(t,e){var o=0;if(0!=t){var s=t.indexOf("px");if(-1<s)o=parseInt(t.substring(0,s));else if(null!=e&&-1<(s=t.indexOf("%"))){var n=.01*parseFloat(t.substring(0,s));o=Math.round(n*e)}}return o},mt=function(t,e,o){var s=!1;if(o)if(ct(t.target,o))s=!0;else if(e)for(var n=e.getElementsByClassName(o),r=0,i=n.length;r<i;r++)if(n[r].contains(t.target)){s=!0;break}return s},ut=function(t){return t.touches&&t.touches.length?t.touches[0].pageX:t.changedTouches&&t.changedTouches.length?t.changedTouches[0].pageX:t.pageX},ft=function(t){return t.touches&&t.touches.length?t.touches[0].pageY:t.changedTouches&&t.changedTouches.length?t.changedTouches[0].pageY:t.pageY},ct=function(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))},dt=function(t,e){t.classList?t.classList.add(e):ct(t,e)||(t.className+=" "+e)},ht=function(t,e){if(t.classList)t.classList.remove(e);else if(ct(t,e)){var o=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(o," ")}},gt=function(t){var e=new XMLHttpRequest;e.onload=function(){Ct(e,t)};var o="https://www.lithiumlist.com/api/v1/rcheck?llv=1.2.0&key="+t.rkey;e.open("GET",o,!0),e.send()},Ct=function(t,e){if(200==t.status){var o=JSON.parse(t.responseText);0==o.data?St(e):1==o.data&&(e.isr=!0)}},St=function(t,e){var o="div-lit";if(!document.getElementById(o+"hiumlist-rmsg")){var s=document.createElement("div");if(s.id=o+"hiumlist-rmsg",s.style.position="absolute",s.style.left="0",s.style.top="0",e)return!0;s.style.color="red",s.style.textShadow="0 0 6px #FFFFFF, 0 0 6px #FFFFFF, 0 0 6px #FFFFFF",s.style.fontWeight="bold",s.style.padding="0.3em",s.style.zIndex="9999",s.appendChild(document.createTextNode("Lithi")),s.appendChild(document.createTextNode("um List - unlic")),s.appendChild(document.createTextNode("ensed ver")),s.appendChild(document.createTextNode("sion")),t.listCont.appendChild(s)}},vt=function(t){if(!bt(t.onSortStart)&&!Ot(t.onSortStart))throw"onSortStart must be a function";if(!bt(t.onSortEnd)&&!Ot(t.onSortEnd))throw"onSortEnd must be a function";if(!bt(t.onSortAutoScrollStart)&&!Ot(t.onSortAutoScrollStart))throw"onSortAutoScrollStart must be a function";if(!bt(t.onSortAutoScrollEnd)&&!Ot(t.onSortAutoScrollEnd))throw"onSortAutoScrollEnd must be a function";if(!bt(t.sortEnabled)&&!kt(t.sortEnabled))throw"sortEnabled must be a boolean";if(!bt(t.sortByLongPress)&&!kt(t.sortByLongPress))throw"sortByLongPress must be a boolean";if(!bt(t.sortStartDuration)&&(!yt(t.sortStartDuration)||t.sortStartDuration<0))throw"sortStartDuration must be a positive integer or zero";if(!bt(t.sortEndDuration)&&(!yt(t.sortEndDuration)||t.sortEndDuration<0))throw"sortEndDuration must be a positive integer or zero";if(!(bt(t.sortOuterClass)||xt(t.sortOuterClass)&&0!=t.sortOuterClass.length))throw"sortOuterClass must be a string of length >0";if(!(bt(t.sortListClass)||xt(t.sortListClass)&&0!=t.sortListClass.length))throw"sortListClass must be a string of length >0";if(!(bt(t.sortCloneClass)||xt(t.sortCloneClass)&&0!=t.sortCloneClass.length))throw"sortCloneClass must be a string of length >0";if(!(bt(t.sortCloneBoxShadow)||xt(t.sortCloneBoxShadow)&&0!=t.sortCloneBoxShadow.length))throw"sortCloneBoxShadow must be a string of length >0";if(!(bt(t.sortCloneScale)||xt(t.sortCloneScale)&&0!=t.sortCloneScale.length))throw"sortCloneScale must be a string of length >0";if(!bt(t.sortCloneMaxOverhang)&&!Mt(t.sortCloneMaxOverhang))throw"sortCloneMaxOverhang must be '#px', '#%' or '0' (eg. '10px' or '10%')";if(!bt(t.sortItemActiveHide)&&!kt(t.sortItemActiveHide))throw"sortItemActiveHide must be a boolean";if(!(bt(t.sortItemActiveClass)||xt(t.sortItemActiveClass)&&0!=t.sortItemActiveClass.length))throw"sortItemActiveClass must be a string of length >0";if(!(bt(t.sortDragHandleClass)||xt(t.sortDragHandleClass)&&0!=t.sortDragHandleClass.length))throw"sortDragHandleClass must be a string of length >0";if(!bt(t.sortMoveStartDelay)&&(!yt(t.sortMoveStartDelay)||t.sortMoveStartDelay<0))throw"sortMoveStartDelay must be a positive integer or zero";if(!bt(t.sortReorderDuration)&&(!yt(t.sortReorderDuration)||t.sortReorderDuration<0))throw"sortReorderDuration must be a positive integer or zero";if(!bt(t.sortScrollEnabled)&&!kt(t.sortScrollEnabled))throw"sortScrollEnabled must be a boolean";if(!bt(t.sortScrollSpeed)&&(!yt(t.sortScrollSpeed)||1!=t.sortScrollSpeed&&2!=t.sortScrollSpeed&&3!=t.sortScrollSpeed&&4!=t.sortScrollSpeed&&5!=t.sortScrollSpeed))throw"sortScrollSpeed must be an integer 1 - 5";if(!bt(t.safariBodyUnselectable)&&!kt(t.safariBodyUnselectable))throw"safariBodyUnselectable must be a boolean";if(!bt(t.safariAutoOuterOverflow)&&!kt(t.safariAutoOuterOverflow))throw"safariAutoOuterOverflow must be a boolean";if(!bt(t.onLeftStart)&&!Ot(t.onLeftStart))throw"onLeftStart must be a function";if(!bt(t.onLeftSlideOutStart)&&!Ot(t.onLeftSlideOutStart))throw"onLeftSlideOutStart must be a function";if(!bt(t.onLeftSlideBackStart)&&!Ot(t.onLeftSlideBackStart))throw"onLeftSlideBackStart must be a function";if(!bt(t.onLeftEnd)&&!Ot(t.onLeftEnd))throw"onLeftEnd must be a function";if(!bt(t.leftEnabled)&&!kt(t.leftEnabled))throw"leftEnabled must be a boolean";if(!bt(t.leftBySwipe)&&!kt(t.leftBySwipe))throw"leftBySwipe must be a boolean";if(!(bt(t.leftOuterClass)||xt(t.leftOuterClass)&&0!=t.leftOuterClass.length))throw"leftOuterClass must be a string of length >0";if(!(bt(t.leftListClass)||xt(t.leftListClass)&&0!=t.leftListClass.length))throw"leftListClass must be a string of length >0";if(!(bt(t.leftCloneClass)||xt(t.leftCloneClass)&&0!=t.leftCloneClass.length))throw"leftCloneClass must be a string of length >0";if(!(bt(t.leftCloneSlideOutClass)||xt(t.leftCloneSlideOutClass)&&0!=t.leftCloneSlideOutClass.length))throw"leftCloneSlideOutClass must be a string of length >0";if(!(bt(t.leftCloneSlideBackClass)||xt(t.leftCloneSlideBackClass)&&0!=t.leftCloneSlideBackClass.length))throw"leftCloneSlideBackClass must be a string of length >0";if(!(bt(t.leftItemActiveClass)||xt(t.leftItemActiveClass)&&0!=t.leftItemActiveClass.length))throw"leftItemActiveClass must be a string of length >0";if(!bt(t.leftMasks)){if(!Tt(t.leftMasks))throw"leftMasks must be an array";for(var e=0,o=t.leftMasks.length;e<o;e++){var s=t.leftMasks[e];if(!(bt(s.background)||xt(s.background)&&0!=s.background.length))throw"leftMasks.background must be a string of length >0";if(!(bt(s.classNameDefault)||xt(s.classNameDefault)&&0!=s.classNameDefault.length))throw"leftMasks.classNameDefault must be a string of length >0";if(!(bt(s.classNameSlideOut)||xt(s.classNameSlideOut)&&0!=s.classNameSlideOut.length))throw"leftMasks.classNameSlideOut must be a string of length >0";if(!(bt(s.classNameSlideBack)||xt(s.classNameSlideBack)&&0!=s.classNameSlideBack.length))throw"leftMasks.classNameSlideBack must be a string of length >0";if(!bt(s.childNode)&&!Et(s.childNode)&&!It(s.childNode))throw"leftMasks.childNode must be a text node or a DOM element"}}if(!(bt(t.leftButtonClass)||xt(t.leftButtonClass)&&0!=t.leftButtonClass.length))throw"leftButtonClass must be a string of length >0";if(!bt(t.leftSwipeStartThreshold)&&!Mt(t.leftSwipeStartThreshold))throw"leftSwipeStartThreshold must be '#px', '#%' or '0' (eg. '10px' or '10%')";if(!bt(t.leftSwipeEndThreshold)&&!Mt(t.leftSwipeEndThreshold))throw"leftSwipeEndThreshold must be '#px', '#%' or '0' (eg. '10px' or '10%')";if(!bt(t.leftSlideOutDuration)&&(!yt(t.leftSlideOutDuration)||t.leftSlideOutDuration<0))throw"leftSlideOutDuration must be a positive integer or zero";if(!bt(t.leftSlideBackDuration)&&(!yt(t.leftSlideBackDuration)||t.leftSlideBackDuration<0))throw"leftSlideBackDuration must be a positive integer or zero";if(!bt(t.onRightStart)&&!Ot(t.onRightStart))throw"onRightStart must be a function";if(!bt(t.onRightSlideOutStart)&&!Ot(t.onRightSlideOutStart))throw"onRightSlideOutStart must be a function";if(!bt(t.onRightSlideBackStart)&&!Ot(t.onRightSlideBackStart))throw"onRightSlideBackStart must be a function";if(!bt(t.onRightEnd)&&!Ot(t.onRightEnd))throw"onRightEnd must be a function";if(!bt(t.rightEnabled)&&!kt(t.rightEnabled))throw"rightEnabled must be a boolean";if(!bt(t.rightBySwipe)&&!kt(t.rightBySwipe))throw"rightBySwipe must be a boolean";if(!(bt(t.rightOuterClass)||xt(t.rightOuterClass)&&0!=t.rightOuterClass.length))throw"rightOuterClass must be a string of length >0";if(!(bt(t.rightListClass)||xt(t.rightListClass)&&0!=t.rightListClass.length))throw"rightListClass must be a string of length >0";if(!(bt(t.rightCloneClass)||xt(t.rightCloneClass)&&0!=t.rightCloneClass.length))throw"rightCloneClass must be a string of length >0";if(!(bt(t.rightCloneSlideOutClass)||xt(t.rightCloneSlideOutClass)&&0!=t.rightCloneSlideOutClass.length))throw"rightCloneSlideOutClass must be a string of length >0";if(!(bt(t.rightCloneSlideBackClass)||xt(t.rightCloneSlideBackClass)&&0!=t.rightCloneSlideBackClass.length))throw"rightCloneSlideBackClass must be a string of length >0";if(!(bt(t.rightItemActiveClass)||xt(t.rightItemActiveClass)&&0!=t.rightItemActiveClass.length))throw"rightItemActiveClass must be a string of length >0";if(!bt(t.rightMasks)){if(!Tt(t.rightMasks))throw"rightMasks must be an array";for(e=0,o=t.rightMasks.length;e<o;e++){s=t.rightMasks[e];if(!(bt(s.background)||xt(s.background)&&0!=s.background.length))throw"rightMasks.background must be a string of length >0";if(!(bt(s.classNameDefault)||xt(s.classNameDefault)&&0!=s.classNameDefault.length))throw"rightMasks.classNameDefault must be a string of length >0";if(!(bt(s.classNameSlideOut)||xt(s.classNameSlideOut)&&0!=s.classNameSlideOut.length))throw"rightMasks.classNameSlideOut must be a string of length >0";if(!(bt(s.classNameSlideBack)||xt(s.classNameSlideBack)&&0!=s.classNameSlideBack.length))throw"rightMasks.classNameSlideBack must be a string of length >0";if(!bt(s.childNode)&&!Et(s.childNode)&&!It(s.childNode))throw"rightMasks.childNode must be a text node or a DOM element"}}if(!(bt(t.rightButtonClass)||xt(t.rightButtonClass)&&0!=t.rightButtonClass.length))throw"rightButtonClass must be a string of length >0";if(!bt(t.rightSwipeStartThreshold)&&!Mt(t.rightSwipeStartThreshold))throw"rightSwipeStartThreshold must be '#px', '#%' or '0' (eg. '10px' or '10%')";if(!bt(t.rightSwipeEndThreshold)&&!Mt(t.rightSwipeEndThreshold))throw"rightSwipeEndThreshold must be '#px', '#%' or '0' (eg. '10px' or '10%')";if(!bt(t.rightSlideOutDuration)&&(!yt(t.rightSlideOutDuration)||t.rightSlideOutDuration<0))throw"rightSlideOutDuration must be a positive integer or zero";if(!bt(t.rightSlideBackDuration)&&(!yt(t.rightSlideBackDuration)||t.rightSlideBackDuration<0))throw"rightSlideBackDuration must be a positive integer or zero";if(!bt(t.ignoreOnClick)){if(!Tt(t.ignoreOnClick))throw"ignoreOnClick must be an array";for(e=0,o=t.ignoreOnClick.length;e<o;e++){var n=t.ignoreOnClick[e];if(bt(n)||!xt(n)||0==n.length)throw"ignoreOnClick must be an array of strings of length >0"}}},wt=function(t){return void 0!==t&&null!=t&&t==t.window},bt=function(t){return void 0===t||null==t},Ot=function(t){return!(!t||"function"!=typeof t)},kt=function(t){return"boolean"==typeof t},yt=function(t){return!("string"==typeof t||t instanceof String||t!==parseInt(t,10))},xt=function(t){return"string"==typeof t||t instanceof String},Tt=function(t){return t instanceof Array},It=function(t){return t instanceof Element},Et=function(t){return!(!t||!t.nodeType||t.nodeType!=Node.TEXT_NODE)},Mt=function(t){if("string"==typeof t||t instanceof String){return!!/^0|[0-9]+px|[0-9]+([.][0-9]+)?%$/.test(t)}return!1};return{attachToList:function(t,e,o,s,n){if(bt(e))e=window;else if(!wt(e)){if(!It(e))throw"outerCont must be a DOM element";if(e===o)console.warn("Auto scrolling may not work where outerCont === listCont");else if(!e.contains(o))throw"outerCont must contain listCont"}if(bt(o))throw"listCont must not be undefined or null";if(!It(o))throw"listCont must be a DOM element";for(var r=0,i=m.length;r<i;r++)if(m[r].listCont===o)throw"listCont already has lithiumlist attached";if(bt(s)||!xt(s)||0==s.length)throw"listItemClass must be a string of length > 0";var l={};if(bt(n))for(var a in u)Tt(u[a])?l[a]=u[a].slice(0):l[a]=u[a];else for(var a in vt(n),u)void 0===n[a]?Tt(u[a])?l[a]=u[a].slice(0):l[a]=u[a]:Tt(n[a])?l[a]=n[a].slice(0):l[a]=n[a];f(l);var p={rkey:t,isr:!1,outerCont:e,listCont:o,listItemClass:s,props:l,ignoreObjects:F(l.ignoreOnClick),temp:P()};m.push(p),St(p,!0)&&(p.temp.funcOnScroll=function(t){c(t,p)},p.temp.funcMouseDown=function(t){d(t,p)},p.temp.funcTouchStart=function(t){h(t,p)},p.outerCont.addEventListener("scroll",p.temp.funcOnScroll),p.listCont.addEventListener("mousedown",p.temp.funcMouseDown),p.listCont.addEventListener("touchstart",p.temp.funcTouchStart)),!bt(p.rkey)&&Ot(gt)&&Ot(Ct)?gt(p):St(p)},detachFromList:function(t){if(!t)throw"listCont cannot be null.";for(var e=null,o=0,s=m.length;o<s;o++)if(m[o].listCont===t){e=o;break}null!=e&&(m[e].temp.funcOnScroll&&m[e].outerCont.removeEventListener("scroll",m[e].temp.funcOnScroll),m[e].temp.funcMouseDown&&t.removeEventListener("mousedown",m[e].temp.funcMouseDown),m[e].temp.funcTouchStart&&t.removeEventListener("touchstart",m[e].temp.funcTouchStart),m.splice(e,1))},setListProperties:function(t,e){if(bt(t)||!It(t))throw"listCont must be a DOM element";if(bt(e))throw"listProperties must not be undefined or null";for(var o=null,s=0,n=m.length;s<n;s++)if(m[s].listCont===t){o=s;break}if(null==o)throw"listCont does not have lithiumlist attached ";for(var r in vt(e),m[o].props)void 0!==e[r]&&(Tt(e[r])?m[o].props[r]=e[r].slice(0):m[o].props[r]=e[r]);m[o].ignoreObjects=F(m[o].props.ignoreOnClick),f(m[o].props)},setDefaultProperties:function(t){if(bt(t))throw"newDefaultProperties must not be undefined or null";for(var e in u)void 0!==t[e]&&(Tt(t[e])?u[e]=t[e].slice(0):u[e]=t[e]);f(u)},triggerLeft:function(t,e){if(!t)throw"listCont cannot be null.";for(var o=null,s=0,n=m.length;s<n;s++)if(m[s].listCont===t){o=s;break}null!=o?m[o].props.leftEnabled?(L(m[o]),m[o].temp.items.length>e?(m[o].temp.activeIndex=e,g(m[o],0),k(m[o])):console.warn("List item not found.")):console.warn("listCont has 'leftEnabled = false'."):console.warn("listCont does not have lithiumlist attached.")},triggerRight:function(t,e){if(!t)throw"listCont cannot be null.";for(var o=null,s=0,n=m.length;s<n;s++)if(m[s].listCont===t){o=s;break}null!=o?m[o].props.rightEnabled?(L(m[o]),m[o].temp.items.length>e?(m[o].temp.activeIndex=e,C(m[o],0),x(m[o])):console.warn("List item not found.")):console.warn("listCont has 'rightEnabled = false'."):console.warn("listCont does not have lithiumlist attached.")}}}();export default lithiumlist;