/**! * mixitup v2.1.8 * * @copyright copyright 2015 kunkalabs limited. * @author kunkalabs limited. * @link https://mixitup.kunkalabs.com * * @license commercial use requires a commercial license. * https://mixitup.kunkalabs.com/licenses/ * * non-commercial use permitted under terms of cc-by-nc license. * http://creativecommons.org/licenses/by-nc/3.0/ */ !function(a,b){a.mixitup=function(){var b=this;b._execaction("_constructor",0),a.extend(b,{selectors:{target:".mix",filter:".filter",sort:".sort"},animation:{enable:!0,effects:"fade scale",duration:600,easing:"ease",perspectivedistance:"3000",perspectiveorigin:"50% 50%",queue:!0,queuelimit:1,animatechangelayout:!1,animateresizecontainer:!0,animateresizetargets:!1,staggersequence:!1,reverseout:!1},callbacks:{onmixload:!1,onmixstart:!1,onmixbusy:!1,onmixend:!1,onmixfail:!1,_user:!1},controls:{enable:!0,live:!1,togglefilterbuttons:!1,togglelogic:"or",activeclass:"active"},layout:{display:"inline-block",containerclass:"",containerclassfail:"fail"},load:{filter:"all",sort:!1},_$body:null,_$container:null,_$targets:null,_$parent:null,_$sortbuttons:null,_$filterbuttons:null,_suckmode:!1,_mixing:!1,_sorting:!1,_clicking:!1,_loading:!0,_changinglayout:!1,_changingclass:!1,_changingdisplay:!1,_origorder:[],_startorder:[],_neworder:[],_activefilter:null,_togglearray:[],_togglestring:"",_activesort:"default:asc",_newsort:null,_startheight:null,_newheight:null,_incpadding:!0,_newdisplay:null,_newclass:null,_targetsbound:0,_targetsdone:0,_queue:[],_$show:a(),_$hide:a()}),b._execaction("_constructor",1)},a.mixitup.prototype={constructor:a.mixitup,_instances:{},_handled:{_filter:{},_sort:{}},_bound:{_filter:{},_sort:{}},_actions:{},_filters:{},extend:function(b){for(var c in b)a.mixitup.prototype[c]=b[c]},addaction:function(b,c,d,e){a.mixitup.prototype._addhook("_actions",b,c,d,e)},addfilter:function(b,c,d,e){a.mixitup.prototype._addhook("_filters",b,c,d,e)},_addhook:function(b,c,d,e,f){var g=a.mixitup.prototype[b],h={};f=1===f||"post"===f?"post":"pre",h[c]={},h[c][f]={},h[c][f][d]=e,a.extend(!0,g,h)},_init:function(b,c){var d=this;if(d._execaction("_init",0,arguments),c&&a.extend(!0,d,c),d._$body=a("body"),d._domnode=b,d._$container=a(b),d._$container.addclass(d.layout.containerclass),d._id=b.id,d._platformdetect(),d._brake=d._getprefixedcss("transition","none"),d._refresh(!0),d._$parent=d._$targets.parent().length?d._$targets.parent():d._$container,d.load.sort&&(d._newsort=d._parsesort(d.load.sort),d._newsortstring=d.load.sort,d._activesort=d.load.sort,d._sort(),d._printsort()),d._activefilter="all"===d.load.filter?d.selectors.target:"none"===d.load.filter?"":d.load.filter,d.controls.enable&&d._bindhandlers(),d.controls.togglefilterbuttons){d._buildtogglearray();for(var e=0;e-1){var k=d._helpers._camelcase(i.substring(5,i.length));f.dataset[k]=j}}}f.mixparent===b&&(f.mixparent=d._id)}if(d._$targets.length&&a||!d._origorder.length&&d._$targets.length){d._origorder=[];for(var e=0;e-1)&&(a(e.selectors.sort).removeclass(e.controls.activeclass),f(c,d),e.sort(g))}if("filter"===d){var h,i=c.attr("data-filter"),j="or"===e.controls.togglelogic?",":"";e.controls.togglefilterbuttons?(e._buildtogglearray(),c.hasclass(e.controls.activeclass)?(f(c,d,!0),h=e._togglearray.indexof(i),e._togglearray.splice(h,1)):(f(c,d),e._togglearray.push(i)),e._togglearray=a.grep(e._togglearray,function(a){return a}),e._togglestring=e._togglearray.join(j),e.filter(e._togglestring)):c.hasclass(e.controls.activeclass)||(a(e.selectors.filter).removeclass(e.controls.activeclass),f(c,d),e.filter(i))}e._execaction("_processclick",1,arguments)}else"function"==typeof e.callbacks.onmixbusy&&e.callbacks.onmixbusy.call(e._domnode,e._state,e),e._execaction("_processclickbusy",1,arguments)},_buildtogglearray:function(){var a=this,b=a._activefilter.replace(/\s/g,"");if(a._execaction("_buildtogglearray",0,arguments),"or"===a.controls.togglelogic)a._togglearray=b.split(",");else{a._togglearray=b.split("."),!a._togglearray[0]&&a._togglearray.shift();for(var c,d=0;c=a._togglearray[d];d++)a._togglearray[d]="."+c}a._execaction("_buildtogglearray",1,arguments)},_updatecontrols:function(c,d){var e=this,f={filter:c.filter,sort:c.sort},g=function(a,b){try{d&&"filter"===h&&"none"!==f.filter&&""!==f.filter?a.filter(b).addclass(e.controls.activeclass):a.removeclass(e.controls.activeclass).filter(b).addclass(e.controls.activeclass)}catch(c){}},h="filter",i=null;e._execaction("_updatecontrols",0,arguments),c.filter===b&&(f.filter=e._activefilter),c.sort===b&&(f.sort=e._activesort),f.filter===e.selectors.target&&(f.filter="all");for(var j=0;2>j;j++)i=e.controls.live?a(e.selectors[h]):e["_$"+h+"buttons"],i&&g(i,"[data-"+h+'="'+f[h]+'"]'),h="sort";e._execaction("_updatecontrols",1,arguments)},_filter:function(){var b=this;b._execaction("_filter",0);for(var c=0;cg?"asc"===e?-1:1:g>h?"asc"===e?1:-1:g===h&&d._newsort.length>c+1?d._compare(a,b,c+1):0},_printsort:function(a){var b=this,c=a?b._startorder:b._neworder,d=b._$parent[0].queryselectorall(b.selectors.target),e=d.length?d[d.length-1].nextelementsibling:null,f=document.createdocumentfragment();b._execaction("_printsort",0,arguments);for(var g=0;g-1){if(c){var e=a.animation.effects.indexof(b+"(");if(e>-1){var f=a.animation.effects.substring(e),g=/\(([^)]+)\)/.exec(f),h=g[1];return{val:h}}}return!0}return!1},d=function(a,b){return b?"-"===a.charat(0)?a.substr(1,a.length):"-"+a:a},e=function(a,e){for(var f=[["scale",".01"],["translatex","20px"],["translatey","20px"],["translatez","20px"],["rotatex","90deg"],["rotatey","90deg"],["rotatez","180deg"]],g=0;gi;i++){var j=0===i?j=b._prefix:"";b._ff&&b._ff<=20&&(h[j+"transition-property"]="all",h[j+"transition-timing-function"]=b.animation.easing+"ms",h[j+"transition-duration"]=b.animation.duration+"ms"),h[j+"transition-delay"]=g+"ms",h[j+"transform"]="translate("+f.x+"px,"+f.y+"px)"}(b.effects.transform||b.effects.opacity)&&b._bindtargetdone(e),b._ff&&b._ff<=20?e.css(h):e.css(b.effects.transition).css(h)}for(var c=0;ci;i++){var j=0===i?j=b._prefix:"";k[j+"transition-delay"]=g+"ms",k[j+"transform"]=b.effects.transformout,k.opacity=b.effects.opacity}e.css(b.effects.transition).css(k),(b.effects.transform||b.effects.opacity)&&b._bindtargetdone(e)}b._execaction("_animatetargets",1)},_bindtargetdone:function(b){var c=this,d=b[0];c._execaction("_bindtargetdone",0,arguments),d.dataset.bound||(d.dataset.bound=!0,c._targetsbound++,b.on("webkittransitionend.mixitup transitionend.mixitup",function(e){(e.originalevent.propertyname.indexof("transform")>-1||e.originalevent.propertyname.indexof("opacity")>-1)&&a(e.originalevent.target).is(c.selectors.target)&&(b.off(".mixitup"),delete d.dataset.bound,c._targetdone())})),c._execaction("_bindtargetdone",1,arguments)},_targetdone:function(){var a=this;a._execaction("_targetdone",0),a._targetsdone++,a._targetsdone===a._targetsbound&&a._cleanup(),a._execaction("_targetdone",1)},_cleanup:function(){var b=this,c=b.animation.animateresizetargets?"transform opacity width height margin-bottom margin-right":"transform opacity";unbrake=function(){b._$targets.removestyle("transition",b._prefix)},b._execaction("_cleanup",0),b._changinglayout?b._$show.css("display",b._newdisplay):b._$show.css("display",b.layout.display),b._$targets.css(b._brake),b._$targets.removestyle(c,b._prefix).removeattr("data-inter-pos-x data-inter-pos-y data-final-pos-x data-final-pos-y data-orig-pos-x data-orig-pos-y data-orig-height data-orig-width data-final-height data-final-width data-inter-width data-inter-height data-orig-margin-right data-orig-margin-bottom data-inter-margin-right data-inter-margin-bottom data-final-margin-right data-final-margin-bottom"),b._$hide.removestyle("display"),b._$parent.removestyle("height transition perspective-distance perspective perspective-origin-x perspective-origin-y perspective-origin perspectiveorigin",b._prefix),b._sorting&&(b._printsort(),b._activesort=b._newsortstring,b._sorting=!1),b._changinglayout&&(b._changingdisplay&&(b.layout.display=b._newdisplay,b._changingdisplay=!1),b._changingclass&&(b._$parent.removeclass(b.layout.containerclass).addclass(b._newclass),b.layout.containerclass=b._newclass,b._changingclass=!1),b._changinglayout=!1),b._refresh(),b._buildstate(),b._state.fail&&b._$container.addclass(b.layout.containerclassfail),b._$show=a(),b._$hide=a(),window.requestanimationframe&&requestanimationframe(unbrake),b._mixing=!1,"function"==typeof b.callbacks._user&&b.callbacks._user.call(b._domnode,b._state,b),"function"==typeof b.callbacks.onmixend&&b.callbacks.onmixend.call(b._domnode,b._state,b),b._$container.trigger("mixend",[b._state,b]),b._state.fail&&("function"==typeof b.callbacks.onmixfail&&b.callbacks.onmixfail.call(b._domnode,b._state,b),b._$container.trigger("mixfail",[b._state,b])),b._loading&&("function"==typeof b.callbacks.onmixload&&b.callbacks.onmixload.call(b._domnode,b._state,b),b._$container.trigger("mixload",[b._state,b])),b._queue.length&&(b._execaction("_queue",0),b.multimix(b._queue[0][0],b._queue[0][1],b._queue[0][2]),b._queue.splice(0,1)),b._execaction("_cleanup",1),b._loading=!1},_getprefixedcss:function(a,b,c){var d=this,e={};for(i=0;i<2;i++){var f=0===i?d._prefix:"";c?e[f+a]=f+b:e[f+a]=b}return d._execfilter("_getprefixedcss",e,arguments)},_getdelay:function(a){var b=this,c="function"==typeof b.animation.staggersequence?b.animation.staggersequence.call(b._domnode,a,b._state):a,d=b.animation.stagger?c*b.animation.staggerduration:0;return b._execfilter("_getdelay",d,arguments)},_parsemultimixargs:function(a){for(var b=this,c={command:null,animate:b.animation.enable,callback:null},d=0;dg;)h=d[g],g++;return a!==b?a[e]!==b?a[e]:a:void 0};return a?c._execfilter("getoption",d(c,a),arguments):c},setoptions:function(b){var c=this;c._execaction("setoptions",0,arguments),"object"==typeof b&&a.extend(!0,c,b),c._execaction("setoptions",1,arguments)},getstate:function(){var a=this;return a._execfilter("getstate",a._state,a)},forcerefresh:function(){var a=this;a._refresh(!1,!0)},destroy:function(b){var c=this,d=a.mixitup.prototype._bound._filter,e=a.mixitup.prototype._bound._sort;c._execaction("destroy",0,arguments),c._$body.add(a(c.selectors.sort)).add(a(c.selectors.filter)).off(".mixitup");for(var f=0;f1?d[c.selectors.filter]--:1===d[c.selectors.filter]&&delete d[c.selectors.filter],e[c.selectors.sort]&&e[c.selectors.sort]>1?e[c.selectors.sort]--:1===e[c.selectors.sort]&&delete e[c.selectors.sort],delete a.mixitup.prototype._instances[c._id]}},a.fn.mixitup=function(){var c,d=arguments,e=[],f=function(b,c){var d=new a.mixitup,e=function(){return("00000"+(16777216*math.random()<<0).tostring(16)).substr(-6).touppercase()};d._execaction("_instantiate",0,arguments),b.id=b.id?b.id:"mixitup"+e(),d._instances[b.id]||(d._instances[b.id]=d,d._init(b,c)),d._execaction("_instantiate",1,arguments)};return c=this.each(function(){if(d&&"string"==typeof d[0]){var c=a.mixitup.prototype._instances[this.id];if("isloaded"===d[0])e.push(c?!0:!1);else{var g=c[d[0]](d[1],d[2],d[3]);g!==b&&e.push(g)}}else f(this,d[0])}),e.length?e.length>1?e:e[0]:c},a.fn.removestyle=function(c,d){return d=d?d:"",this.each(function(){for(var e=this,f=c.split(" "),g=0;gh;h++){switch(h){case 0:var i=f[g];break;case 1:var i=a.mixitup.prototype._helpers._camelcase(i);break;case 2:var i=d+f[g];break;case 3:var i=a.mixitup.prototype._helpers._camelcase(d+f[g])}if(e.style[i]!==b&&"unknown"!=typeof e.style[i]&&e.style[i].length>0&&(e.style[i]=""),!d&&1===h)break}e.attributes&&e.attributes.style&&e.attributes.style!==b&&""===e.attributes.style.value&&e.attributes.removenameditem("style")})}}(jquery);