text: (function(n){typeof define=="function"&&!1&&define.amd&&define.amd.jQuery?define(["jquery"],n):typeof module!="undefined"&&!1&&module.exports?n(require("jquery")):n(jQuery)})(function(n){var r="left",u="right",f="up",e="down",v="in",y="out",p="none",nt="auto",w="swipe",b="pinch",k="tap",tt="doubletap",it="longtap",d="horizontal",g="vertical",l="all",ut=10,rt="start",o="move",t="end",i="cancel",c="ontouchstart"in window,a=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!c,s=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!c,h="TouchSwipe";n.fn.swipe=function(t){var r=n(this),i=r.data(h);if(i&&typeof t=="string"){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));n.error("Method "+t+" does not exist on jQuery.swipe")}else if(i&&typeof t=="object")i.option.apply(this,arguments);else if(!i&&(typeof t=="object"||!t))return ft.apply(this,arguments);return r};n.fn.swipe.version="1.6.15";n.fn.swipe.defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};n.fn.swipe.phases={PHASE_START:rt,PHASE_MOVE:o,PHASE_END:t,PHASE_CANCEL:i};n.fn.swipe.directions={LEFT:r,RIGHT:u,UP:f,DOWN:e,IN:v,OUT:y};n.fn.swipe.pageScroll={NONE:p,HORIZONTAL:d,VERTICAL:g,AUTO:nt};n.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:l};function ft(t){return t&&t.allowPageScroll===undefined&&(t.swipe!==undefined||t.swipeStatus!==undefined)&&(t.allowPageScroll=p),t.click!==undefined&&t.tap===undefined&&(t.tap=t.click),t||(t={}),t=n.extend({},n.fn.swipe.defaults,t),this.each(function(){var r=n(this),i=r.data(h);i||(i=new et(this,t),r.data(h,i))})}function et(ft,et){var et=n.extend({},et),si=c||s||!et.fallbackToMouseEvents,hi=si?s?a?"MSPointerDown":"pointerdown":"touchstart":"mousedown",ki=si?s?a?"MSPointerMove":"pointermove":"touchmove":"mousemove",di=si?s?a?"MSPointerUp":"pointerup":"touchend":"mouseup",ri=si?s?"mouseleave":null:"mouseleave",ci=s?a?"MSPointerCancel":"pointercancel":"touchcancel",at=0,vt=null,yt=null,lt=0,gt=0,ni=0,pt=1,bt=0,kt=0,li=null,ot=n(ft),st="start",ct=0,ht={},gi=0,ai=0,vi=0,nr=0,ti=0,fi=null,ei=null;try{ot.bind(hi,tr);ot.bind(ci,ui)}catch(ff){n.error("events not supported "+hi+","+ci+" on jQuery.swipe")}this.enable=function(){return ot.bind(hi,tr),ot.bind(ci,ui),ot};this.disable=function(){return lr(),ot};this.destroy=function(){lr();ot.data(h,null);ot=null};this.option=function(t,i){if(typeof t=="object")et=n.extend(et,t);else if(et[t]!==undefined){if(i===undefined)return et[t];et[t]=i}else if(t)n.error("Option "+t+" does not exist on jQuery.swipe.options");else return et;return null};function tr(t){if(!pu()&&!(n(t.target).closest(et.excludedElements,ot).length>0)){var r=t.originalEvent?t.originalEvent:t,f,u=r.touches,e=u?u[0]:r;return(st=rt,u?ct=u.length:et.preventDefaultEvents!==!1&&t.preventDefault(),at=0,vt=null,yt=null,kt=null,lt=0,gt=0,ni=0,pt=1,bt=0,li=ku(),dr(),wi(0,e),!u||ct===et.fingers||et.fingers===l||oi()?(gi=ii(),ct==2&&(wi(1,u[1]),gt=ni=cr(ht[0].start,ht[1].start)),(et.swipeStatus||et.pinchStatus)&&(f=wt(r,st))):f=!1,f===!1)?(st=i,wt(r,st),f):(et.hold&&(ei=setTimeout(n.proxy(function(){ot.trigger("hold",[r.target]);et.hold&&(f=et.hold.call(ot,r,r.target))},this),et.longTapThreshold)),pi(!0),null)}}function ir(n){var f=n.originalEvent?n.originalEvent:n;if(st!==t&&st!==i&&!yi()){var s,r=f.touches,h=r?r[0]:f,u=gr(h);if(ai=ii(),r&&(ct=r.length),et.hold&&clearTimeout(ei),st=o,ct==2&&(gt==0?(wi(1,r[1]),gt=ni=cr(ht[0].start,ht[1].start)):(gr(r[1]),ni=cr(ht[0].end,ht[1].end),kt=gu(ht[0].end,ht[1].end)),pt=du(gt,ni),bt=Math.abs(gt-ni)),ct===et.fingers||et.fingers===l||!r||oi()){if(vt=iu(u.start,u.end),yt=iu(u.last,u.end),uu(n,yt),at=nf(u.start,u.end),lt=tu(),bu(vt,at),s=wt(f,st),!et.triggerOnTouchEnd||et.triggerOnTouchLeave){var e=!0;if(et.triggerOnTouchLeave){var c=rf(this);e=uf(u.end,c)}!et.triggerOnTouchEnd&&e?st=fr(o):et.triggerOnTouchLeave&&!e&&(st=fr(t));(st==i||st==t)&&wt(f,st)}}else st=i,wt(f,st);s===!1&&(st=i,wt(f,st))}}function rr(n){var r=n.originalEvent?n.originalEvent:n,u=r.touches;if(u){if(u.length&&!yi())return yu(r),!0;if(u.length&&yi())return!0}return yi()&&(ct=nr),ai=ii(),lt=tu(),or()||!er()?(st=i,wt(r,st)):et.triggerOnTouchEnd||et.triggerOnTouchEnd==!1&&st===o?(et.preventDefaultEvents!==!1&&n.preventDefault(),st=t,wt(r,st)):!et.triggerOnTouchEnd&&br()?(st=t,dt(r,st,k)):st===o&&(st=i,wt(r,st)),pi(!1),null}function ui(){ct=0;ai=0;gi=0;gt=0;ni=0;pt=1;dr();pi(!1)}function ur(n){var i=n.originalEvent?n.originalEvent:n;et.triggerOnTouchLeave&&(st=fr(t),wt(i,st))}function lr(){ot.unbind(hi,tr);ot.unbind(ci,ui);ot.unbind(ki,ir);ot.unbind(di,rr);ri&&ot.unbind(ri,ur);pi(!1)}function fr(n){var r=n,f=ar(),u=er(),e=or();return!f||e?r=i:u&&n==o&&(!et.triggerOnTouchEnd||et.triggerOnTouchLeave)?r=t:!u&&n==t&&et.triggerOnTouchLeave&&(r=i),r}function wt(n,r){var u,f=n.touches;return(eu()||sr())&&(u=dt(n,r,w)),(fu()||oi())&&u!==!1&&(u=dt(n,r,b)),au()&&u!==!1?u=dt(n,r,tt):vu()&&u!==!1?u=dt(n,r,it):lu()&&u!==!1&&(u=dt(n,r,k)),r===i&&(sr()&&(u=dt(n,r,w)),oi()&&(u=dt(n,r,b)),ui(n)),r===t&&(f?f.length||ui(n):ui(n)),u}function dt(o,s,h){var c;if(h==w){if(ot.trigger("swipeStatus",[s,vt||null,at||0,lt||0,ct,ht,yt]),et.swipeStatus&&(c=et.swipeStatus.call(ot,o,s,vt||null,at||0,lt||0,ct,ht,yt),c===!1))return!1;if(s==t&&yr()){if(clearTimeout(fi),clearTimeout(ei),ot.trigger("swipe",[vt,at,lt,ct,ht,yt]),et.swipe&&(c=et.swipe.call(ot,o,vt,at,lt,ct,ht,yt),c===!1))return!1;switch(vt){case r:ot.trigger("swipeLeft",[vt,at,lt,ct,ht,yt]);et.swipeLeft&&(c=et.swipeLeft.call(ot,o,vt,at,lt,ct,ht,yt));break;case u:ot.trigger("swipeRight",[vt,at,lt,ct,ht,yt]);et.swipeRight&&(c=et.swipeRight.call(ot,o,vt,at,lt,ct,ht,yt));break;case f:ot.trigger("swipeUp",[vt,at,lt,ct,ht,yt]);et.swipeUp&&(c=et.swipeUp.call(ot,o,vt,at,lt,ct,ht,yt));break;case e:ot.trigger("swipeDown",[vt,at,lt,ct,ht,yt]);et.swipeDown&&(c=et.swipeDown.call(ot,o,vt,at,lt,ct,ht,yt))}}}if(h==b){if(ot.trigger("pinchStatus",[s,kt||null,bt||0,lt||0,ct,pt,ht]),et.pinchStatus&&(c=et.pinchStatus.call(ot,o,s,kt||null,bt||0,lt||0,ct,pt,ht),c===!1))return!1;if(s==t&&vr())switch(kt){case v:ot.trigger("pinchIn",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchIn&&(c=et.pinchIn.call(ot,o,kt||null,bt||0,lt||0,ct,pt,ht));break;case y:ot.trigger("pinchOut",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchOut&&(c=et.pinchOut.call(ot,o,kt||null,bt||0,lt||0,ct,pt,ht))}}return h==k?(s===i||s===t)&&(clearTimeout(fi),clearTimeout(ei),hr()&&!su()?(ti=ii(),fi=setTimeout(n.proxy(function(){ti=null;ot.trigger("tap",[o.target]);et.tap&&(c=et.tap.call(ot,o,o.target))},this),et.doubleTapThreshold)):(ti=null,ot.trigger("tap",[o.target]),et.tap&&(c=et.tap.call(ot,o,o.target)))):h==tt?(s===i||s===t)&&(clearTimeout(fi),clearTimeout(ei),ti=null,ot.trigger("doubletap",[o.target]),et.doubleTap&&(c=et.doubleTap.call(ot,o,o.target))):h==it&&(s===i||s===t)&&(clearTimeout(fi),ti=null,ot.trigger("longtap",[o.target]),et.longTap&&(c=et.longTap.call(ot,o,o.target))),c}function er(){var n=!0;return et.threshold!==null&&(n=at>=et.threshold),n}function or(){var n=!1;return et.cancelThreshold!==null&&vt!==null&&(n=nu(vt)-at>=et.cancelThreshold),n}function ru(){return et.pinchThreshold!==null?bt>=et.pinchThreshold:!0}function ar(){return et.maxTimeThreshold?lt>=et.maxTimeThreshold?!1:!0:!0}function uu(n,t){if(et.preventDefaultEvents!==!1)if(et.allowPageScroll===p)n.preventDefault();else{var i=et.allowPageScroll===nt;switch(t){case r:(et.swipeLeft&&i||!i&&et.allowPageScroll!=d)&&n.preventDefault();break;case u:(et.swipeRight&&i||!i&&et.allowPageScroll!=d)&&n.preventDefault();break;case f:(et.swipeUp&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault();break;case e:(et.swipeDown&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault()}}}function vr(){var n=pr(),t=wr(),i=ru();return n&&t&&i}function oi(){return!!(et.pinchStatus||et.pinchIn||et.pinchOut)}function fu(){return!!(vr()&&oi())}function yr(){var n=ar(),t=er(),i=pr(),r=wr(),u=or();return!u&&r&&i&&t&&n}function sr(){return!!(et.swipe||et.swipeStatus||et.swipeLeft||et.swipeRight||et.swipeUp||et.swipeDown)}function eu(){return!!(yr()&&sr())}function pr(){return ct===et.fingers||et.fingers===l||!c}function wr(){return ht[0].end.x!==0}function br(){return!!et.tap}function hr(){return!!et.doubleTap}function ou(){return!!et.longTap}function kr(){if(ti==null)return!1;var n=ii();return hr()&&n-ti<=et.doubleTapThreshold}function su(){return kr()}function hu(){return(ct===1||!c)&&(isNaN(at)||at<et.threshold)}function cu(){return lt>et.longTapThreshold&&at<ut}function lu(){return!!(hu()&&br())}function au(){return!!(kr()&&hr())}function vu(){return!!(cu()&&ou())}function yu(n){vi=ii();nr=n.touches.length+1}function dr(){vi=0;nr=0}function yi(){var n=!1;if(vi){var t=ii()-vi;t<=et.fingerReleaseThreshold&&(n=!0)}return n}function pu(){return!!(ot.data(h+"_intouch")===!0)}function pi(n){ot&&(n===!0?(ot.bind(ki,ir),ot.bind(di,rr),ri&&ot.bind(ri,ur)):(ot.unbind(ki,ir,!1),ot.unbind(di,rr,!1),ri&&ot.unbind(ri,ur,!1)),ot.data(h+"_intouch",n===!0))}function wi(n,t){var i={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return i.start.x=i.last.x=i.end.x=t.pageX||t.clientX,i.start.y=i.last.y=i.end.y=t.pageY||t.clientY,ht[n]=i,i}function gr(n){var i=n.identifier!==undefined?n.identifier:0,t=wu(i);return t===null&&(t=wi(i,n)),t.last.x=t.end.x,t.last.y=t.end.y,t.end.x=n.pageX||n.clientX,t.end.y=n.pageY||n.clientY,t}function wu(n){return ht[n]||null}function bu(n,t){t=Math.max(t,nu(n));li[n].distance=t}function nu(n){return li[n]?li[n].distance:undefined}function ku(){var n={};return n[r]=bi(r),n[u]=bi(u),n[f]=bi(f),n[e]=bi(e),n}function bi(n){return{direction:n,distance:0}}function tu(){return ai-gi}function cr(n,t){var i=Math.abs(n.x-t.x),r=Math.abs(n.y-t.y);return Math.round(Math.sqrt(i*i+r*r))}function du(n,t){var i=t/n*1;return i.toFixed(2)}function gu(){return pt<1?y:v}function nf(n,t){return Math.round(Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)))}function tf(n,t){var r=n.x-t.x,u=t.y-n.y,f=Math.atan2(u,r),i=Math.round(f*180/Math.PI);return i<0&&(i=360-Math.abs(i)),i}function iu(n,t){var i=tf(n,t);return i<=45&&i>=0?r:i<=360&&i>=315?r:i>=135&&i<=225?u:i>45&&i<135?e:f}function ii(){var n=new Date;return n.getTime()}function rf(t){t=n(t);var i=t.offset();return{left:i.left,right:i.left+t.outerWidth(),top:i.top,bottom:i.top+t.outerHeight()}}function uf(n,t){return n.x>t.left&&n.x<t.right&&n.y>t.top&&n.y<t.bottom}}});jQuery.extend({highlight:function(n,t,i,r){if(n.nodeType===3){var u=n.data.match(t);if(u){var o=document.createElement(i||"span");if(o.className=r||"highlight",/\.|,|\s/.test(u[0].charAt(0)))var s=u.index+1;else var s=u.index;var f=n.splitText(s);f.splitText(u[1].length);var h=f.cloneNode(!0);return o.appendChild(h),f.parentNode.replaceChild(o,f),1}}else if(n.nodeType===1&&n.childNodes&&!/(script|style)/i.test(n.tagName)&&!(n.tagName===i.toUpperCase()&&n.className===r))for(var e=0;e<n.childNodes.length;e++)e+=jQuery.highlight(n.childNodes[e],t,i,r);return 0}});jQuery.fn.unhighlight=function(n){var t={className:"highlight",element:"span"};return jQuery.extend(t,n),this.find(t.element+"."+t.className).each(function(){var n=this.parentNode;n.replaceChild(this.firstChild,this);n.normalize()}).end()};jQuery.fn.highlight=function(n,t){var i={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(jQuery.extend(i,t),n.constructor===String&&(n=[n]),n=jQuery.grep(n,function(n){return n!=""}),n=jQuery.map(n,function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}),n.length==0)return this;var u=i.caseSensitive?"":"i",r="("+n.join("|")+")";i.wordsOnly&&(r="(?:,|^|\\s)"+r+"(?:,|$|\\s)");var f=new RegExp(r,u);return this.each(function(){jQuery.highlight(this,f,i.element,i.className)})};!function(n){"function"==typeof define&&!1&&define.amd?define(["jquery"],n):"object"==typeof exports&&!1?module.exports=n:n(jQuery)}(function(n){function u(i){var u=i||window.event,p=c.call(arguments,1),l=0,s=0,o=0,a=0,w=0,b=0;if(i=n.event.fix(u),i.type="mousewheel","detail"in u&&(o=-1*u.detail),"wheelDelta"in u&&(o=u.wheelDelta),"wheelDeltaY"in u&&(o=u.wheelDeltaY),"wheelDeltaX"in u&&(s=-1*u.wheelDeltaX),"axis"in u&&u.axis===u.HORIZONTAL_AXIS&&(s=-1*o,o=0),l=0===o?s:o,"deltaY"in u&&(o=-1*u.deltaY,l=o),"deltaX"in u&&(s=u.deltaX,0===o&&(l=-1*s)),0!==o||0!==s){if(1===u.deltaMode){var v=n.data(this,"mousewheel-line-height");l*=v;o*=v;s*=v}else if(2===u.deltaMode){var y=n.data(this,"mousewheel-page-height");l*=y;o*=y;s*=y}if(a=Math.max(Math.abs(o),Math.abs(s)),(!t||t>a)&&(t=a,e(u,a)&&(t/=40)),e(u,a)&&(l/=40,s/=40,o/=40),l=Math[l>=1?"floor":"ceil"](l/t),s=Math[s>=1?"floor":"ceil"](s/t),o=Math[o>=1?"floor":"ceil"](o/t),r.settings.normalizeOffset&&this.getBoundingClientRect){var k=this.getBoundingClientRect();w=i.clientX-k.left;b=i.clientY-k.top}return i.deltaX=s,i.deltaY=o,i.deltaFactor=t,i.offsetX=w,i.offsetY=b,i.deltaMode=0,p.unshift(i,l,s,o),f&&clearTimeout(f),f=setTimeout(h,200),(n.event.dispatch||n.event.handle).apply(this,p)}}function h(){t=null}function e(n,t){return r.settings.adjustOldDeltas&&"mousewheel"===n.type&&t%120==0}var f,t,o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice;if(n.event.fixHooks)for(var s=o.length;s;)n.event.fixHooks[o[--s]]=n.event.mouseHooks;var r=n.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],u,!1);else this.onmousewheel=u;n.data(this,"mousewheel-line-height",r.getLineHeight(this));n.data(this,"mousewheel-page-height",r.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=i.length;t;)this.removeEventListener(i[--t],u,!1);else this.onmousewheel=null;n.removeData(this,"mousewheel-line-height");n.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var r=n(t),i=r["offsetParent"in n.fn?"offsetParent":"parent"]();return i.length||(i=n("body")),parseInt(i.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})});!function(n){"function"==typeof define&&!1&&define.amd?define(["jquery"],n):"object"==typeof exports&&!1?module.exports=n:n(jQuery)}(function(n){function u(i){var u=i||window.event,p=c.call(arguments,1),l=0,s=0,o=0,a=0,w=0,b=0;if(i=n.event.fix(u),i.type="mousewheel","detail"in u&&(o=-1*u.detail),"wheelDelta"in u&&(o=u.wheelDelta),"wheelDeltaY"in u&&(o=u.wheelDeltaY),"wheelDeltaX"in u&&(s=-1*u.wheelDeltaX),"axis"in u&&u.axis===u.HORIZONTAL_AXIS&&(s=-1*o,o=0),l=0===o?s:o,"deltaY"in u&&(o=-1*u.deltaY,l=o),"deltaX"in u&&(s=u.deltaX,0===o&&(l=-1*s)),0!==o||0!==s){if(1===u.deltaMode){var v=n.data(this,"mousewheel-line-height");l*=v;o*=v;s*=v}else if(2===u.deltaMode){var y=n.data(this,"mousewheel-page-height");l*=y;o*=y;s*=y}if(a=Math.max(Math.abs(o),Math.abs(s)),(!t||t>a)&&(t=a,e(u,a)&&(t/=40)),e(u,a)&&(l/=40,s/=40,o/=40),l=Math[l>=1?"floor":"ceil"](l/t),s=Math[s>=1?"floor":"ceil"](s/t),o=Math[o>=1?"floor":"ceil"](o/t),r.settings.normalizeOffset&&this.getBoundingClientRect){var k=this.getBoundingClientRect();w=i.clientX-k.left;b=i.clientY-k.top}return i.deltaX=s,i.deltaY=o,i.deltaFactor=t,i.offsetX=w,i.offsetY=b,i.deltaMode=0,p.unshift(i,l,s,o),f&&clearTimeout(f),f=setTimeout(h,200),(n.event.dispatch||n.event.handle).apply(this,p)}}function h(){t=null}function e(n,t){return r.settings.adjustOldDeltas&&"mousewheel"===n.type&&t%120==0}var f,t,o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice;if(n.event.fixHooks)for(var s=o.length;s;)n.event.fixHooks[o[--s]]=n.event.mouseHooks;var r=n.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],u,!1);else this.onmousewheel=u;n.data(this,"mousewheel-line-height",r.getLineHeight(this));n.data(this,"mousewheel-page-height",r.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=i.length;t;)this.removeEventListener(i[--t],u,!1);else this.onmousewheel=null;n.removeData(this,"mousewheel-line-height");n.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var r=n(t),i=r["offsetParent"in n.fn?"offsetParent":"parent"]();return i.length||(i=n("body")),parseInt(i.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})});typeof jQuery.fn.mCustScr=="undefined"?!function(n){"function"==typeof define&&!1&&define.amd?define(["jquery"],n):"undefined"!=typeof module&&!1&&module.exports?module.exports=n:n(jQuery,window,document)}(function(n){!function(t){var i="function"==typeof define&&!1&&define.amd,r="undefined"!=typeof module&&!1&&module.exports,u="https:"==document.location.protocol?"https:":"http:";i||(r?require("jquery-mousewheel")(n):n.event.special.mousewheel||n("head").append(decodeURI("%3Cscript src="+u+"//"+"cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"+"%3E%3C/script%3E")));t()}(function(){var h,c="mCustScr",t="mCSap",it=".mCustScr",ot={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},pt=0,b={},p=window.attachEvent&&!window.addEventListener?1:0,e=!1,i=["mCSBap_dragger_onDrag","mCSBap_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSBap_draggerContainer","mCSBap_buttonUp","mCSBap_buttonDown","mCSBap_buttonLeft","mCSBap_buttonRight"],s={init:function(r){var r=n.extend(!0,{},ot,r),e=v.call(this);if(r.live){var u=r.liveSelector||this.selector||it,f=n(u);if("off"===r.live)return void k(u);b[u]=setTimeout(function(){f.mCustScr(r);"once"===r.live&&f.length&&k(u)},500)}else k(u);return r.setWidth=r.set_width?r.set_width:r.setWidth,r.setHeight=r.set_height?r.set_height:r.setHeight,r.axis=r.horizontalScroll?"x":wt(r.axis),r.scrollInertia=r.scrollInertia>0&&r.scrollInertia<17?17:r.scrollInertia,"object"!=typeof r.mouseWheel&&1==r.mouseWheel&&(r.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),r.mouseWheel.scrollAmount=r.mouseWheelPixels?r.mouseWheelPixels:r.mouseWheel.scrollAmount,r.mouseWheel.normalizeDelta=r.advanced.normalizeMouseWheelDelta?r.advanced.normalizeMouseWheelDelta:r.mouseWheel.normalizeDelta,r.scrollButtons.scrollType=bt(r.scrollButtons.scrollType),st(r),n(e).each(function(){var u=n(this);if(!u.data(t)){u.data(t,{idx:++pt,opt:r,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:u.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var e=u.data(t),f=e.opt,o=u.data("mcs-axis"),h=u.data("mcs-scrollbar-position"),c=u.data("mcs-theme");o&&(f.axis=o);h&&(f.scrollbarPosition=h);c&&(f.theme=c,st(f));kt.call(this);e&&f.callbacks.onCreate&&"function"==typeof f.callbacks.onCreate&&f.callbacks.onCreate.call(this);n("#mCSBap_"+e.idx+"_container img:not(."+i[2]+")").addClass(i[2]);s.update.call(null,u)}})},update:function(r,f){var e=r||v.call(this);return n(e).each(function(){var s=n(this);if(s.data(t)){var e=s.data(t),r=e.opt,h=n("#mCSBap_"+e.idx+"_container"),a=n("#mCSBap_"+e.idx),c=[n("#mCSBap_"+e.idx+"_dragger_vertical"),n("#mCSBap_"+e.idx+"_dragger_horizontal")];if(!h.length)return;e.tweenRunning&&o(s);f&&e&&r.callbacks.onBeforeUpdate&&"function"==typeof r.callbacks.onBeforeUpdate&&r.callbacks.onBeforeUpdate.call(this);s.hasClass(i[3])&&s.removeClass(i[3]);s.hasClass(i[4])&&s.removeClass(i[4]);a.css("max-height","none");a.height()!==s.height()&&a.css("max-height",s.height());dt.call(this);"y"===r.axis||r.advanced.autoExpandHorizontalScroll||h.css("width",ht(h));e.overflowed=ii.call(this);ct.call(this);r.autoDraggerLength&&ni.call(this);ti.call(this);ri.call(this);var l=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)];"x"!==r.axis&&(e.overflowed[0]?c[0].height()>c[0].parent().height()?y.call(this):(u(s,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}),e.contentReset.y=null):(y.call(this),"y"===r.axis?g.call(this):"yx"===r.axis&&e.overflowed[1]&&u(s,l[1].toString(),{dir:"x",dur:0,overwrite:"none"})));"y"!==r.axis&&(e.overflowed[1]?c[1].width()>c[1].parent().width()?y.call(this):(u(s,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}),e.contentReset.x=null):(y.call(this),"x"===r.axis?g.call(this):"yx"===r.axis&&e.overflowed[0]&&u(s,l[0].toString(),{dir:"y",dur:0,overwrite:"none"})));f&&e&&(2===f&&r.callbacks.onImageLoad&&"function"==typeof r.callbacks.onImageLoad?r.callbacks.onImageLoad.call(this):3===f&&r.callbacks.onSelectorChange&&"function"==typeof r.callbacks.onSelectorChange?r.callbacks.onSelectorChange.call(this):r.callbacks.onUpdate&&"function"==typeof r.callbacks.onUpdate&&r.callbacks.onUpdate.call(this));et.call(this)}})},scrollTo:function(i,r){if("undefined"!=typeof i&&null!=i){var f=v.call(this);return n(f).each(function(){var s=n(this);if(s.data(t)){var o=s.data(t),h=o.opt,c={trigger:"external",scrollInertia:h.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},f=n.extend(!0,{},c,r),e=ft.call(this,i),l=f.scrollInertia>0&&f.scrollInertia<17?17:f.scrollInertia;e[0]=at.call(this,e[0],"y");e[1]=at.call(this,e[1],"x");f.moveDragger&&(e[0]*=o.scrollRatio.y,e[1]*=o.scrollRatio.x);f.dur=wi()?0:l;setTimeout(function(){null!==e[0]&&"undefined"!=typeof e[0]&&"x"!==h.axis&&o.overflowed[0]&&(f.dir="y",f.overwrite="all",u(s,e[0].toString(),f));null!==e[1]&&"undefined"!=typeof e[1]&&"y"!==h.axis&&o.overflowed[1]&&(f.dir="x",f.overwrite="none",u(s,e[1].toString(),f))},f.timeout)}})}},stop:function(){var i=v.call(this);return n(i).each(function(){var i=n(this);i.data(t)&&o(i)})},disable:function(r){var u=v.call(this);return n(u).each(function(){var u=n(this);u.data(t)&&(u.data(t),et.call(this,"remove"),g.call(this),r&&y.call(this),ct.call(this,!0),u.addClass(i[3]))})},destroy:function(){var r=v.call(this);return n(r).each(function(){var f=n(this);if(f.data(t)){var u=f.data(t),e=u.opt,s=n("#mCSBap_"+u.idx),o=n("#mCSBap_"+u.idx+"_container"),h=n(".mCSBap_"+u.idx+"_scrollbar");e.live&&k(e.liveSelector||n(r).selector);et.call(this,"remove");g.call(this);y.call(this);f.removeData(t);a(this,"mcs");h.remove();o.find("img."+i[2]).removeClass(i[2]);s.replaceWith(o.contents());f.removeClass(c+" _"+t+"_"+u.idx+" "+i[6]+" "+i[7]+" "+i[5]+" "+i[3]).addClass(i[4])}})}},v=function(){return"object"!=typeof n(this)||n(this).length<1?it:this},st=function(t){t.autoDraggerLength=n.inArray(t.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"])>-1?!1:t.autoDraggerLength;t.autoExpandScrollbar=n.inArray(t.theme,["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"])>-1?!1:t.autoExpandScrollbar;t.scrollButtons.enable=n.inArray(t.theme,["minimal","minimal-dark"])>-1?!1:t.scrollButtons.enable;t.autoHideScrollbar=n.inArray(t.theme,["minimal","minimal-dark"])>-1?!0:t.autoHideScrollbar;t.scrollbarPosition=n.inArray(t.theme,["minimal","minimal-dark"])>-1?"outside":t.scrollbarPosition},k=function(n){b[n]&&(clearTimeout(b[n]),a(b,n))},wt=function(n){return"yx"===n||"xy"===n||"auto"===n?"yx":"x"===n||"horizontal"===n?"x":"y"},bt=function(n){return"stepped"===n||"pixels"===n||"step"===n||"click"===n?"stepped":"stepless"},kt=function(){var f=n(this),u=f.data(t),r=u.opt,h=r.autoExpandScrollbar?" "+i[1]+"_expand":"",e=["<div id='mCSBap_"+u.idx+"_scrollbar_vertical' class='mCSBap_scrollTools mCSBap_"+u.idx+"_scrollbar mCS-"+r.theme+" mCSBap_scrollTools_vertical"+h+"'><div class='"+i[12]+"'><div id='mCSBap_"+u.idx+"_dragger_vertical' class='mCSBap_dragger' style='position:absolute;'><div class='mCSBap_dragger_bar' /><\/div><div class='mCSBap_draggerRail' /><\/div><\/div>","<div id='mCSBap_"+u.idx+"_scrollbar_horizontal' class='mCSBap_scrollTools mCSBap_"+u.idx+"_scrollbar mCS-"+r.theme+" mCSBap_scrollTools_horizontal"+h+"'><div class='"+i[12]+"'><div id='mCSBap_"+u.idx+"_dragger_horizontal' class='mCSBap_dragger' style='position:absolute;'><div class='mCSBap_dragger_bar' /><\/div><div class='mCSBap_draggerRail' /><\/div><\/div>"],v="yx"===r.axis?"mCSBap_vertical_horizontal":"x"===r.axis?"mCSBap_horizontal":"mCSBap_vertical",l="yx"===r.axis?e[0]+e[1]:"x"===r.axis?e[1]:e[0],y="yx"===r.axis?"<div id='mCSBap_"+u.idx+"_container_wrapper' class='mCSBap_container_wrapper' />":"",p=r.autoHideScrollbar?" "+i[6]:"",w="x"!==r.axis&&"rtl"===u.langDir?" "+i[7]:"";r.setWidth&&f.css("width",r.setWidth);r.setHeight&&f.css("height",r.setHeight);r.setLeft="y"!==r.axis&&"rtl"===u.langDir?"989999px":r.setLeft;f.addClass(c+" _"+t+"_"+u.idx+p+w).wrapInner("<div id='mCSBap_"+u.idx+"' class='mCustomScrollBox mCS-"+r.theme+" "+v+"'><div id='mCSBap_"+u.idx+"_container' class='mCSBap_container' style='position:relative; top:"+r.setTop+"; left:"+r.setLeft+";' dir='"+u.langDir+"' /><\/div>");var a=n("#mCSBap_"+u.idx),s=n("#mCSBap_"+u.idx+"_container");"y"===r.axis||r.advanced.autoExpandHorizontalScroll||s.css("width",ht(s));"outside"===r.scrollbarPosition?("static"===f.css("position")&&f.css("position","relative"),f.css("overflow","visible"),a.addClass("mCSBap_outside").after(l)):(a.addClass("mCSBap_inside").append(l),s.wrap(y));gt.call(this);var o=[n("#mCSBap_"+u.idx+"_dragger_vertical"),n("#mCSBap_"+u.idx+"_dragger_horizontal")];o[0].css("min-height",o[0].height());o[1].css("min-width",o[1].width())},ht=function(t){var i=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return n(this).outerWidth(!0)}).get())],r=t.parent().width();return i[0]>r?i[0]:i[1]>r?i[1]:"100%"},dt=function(){var e=n(this),u=e.data(t),r=u.opt,i=n("#mCSBap_"+u.idx+"_container");if(r.advanced.autoExpandHorizontalScroll&&"y"!==r.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var f=Math.ceil(i[0].scrollWidth);3===r.advanced.autoExpandHorizontalScroll||2!==r.advanced.autoExpandHorizontalScroll&&f>i.parent().width()?i.css({width:f,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSBap_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},gt=function(){var s=n(this),o=s.data(t),u=o.opt,h=n(".mCSBap_"+o.idx+"_scrollbar:first"),f=tt(u.scrollButtons.tabindex)?"tabindex='"+u.scrollButtons.tabindex+"'":"",r=["<a href='#' class='"+i[13]+"' "+f+" />","<a href='#' class='"+i[14]+"' "+f+" />","<a href='#' class='"+i[15]+"' "+f+" />","<a href='#' class='"+i[16]+"' "+f+" />"],e=["x"===u.axis?r[2]:r[0],"x"===u.axis?r[3]:r[1],r[2],r[3]];u.scrollButtons.enable&&h.prepend(e[0]).append(e[1]).next(".mCSBap_scrollTools").prepend(e[2]).append(e[3])},ni=function(){var s=n(this),u=s.data(t),f=n("#mCSBap_"+u.idx),e=n("#mCSBap_"+u.idx+"_container"),r=[n("#mCSBap_"+u.idx+"_dragger_vertical"),n("#mCSBap_"+u.idx+"_dragger_horizontal")],o=[f.height()/e.outerHeight(!1),f.width()/e.outerWidth(!1)],i=[parseInt(r[0].css("min-height")),Math.round(o[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(o[1]*r[1].parent().width())],h=p&&i[1]<i[0]?i[0]:i[1],c=p&&i[3]<i[2]?i[2]:i[3];r[0].css({height:h,"max-height":r[0].parent().height()-10}).find(".mCSBap_dragger_bar").css({"line-height":i[0]+"px"});r[1].css({width:c,"max-width":r[1].parent().width()-10})},ti=function(){var s=n(this),i=s.data(t),u=n("#mCSBap_"+i.idx),f=n("#mCSBap_"+i.idx+"_container"),r=[n("#mCSBap_"+i.idx+"_dragger_vertical"),n("#mCSBap_"+i.idx+"_dragger_horizontal")],e=[f.outerHeight(!1)-u.height(),f.outerWidth(!1)-u.width()],o=[e[0]/(r[0].parent().height()-r[0].height()),e[1]/(r[1].parent().width()-r[1].width())];i.scrollRatio={y:o[0],x:o[1]}},d=function(n,t,r){var f=r?i[0]+"_expanded":"",u=n.closest(".mCSBap_scrollTools");"active"===t?(n.toggleClass(i[0]+" "+f),u.toggleClass(i[1]),n[0]._draggable=n[0]._draggable?0:1):n[0]._draggable||("hide"===t?(n.removeClass(i[0]),u.removeClass(i[1])):(n.addClass(i[0]),u.addClass(i[1])))},ii=function(){var h=n(this),r=h.data(t),e=n("#mCSBap_"+r.idx),i=n("#mCSBap_"+r.idx+"_container"),u=null==r.overflowed?i.height():i.outerHeight(!1),f=null==r.overflowed?i.width():i.outerWidth(!1),o=i[0].scrollHeight,s=i[0].scrollWidth;return o>u&&(u=o),s>f&&(f=s),[u>e.height(),f>e.width()]},y=function(){var r=n(this),i=r.data(t),f=i.opt,c=n("#mCSBap_"+i.idx),e=n("#mCSBap_"+i.idx+"_container"),h=[n("#mCSBap_"+i.idx+"_dragger_vertical"),n("#mCSBap_"+i.idx+"_dragger_horizontal")];if(o(r),("x"!==f.axis&&!i.overflowed[0]||"y"===f.axis&&i.overflowed[0])&&(h[0].add(e).css("top",0),u(r,"_resetY")),"y"!==f.axis&&!i.overflowed[1]||"x"===f.axis&&i.overflowed[1]){var s=dx=0;"rtl"===i.langDir&&(s=c.width()-e.outerWidth(!1),dx=Math.abs(s/i.scrollRatio.x));e.css("left",s);h[1].css("left",dx);u(r,"_resetX")}},ri=function(){function u(){e=setTimeout(function(){n.event.special.mousewheel?(clearTimeout(e),oi.call(f[0])):u()},100)}var f=n(this),r=f.data(t),i=r.opt;if(!r.bindEvents){if(ui.call(this),i.contentTouchScroll&&fi.call(this),ei.call(this),i.mouseWheel.enable){var e;u()}hi.call(this);li.call(this);i.advanced.autoScrollOnFocus&&ci.call(this);i.scrollButtons.enable&&ai.call(this);i.keyboard.enable&&vi.call(this);r.bindEvents=!0}},g=function(){var f=n(this),r=f.data(t),u=r.opt,o=t+"_"+r.idx,s=".mCSBap_"+r.idx+"_scrollbar",e=n("#mCSBap_"+r.idx+",#mCSBap_"+r.idx+"_container,#mCSBap_"+r.idx+"_container_wrapper,"+s+" ."+i[12]+",#mCSBap_"+r.idx+"_dragger_vertical,#mCSBap_"+r.idx+"_dragger_horizontal,"+s+">a"),h=n("#mCSBap_"+r.idx+"_container");u.advanced.releaseDraggableSelectors&&e.add(n(u.advanced.releaseDraggableSelectors));u.advanced.extraDraggableSelectors&&e.add(n(u.advanced.extraDraggableSelectors));r.bindEvents&&(n(document).add(n(!l()||top.document)).unbind("."+o),e.each(function(){n(this).unbind("."+o)}),clearTimeout(f[0]._focusTimeout),a(f[0],"_focusTimeout"),clearTimeout(r.sequential.step),a(r.sequential,"step"),clearTimeout(h[0].onCompleteTimeout),a(h[0],"onCompleteTimeout"),r.bindEvents=!1)},ct=function(r){var h=n(this),u=h.data(t),o=u.opt,c=n("#mCSBap_"+u.idx+"_container_wrapper"),f=c.length?c:n("#mCSBap_"+u.idx+"_container"),e=[n("#mCSBap_"+u.idx+"_scrollbar_vertical"),n("#mCSBap_"+u.idx+"_scrollbar_horizontal")],s=[e[0].find(".mCSBap_dragger"),e[1].find(".mCSBap_dragger")];"x"!==o.axis&&(u.overflowed[0]&&!r?(e[0].add(s[0]).add(e[0].children("a")).css("display","block"),f.removeClass(i[8]+" "+i[10])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[0].css("display","none"),f.removeClass(i[10])):(e[0].css("display","none"),f.addClass(i[10])),f.addClass(i[8])));"y"!==o.axis&&(u.overflowed[1]&&!r?(e[1].add(s[1]).add(e[1].children("a")).css("display","block"),f.removeClass(i[9]+" "+i[11])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&s[1].css("display","none"),f.removeClass(i[11])):(e[1].css("display","none"),f.addClass(i[11])),f.addClass(i[9])));u.overflowed[0]||u.overflowed[1]?h.removeClass(i[5]):h.addClass(i[5])},r=function(t){var e=t.type,i=t.target.ownerDocument!==document&&null!==frameElement?[n(frameElement).offset().top,n(frameElement).offset().left]:null,r=l()&&t.target.ownerDocument!==top.document&&null!==frameElement?[n(t.view.frameElement).offset().top,n(t.view.frameElement).offset().left]:[0,0];switch(e){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return i?[t.originalEvent.pageY-i[0]+r[0],t.originalEvent.pageX-i[1]+r[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var u=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],f=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[u.screenY,u.screenX,f>1]:[u.pageY,u.pageX,f>1];default:return i?[t.pageY-i[0]+r[0],t.pageX-i[1]+r[1],!1]:[t.pageY,t.pageX,!1]}},ui=function(){function k(n,t,r,f){if(w[0].idleTimer=h.scrollInertia<233?250:0,i.attr("id")===y[1])var e="x",o=(i[0].offsetLeft-t+f)*s.scrollRatio.x;else var e="y",o=(i[0].offsetTop-n+r)*s.scrollRatio.y;u(v,o.toString(),{dir:e,drag:!0})}var i,c,a,v=n(this),s=v.data(t),h=s.opt,f=t+"_"+s.idx,y=["mCSBap_"+s.idx+"_dragger_vertical","mCSBap_"+s.idx+"_dragger_horizontal"],w=n("#mCSBap_"+s.idx+"_container"),b=n("#"+y[0]+",#"+y[1]),g=h.advanced.releaseDraggableSelectors?b.add(n(h.advanced.releaseDraggableSelectors)):b,nt=h.advanced.extraDraggableSelectors?n(!l()||top.document).add(n(h.advanced.extraDraggableSelectors)):n(!l()||top.document);b.bind("contextmenu."+f,function(n){n.preventDefault()}).bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),yt(t)){e=!0;p&&(document.onselectstart=function(){return!1});lt.call(w,!1);o(v);i=n(this);var u=i.offset(),f=r(t)[0]-u.top,s=r(t)[1]-u.left,l=i.height()+u.top,y=i.width()+u.left;l>f&&f>0&&y>s&&s>0&&(c=f,a=s);d(i,"active",h.autoExpandScrollbar)}}).bind("touchmove."+f,function(n){n.stopImmediatePropagation();n.preventDefault();var t=i.offset(),u=r(n)[0]-t.top,f=r(n)[1]-t.left;k(c,a,u,f)});n(document).add(nt).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(n){if(i){var t=i.offset(),u=r(n)[0]-t.top,f=r(n)[1]-t.left;if(c===u&&a===f)return;k(c,a,u,f)}}).add(g).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(){i&&(d(i,"active",h.autoExpandScrollbar),i=null);e=!1;p&&(document.onselectstart=null);lt.call(w,!0)})},fi=function(){function at(n){if(!nt(n)||e||r(n)[2])return void(h=0);h=1;it=0;rt=0;st=1;g.removeClass("mCS_touch_action");var t=b.offset();k=r(n)[0]-t.top;d=r(n)[1]-t.left;v=[r(n)[0],r(n)[1]]}function vt(n){if(nt(n)&&!e&&!r(n)[2]&&(f.documentTouchScroll||n.preventDefault(),n.stopImmediatePropagation(),(!rt||it)&&st)){gt=w();var o=ut.offset(),t=r(n)[0]-o.top,u=r(n)[1]-o.left,h="mcsLinearOut";if(et.push(t),ot.push(u),v[2]=Math.abs(r(n)[0]-v[0]),v[3]=Math.abs(r(n)[1]-v[1]),i.overflowed[0])var c=ft[0].parent().height()-ft[0].height(),l=k-t>0&&t-k>-(c*i.scrollRatio.y)&&(2*v[3]<v[2]||"yx"===f.axis);if(i.overflowed[1])var a=ft[1].parent().width()-ft[1].width(),y=d-u>0&&u-d>-(a*i.scrollRatio.x)&&(2*v[2]<v[3]||"yx"===f.axis);l||y?(ii||n.preventDefault(),it=1):(rt=1,g.addClass("mCS_touch_action"));ii&&n.preventDefault();s="yx"===f.axis?[k-t,d-u]:"x"===f.axis?[null,d-u]:[k-t,null];b[0].idleTimer=250;i.overflowed[0]&&tt(s[0],ni,h,"y","all",!0);i.overflowed[1]&&tt(s[1],ni,h,"x",lt,!0)}}function yt(n){if(!nt(n)||e||r(n)[2])return void(h=0);h=1;n.stopImmediatePropagation();o(g);dt=w();var t=ut.offset();bt=r(n)[0]-t.top;kt=r(n)[1]-t.left;et=[];ot=[]}function pt(n){if(nt(n)&&!e&&!r(n)[2]){st=0;n.stopImmediatePropagation();it=0;rt=0;ht=w();var h=ut.offset(),l=r(n)[0]-h.top,a=r(n)[1]-h.left;if(!(ht-gt>30)){c=1e3/(ht-dt);var v="mcsEaseOut",o=2.5>c,p=o?[et[et.length-2],ot[ot.length-2]]:[0,0];y=o?[l-p[0],a-p[1]]:[l-bt,a-kt];var t=[Math.abs(y[0]),Math.abs(y[1])];c=o?[Math.abs(y[0]/4),Math.abs(y[1]/4)]:[c,c];var u=[Math.abs(b[0].offsetTop)-y[0]*wt(t[0]/c[0],c[0]),Math.abs(b[0].offsetLeft)-y[1]*wt(t[1]/c[1],c[1])];s="yx"===f.axis?[u[0],u[1]]:"x"===f.axis?[null,u[1]]:[u[0],null];ct=[4*t[0]+f.scrollInertia,4*t[1]+f.scrollInertia];var k=parseInt(f.contentTouchScroll)||0;s[0]=t[0]>k?s[0]:0;s[1]=t[1]>k?s[1]:0;i.overflowed[0]&&tt(s[0],ct[0],v,"y",lt,!1);i.overflowed[1]&&tt(s[1],ct[1],v,"x",lt,!1)}}}function wt(n,t){var i=[1.5*t,2*t,t/1.5,t/2];return n>90?t>4?i[0]:i[3]:n>60?t>3?i[3]:i[2]:n>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function tt(n,t,i,r,f,e){n&&u(g,n.toString(),{dur:t,scrollEasing:i,dir:r,overwrite:f,drag:e})}var st,k,d,bt,kt,dt,gt,ht,y,c,s,ct,it,rt,g=n(this),i=g.data(t),f=i.opt,a=t+"_"+i.idx,ut=n("#mCSBap_"+i.idx),b=n("#mCSBap_"+i.idx+"_container"),ft=[n("#mCSBap_"+i.idx+"_dragger_vertical"),n("#mCSBap_"+i.idx+"_dragger_horizontal")],et=[],ot=[],ni=0,lt="yx"===f.axis?"none":"all",v=[],ti=b.find("iframe"),p=["touchstart."+a+" pointerdown."+a+" MSPointerDown."+a,"touchmove."+a+" pointermove."+a+" MSPointerMove."+a,"touchend."+a+" pointerup."+a+" MSPointerUp."+a],ii=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;b.bind(p[0],function(n){at(n)}).bind(p[1],function(n){vt(n)});ut.bind(p[0],function(n){yt(n)}).bind(p[2],function(n){pt(n)});ti.length&&ti.each(function(){n(this).bind("load",function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind(p[0],function(n){at(n);yt(n)}).bind(p[1],function(n){vt(n)}).bind(p[2],function(n){pt(n)})})})},ei=function(){function y(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function i(n,t,i){l.type=i&&u?"stepped":"stepless";l.scrollAmount=10;ut(a,n,t,"mcsLinearOut",i?60:null)}var u,a=n(this),f=a.data(t),v=f.opt,l=f.sequential,s=t+"_"+f.idx,o=n("#mCSBap_"+f.idx+"_container"),c=o.parent();o.bind("mousedown."+s,function(){h||u||(u=1,e=!0)}).add(document).bind("mousemove."+s,function(n){if(!h&&u&&y()){var s=o.offset(),t=r(n)[0]-s.top+o[0].offsetTop,e=r(n)[1]-s.left+o[0].offsetLeft;t>0&&t<c.height()&&e>0&&e<c.width()?l.step&&i("off",null,"stepped"):("x"!==v.axis&&f.overflowed[0]&&(0>t?i("on",38):t>c.height()&&i("on",40)),"y"!==v.axis&&f.overflowed[1]&&(0>e?i("on",37):e>c.width()&&i("on",39)))}}).bind("mouseup."+s+" dragend."+s,function(){h||(u&&(u=0,i("off",null)),e=!1)})},oi=function(){function h(t,h){if(o(s),!si(s,t.target)){var v="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):p&&t.deltaFactor<100?100:t.deltaFactor||100,y=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var a="x",l=[Math.round(v*r.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],w="auto"!==i.mouseWheel.scrollAmount?l[1]:l[0]>=e.width()?.9*e.width():l[0],k=Math.abs(n("#mCSBap_"+r.idx+"_container")[0].offsetLeft),b=f[1][0].offsetLeft,d=f[1].parent().width()-f[1].width(),c="y"===i.mouseWheel.axis?t.deltaY||h:t.deltaX;else var a="y",l=[Math.round(v*r.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],w="auto"!==i.mouseWheel.scrollAmount?l[1]:l[0]>=e.height()?.9*e.height():l[0],k=Math.abs(n("#mCSBap_"+r.idx+"_container")[0].offsetTop),b=f[0][0].offsetTop,d=f[0].parent().height()-f[0].height(),c=t.deltaY||h;("y"!==a||r.overflowed[0])&&("x"!==a||r.overflowed[1])&&((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(c=-c),i.mouseWheel.normalizeDelta&&(c=0>c?-1:1),(c>0&&0!==b||0>c&&b!==d||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!i.mouseWheel.normalizeDelta&&(w=t.deltaFactor,y=17),u(s,(k-c*w).toString(),{dir:a,dur:y}))}}if(n(this).data(t)){var s=n(this),r=s.data(t),i=r.opt,c=t+"_"+r.idx,e=n("#mCSBap_"+r.idx),f=[n("#mCSBap_"+r.idx+"_dragger_vertical"),n("#mCSBap_"+r.idx+"_dragger_horizontal")],a=n("#mCSBap_"+r.idx+"_container").find("iframe");a.length&&a.each(function(){n(this).bind("load",function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind("mousewheel."+c,function(n,t){h(n,t)})})});e.bind("mousewheel."+c,function(n,t){h(n,t)})}},rt={},l=function(t){var r=!1,i=!1,u=null;if(void 0===t?i="#empty":void 0!==n(t).attr("id")&&(i=n(t).attr("id")),i!==!1&&void 0!==rt[i])return rt[i];if(t){try{var f=t.contentDocument||t.contentWindow.document;u=f.body.innerHTML}catch(e){}r=null!==u}else{try{var f=top.document;u=f.body.innerHTML}catch(e){}r=null!==u}return i!==!1&&(rt[i]=r),r},lt=function(n){var t=this.find("iframe");if(t.length){var i=n?"auto":"none";t.css("pointer-events",i)}},si=function(i,r){var u=r.nodeName.toLowerCase(),f=i.data(t).opt.mouseWheel.disableOver;return n.inArray(u,f)>-1&&!(n.inArray(u,["select","textarea"])>-1&&!n(r).is(":focus"))},hi=function(){var s,h=n(this),f=h.data(t),r=t+"_"+f.idx,c=n("#mCSBap_"+f.idx+"_container"),l=c.parent(),a=n(".mCSBap_"+f.idx+"_scrollbar ."+i[12]);a.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(t){e=!0;n(t.target).hasClass("mCSBap_dragger")||(s=1)}).bind("touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(){e=!1}).bind("click."+r,function(t){if(s&&(s=0,n(t.target).hasClass(i[12])||n(t.target).hasClass("mCSBap_draggerRail"))){o(h);var r=n(this),e=r.find(".mCSBap_dragger");if(r.parent(".mCSBap_scrollTools_horizontal").length>0){if(!f.overflowed[1])return;var v="x",a=t.pageX>e.offset().left?-1:1,y=Math.abs(c[0].offsetLeft)-a*.9*l.width()}else{if(!f.overflowed[0])return;var v="y",a=t.pageY>e.offset().top?-1:1,y=Math.abs(c[0].offsetTop)-a*.9*l.height()}u(h,y.toString(),{dir:v,scrollEasing:"mcsEaseInOut"})}})},ci=function(){var i=n(this),s=i.data(t),e=s.opt,c=t+"_"+s.idx,r=n("#mCSBap_"+s.idx+"_container"),h=r.parent();r.bind("focusin."+c,function(){var t=n(document.activeElement),c=r.find(".mCustomScrollBox").length,s=0;t.is(e.advanced.autoScrollOnFocus)&&(o(i),clearTimeout(i[0]._focusTimeout),i[0]._focusTimer=c?(s+17)*c:0,i[0]._focusTimeout=setTimeout(function(){var n=[f(t)[0],f(t)[1]],o=[r[0].offsetTop,r[0].offsetLeft],c=[o[0]+n[0]>=0&&o[0]+n[0]<h.height()-t.outerHeight(!1),o[1]+n[1]>=0&&o[0]+n[1]<h.width()-t.outerWidth(!1)],l="yx"!==e.axis||c[0]||c[1]?"all":"none";"x"===e.axis||c[0]||u(i,n[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:l,dur:s});"y"===e.axis||c[1]||u(i,n[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:l,dur:s})},i[0]._focusTimer))})},li=function(){var u=n(this),i=u.data(t),f=t+"_"+i.idx,r=n("#mCSBap_"+i.idx+"_container").parent();r.bind("scroll."+f,function(){0===r.scrollTop()&&0===r.scrollLeft()||n(".mCSBap_"+i.idx+"_scrollbar").css("visibility","hidden")})},ai=function(){var f=n(this),r=f.data(t),o=r.opt,u=r.sequential,i=t+"_"+r.idx,s=".mCSBap_"+r.idx+"_scrollbar",h=n(s+">a");h.bind("contextmenu."+i,function(n){n.preventDefault()}).bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i+" mouseup."+i+" touchend."+i+" pointerup."+i+" MSPointerUp."+i+" mouseout."+i+" pointerout."+i+" MSPointerOut."+i+" click."+i,function(t){function i(n,t){u.scrollAmount=o.scrollButtons.scrollAmount;ut(f,n,t)}if(t.preventDefault(),yt(t)){var s=n(this).attr("class");switch(u.type=o.scrollButtons.scrollType,t.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===u.type)return;e=!0;r.tweenRunning=!1;i("on",s);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===u.type)return;e=!1;u.dir&&i("off",s);break;case"click":if("stepped"!==u.type||r.tweenRunning)return;i("on",s)}}})},vi=function(){function a(t){function l(n,t){s.type=r.keyboard.scrollType;s.scrollAmount=r.keyboard.scrollAmount;"stepped"===s.type&&i.tweenRunning||ut(e,n,t)}switch(t.type){case"blur":i.tweenRunning&&s.dir&&l("off",null);break;case"keydown":case"keyup":var c=t.keyCode?t.keyCode:t.which,a="on";if("x"!==r.axis&&(38===c||40===c)||"y"!==r.axis&&(37===c||39===c)){if((38===c||40===c)&&!i.overflowed[0]||(37===c||39===c)&&!i.overflowed[1])return;"keyup"===t.type&&(a="off");n(document.activeElement).is(v)||(t.preventDefault(),t.stopImmediatePropagation(),l(a,c))}else if(33===c||34===c){if((i.overflowed[0]||i.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){o(e);var y=34===c?-1:1;if("x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0])var p="x",w=Math.abs(f[0].offsetLeft)-y*.9*h.width();else var p="y",w=Math.abs(f[0].offsetTop)-y*.9*h.height();u(e,w.toString(),{dir:p,scrollEasing:"mcsEaseInOut"})}}else if((35===c||36===c)&&!n(document.activeElement).is(v)&&((i.overflowed[0]||i.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0])var p="x",w=35===c?Math.abs(h.width()-f.outerWidth(!1)):0;else var p="y",w=35===c?Math.abs(h.height()-f.outerHeight(!1)):0;u(e,w.toString(),{dir:p,scrollEasing:"mcsEaseInOut"})}}}var e=n(this),i=e.data(t),r=i.opt,s=i.sequential,c=t+"_"+i.idx,w=n("#mCSBap_"+i.idx),f=n("#mCSBap_"+i.idx+"_container"),h=f.parent(),v="input,textarea,select,datalist,keygen,[contenteditable='true']",y=f.find("iframe"),p=["blur."+c+" keydown."+c+" keyup."+c];y.length&&y.each(function(){n(this).bind("load",function(){l(this)&&n(this.contentDocument||this.contentWindow.document).bind(p[0],function(n){a(n)})})});w.attr("tabindex","0").bind(p[0],function(n){a(n)})},ut=function(r,f,e,s,h){function y(n){l.snapAmount&&(c.scrollAmount=l.snapAmount instanceof Array?"x"===c.dir[0]?l.snapAmount[1]:l.snapAmount[0]:l.snapAmount);var i="stepped"!==c.type,f=h?h:n?i?k/1.5:d:1e3/60,e=n?i?7.5:40:2.5,t=[Math.abs(p[0].offsetTop),Math.abs(p[0].offsetLeft)],o=[v.scrollRatio.y>10?10:v.scrollRatio.y,v.scrollRatio.x>10?10:v.scrollRatio.x],w="x"===c.dir[0]?t[1]+c.dir[1]*o[1]*e:t[0]+c.dir[1]*o[0]*e,b="x"===c.dir[0]?t[1]+c.dir[1]*parseInt(c.scrollAmount):t[0]+c.dir[1]*parseInt(c.scrollAmount),a="auto"!==c.scrollAmount?b:w,g=s?s:n?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",nt=!!n;return n&&17>f&&(a="x"===c.dir[0]?t[1]:t[0]),u(r,a.toString(),{dir:c.dir[0],scrollEasing:g,dur:f,onComplete:nt}),n?void(c.dir=!1):(clearTimeout(c.step),void(c.step=setTimeout(function(){y()},f)))}function b(){clearTimeout(c.step);a(c,"step");o(r)}var v=r.data(t),l=v.opt,c=v.sequential,p=n("#mCSBap_"+v.idx+"_container"),w="stepped"===c.type,k=l.scrollInertia<26?26:l.scrollInertia,d=l.scrollInertia<1?17:l.scrollInertia;switch(f){case"on":if(c.dir=[e===i[16]||e===i[15]||39===e||37===e?"x":"y",e===i[13]||e===i[15]||38===e||37===e?-1:1],o(r),tt(e)&&"stepped"===c.type)return;y(w);break;case"off":b();(w||v.tweenRunning&&c.dir)&&y(!0)}},ft=function(i){var u=n(this).data(t).opt,r=[];return"function"==typeof i&&(i=i()),i instanceof Array?r=i.length>1?[i[0],i[1]]:"x"===u.axis?[null,i[0]]:[i[0],null]:(r[0]=i.y?i.y:i.x||"x"===u.axis?null:i,r[1]=i.x?i.x:i.y||"y"===u.axis?null:i),"function"==typeof r[0]&&(r[0]=r[0]()),"function"==typeof r[1]&&(r[1]=r[1]()),r},at=function(i,r){if(null!=i&&"undefined"!=typeof i){var h=n(this),c=h.data(t),v=c.opt,u=n("#mCSBap_"+c.idx+"_container"),o=u.parent(),y=typeof i;r||(r="x"===v.axis?"x":"y");var p="x"===r?u.outerWidth(!1)-o.width():u.outerHeight(!1)-o.height(),l="x"===r?u[0].offsetLeft:u[0].offsetTop,w="x"===r?"left":"top";switch(y){case"function":return i();case"object":var e=i.jquery?i:n(i);return e.length?"x"===r?f(e)[1]:f(e)[0]:void 0;case"string":case"number":if(tt(i))return Math.abs(i);if(-1!==i.indexOf("%"))return Math.abs(p*parseInt(i)/100);if(-1!==i.indexOf("-="))return Math.abs(l-parseInt(i.split("-=")[1]));if(-1!==i.indexOf("+=")){var a=l+parseInt(i.split("+=")[1]);return a>=0?0:Math.abs(a)}if(-1!==i.indexOf("px")&&tt(i.split("px")[0]))return Math.abs(i.split("px")[0]);if("top"===i||"left"===i)return 0;if("bottom"===i)return Math.abs(o.height()-u.outerHeight(!1));if("right"===i)return Math.abs(o.width()-u.outerWidth(!1));if("first"===i||"last"===i){var e=u.find(":"+i);return"x"===r?f(e)[1]:f(e)[0]}return n(i).length?"x"===r?f(n(i))[1]:f(n(i))[0]:(u.css(w,i),void s.update.call(null,h[0]))}}},et=function(r){function c(){return clearTimeout(e[0].autoUpdate),0===o.parents("html").length?void(o=null):void(e[0].autoUpdate=setTimeout(function(){return f.advanced.updateOnSelectorChange&&(u.poll.change.n=v(),u.poll.change.n!==u.poll.change.o)?(u.poll.change.o=u.poll.change.n,void h(3)):f.advanced.updateOnContentResize&&(u.poll.size.n=o[0].scrollHeight+o[0].scrollWidth+e[0].offsetHeight+o[0].offsetHeight+o[0].offsetWidth,u.poll.size.n!==u.poll.size.o)?(u.poll.size.o=u.poll.size.n,void h(1)):!f.advanced.updateOnImageLoad||"auto"===f.advanced.updateOnImageLoad&&"y"===f.axis||(u.poll.img.n=e.find("img").length,u.poll.img.n===u.poll.img.o)?void((f.advanced.updateOnSelectorChange||f.advanced.updateOnContentResize||f.advanced.updateOnImageLoad)&&c()):(u.poll.img.o=u.poll.img.n,void e.find("img").each(function(){l(this)}))},f.advanced.autoUpdateTimeout))}function l(t){function u(n,t){return function(){return t.apply(n,arguments)}}function f(){this.onload=null;n(t).addClass(i[2]);h(2)}if(n(t).hasClass(i[2]))return void h();var r=new Image;r.onload=u(r,f);r.src=t.src}function v(){f.advanced.updateOnSelectorChange===!0&&(f.advanced.updateOnSelectorChange="*");var n=0,t=e.find(f.advanced.updateOnSelectorChange);return f.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){n+=this.offsetHeight+this.offsetWidth}),n}function h(n){clearTimeout(e[0].autoUpdate);s.update.call(null,o[0],n)}var o=n(this),u=o.data(t),f=u.opt,e=n("#mCSBap_"+u.idx+"_container");return r?(clearTimeout(e[0].autoUpdate),void a(e[0],"autoUpdate")):void c()},yi=function(n,t,i){return Math.round(n/t)*t-i},o=function(i){var r=i.data(t),u=n("#mCSBap_"+r.idx+"_container,#mCSBap_"+r.idx+"_container_wrapper,#mCSBap_"+r.idx+"_dragger_vertical,#mCSBap_"+r.idx+"_dragger_horizontal");u.each(function(){pi.call(this)})},u=function(i,r,u){function h(n){return f&&e.callbacks[n]&&"function"==typeof e.callbacks[n]}function it(){return[e.callbacks.alwaysTriggerOffsets||w>=l[0]+v,e.callbacks.alwaysTriggerOffsets||-y>=w]}function a(){var n=[o[0].offsetTop,o[0].offsetLeft],t=[c[0].offsetTop,c[0].offsetLeft],r=[o.outerHeight(!1),o.outerWidth(!1)],f=[p.height(),p.width()];i[0].mcs={content:o,top:n[0],left:n[1],draggerTop:t[0],draggerLeft:t[1],topPct:Math.round(100*Math.abs(n[0])/(Math.abs(r[0])-f[0])),leftPct:Math.round(100*Math.abs(n[1])/(Math.abs(r[1])-f[1])),direction:u.dir}}var f=i.data(t),e=f.opt,rt={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:e.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},u=n.extend(rt,u),k=[u.dur,u.drag?0:u.dur],p=n("#mCSBap_"+f.idx),o=n("#mCSBap_"+f.idx+"_container"),b=o.parent(),g=e.callbacks.onTotalScrollOffset?ft.call(i,e.callbacks.onTotalScrollOffset):[0,0],nt=e.callbacks.onTotalScrollBackOffset?ft.call(i,e.callbacks.onTotalScrollBackOffset):[0,0];if(f.trigger=u.trigger,0===b.scrollTop()&&0===b.scrollLeft()||(n(".mCSBap_"+f.idx+"_scrollbar").css("visibility","visible"),b.scrollTop(0).scrollLeft(0)),"_resetY"!==r||f.contentReset.y||(h("onOverflowYNone")&&e.callbacks.onOverflowYNone.call(i[0]),f.contentReset.y=1),"_resetX"!==r||f.contentReset.x||(h("onOverflowXNone")&&e.callbacks.onOverflowXNone.call(i[0]),f.contentReset.x=1),"_resetY"!==r&&"_resetX"!==r){if(!f.contentReset.y&&i[0].mcs||!f.overflowed[0]||(h("onOverflowY")&&e.callbacks.onOverflowY.call(i[0]),f.contentReset.x=null),!f.contentReset.x&&i[0].mcs||!f.overflowed[1]||(h("onOverflowX")&&e.callbacks.onOverflowX.call(i[0]),f.contentReset.x=null),e.snapAmount){var ut=e.snapAmount instanceof Array?"x"===u.dir?e.snapAmount[1]:e.snapAmount[0]:e.snapAmount;r=yi(r,ut,e.snapOffset)}switch(u.dir){case"x":var c=n("#mCSBap_"+f.idx+"_dragger_horizontal"),tt="left",w=o[0].offsetLeft,l=[p.width()-o.outerWidth(!1),c.parent().width()-c.width()],s=[r,0===r?0:r/f.scrollRatio.x],v=g[1],y=nt[1],et=v>0?v/f.scrollRatio.x:0,ot=y>0?y/f.scrollRatio.x:0;break;case"y":var c=n("#mCSBap_"+f.idx+"_dragger_vertical"),tt="top",w=o[0].offsetTop,l=[p.height()-o.outerHeight(!1),c.parent().height()-c.height()],s=[r,0===r?0:r/f.scrollRatio.y],v=g[0],y=nt[0],et=v>0?v/f.scrollRatio.y:0,ot=y>0?y/f.scrollRatio.y:0}s[1]<0||0===s[0]&&0===s[1]?s=[0,0]:s[1]>=l[1]?s=[l[0],l[1]]:s[0]=-s[0];i[0].mcs||(a(),h("onInit")&&e.callbacks.onInit.call(i[0]));clearTimeout(o[0].onCompleteTimeout);vt(c[0],tt,Math.round(s[1]),k[1],u.scrollEasing);!f.tweenRunning&&(0===w&&s[0]>=0||w===l[0]&&s[0]<=l[0])||vt(o[0],tt,Math.round(s[0]),k[0],u.scrollEasing,u.overwrite,{onStart:function(){u.callbacks&&u.onStart&&!f.tweenRunning&&(h("onScrollStart")&&(a(),e.callbacks.onScrollStart.call(i[0])),f.tweenRunning=!0,d(c),f.cbOffsets=it())},onUpdate:function(){u.callbacks&&u.onUpdate&&h("whileScrolling")&&(a(),e.callbacks.whileScrolling.call(i[0]))},onComplete:function(){if(u.callbacks&&u.onComplete){"yx"===e.axis&&clearTimeout(o[0].onCompleteTimeout);var n=o[0].idleTimer||0;o[0].onCompleteTimeout=setTimeout(function(){h("onScroll")&&(a(),e.callbacks.onScroll.call(i[0]));h("onTotalScroll")&&s[1]>=l[1]-et&&f.cbOffsets[0]&&(a(),e.callbacks.onTotalScroll.call(i[0]));h("onTotalScrollBack")&&s[1]<=ot&&f.cbOffsets[1]&&(a(),e.callbacks.onTotalScrollBack.call(i[0]));f.tweenRunning=!1;o[0].idleTimer=0;d(c,"hide")},n)}}})}},vt=function(n,t,i,r,u,f,e){function a(){o.stop||(s||d.call(),s=w()-tt,v(),s>=o.time&&(o.time=s>o.time?s+h-(s-o.time):s+h-1,o.time<s+1&&(o.time=s+1)),o.time<r?o.id=c(a):nt.call())}function v(){r>0?(o.currVal=k(o.time,l,it,r,u),y[t]=Math.round(o.currVal)+"px"):y[t]=i+"px";g.call()}function p(){h=1e3/60;o.time=s+h;c=window.requestAnimationFrame?window.requestAnimationFrame:function(n){return v(),setTimeout(n,.01)};o.id=c(a)}function b(){null!=o.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(o.id):clearTimeout(o.id),o.id=null)}function k(n,t,i,r,u){switch(u){case"linear":case"mcsLinear":return i*n/r+t;case"mcsLinearOut":return n/=r,n--,i*Math.sqrt(1-n*n)+t;case"easeInOutSmooth":return n/=r/2,1>n?i/2*n*n+t:(n--,-i/2*(n*(n-2)-1)+t);case"easeInOutStrong":return n/=r/2,1>n?i/2*Math.pow(2,10*(n-1))+t:(n--,i/2*(-Math.pow(2,-10*n)+2)+t);case"easeInOut":case"mcsEaseInOut":return n/=r/2,1>n?i/2*n*n*n+t:(n-=2,i/2*(n*n*n+2)+t);case"easeOutSmooth":return n/=r,n--,-i*(n*n*n*n-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*n/r)+1)+t;case"easeOut":case"mcsEaseOut":default:var f=(n/=r)*n,e=f*n;return t+i*(.499999999999997*e*f+-2.5*f*f+5.5*e+-6.5*f+4*n)}}n._mTween||(n._mTween={top:{},left:{}});var h,c,e=e||{},d=e.onStart||function(){},g=e.onUpdate||function(){},nt=e.onComplete||function(){},tt=w(),s=0,l=n.offsetTop,y=n.style,o=n._mTween[t];"left"===t&&(l=n.offsetLeft);var it=i-l;o.stop=0;"none"!==f&&b();p()},w=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},pi=function(){var n=this;n._mTween||(n._mTween={top:{},left:{}});for(var r=["top","left"],i=0;i<r.length;i++){var t=r[i];n._mTween[t].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(n._mTween[t].id):clearTimeout(n._mTween[t].id),n._mTween[t].id=null,n._mTween[t].stop=1)}},a=function(n,t){try{delete n[t]}catch(i){n[t]=null}},yt=function(n){return!(n.which&&1!==n.which)},nt=function(n){var t=n.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},tt=function(n){return!isNaN(parseFloat(n))&&isFinite(n)},f=function(n){var t=n.parents(".mCSBap_container");return[n.offset().top-t.offset().top,n.offset().left-t.offset().left]},wi=function(){function t(){var t=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var n=0;n<t.length;n++)if(t[n]+"Hidden"in document)return t[n]+"Hidden";return null}var n=t();return n?document[n]:!1};n.fn[c]=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist"):s.init.apply(this,arguments)};n[c]=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void n.error("Method "+t+" does not exist"):s.init.apply(this,arguments)};n[c].defaults=ot;window[c]=!0;n(window).bind("load",function(){n(it)[c]();n.extend(n.expr[":"],{mcsInView:n.expr[":"].mcsInView||function(t){var e,r,i=n(t),u=i.parents(".mCSBap_container");if(u.length)return e=u.parent(),r=[u[0].offsetTop,u[0].offsetLeft],r[0]+f(i)[0]>=0&&r[0]+f(i)[0]<e.height()-i.outerHeight(!1)&&r[1]+f(i)[1]>=0&&r[1]+f(i)[1]<e.width()-i.outerWidth(!1)},mcsInSight:n.expr[":"].mcsInSight||function(t,i,r){var e,u,o,s,h=n(t),c=h.parents(".mCSBap_container"),l="exact"===r[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(c.length)return e=[h.outerHeight(!1),h.outerWidth(!1)],o=[c[0].offsetTop+f(h)[0],c[0].offsetLeft+f(h)[1]],u=[c.parent()[0].offsetHeight,c.parent()[0].offsetWidth],s=[e[0]<u[0]?l[0]:l[1],e[1]<u[1]?l[0]:l[1]],o[0]-u[0]*s[0][0]<0&&o[0]+e[0]-u[0]*s[0][1]>=0&&o[1]-u[1]*s[1][0]<0&&o[1]+e[1]-u[1]*s[1][1]>=0},mcsOverflow:n.expr[":"].mcsOverflow||function(i){var r=n(i).data(t);if(r)return r.overflowed[0]||r.overflowed[1]}})})})}):console.log("ASP: scrollbar detected, skipping loading");
  /*! Ajax Search Lite 4.6 js */
  (function(n){var t,c=!0,s={init:function(t,i){var r=this;this.elem=i;this.$elem=n(i);r.searching=!1;r.o=n.extend({blocking:!1},t);r.n={};r.n.container=n(this.elem);r.o.rid=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.o.id=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.n.probox=n(".probox",r.n.container);r.n.proinput=n(".proinput",r.n.container);r.n.text=n(".proinput input.orig",r.n.container);r.n.textAutocomplete=n(".proinput input.autocomplete",r.n.container);r.n.loading=n(".proinput .loading",r.n.container);r.n.proloading=n(".proloading",r.n.container);r.n.proclose=n(".proclose",r.n.container);r.n.promagnifier=n(".promagnifier",r.n.container);r.n.prosettings=n(".prosettings",r.n.container);r.n.searchsettings=n("#ajaxsearchlitesettings"+r.o.rid);r.n.resultsDiv=n("#ajaxsearchliteres"+r.o.rid);r.n.hiddenContainer=n("#asl_hidden_data");r.n.aslItemOverlay=n(".asl_item_overlay",r.n.hiddenContainer);r.resizeTimeout=null;r.n.showmore=n(".showmore",r.n.resultsDiv);r.n.items=n(".item",r.n.resultsDiv);r.n.results=n(".results",r.n.resultsDiv);r.n.resdrg=n(".resdrg",r.n.resultsDiv);r.il={columns:3,itemsPerPage:6};r.firstClick=!0;r.post=null;r.postAuto=null;r.cleanUp();r.n.textAutocomplete.val("");r.o.resultitemheight=parseInt(r.o.resultitemheight);r.scroll={};r.savedScrollTop=0;r.savedContainerTop=0;r.is_scroll=typeof n.fn.mCustScr!="undefined";typeof ASL.scrollbar!="undefined"&&ASL.scrollbar==0&&(r.is_scroll=!1);r.settScroll=null;r.n.resultsAppend=n("#wpdreams_asl_results_"+r.o.id);r.currentPage=1;r.isotopic=null;r.lastSuccesfulSearch="";r.lastSearchData={};r.triggerPrevState=!1;r.animation="bounceIn";switch(r.o.resultstype){case"vertical":r.animation=r.o.vresultanimation;break;default:r.animation=r.o.hresultanimation}return r.filterFns={number:function(){for(var t=n(this).parent();!t.hasClass("isotopic");)t=t.parent();var i=n(this).attr("data-itemnum"),u=r.currentPage,f=r.il.itemsPerPage;return parseInt(i,10)<f*u&&parseInt(i,10)>=f*(u-1)}},r.disableMobileScroll=!1,r.n.searchsettings.detach().appendTo("body"),r.o.resultsposition=="hover"?r.n.resultsDiv.detach().appendTo("body"):r.n.resultsAppend.length>0&&r.n.resultsDiv.detach().appendTo(r.n.resultsAppend),typeof ASL.resHTML=="undefined"&&(ASL.resHTML=r.n.resultsDiv.html()),typeof ASL.setHTML=="undefined"&&(ASL.setHTML=r.n.searchsettings.html()),n("fieldset",r.n.searchsettings).each(function(){n(".asl_option:not(.hiddend)",this).last().addClass("asl-o-last")}),ASL.js_retain_popstate==1&&r.initPrevState(),r.createVerticalScroll(),a()&&r.n.container.addClass("asl_msie"),r.initSettingsAnimations(),r.initResultsAnimations(),r.initEvents(),r.initAutop(),r.initEtc(),this},initPrevState:function(){var i=this;c&&t==null&&(t=localStorage.getItem("asl-"+r.encode(location.href)),t!=null&&(t=JSON.parse(t),t.settings=r.decode(t.settings)));t!=null&&typeof t.id!="undefined"&&t.id==i.o.id&&(t.phrase!=""&&(i.triggerPrevState=!0,i.n.text.val(t.phrase)),o(n("form",i.n.searchsettings))!=t.settings&&(i.triggerPrevState=!0,o(n("form",i.n.searchsettings),t.settings)));localStorage.removeItem("asl-"+r.encode(location.href));i.n.resultsDiv.on("click",".results .item",function(){var t=i.n.text.val();if(t!=""||i.settingsChanged){var u={id:i.o.id,phrase:t,settings:r.encode(o(n("form",i.n.searchsettings)))};localStorage.setItem("asl-"+r.encode(location.href),JSON.stringify(u))}})},duplicateCheck:function(){var i=this,t={};n("div[id*=ajaxsearchlite]").each(function(){t.hasOwnProperty(this.id)?n(this).remove():t[this.id]="true"})},analytics:function(n){var t=this,i=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:null;window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var r=t.o.homeurl.replace(window.location.origin,"");if(i!=null&&t.o.analytics&&t.o.analyticsString!=""){var u=t.o.analyticsString.replace("{asl_term}",n).replace("{asp_term}",n);i("send","pageview",{page:r+u,title:"Ajax Search"})}},createVerticalScroll:function(){var t=this;t.is_scroll&&(t.scroll=t.n.results.mCustScr({contentTouchScroll:!0,scrollButtons:{enable:!0},callbacks:{onScroll:function(){if(!i()){var s=parseInt(n(".mCSBap_container",t.n.results).position().top),h=n(".mCSBap_container .resdrg").children(),f=0,o=3e3,u=4e3,c=1e4,e=1e4,r=null;h.each(function(){u=Math.abs(Math.abs(s)-f);u<o&&(c=u,e=f,r=n(this));f+=n(this).outerHeight(!0);o=u});r.hasClass("group")&&(e=e+(r.outerHeight(!0)-r.outerHeight(!1)));t.scroll.mCustScr("scrollTo",r,{scrollInertia:200,callbacks:!1})}}}}),n("a.mCSBap_buttonUp").text("Scroll up the results"),n("a.mCSBap_buttonDown").text("Scroll down the results"))},initEvents:function(){var t=this;if(i()&&e())t.n.text.on("touchstart",function(){t.savedScrollTop=n(window).scrollTop();t.savedContainerTop=t.n.container.offset().top});t.n.text.click(function(){n(this).focus()});t.n.text.on("focus input",function(){t.searching||(n(this).val()!=""?t.n.proclose.css("display","block"):t.n.proclose.css({display:"none"}))});n(t.n.text.parent()).submit(function(n){if(n.preventDefault(),i())if(t.o.redirect_on_enter){var r=jQuery.Event("keyup");r.keyCode=r.which=13;t.n.text.trigger(r)}else t.o.redirectEnterTo=="ajax_search"&&(t.search(),document.activeElement.blur());else t.o.redirectEnterTo=="ajax_search"&&t.search()});t.n.text.click(function(){t.firstClick&&(n(this).val(""),t.firstClick=!1)});t.n.resultsDiv.css({opacity:0});n(document).bind("click touchend",function(){(t.hideSettings(),t.opened!=!1&&t.o.closeOnDocClick==1)&&t.hideResults()});t.n.proclose.on("click touchend",function(){t.n.text.val("");t.n.textAutocomplete.val("");t.hideResults();t.n.text.focus()});n(t.elem).bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.resultsDiv.bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.searchsettings.bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.prosettings.on("click",function(){t.n.prosettings.data("opened")==0?t.showSettings():t.hideSettings()});var f=t.n.container.parents().filter(function(){return n(this).css("position")=="fixed"});if((f.length>0||t.n.container.css("position")=="fixed")&&(t.n.resultsDiv.css("position")=="absolute"&&t.n.resultsDiv.css("position","fixed"),t.n.resultsDiv.css("z-index",99999999999),t.o.blocking||t.n.searchsettings.css("position","fixed")),i())n(window).on("orientationchange",function(){t.orientationChange();setTimeout(function(){t.orientationChange()},800)});else{var r;n(window).on("resize",function(){clearTimeout(r);r=setTimeout(function(){t.resize()},100)})}var u;n(window).on("scroll",function(){clearTimeout(u);u=setTimeout(function(){t.scrolling(!1)},400)});e()&&i()&&l()&&parseInt(t.n.text.css("font-size"))<16&&(t.n.text.data("fontSize",t.n.text.css("font-size")).css("font-size","16px"),t.n.textAutocomplete.css("font-size","16px"),n("<style>#ajaxsearchlite"+t.o.rid+" input.orig::-webkit-input-placeholder{font-size: 16px !important;}<\/style>").appendTo("head"));t.initNavigationEvent();t.initMagnifierEvent();t.initAutocompleteEvent();t.initFacetEvents()},initAutop:function(){var n=this;if(t!=null&&n.triggerPrevState)return n.search(),t=null,!1},initEtc:function(){var t=this,i=null;n("div.asl_option",t.n.searchsettings).on("mouseup touchend",function(r){if(r.preventDefault(),r.stopImmediatePropagation(),t.dragging)return!1;n('input[type="checkbox"]',this).prop("checked",!n('input[type="checkbox"]',this).prop("checked"));clearTimeout(i);var u=this;i=setTimeout(function(){n('input[type="checkbox"]',u).trigger("asl_chbx_change")},50)});n("div.asl_option label",t.n.searchsettings).click(function(n){n.preventDefault()})},initNavigationEvent:function(){var t=this;n(t.n.resultsDiv).on("mouseenter",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered");n(this).addClass("hovered")});n(t.n.resultsDiv).on("mouseleave",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered")});n(document).keydown(function(i){if(window.event)var r=window.event.keyCode,u=window.event.type;else if(i)var r=i.which,u=i.type;n(".item",t.n.resultsDiv).length>0&&t.n.resultsDiv.css("display")!="none"&&(r==40&&(i.stopPropagation(),i.preventDefault(),t.n.text.blur(),t.post!=null&&t.post.abort(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).first().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").next().next(".item").addClass("hovered"),t.is_scroll&&t.scroll.mCustScr("scrollTo",".resdrg .item.hovered",{scrollInertia:200,callbacks:!1})),r==38&&(i.stopPropagation(),i.preventDefault(),t.n.text.blur(),t.post!=null&&t.post.abort(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).last().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").prev().prev(".item").addClass("hovered"),t.is_scroll&&t.scroll.mCustScr("scrollTo",".resdrg .item.hovered",{scrollInertia:200,callbacks:!1})),r==13&&n(".item.hovered",t.n.resultsDiv).length>0&&(i.stopPropagation(),i.preventDefault(),n(".item.hovered a.asl_res_url",t.n.resultsDiv).get(0).click()))})},initMagnifierEvent:function(){var t=this,i,u,r=!1;t.n.text.on("keyup",function(f){if(window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):f&&(t.keycode=f.which,t.ktype=f.type),t.keycode==13){if(clearTimeout(u),u=setTimeout(function(){r=!1},300),r)return!1;r=!0}var e=n(this).hasClass("orig");if(t.n.text.val().length>=t.o.charcount&&e&&t.ktype=="keyup"&&t.keycode==13){if(t.o.redirect_on_enter==1)t.o.redirectEnterTo!="first_result"?t.doRedirectToResults(t.ktype):t.search();else{if(t.o.redirectEnterTo=="nothing")return!1;n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()==t.lastSuccesfulSearch&&t.resultsOpened||t.search()}clearTimeout(i)}});t.n.promagnifier.add(t.n.text).bind("click input",function(r){window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):r&&(t.keycode=r.which,t.ktype=r.type);var u=n(this).hasClass("orig");if(t.n.text.val().length<t.o.charcount){t.n.proloading.css("display","none");t.hideResults();t.post!=null&&t.post.abort();clearTimeout(i);return}if(t.n.text.val().length>=t.o.charcount&&!u&&t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo!="first_result"){t.doRedirectToResults(t.ktype);clearTimeout(i);return}if((!(t.keycode>=37)||!(t.keycode<=40))&&(!(t.keycode>=112)||!(t.keycode<=123))){if(u&&t.ktype=="click"||t.keycode==32){n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()==t.lastSuccesfulSearch&&(t.n.proclose.css("display","block"),t.resultsOpened||t.showResults());return}n(this).hasClass("orig")&&t.ktype=="click"||(t.o.trigger_on_click!=0||t.ktype!="click")&&(t.o.triggerontype!=0||t.ktype!="input")&&(!u||t.ktype!="input"||t.o.redirectEnterTo!="nothing")&&(u||t.ktype!="click"||t.o.redirectClickTo!="nothing")&&(t.post!=null&&t.post.abort(),clearTimeout(i),t.hideLoader(),i=setTimeout(function(){if(n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()!=t.lastSuccesfulSearch)t.search();else{if(t.n.proclose.css("display","block"),t.isRedirectToFirstResult())return t.doRedirectToFirstResult(),!1;t.resultsOpened||t.showResults()}},250))}})},initFacetEvents:function(){var t=this,i=null;if(t.o.trigger_on_facet_change==1){n("input[type!=checkbox], select",t.n.searchsettings).on("change slidechange",function(){t.n.text.val().length<t.o.charcount||(t.post!=null&&t.post.abort(),clearTimeout(i),i=setTimeout(function(){t.search()},50))});n("input[type=checkbox]",t.n.searchsettings).on("asl_chbx_change",function(){t.n.text.val().length<t.o.charcount||(t.post!=null&&t.post.abort(),clearTimeout(i),i=setTimeout(function(){t.search()},50))})}},isRedirectToFirstResult:function(){var t=this;return n(".asl_res_url",t.n.resultsDiv).length>0&&(t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo=="first_result"||t.o.redirect_on_enter==1&&(t.ktype=="input"||t.ktype=="keyup")&&t.keycode==13&&t.o.redirectEnterTo=="first_result")?!0:!1},doRedirectToFirstResult:function(){var t=this,i;return i=t.ktype=="click"?t.o.redirectClickLoc:t.o.redirectEnterLoc,i=="same"?location.href=n(n(".asl_res_url",t.n.resultsDiv).get(0)).attr("href"):h(n(n(".asl_res_url",t.n.resultsDiv).get(0)).attr("href")),t.hideLoader(),t.hideResults(),!1},doRedirectToResults:function(t){var i=this,s=i.ktype=="click"?i.o.redirectClickTo:i.o.redirectEnterTo,e=t=="click"?i.o.redirectClickLoc:i.o.redirectEnterLoc;if(s=="results_page")var o="?s="+u(i.n.text.val());else if(s=="woo_results_page")var o="?post_type=product&s="+u(i.n.text.val());else var o=i.o.redirect_url.replace("{phrase}",u(i.n.text.val()));if(i.o.overridewpdefault)if(i.o.override_method=="post")f(i.o.homeurl+o,"post",{asl_active:1,p_asl_data:n("form",i.n.searchsettings).serialize()},e);else{var c=i.o.homeurl+o+"&asl_active=1&p_asid="+i.o.id+"&p_asl_data="+r.encode(n("form",i.n.searchsettings).serialize());e=="same"?location.href=c:h(c)}else f(i.o.homeurl+o,"post",{np_asl_data:n("form",i.n.searchsettings).serialize()},e);i.n.proloading.css("display","none");i.hideLoader();i.hideResults();i.post!=null&&i.post.abort()},destroy:function(){return this.each(function(){var t=n.extend({},this,s);n(window).unbind(t)})},searchfor:function(t){n(".proinput input",this).val(t).trigger("keyup")},initAutocompleteEvent:function(){var t=this;t.o.autocomplete.enabled!=1||i()||t.n.text.keyup(function(i){window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):i&&(t.keycode=i.which,t.ktype=i.type);var r=39;n("body").hasClass("rtl")&&(r=37);t.keycode==r&&t.n.textAutocomplete.val()!=""?(i.preventDefault(),t.n.text.val(t.n.textAutocomplete.val()),t.post!=null&&t.post.abort(),t.search()):(t.postAuto!=null&&t.postAuto.abort(),t.autocompleteGoogleOnly())})},autocompleteGoogleOnly:function(){var t=this,i=t.n.text.val();if(t.n.text.val()==""){t.n.textAutocomplete.val("");return}var r=t.n.textAutocomplete.val();(r==""||r.indexOf(i)!=0)&&(t.n.textAutocomplete.val(""),n.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:i,hl:t.o.autocomplete.lang,nolabels:"t",client:"hp",ds:""},success:function(r){r[1].length>0&&(response=r[1][0][0].replace(/(<([^>]+)>)/ig,""),response=n("<textarea />").html(response).text(),response=response.substr(i.length),t.n.textAutocomplete.val(i+response))}}))},search:function(){var t=this;if((!t.searching||!0)&&!(t.n.text.val().length<t.o.charcount)){t.searching=!0;t.n.proloading.css({display:"block"});t.n.proclose.css({display:"none"});var i={action:"ajaxsearchlite_search",aslp:t.n.text.val(),asid:t.o.id,options:n("form",t.n.searchsettings).serialize()};if(JSON.stringify(i)===JSON.stringify(t.lastSearchData))return(t.resultsOpened||t.showResults(),t.hideLoader(),t.isRedirectToFirstResult())?(t.doRedirectToFirstResult(),!1):!1;t.post=n.post(ASL.ajaxurl,i,function(e){if(e=e.replace(/^\s*[\r\n]/gm,""),e=e.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1],t.n.resdrg.html(""),t.n.resdrg.html(e),n(".asl_keyword",t.n.resdrg).bind("click",function(){t.n.text.val(n(this).html());n("input.orig",t.n.container).val(n(this).html()).keydown();n("form",t.n.container).trigger("submit","ajax");t.search()}),t.n.items=n(".item",t.n.resultsDiv),t.analytics(t.n.text.val()),t.isRedirectToFirstResult())return t.doRedirectToFirstResult(),!1;if(t.hideLoader(),t.showResults(),t.scrollToResults(),t.lastSuccesfulSearch=n("form",t.n.searchsettings).serialize()+t.n.text.val().trim(),t.lastSearchData=i,t.n.items.length==0)t.n.showmore!=null&&t.n.showmore.css("display","none");else if(t.n.showmore!=null){t.n.showmore.css("display","block");n("a",t.n.showmore).off();n("a",t.n.showmore).on("click",function(){var e=t.o.redirectClickTo,i="?s="+u(t.n.text.val());i=e=="results_page"?"?s="+u(t.n.text.val()):e=="woo_results_page"?"?post_type=product&s="+u(t.n.text.val()):t.o.redirect_url.replace("{phrase}",u(t.n.text.val()));t.o.overridewpdefault?t.o.override_method=="post"?f(t.o.homeurl+i,"post",{asl_active:1,p_asl_data:n("form",t.n.searchsettings).serialize()}):location.href=t.o.homeurl+i+"&asl_active=1&p_asid="+t.o.id+"&p_asl_data="+r.encode(n("form",t.n.searchsettings).serialize()):f(t.o.homeurl+i,"post",{np_asl_data:n("form",t.n.searchsettings).serialize()})})}},"text").fail(function(i,r){i.aborted||r=="abort"||(t.n.resdrg.html(""),t.n.resdrg.html('<div class="asp_nores">The request failed. Please check your connection! Status: '+i.status+"<\/div>"),t.n.items=n(".item",t.n.resultsDiv),t.hideLoader(),t.showResults(),t.scrollToResults())})}},showLoader:function(){var n=this;n.n.proloading.css({display:"block"})},hideLoader:function(){var n=this;n.n.proloading.css({display:"none"});n.n.results.css("display","")},showResultsBox:function(){var n=this;n.n.resultsDiv.css({display:"block",height:"auto"});n.n.items.addClass(n.animationOpacity);n.fixResultsPosition(!0);n.n.resultsDiv.css(n.resAnim.showCSS);n.n.resultsDiv.removeClass(n.resAnim.hideClass).addClass(n.resAnim.showClass)},showResults:function(){var n=this;switch(n.o.resultstype){case"vertical":n.showVerticalResults();break;default:n.showHorizontalResults()}n.hideLoader();n.n.proclose.css({display:"block"});n.n.showmore!=null&&(n.n.items.length>0?n.n.showmore.css({display:"block"}):n.n.showmore.css({display:"none"}));n.resultsOpened=!0},hideResults:function(){var n=this;if(!n.resultsOpened)return!1;n.n.resultsDiv.removeClass(n.resAnim.showClass).addClass(n.resAnim.hideClass);setTimeout(function(){n.n.resultsDiv.css(n.resAnim.hideCSS)},n.resAnim.duration);n.n.proclose.css({display:"none"});n.n.showmore!=null&&n.n.showmore.css({display:"none"});i()&&document.activeElement.blur();n.resultsOpened=!1},scrollToResults:function(){if(($this=this,this.o.scrollToResults==1)&&!this.$elem.parent().hasClass("asl_preview_data")){if($this.o.resultsposition=="hover")var t=$this.n.probox.offset().top-20;else var t=$this.n.resultsDiv.offset().top-20;n("#wpadminbar").length>0&&(t-=n("#wpadminbar").height());t=t<0?0:t;n("body, html").animate({scrollTop:t},{duration:500})}},createGroup:function(n){return"<div class='group'>"+n+"<\/div>"},showVerticalResults:function(){var t=this;if(t.showResultsBox(),t.n.items.length>0){var u=t.n.items.length<t.o.itemscount?t.n.items.length:t.o.itemscount,e=n(".group",t.n.resultsDiv);if(t.n.items.length<=t.o.itemscount)t.n.results.css({height:"auto"});else{t.n.results.css({height:30});t.is_scroll&&t.scroll.mCustScr("update");t.resize();var i=0,r=0;t.n.items.each(function(){r+=n(this).outerHeight(!0);i++});i=i<1?1:i;r=r/i*u;t.n.results.css({height:r})}if(window.sscroll=t.scroll,t.is_scroll&&(t.scroll.mCustScr("disable",!0),t.scroll.mCustScr("update")),t.resize(),t.is_scroll&&t.scroll.mCustScr("scrollTo",0),t.o.highlight==1){var f=t.o.highlightwholewords==1?!0:!1;n("div.item",t.n.resultsDiv).highlight(t.n.text.val().split(" "),{element:"span",className:"highlighted",wordsOnly:f})}}if(t.resize(),t.n.items.length==0){var r=n(".nores",t.n.results).outerHeight(!0)>t.o.resultitemheight?t.o.resultitemheight:n(".nores",t.n.results).outerHeight(!0);t.is_scroll?(t.n.results.css({height:11110}),t.scroll.mCustScr("update"),t.n.results.css({height:"auto"})):t.n.results.css({height:"auto"})}t.is_scroll||t.n.results.css({overflowY:"auto"});t.addAnimation();t.fixResultsPosition(!0);t.searching=!1},hideVerticalResults:function(){var t=this;t.disableMobileScroll=!1;t.n.resultsDiv.animate({opacity:0,height:0},{duration:120,complete:function(){n(this).css({visibility:"hidden",display:"none"})}})},addAnimation:function(){var i=this,t=0,r=1;i.n.items.each(function(){var u=this;setTimeout(function(){n(u).addClass(i.animation)},t);t=t+60;r++})},removeAnimation:function(){var t=this;t.n.items.each(function(){var i=this;n(i).removeClass(t.animation)})},initSettingsAnimations:function(){var n=this,t=300;n.settAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":t},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:t};n.n.searchsettings.css({"-webkit-animation-duration":n.settAnim.duration+"ms","animation-duration":n.settAnim.duration+"ms"})},initResultsAnimations:function(){var t=this,n=300;t.resAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":n},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:n};t.n.resultsDiv.css({"-webkit-animation-duration":n+"ms","animation-duration":n+"ms"})},showSettings:function(){var t=this;t.n.searchsettings.css(t.settAnim.showCSS);t.n.searchsettings.removeClass(t.settAnim.hideClass).addClass(t.settAnim.showClass);t.settScroll==null&&t.is_scroll&&(t.settScroll=n(".asl_sett_scroll",t.n.searchsettings).mCustScr({contentTouchScroll:!0}));t.n.prosettings.data("opened",1);t.fixSettingsPosition(!0)},hideSettings:function(){var n=this;n.n.searchsettings.removeClass(n.settAnim.showClass).addClass(n.settAnim.hideClass);setTimeout(function(){n.n.searchsettings.css(n.settAnim.hideCSS)},n.settAnim.duration);n.n.prosettings.data("opened",0)},cleanUp:function(){var t=this;n(".searchsettings",t.n.container).length>0&&(n("body>#ajaxsearchlitesettings"+t.o.rid).remove(),n("body>#ajaxsearchliteres"+t.o.rid).remove())},orientationChange:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},resize:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},scrolling:function(n){var t=this;t.fixSettingsPosition(n);t.fixResultsPosition(n)},fixTryThisPosition:function(){},fixResultsPosition:function(t){t=typeof t=="undefined"?!1:t;var r=this,f=r.n.resultsDiv.css("position");if(f=="fixed"||f=="absolute"){var o=0;if(n("body").css("position")!="static"&&(o=n("body").offset().top),t==!0||r.n.resultsDiv.css("visibility")=="visible"){var s=0,h=0,u=r.n.container.offset();if(f=="fixed"&&(o=0,s=n(document).scrollTop(),h=n(document).scrollLeft(),i()&&e()&&r.n.text.is(":focus")&&(s=r.savedScrollTop,u.top=r.savedContainerTop)),typeof u!="undefined"){var c=r.n.container.outerWidth()<240?240:r.n.container.outerWidth();r.n.resultsDiv.outerWidth(c);r.n.resultsDiv.css({top:u.top+r.n.container.outerHeight(!0)+10-o-s,left:u.left-h})}}}},fixSettingsPosition:function(t){t=typeof t=="undefined"?!1:t;var r=this,s=0;if(n("body").css("position")!="static"&&(s=n("body").offset().top),(t==!0||r.n.prosettings.data("opened")!=0)&&r.o.blocking!=!0){if(r.fixSettingsWidth(),r.n.prosettings.css("display")!="none")var f=r.n.prosettings;else var f=r.n.promagnifier;var u=f.offset(),o=0,h=0;r.n.searchsettings.css("position")=="fixed"&&(o=n(window).scrollTop(),h=n(window).scrollLeft(),i()&&e()&&r.n.text.is(":focus")&&(u.top=r.savedContainerTop,o=r.savedScrollTop));r.o.settingsimagepos=="left"?r.n.searchsettings.css({display:"block",top:u.top+f.height()-2-s-o,left:u.left-h}):r.n.searchsettings.css({display:"block",top:u.top+f.height()-2-s-o,left:u.left+f.width()-r.n.searchsettings.width()-h})}},fixSettingsWidth:function(){}};function l(){return!("ontouchstart"in window)?0:1}function i(){try{return document.createEvent("TouchEvent"),!0}catch(n){return!1}}function o(t,i){var r=t.find(":input").get();return arguments.length===1?(i={},n.each(r,function(){!this.name||this.disabled||!(this.checked||/select|textarea/i.test(this.nodeName)||/text/i.test(this.type))||n(this).hasClass("asp_datepicker_field")||n(this).hasClass("asp_datepicker")||(i[this.name]==undefined&&(i[this.name]=[]),i[this.name].push(n(this).val()))}),JSON.stringify(i)):(typeof i!="object"&&(i=JSON.parse(i)),n.each(r,function(){if(this.name&&i[this.name]){var t=i[this.name],r=n(this);if(Object.prototype.toString.call(t)!=="[object Array]"&&(t=[t]),this.type=="checkbox"||this.type=="radio"){for(var e=r.val(),f=!1,u=0;u<t.length;u++)if(t[u]==e){f=!0;break}r.attr("checked",f)}else r.val(t[0])}}),t)}function u(n){return encodeURIComponent(n).replace(/\%20/g,"+")}function f(t,i,r,u){"use strict";var f;f=n("<form />",{action:t,method:i,style:"display: none;"});typeof r!="undefined"&&r!==null&&n.each(r,function(t,i){n("<input />",{type:"hidden",name:t,value:i}).appendTo(f)});typeof u!="undefined"&&u=="new"&&f.attr("target","_blank");f.appendTo("body").submit()}function h(t){n('<a href="'+t+'" target="_blank">').get(0).click()}function e(){return typeof navigator!="undefined"&&typeof window.navigator.userAgent!="undefined"?window.navigator.userAgent.match(/(iPod|iPhone|iPad)/)!=null:!1}function a(){var n=window.navigator.userAgent,t=n.indexOf("MSIE ");return t>0?!0:!1}typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t});n.plugin=function(t,i){n.fn[t]=function(r){return this.each(function(){n.data(this,t)||n.data(this,t,Object.create(i).init(r,this))})}};n.plugin("ajaxsearchlite",s);var r={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(n){var e="",o,t,i,h,c,s,u,f=0;for(n=r._utf8_encode(n);f<n.length;)o=n.charCodeAt(f++),t=n.charCodeAt(f++),i=n.charCodeAt(f++),h=o>>2,c=(o&3)<<4|t>>4,s=(t&15)<<2|i>>6,u=i&63,isNaN(t)?s=u=64:isNaN(i)&&(u=64),e=e+this._keyStr.charAt(h)+this._keyStr.charAt(c)+this._keyStr.charAt(s)+this._keyStr.charAt(u);return e},decode:function(n){var t="",o,s,h,c,f,u,e,i=0;for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)c=this._keyStr.indexOf(n.charAt(i++)),f=this._keyStr.indexOf(n.charAt(i++)),u=this._keyStr.indexOf(n.charAt(i++)),e=this._keyStr.indexOf(n.charAt(i++)),o=c<<2|f>>4,s=(f&15)<<4|u>>2,h=(u&3)<<6|e,t=t+String.fromCharCode(o),u!=64&&(t=t+String.fromCharCode(s)),e!=64&&(t=t+String.fromCharCode(h));return r._utf8_decode(t)},_utf8_encode:function(n){n=n.replace(/\r\n/g,"\n");for(var i="",r=0;r<n.length;r++){var t=n.charCodeAt(r);t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128))}return i},_utf8_decode:function(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}}})(jQuery);window.ASL=window.ASL||{};window.ASL.getScope=function(){return typeof jQuery!="undefined"?jQuery:typeof window[ASL.js_scope]!="undefined"?window[ASL.js_scope]:eval(ASL.js_scope)};window.ASL.initialized=!1;window.ASL.initialize=function(n){var i=this;if(typeof i.getScope=="undefined")return!1;var t=i.getScope(),r=".asl_init_data";if(typeof ASL_INSTANCES!="undefined"&&Object.keys(ASL_INSTANCES).length>0)t.each(ASL_INSTANCES,function(n,i){return typeof i=="undefined"?!1:t("#ajaxsearchlite"+n).hasClass("hasASL")?!1:(t("#ajaxsearchlite"+n).addClass("hasASL"),t("#ajaxsearchlite"+n).ajaxsearchlite(i))});else{typeof n!="undefined"&&(r="div[id*=asl_init_id_"+n+"]");function u(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}function f(n){var t="",s,h,c,l,e,r,o,i=0,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)l=f.indexOf(n.charAt(i++)),e=f.indexOf(n.charAt(i++)),r=f.indexOf(n.charAt(i++)),o=f.indexOf(n.charAt(i++)),s=l<<2|e>>4,h=(e&15)<<4|r>>2,c=(r&3)<<6|o,t=t+String.fromCharCode(s),r!=64&&(t=t+String.fromCharCode(h)),o!=64&&(t=t+String.fromCharCode(c));return u(t)}t(r).each(function(){var i=t(this).attr("id").match(/^asl_init_id_(.*)/)[1],n=t(this).data("asldata");if(typeof n=="undefined"||(n=f(n),typeof n=="undefined"||n==""))return!1;var r=JSON.parse(n);return t("#ajaxsearchlite"+i).addClass("hasASL"),t("#ajaxsearchlite"+i).ajaxsearchlite(r)})}i.initialized=!0};window.ASL.fixClones=function(){var t=this;if((t.fix_duplicates=t.fix_duplicates||0,t.fix_duplicates==0)||typeof t.getScope=="undefined")return!1;var n=t.getScope(),i={};n(".asl_init_data").each(function(){var t=n(this).attr("id").match(/^asl_init_id_(.*)/)[1];typeof i[t]=="undefined"?i[t]={rid:t,id:t,count:1}:i[t].count++});n.each(i,function(i,r){r.count>1&&n(".asl_m_"+r.rid).each(function(i){if(i==0)return!0;for(var f=n(this).parent(),u=r.id;n("#ajaxsearchlite"+u).length!=0;)u++;n(this).attr("id","ajaxsearchlite"+u);n(this).removeClass("asl_m_"+r.rid).addClass("asl_m_"+u);n(this).removeClass("hasASL");n(".asl_r_"+r.rid,this).length==0&&n(".asl_r_"+r.rid).clone().appendTo(n(this));n(".asl_r_"+r.rid,this).attr("id","ajaxsearchliteres"+u);n(".asl_r_"+r.rid,this).attr("data-id",u);n(".asl_r_"+r.rid,this).removeClass("asl_r_"+r.rid).addClass("asl_r_"+u);typeof ASL.resHTML!="undefined"&&n("#ajaxsearchliteres"+u).html(ASL.resHTML);n(".asl_s_"+r.rid,this).length==0&&n(".asl_s_"+r.rid).length!=0&&n(".asl_s_"+r.rid).clone().appendTo(n(this));n(".asl_sb_"+r.rid,this).length==0&&n(".asl_sb_"+r.rid).length!=0&&n(".asl_sb_"+r.rid).clone().appendTo(n(this));n(".asl_s_"+r.rid,this).attr("id","ajaxsearchlitesettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitesettings"+u).html(ASL.setHTML);n(".asl_sb_"+r.rid,f).attr("id","ajaxsearchlitebsettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitebsettings"+u).html(ASL.setHTML);n(".asl_hidden_data",f).length>0&&n(".asl_hidden_data",f).attr("id","asl_hidden_data_"+u);n(".asl_init_data",f).length>0&&n(".asl_init_data",f).attr("id","asl_init_id_"+u);t.initialize(u)})})};window.ASL.ready=function(){var n=this,t=n.getScope(),i=null;t(document).ready(function(){n.initialize();setTimeout(function(){n.fixClones()},2500)});t(window).on("load",function(){n.initialized||(n.initialize(),setTimeout(function(){n.fixClones()},2500),console.log("ASL initialized via window.load"))});typeof ASL.detect_ajax!="undefined"&&ASL.detect_ajax==1&&t("body").bind("DOMSubtreeModified",function(){clearTimeout(i);i=setTimeout(function(){n.initialize()},500)});var r;t(window).on("resize",function(){clearTimeout(r);r=setTimeout(function(){n.fixClones()},2e3)})};window._ASL=ASL;window._ASL.ready();