!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=e():"function"==typeofdefine&&define.amd?define(e):t.Shuffle=e()}(this,function(){"use strict";functiont(){}t.prototype={on:function(t,e,i){varn=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){varn=this;functions(){n.off(t,s),e.apply(i,arguments)}returns._=e,this.on(t,s,i)},emit:function(t){for(vare=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),n=0,s=i.length;n<s;n++)i[n].fn.apply(i[n].ctx,e);returnthis},off:function(t,e){vari=this.e||(this.e={}),n=i[t],s=[];if(n&&e)for(varo=0,r=n.length;o<r;o++)n[o].fn!==e&&n[o].fn._!==e&&s.push(n[o]);returns.length?i[t]=s:deletei[t],this}};vare=t,i="undefined"!=typeofElement?Element.prototype:{},n=i.matches||i.matchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector,s=function(t,e){if(!t||1!==t.nodeType)return!1;if(n)returnn.call(t,e);for(vari=t.parentNode.querySelectorAll(e),s=0;s<i.length;s++)if(i[s]==t)return!0;return!1};varo=function(t,e){vari,n,s,o,r=0;returnfunction(){i=this,n=arguments;vart=newDate-r;returno||(t>=e?l():o=setTimeout(l,e-t)),s};functionl(){o=0,r=+newDate,s=t.apply(i,n),i=null,n=null}};functionr(){}functionl(t){returnparseFloat(t)||0}vara=function(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")},u=function(){functiont(t,e){for(vari=0;i<e.length;i++){varn=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}returnfunction(e,i,n){returni&&t(e.prototype,i),n&&t(e,n),e}}(),h=function(t,e){if(!t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeofe&&"function"!=typeofe?t:e},f=function(){functiont(e,i){a(this,t),this.x=l(e),this.y=l(i)}returnu(t,null,[{key:"equals",value:function(t,e){returnt.x===e.x&&t.y===e.y}}]),t}(),c=function(){functiont(e,i,n,s,o){a(this,t),this.id=o,this.left=e,this.top=i,this.width=n,this.height=s}returnu(t,null,[{key:"intersects",value:function(t,e){returnt.left<e.left+e.width&&e.left<t.left+t.width&&t.top<e.top+e.height&&e.top<t.top+t.height}}]),t}(),d={BASE:"shuffle",SHUFFLE_ITEM:"shuffle-item",VISIBLE:"shuffle-item--visible",HIDDEN:"shuffle-item--hidden"},m=0,p=function(){functiont(e){a(this,t),m+=1,this.id=m,this.element=e,this.isVisible=!0,this.isHidden=!1}returnu(t,[{key:"show",value:function(){this.isVisible=!0,this.element.classList.remove(d.HIDDEN),this.element.classList.add(d.VISIBLE),this.element.removeAttribute("aria-hidden")}},{key:"hide",value:function(){this.isVisible=!1,this.element.classList.remove(d.VISIBLE),this.element.classList.add(d.HIDDEN),this.element.setAttribute("aria-hidden",!0)}},{key:"init",value:function(){this.addClasses([d.SHUFFLE_ITEM,d.VISIBLE]),this.applyCss(t.Css.INITIAL),this.scale=t.Scale.VISIBLE,this.point=newf}},{key:"addClasses",value:function(t){vare=this;t.forEach(function(t){e.element.classList.add(t)})}},{key:"removeClasses",value:function(t){vare=this;t.forEach(function(t){e.element.classList.remove(t)})}},{key:"applyCss",value:function(t){vare=this;Object.keys(t).forEach(function(i){e.element.style[i]=t[i]})}},{key:"dispose",value:function(){this.removeClasses([d.HIDDEN,d.VISIBLE,d.SHUFFLE_ITEM]),this.element.removeAttribute("style"),this.element=null}}]),t}();p.Css={INITIAL:{position:"absolute",top:0,left:0,visibility:"visible","will-change":"transform"},VISIBLE:{before:{opacity:1,visibility:"visible"},after:{transitionDelay:""}},HIDDEN:{before:{opacity:0},after:{visibility:"hidden",transitionDelay:""}}},p.Scale={VISIBLE:1,HIDDEN:.001};varv=null,y=function(){if(null!==v)returnv;vart=document.body||document.documentElement,e=document.createElement("div");returne.style.cssText="width:10px;padding:2px;box-sizing:border-box;",t.appendChild(e),v="10px"===window.getComputedStyle(e,null).width,t.removeChild(e),v};functiong(t,e){vari=arguments.length>2&&void0!==arguments[2]?arguments[2]:window.getComputedSt