'+this.t("Stream Type")+""+this.t("LIVE"),"aria-live":"off"}),e.appendChild(this.v),e},t.dc=t.u.extend({i:function(e,i){t.u.call(this,e,i),this.c(e,"play",this.Pb),this.c(e,"pause",this.Ob)}}),s=t.dc.prototype,s.wa="Play",s.S=function(){return"vjs-play-control "+t.u.prototype.S.call(this)},s.s=function(){this.d.paused()?this.d.play():this.d.pause()},s.Pb=function(){this.r("vjs-paused"),this.n("vjs-playing"),this.b.children[0].children[0].innerHTML=this.t("Pause")},s.Ob=function(){this.r("vjs-playing"),this.n("vjs-paused"),this.b.children[0].children[0].innerHTML=this.t("Play")},t.jb=t.a.extend({i:function(e,i){t.a.call(this,e,i),this.c(e,"timeupdate",this.ia)}}),t.jb.prototype.e=function(){var e=t.a.prototype.e.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});return this.v=t.e("div",{className:"vjs-current-time-display",innerHTML:'Current Time 0:00',"aria-live":"off"}),e.appendChild(this.v),e},t.jb.prototype.ia=function(){var e=this.d.eb?this.d.F.currentTime:this.d.currentTime();this.v.innerHTML=''+this.t("Current Time")+" "+t.Ba(e,this.d.duration())},t.kb=t.a.extend({i:function(e,i){t.a.call(this,e,i),this.c(e,"timeupdate",this.ia)}}),t.kb.prototype.e=function(){var e=t.a.prototype.e.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});return this.v=t.e("div",{className:"vjs-duration-display",innerHTML:''+this.t("Duration Time")+" 0:00","aria-live":"off"}),e.appendChild(this.v),e},t.kb.prototype.ia=function(){var e=this.d.duration();e&&(this.v.innerHTML=''+this.t("Duration Time")+" "+t.Ba(e))},t.kc=t.a.extend({i:function(e,i){t.a.call(this,e,i)}}),t.kc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-time-divider",innerHTML:"/
"})},t.rb=t.a.extend({i:function(e,i){t.a.call(this,e,i),this.c(e,"timeupdate",this.ia)}}),t.rb.prototype.e=function(){var e=t.a.prototype.e.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});return this.v=t.e("div",{className:"vjs-remaining-time-display",innerHTML:''+this.t("Remaining Time")+" -0:00","aria-live":"off"}),e.appendChild(this.v),e},t.rb.prototype.ia=function(){this.d.duration()&&(this.v.innerHTML=''+this.t("Remaining Time")+" -"+t.Ba(this.d.remainingTime()))},t.Na=t.u.extend({i:function(e,i){t.u.call(this,e,i)}}),t.Na.prototype.wa="Fullscreen",t.Na.prototype.S=function(){return"vjs-fullscreen-control "+t.u.prototype.S.call(this)},t.Na.prototype.s=function(){this.d.isFullscreen()?(this.d.exitFullscreen(),this.xb.innerHTML=this.t("Fullscreen")):(this.d.requestFullscreen(),this.xb.innerHTML=this.t("Non-Fullscreen"))},t.qb=t.a.extend({i:function(e,i){t.a.call(this,e,i)}}),t.qb.prototype.m={children:{seekBar:{}}},t.qb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.gc=t.R.extend({i:function(e,i){t.R.call(this,e,i),this.c(e,"timeupdate",this.ra),e.H(t.bind(this,this.ra))}}),s=t.gc.prototype,s.m={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"},s.Lc="timeupdate",s.e=function(){return t.R.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})},s.ra=function(){var e=this.d.eb?this.d.F.currentTime:this.d.currentTime();this.b.setAttribute("aria-valuenow",t.round(100*this.Hb(),2)),this.b.setAttribute("aria-valuetext",t.Ba(e,this.d.duration()))},s.Hb=function(){return this.d.currentTime()/this.d.duration()},s.bb=function(e){t.R.prototype.bb.call(this,e),this.d.eb=f,this.xe=!this.d.paused(),this.d.pause()},s.fa=function(t){t=H(this,t)*this.d.duration(),t==this.d.duration()&&(t-=.1),this.d.currentTime(t)},s.pa=function(e){t.R.prototype.pa.call(this,e),this.d.eb=l,this.xe&&this.d.play()},s.Yc=function(){this.d.currentTime(this.d.currentTime()+5)},s.Xc=function(){this.d.currentTime(this.d.currentTime()-5)},t.nb=t.a.extend({i:function(e,i){t.a.call(this,e,i),this.c(e,"progress",this.update)}}),t.nb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.t("Loaded")+": 0%"})},t.nb.prototype.update=function(){var e,i,o,s,n=this.d.buffered();e=this.d.duration();var r,a=this.d;for(r=a.buffered(),a=a.duration(),r=r.end(r.length-1),r>a&&(r=a),a=this.b.children,this.b.style.width=100*(r/e||0)+"%",e=0;en.length;e--)this.b.removeChild(a[e-1])},t.cc=t.a.extend({i:function(e,i){t.a.call(this,e,i)}}),t.cc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-play-progress",innerHTML:''+this.t("Progress")+": 0%"})},t.Oa=t.$.extend({i:function(e,i){t.$.call(this,e,i),this.c(e,"timeupdate",this.ia)}}),t.Oa.prototype.defaultValue="00:00",t.Oa.prototype.e=function(){return t.$.prototype.e.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})},t.Oa.prototype.ia=function(){var e=this.d.eb?this.d.F.currentTime:this.d.currentTime();this.b.innerHTML=''+t.Ba(e,this.d.duration())+""},t.tb=t.a.extend({i:function(e,i){t.a.call(this,e,i),e.o&&e.o.featuresVolumeControl===l&&this.n("vjs-hidden"),this.c(e,"loadstart",function(){e.o.featuresVolumeControl===l?this.n("vjs-hidden"):this.r("vjs-hidden")})}}),t.tb.prototype.m={children:{volumeBar:{}}},t.tb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})},t.sb=t.R.extend({i:function(e,i){t.R.call(this,e,i),this.c(e,"volumechange",this.ra),e.H(t.bind(this,this.ra))}}),s=t.sb.prototype,s.ra=function(){this.b.setAttribute("aria-valuenow",t.round(100*this.d.volume(),2)),this.b.setAttribute("aria-valuetext",t.round(100*this.d.volume(),2)+"%")},s.m={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"},s.Lc="volumechange",s.e=function(){return t.R.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})},s.fa=function(t){this.d.muted()&&this.d.muted(l),this.d.volume(H(this,t))},s.Hb=function(){return this.d.muted()?0:this.d.volume()},s.Yc=function(){this.d.volume(this.d.volume()+.1)},s.Xc=function(){this.d.volume(this.d.volume()-.1)},t.lc=t.a.extend({i:function(e,i){t.a.call(this,e,i)}}),t.lc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},t.ub=t.$.extend(),t.ub.prototype.defaultValue="00:00",t.ub.prototype.e=function(){return t.$.prototype.e.call(this,"div",{className:"vjs-volume-handle"})},t.ka=t.u.extend({i:function(e,i){t.u.call(this,e,i),this.c(e,"volumechange",this.update),e.o&&e.o.featuresVolumeControl===l&&this.n("vjs-hidden"),this.c(e,"loadstart",function(){e.o.featuresVolumeControl===l?this.n("vjs-hidden"):this.r("vjs-hidden")})}}),t.ka.prototype.e=function(){return t.u.prototype.e.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:''+this.t("Mute")+"
"})},t.ka.prototype.s=function(){this.d.muted(this.d.muted()?l:f)},t.ka.prototype.update=function(){var e=this.d.volume(),i=3;for(0===e||this.d.muted()?i=0:.33>e?i=1:.67>e&&(i=2),this.d.muted()?this.b.children[0].children[0].innerHTML!=this.t("Unmute")&&(this.b.children[0].children[0].innerHTML=this.t("Unmute")):this.b.children[0].children[0].innerHTML!=this.t("Mute")&&(this.b.children[0].children[0].innerHTML=this.t("Mute")),e=0;4>e;e++)t.r(this.b,"vjs-vol-"+e);t.n(this.b,"vjs-vol-"+i)},t.ua=t.M.extend({i:function(e,i){t.M.call(this,e,i),this.c(e,"volumechange",this.update),e.o&&e.o.featuresVolumeControl===l&&this.n("vjs-hidden"),this.c(e,"loadstart",function(){e.o.featuresVolumeControl===l?this.n("vjs-hidden"):this.r("vjs-hidden")}),this.n("vjs-menu-button")}}),t.ua.prototype.za=function(){var e=new t.ja(this.d,{rc:"div"}),i=new t.sb(this.d,this.m.volumeBar);return i.c("focus",function(){e.n("vjs-lock-showing")}),i.c("blur",function(){E(e)}),e.U(i),e},t.ua.prototype.s=function(){t.ka.prototype.s.call(this),t.M.prototype.s.call(this)},t.ua.prototype.e=function(){return t.u.prototype.e.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:''+this.t("Mute")+"
"})},t.ua.prototype.update=t.ka.prototype.update,t.ec=t.M.extend({i:function(e,i){t.M.call(this,e,i),this.bd(),this.ad(),this.c(e,"loadstart",this.bd),this.c(e,"ratechange",this.ad)}}),s=t.ec.prototype,s.e=function(){var e=t.a.prototype.e.call(this,"div",{className:"vjs-playback-rate vjs-menu-button vjs-control",innerHTML:''+this.t("Playback Rate")+"
"});return this.Hc=t.e("div",{className:"vjs-playback-rate-value",innerHTML:1}),e.appendChild(this.Hc),e},s.za=function(){var e=new t.ja(this.j()),i=this.j().options().playbackRates;if(i)for(var o=i.length-1;o>=0;o--)e.U(new t.pb(this.j(),{rate:i[o]+"x"}));return e},s.ra=function(){this.w().setAttribute("aria-valuenow",this.j().playbackRate())},s.s=function(){for(var t=this.j().playbackRate(),e=this.j().options().playbackRates,i=e[0],o=0;ot){i=e[o];
break}this.j().playbackRate(i)},s.bd=function(){ea(this)?this.r("vjs-hidden"):this.n("vjs-hidden")},s.ad=function(){ea(this)&&(this.Hc.innerHTML=this.j().playbackRate()+"x")},t.pb=t.J.extend({rc:"button",i:function(e,i){var o=this.label=i.rate,s=this.Oc=parseFloat(o,10);i.label=o,i.selected=1===s,t.J.call(this,e,i),this.c(e,"ratechange",this.update)}}),t.pb.prototype.s=function(){t.J.prototype.s.call(this),this.j().playbackRate(this.Oc)},t.pb.prototype.update=function(){this.selected(this.j().playbackRate()==this.Oc)},t.fc=t.u.extend({i:function(e,i){t.u.call(this,e,i),this.update(),e.c("posterchange",t.bind(this,this.update))}}),s=t.fc.prototype,s.dispose=function(){this.j().k("posterchange",this.update),t.u.prototype.dispose.call(this)},s.e=function(){var e=t.e("div",{className:"vjs-poster",tabIndex:-1});return t.fd||(this.Eb=t.e("img"),e.appendChild(this.Eb)),e},s.update=function(){var t=this.j().poster();this.ga(t),t?this.b.style.display="":this.Y()},s.ga=function(t){var e;this.Eb?this.Eb.src=t:(e="",t&&(e='url("'+t+'")'),this.b.style.backgroundImage=e)},s.s=function(){this.d.play()},t.bc=t.a.extend({i:function(e,i){t.a.call(this,e,i)}}),t.bc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-loading-spinner"})},t.hb=t.u.extend(),t.hb.prototype.e=function(){return t.u.prototype.e.call(this,"div",{className:"vjs-big-play-button",innerHTML:'',"aria-label":"play video"})},t.hb.prototype.s=function(){this.d.play()},t.lb=t.a.extend({i:function(e,i){t.a.call(this,e,i),this.update(),this.c(e,"error",this.update)}}),t.lb.prototype.e=function(){var e=t.a.prototype.e.call(this,"div",{className:"vjs-error-display"});return this.v=t.e("div"),e.appendChild(this.v),e},t.lb.prototype.update=function(){this.j().error()&&(this.v.innerHTML=this.t(this.j().error().message))},t.q=t.a.extend({i:function(e,i,o){i=i||{},i.Qc=l,t.a.call(this,e,i,o),this.featuresProgressEvents||(this.Ic=f,this.Nc=this.setInterval(function(){var t=this.j().bufferedPercent();this.vd!=t&&this.j().l("progress"),this.vd=t,1===t&&this.clearInterval(this.Nc)},500)),this.featuresTimeupdateEvents||(e=this.d,this.Nb=f,this.c(e,"play",this.$c),this.c(e,"pause",this.fb),this.Q("timeupdate",function(){this.featuresTimeupdateEvents=f,fa(this)}));var s;s=this.j(),e=function(){if(s.controls()&&!s.usingNativeControls()){var t;this.c("mousedown",this.s),this.c("touchstart",function(){t=this.d.userActive()}),this.c("touchmove",function(){t&&this.j().reportUserActivity()}),this.c("touchend",function(t){t.preventDefault()}),G(this),this.c("tap",this.ce)}},this.H(e),this.c(s,"controlsenabled",e),this.c(s,"controlsdisabled",this.he),this.H(function(){this.networkState&&0=0;o--)this.c(t.g.mb[o],this.Fd);if((i=i.source)&&(this.b.currentSrc!==i.src||e.I&&3===e.I.Md)&&this.Uc(i),t.ic&&e.options().nativeControlsForTouch===f){var s,n,r,a;s=this,n=this.j(),i=n.controls(),s.b.controls=!!i,r=function(){s.b.controls=f},a=function(){s.b.controls=l},n.c("controlsenabled",r),n.c("controlsdisabled",a),i=function(){n.k("controlsenabled",r),n.k("controlsdisabled",a)},s.c("dispose",i),n.c("usingcustomcontrols",i),n.usingNativeControls(f)}e.H(function(){this.I&&this.m.autoplay&&this.paused()&&(delete this.I.poster,this.play())}),this.Ja()}}),s=t.g.prototype,s.dispose=function(){t.g.Bb(this.b),t.q.prototype.dispose.call(this)},s.e=function(){var e,i=this.d,o=i.I;o&&this.movingMediaElementInDOM!==l||(o?(e=o.cloneNode(l),t.g.Bb(o),o=e,i.I=k):(o=t.e("video"),t.Sc(o,t.h.z(i.se||{},{id:i.id()+"_html5_api","class":"vjs-tech"}))),o.player=i,t.Jb(o,i.w())),e=["autoplay","preload","loop","muted"];for(var s=e.length-1;s>=0;s--){var n=e[s],r={};"undefined"!=typeof i.m[n]&&(r[n]=i.m[n]),t.Sc(o,r)}return o},s.Fd=function(t){"error"==t.type&&this.error()?this.j().error(this.error().code):(t.bubbles=l,this.j().l(t))},s.play=function(){this.b.play()},s.pause=function(){this.b.pause()},s.paused=function(){return this.b.paused},s.currentTime=function(){return this.b.currentTime},s.Tb=function(e){try{this.b.currentTime=e}catch(i){t.log(i,"Video is not ready. (Video.js)")}},s.duration=function(){return this.b.duration||0},s.buffered=function(){return this.b.buffered},s.volume=function(){return this.b.volume},s.oe=function(t){this.b.volume=t},s.muted=function(){return this.b.muted},s.le=function(t){this.b.muted=t},s.width=function(){return this.b.offsetWidth},s.height=function(){return this.b.offsetHeight},s.Ha=function(){return"function"!=typeof this.b.webkitEnterFullScreen||!/Android/.test(t.N)&&/Chrome|Mac OS X 10.5/.test(t.N)?l:f},s.xc=function(){var t=this.b;"webkitDisplayingFullscreen"in t&&this.Q("webkitbeginfullscreen",function(){this.d.isFullscreen(f),this.Q("webkitendfullscreen",function(){this.d.isFullscreen(l),this.d.l("fullscreenchange")}),this.d.l("fullscreenchange")}),t.paused&&t.networkState<=t.ze?(this.b.play(),this.setTimeout(function(){t.pause(),t.webkitEnterFullScreen()},0)):t.webkitEnterFullScreen()},s.Gd=function(){this.b.webkitExitFullScreen()},s.src=function(t){return t===b?this.b.src:void this.ga(t)},s.ga=function(t){this.b.src=t},s.load=function(){this.b.load()},s.currentSrc=function(){return this.b.currentSrc},s.poster=function(){return this.b.poster},s.Tc=function(t){this.b.poster=t},s.Ga=function(){return this.b.Ga},s.ne=function(t){this.b.Ga=t},s.autoplay=function(){return this.b.autoplay},s.ie=function(t){this.b.autoplay=t},s.controls=function(){return this.b.controls},s.loop=function(){return this.b.loop},s.ke=function(t){this.b.loop=t},s.error=function(){return this.b.error},s.seeking=function(){return this.b.seeking},s.ended=function(){return this.b.ended},s.playbackRate=function(){return this.b.playbackRate},s.me=function(t){this.b.playbackRate=t},s.networkState=function(){return this.b.networkState},t.g.isSupported=function(){try{t.A.volume=.5}catch(e){return l}return!!t.A.canPlayType},t.q.dd(t.g),t.g.V={},t.g.V.Sa=function(e){function i(e){try{return!!t.A.canPlayType(e)}catch(i){return""}}return e.type?i(e.type):(e=e.src.match(/\.([^\/\?]+)(\?[^\/]+)?$/i)[1],i("video/"+e))},t.g.V.Ib=function(t,e){e.ga(t.src)},t.g.V.dispose=m(),t.g.Rb(t.g.V),t.g.xd=function(){var e=t.A.volume;return t.A.volume=e/2+.1,e!==t.A.volume},t.g.wd=function(){var e=t.A.playbackRate;return t.A.playbackRate=e/2+.1,e!==t.A.playbackRate},t.g.prototype.featuresVolumeControl=t.g.xd(),t.g.prototype.featuresPlaybackRate=t.g.wd(),t.g.prototype.movingMediaElementInDOM=!t.kd,t.g.prototype.featuresFullscreenResize=f,t.g.prototype.featuresProgressEvents=f;var V,ga=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,ha=/^video\/mp4/i;t.g.Kc=function(){4<=t.Xb&&(V||(V=t.A.constructor.prototype.canPlayType),t.A.constructor.prototype.canPlayType=function(t){return t&&ga.test(t)?"maybe":V.call(this,t)}),t.od&&(V||(V=t.A.constructor.prototype.canPlayType),t.A.constructor.prototype.canPlayType=function(t){return t&&ha.test(t)?"maybe":V.call(this,t)})},t.g.we=function(){var e=t.A.constructor.prototype.canPlayType;return t.A.constructor.prototype.canPlayType=V,V=k,e},t.g.Kc(),t.g.mb="loadstart suspend abort error emptied stalled loadedmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate progress play pause ratechange volumechange".split(" "),t.g.Bb=function(t){if(t){for(t.player=k,t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);if(t.removeAttribute("src"),"function"==typeof t.load)try{t.load()}catch(e){}}},t.f=t.q.extend({i:function(e,i,o){t.q.call(this,e,i,o);var s=i.source;o=i.parentEl;var n=this.b=t.e("div",{id:e.id()+"_temp_flash"}),r=e.id()+"_flash_api",a=e.m,a=t.h.z({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:a.autoplay,preload:a.Ga,loop:a.loop,muted:a.muted},i.flashVars),c=t.h.z({wmode:"opaque",bgcolor:"#000000"},i.params),r=t.h.z({id:r,name:r,"class":"vjs-tech"},i.attributes);s&&this.H(function(){this.Uc(s)}),t.Jb(n,o),i.startTime&&this.H(function(){this.load(),this.play(),this.currentTime(i.startTime)}),t.jd&&this.H(function(){this.c("mousemove",function(){this.j().l({type:"mousemove",bubbles:l})})}),e.c("stageclick",e.reportUserActivity),this.b=t.f.wc(i.swf,n,a,c,r)}}),s=t.f.prototype,s.dispose=function(){t.q.prototype.dispose.call(this)},s.play=function(){this.b.vjs_play()},s.pause=function(){this.b.vjs_pause()},s.src=function(t){return t===b?this.currentSrc():this.ga(t)},s.ga=function(e){if(e=t.Jd(e),this.b.vjs_src(e),this.d.autoplay()){var i=this;this.setTimeout(function(){i.play()},0)}},t.f.prototype.setCurrentTime=function(e){this.Ud=e,this.b.vjs_setProperty("currentTime",e),t.q.prototype.Tb.call(this)},t.f.prototype.currentTime=function(){return this.seeking()?this.Ud||0:this.b.vjs_getProperty("currentTime")},t.f.prototype.currentSrc=function(){return this.sc?this.sc.src:this.b.vjs_getProperty("currentSrc")},t.f.prototype.load=function(){this.b.vjs_load()},t.f.prototype.poster=function(){this.b.vjs_getProperty("poster")},t.f.prototype.setPoster=m(),t.f.prototype.buffered=function(){return t.zb(0,this.b.vjs_getProperty("buffered"))},t.f.prototype.Ha=r(l),t.f.prototype.xc=r(l);var ka=t.f.prototype,W="rtmpConnection rtmpStream preload defaultPlaybackRate playbackRate autoplay loop mediaGroup controller controls volume muted defaultMuted".split(" "),ma="error networkState readyState seeking initialTime duration startOffsetTime paused played seekable ended videoTracks audioTracks videoWidth videoHeight textTracks".split(" "),X;for(X=0;X'}),s=t.h.z({data:e,width:"100%",height:"100%"},s),t.h.X(s,function(t,e){a+=t+'="'+e+'" '}),'"},t.f.qe={"rtmp/mp4":"MP4","rtmp/flv":"FLV"},t.f.Le=function(t,e){return t+"&"+e},t.f.pe=function(t){var e={qc:"",Zc:""};if(!t)return e;var i,o=t.indexOf("&");return-1!==o?i=o+1:(o=i=t.lastIndexOf("/")+1,0===o&&(o=i=t.length)),e.qc=t.substring(0,o),e.Zc=t.substring(i,t.length),e},t.f.Rd=function(e){return e in t.f.qe},t.f.qd=/^rtmp[set]?:\/\//i,t.f.Qd=function(e){return t.f.qd.test(e)},t.f.Sb={},t.f.Sb.Sa=function(e){return t.f.Rd(e.type)||t.f.Qd(e.src)?"maybe":""},t.f.Sb.Ib=function(e,i){var o=t.f.pe(e.src);i.Je(o.qc),i.Ke(o.Zc)},t.f.Rb(t.f.Sb),t.pd=t.a.extend({i:function(e,i,o){if(t.a.call(this,e,i,o),e.m.sources&&0!==e.m.sources.length)e.src(e.m.sources);else for(i=0,o=e.m.techOrder;io;o++)if(i=t.trim(e[o])){for(-1==i.indexOf("-->")?(s=i,i=t.trim(e[++o])):s=this.ca.length,s={id:s,index:this.ca.length},n=i.split(/[\t ]+/),s.startTime=pa(n[0]),s.Aa=pa(n[2]),n=[];e[++o]&&(i=t.trim(e[o]));)n.push(i);s.text=n.join("
"),this.ca.push(s)}this.qa=2,this.l("loaded")}})))},s.update=function(){if(0=this.Za||this.Za===b?s=this.Fb!==b?this.Fb:0:(c=f,s=this.Mb!==b?this.Mb:n.length-1);;){if(o=n[s],o.Aa<=t)a=Math.max(a,o.Aa),o.Qa&&(o.Qa=l);else if(tt;t++)i+=''+e[t].text+"";this.b.innerHTML=i,this.l("cuechange")}}},s.reset=function(){this.Za=0,this.Qb=this.d.duration(),this.Mb=this.Fb=0},t.Zb=t.B.extend(),t.Zb.prototype.G="captions",t.hc=t.B.extend(),t.hc.prototype.G="subtitles",t.$b=t.B.extend(),t.$b.prototype.G="chapters",t.jc=t.a.extend({i:function(e,i,o){if(t.a.call(this,e,i,o),e.m.tracks&&0i;i++)t=e[i],t.L()==this.ha.L()&&2==t.mode()&&(s=l);this.selected(s)},t.T=t.M.extend({i:function(e,i){t.M.call(this,e,i),1>=this.P.length&&this.Y()}}),t.T.prototype.ya=function(){var e,i=[];i.push(new t.ob(this.d,{kind:this.G}));for(var o=0;os;s++)if(e=o[s],e.L()==this.G){if(0!==e.readyState()){i=e;break}e.load(),e.c("loaded",t.bind(this,this.za))}if(o=this.Da,o===b&&(o=new t.ja(this.d),o.la().appendChild(t.e("li",{className:"vjs-menu-title",innerHTML:t.ba(this.G),re:-1}))),i){e=i.ca;for(var a,s=0,n=e.length;n>s;s++)a=e[s],a=new t.ib(this.d,{track:i,cue:a}),r.push(a),o.U(a);this.U(o)}return 0o;o++)n.push(e[o]);if(i&&0o;o++)n.push(i[o]);if(n&&0o;o++){if(!(i=n[o])||!i.getAttribute){t.wb();break}i.player===b&&(e=i.getAttribute("data-setup"),e!==k&&videojs(i))}else t.cd||t.wb()},t.wb=function(){setTimeout(t.nc,1)},"complete"===document.readyState?t.cd=f:t.Q(window,"load",function(){t.cd=f}),t.wb(),t.ge=function(e,i){t.Player.prototype[e]=i};var qa=this;$("videojs",t),$("_V_",t),$("videojs.options",t.options),$("videojs.players",t.Fa),$("videojs.TOUCH_ENABLED",t.ic),$("videojs.cache",t.xa),$("videojs.Component",t.a),t.a.prototype.player=t.a.prototype.j,t.a.prototype.options=t.a.prototype.options,t.a.prototype.init=t.a.prototype.i,t.a.prototype.dispose=t.a.prototype.dispose,t.a.prototype.createEl=t.a.prototype.e,t.a.prototype.contentEl=t.a.prototype.la,t.a.prototype.el=t.a.prototype.w,t.a.prototype.addChild=t.a.prototype.U,t.a.prototype.getChild=t.a.prototype.ma,t.a.prototype.getChildById=t.a.prototype.Kd,t.a.prototype.children=t.a.prototype.children,t.a.prototype.initChildren=t.a.prototype.Dc,t.a.prototype.removeChild=t.a.prototype.removeChild,t.a.prototype.on=t.a.prototype.c,t.a.prototype.off=t.a.prototype.k,t.a.prototype.one=t.a.prototype.Q,t.a.prototype.trigger=t.a.prototype.l,t.a.prototype.triggerReady=t.a.prototype.Ja,t.a.prototype.show=t.a.prototype.show,t.a.prototype.hide=t.a.prototype.Y,t.a.prototype.width=t.a.prototype.width,t.a.prototype.height=t.a.prototype.height,t.a.prototype.dimensions=t.a.prototype.Dd,t.a.prototype.ready=t.a.prototype.H,t.a.prototype.addClass=t.a.prototype.n,t.a.prototype.removeClass=t.a.prototype.r,t.a.prototype.buildCSSClass=t.a.prototype.S,t.a.prototype.localize=t.a.prototype.t,t.a.prototype.setInterval=t.a.prototype.setInterval,t.a.prototype.setTimeout=t.a.prototype.setTimeout,t.Player.prototype.ended=t.Player.prototype.ended,t.Player.prototype.enterFullWindow=t.Player.prototype.yc,t.Player.prototype.exitFullWindow=t.Player.prototype.Db,t.Player.prototype.preload=t.Player.prototype.Ga,t.Player.prototype.remainingTime=t.Player.prototype.remainingTime,t.Player.prototype.supportsFullScreen=t.Player.prototype.Ha,t.Player.prototype.currentType=t.Player.prototype.zd,t.Player.prototype.requestFullScreen=t.Player.prototype.requestFullScreen,t.Player.prototype.requestFullscreen=t.Player.prototype.requestFullscreen,t.Player.prototype.cancelFullScreen=t.Player.prototype.cancelFullScreen,t.Player.prototype.exitFullscreen=t.Player.prototype.exitFullscreen,t.Player.prototype.isFullScreen=t.Player.prototype.isFullScreen,t.Player.prototype.isFullscreen=t.Player.prototype.isFullscreen,$("videojs.MediaLoader",t.pd),$("videojs.TextTrackDisplay",t.jc),$("videojs.ControlBar",t.Ma),$("videojs.Button",t.u),$("videojs.PlayToggle",t.dc),$("videojs.FullscreenToggle",t.Na),$("videojs.BigPlayButton",t.hb),$("videojs.LoadingSpinner",t.bc),$("videojs.CurrentTimeDisplay",t.jb),$("videojs.DurationDisplay",t.kb),$("videojs.TimeDivider",t.kc),$("videojs.RemainingTimeDisplay",t.rb),$("videojs.LiveDisplay",t.ac),$("videojs.ErrorDisplay",t.lb),$("videojs.Slider",t.R),$("videojs.ProgressControl",t.qb),$("videojs.SeekBar",t.gc),$("videojs.LoadProgressBar",t.nb),$("videojs.PlayProgressBar",t.cc),$("videojs.SeekHandle",t.Oa),$("videojs.VolumeControl",t.tb),$("videojs.VolumeBar",t.sb),$("videojs.VolumeLevel",t.lc),$("videojs.VolumeMenuButton",t.ua),$("videojs.VolumeHandle",t.ub),$("videojs.MuteToggle",t.ka),$("videojs.PosterImage",t.fc),$("videojs.Menu",t.ja),$("videojs.MenuItem",t.J),$("videojs.MenuButton",t.M),$("videojs.PlaybackRateMenuButton",t.ec),t.M.prototype.createItems=t.M.prototype.ya,t.T.prototype.createItems=t.T.prototype.ya,t.La.prototype.createItems=t.La.prototype.ya,$("videojs.SubtitlesButton",t.Pa),$("videojs.CaptionsButton",t.Ka),$("videojs.ChaptersButton",t.La),$("videojs.MediaTechController",t.q),t.q.prototype.featuresVolumeControl=t.q.prototype.Ge,t.q.prototype.featuresFullscreenResize=t.q.prototype.Ce,t.q.prototype.featuresPlaybackRate=t.q.prototype.De,t.q.prototype.featuresProgressEvents=t.q.prototype.Ee,t.q.prototype.featuresTimeupdateEvents=t.q.prototype.Fe,t.q.prototype.setPoster=t.q.prototype.Tc,$("videojs.Html5",t.g),t.g.Events=t.g.mb,t.g.isSupported=t.g.isSupported,t.g.canPlaySource=t.g.oc,t.g.patchCanPlayType=t.g.Kc,t.g.unpatchCanPlayType=t.g.we,t.g.prototype.setCurrentTime=t.g.prototype.Tb,t.g.prototype.setVolume=t.g.prototype.oe,t.g.prototype.setMuted=t.g.prototype.le,t.g.prototype.setPreload=t.g.prototype.ne,t.g.prototype.setAutoplay=t.g.prototype.ie,t.g.prototype.setLoop=t.g.prototype.ke,t.g.prototype.enterFullScreen=t.g.prototype.xc,t.g.prototype.exitFullScreen=t.g.prototype.Gd,t.g.prototype.playbackRate=t.g.prototype.playbackRate,t.g.prototype.setPlaybackRate=t.g.prototype.me,$("videojs.Flash",t.f),t.f.isSupported=t.f.isSupported,t.f.canPlaySource=t.f.oc,t.f.onReady=t.f.onReady,t.f.embed=t.f.wc,t.f.version=t.f.version,$("videojs.TextTrack",t.B),t.B.prototype.label=t.B.prototype.label,t.B.prototype.kind=t.B.prototype.L,t.B.prototype.mode=t.B.prototype.mode,t.B.prototype.cues=t.B.prototype.yd,t.B.prototype.activeCues=t.B.prototype.rd,$("videojs.CaptionsTrack",t.Zb),$("videojs.SubtitlesTrack",t.hc),$("videojs.ChaptersTrack",t.$b),$("videojs.autoSetup",t.nc),$("videojs.plugin",t.ge),$("videojs.createTimeRange",t.zb),$("videojs.util",t.Z),t.Z.mergeOptions=t.Z.Ea,t.addLanguage=t.sd}(),!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","videojs","imagesloaded","jquery-ui"],t):t(jQuery,videojs)}(function(t,e){t.BigVideo=function(i){function o(){var e=C.container.outerWidth()t("body").css("height","auto").height()?"100%":"auto"),g>o?"video"==h?(d.width(i*g).height(i),C.shrinkable?t(v).css("top",-(e/g-i)/2).css("left",0).css("height",e/g):t(v).css("top",0).css("left",-(i*g-e)/2).css("height",i),t(v+"_html5_api").css("width",i*g).css("height",i),t(v+"_flash_api").css("width",i*g).css("height",i)):t("#big-video-image").css({width:"auto",height:i,top:0,left:-(i*g-e)/2}):"video"==h?(d.width(e).height(e/g),t(v).css("top",-(e/g-i)/2).css("left",0).css("height",e/g),t(v+"_html5_api").css("width",t(v+"_html5_api").parent().width()+"px").css("height","auto"),t(v+"_flash_api").css("width",e).css("height",e/g)):t("#big-video-image").css({width:e,height:"auto",top:-(e/g-i)/2,left:0})}function s(){var e='';C.container.append(e),t("#big-video-control-container").css("display","none"),t("#big-video-control-timer").css("display","none"),t("#big-video-control-track").slider({animate:!0,step:.01,slide:function(e,i){S=!0,t("#big-video-control-progress").css("width",i.value-.16+"%"),d.currentTime(i.value/100*d.duration())},stop:function(t,e){S=!1,d.currentTime(e.value/100*d.duration())}}),t("#big-video-control-bar").click(function(e){d.currentTime(e.offsetX/t(this).width()*d.duration())}),t("#big-video-control-play").click(function(t){t.preventDefault(),n("toggle")}),d.on("timeupdate",function(){if(!S&&d.currentTime()/d.duration()){var e=d.currentTime(),i=Math.floor(e/60),o=Math.floor(e)-60*i;10>o&&(o="0"+o);var s=d.currentTime()/d.duration()*100;t("#big-video-control-track").slider("value",s),t("#big-video-control-progress").css("width",s-.16+"%"),t("#big-video-control-timer").text(i+":"+o+"/"+y)}})}function n(e){var i=e||"toggle";"toggle"==i&&(i=k?"pause":"play"),"pause"==i?(d.pause(),t("#big-video-control-play").css("background-position","-16px"),k=!1):"play"==i?(d.play(),t("#big-video-control-play").css("background-position","0"),k=!0):"skip"==i&&a()}function r(){d.play(),C.container.off("click",r)}function a(){u++,u===_.length&&(u=0),l(_[u])}function l(e){t(v).css("display","block"),h="video",d.src(e),k=!0,x?(t("#big-video-control-container").css("display","none"),d.ready(function(){d.volume(0)}),doLoop=!0):(t("#big-video-control-container").css("display","block"),d.ready(function(){d.volume(b)}),doLoop=!1),t("#big-video-image").css("display","none"),t(v).css("display","block")}function c(e){t("#big-video-image").remove(),d.pause(),t(v).css("display","none"),t("#big-video-control-container").css("display","none"),h="image";var i=t(''),g=(t(""),16/9),y=0,b=.8,w=!1,S=!1,k=!1,T=!1,x=!1,_=[],C=t.extend({},p,i);f.init=function(){if(!w){C.container.prepend(m);var i=C.forceAutoplay?"autoplay":"";d=t('"),d.css("position","absolute"),m.append(d);var n=["html5","flash"],l=navigator.userAgent.toLowerCase(),c=-1!=l.indexOf("firefox");C.useFlashForFirefox&&c&&(n=["flash","html5"]),d=e(v.substr(1),{controls:!1,autoplay:!0,preload:"auto",techOrder:n}),C.controls&&s(),o(),w=!0,k=!1,C.forceAutoplay&&t("body").on("click",r),t("#big-video-vid_flash_api").attr("scale","noborder").attr("width","100%").attr("height","100%"),t(window).on("resize.bigvideo",function(){o()}),d.on("loadedmetadata",function(){g=document.getElementById("big-video-vid_flash_api")?document.getElementById("big-video-vid_flash_api").vjs_getProperty("videoWidth")/document.getElementById("big-video-vid_flash_api").vjs_getProperty("videoHeight"):t("#big-video-vid_html5_api").prop("videoWidth")/t("#big-video-vid_html5_api").prop("videoHeight"),o();var e=Math.round(d.duration()),i=Math.floor(e/60),s=e-60*i;10>s&&(s="0"+s),y=i+":"+s}),d.on("ended",function(){C.doLoop&&(d.currentTime(0),d.play()),T&&a()})}},f.show=function(e,i){if(void 0===i&&(i={}),x=i.ambient===!0,(x||i.doLoop)&&(C.doLoop=!0),"string"==typeof e){var o=e.lastIndexOf("?")>0?e.substring(e.lastIndexOf(".")+1,e.lastIndexOf("?")):e.substring(e.lastIndexOf(".")+1);"jpg"==o||"gif"==o||"png"==o?c(e):("mp4"==o||"ogg"==o||"ogv"==o||"webm"==o)&&(l(e),i.onShown&&i.onShown(),T=!1)}else if(t.isArray(e))l(e);else{if("object"!=typeof e||!e.src||!e.type)throw"BigVideo.show received invalid input for parameter source";l([e])}},f.showPlaylist=function(e,i){if(!t.isArray(e))throw"BigVideo.showPlaylist parameter files accepts only arrays";void 0===i&&(i={}),x=i.ambient===!0,(x||i.doLoop)&&(C.doLoop=!0),_=e,u=0,this.show(_[u]),i.onShown&&i.onShown(),T=!0},f.getPlayer=function(){return d},f.remove=f.dispose=function(){w=!1,m.remove(),t(window).off("resize.bigvideo"),d&&(d.off("loadedmetadata"),d.off("ended"),d.dispose())},f.triggerPlayer=function(t){n(t)}}}),!function(t,e,i){!function(e){var o="function"==typeof define&&define.amd,s="https:"==i.location.protocol?"https:":"http:",n="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js";o||t.event.special.mousewheel||t("head").append(decodeURI("%3Cscript src="+s+"//"+n+"%3E%3C/script%3E")),e()}(function(){var o="mCustomScrollbar",s="mCS",n=".mCustomScrollbar",r={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,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},a=0,l={},c=e.attachEvent&&!e.addEventListener?1:0,d=!1,u=["mCSB_dragger_onDrag","mCSB_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","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],h={init:function(e){var e=t.extend(!0,{},r,e),i=p.call(this);
if(e.live){var o=e.liveSelector||this.selector||n,c=t(o);if("off"===e.live)return void v(o);l[o]=setTimeout(function(){c.mCustomScrollbar(e),"once"===e.live&&c.length&&v(o)},500)}else v(o);return e.setWidth=e.set_width?e.set_width:e.setWidth,e.setHeight=e.set_height?e.set_height:e.setHeight,e.axis=e.horizontalScroll?"x":m(e.axis),e.scrollInertia=e.scrollInertia>0&&e.scrollInertia<17?17:e.scrollInertia,"object"!=typeof e.mouseWheel&&1==e.mouseWheel&&(e.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),e.mouseWheel.scrollAmount=e.mouseWheelPixels?e.mouseWheelPixels:e.mouseWheel.scrollAmount,e.mouseWheel.normalizeDelta=e.advanced.normalizeMouseWheelDelta?e.advanced.normalizeMouseWheelDelta:e.mouseWheel.normalizeDelta,e.scrollButtons.scrollType=g(e.scrollButtons.scrollType),f(e),t(i).each(function(){var i=t(this);if(!i.data(s)){i.data(s,{idx:++a,opt:e,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:i.css("direction"),cbOffsets:null,trigger:null});var o=i.data(s),n=o.opt,r=i.data("mcs-axis"),l=i.data("mcs-scrollbar-position"),c=i.data("mcs-theme");r&&(n.axis=r),l&&(n.scrollbarPosition=l),c&&(n.theme=c,f(n)),y.call(this),t("#mCSB_"+o.idx+"_container img:not(."+u[2]+")").addClass(u[2]),h.update.call(null,i)}})},update:function(e,i){var o=e||p.call(this);return t(o).each(function(){var e=t(this);if(e.data(s)){var o=e.data(s),n=o.opt,r=t("#mCSB_"+o.idx+"_container"),a=[t("#mCSB_"+o.idx+"_dragger_vertical"),t("#mCSB_"+o.idx+"_dragger_horizontal")];if(!r.length)return;o.tweenRunning&&U(e),e.hasClass(u[3])&&e.removeClass(u[3]),e.hasClass(u[4])&&e.removeClass(u[4]),k.call(this),w.call(this),"y"===n.axis||n.advanced.autoExpandHorizontalScroll||r.css("width",b(r.children())),o.overflowed=C.call(this),$.call(this),n.autoDraggerLength&&T.call(this),x.call(this),O.call(this);var l=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==n.axis&&(o.overflowed[0]?a[0].height()>a[0].parent().height()?j.call(this):(Y(e,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}),o.contentReset.y=null):(j.call(this),"y"===n.axis?P.call(this):"yx"===n.axis&&o.overflowed[1]&&Y(e,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==n.axis&&(o.overflowed[1]?a[1].width()>a[1].parent().width()?j.call(this):(Y(e,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}),o.contentReset.x=null):(j.call(this),"x"===n.axis?P.call(this):"yx"===n.axis&&o.overflowed[0]&&Y(e,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),i&&o&&(2===i&&n.callbacks.onImageLoad&&"function"==typeof n.callbacks.onImageLoad?n.callbacks.onImageLoad.call(this):3===i&&n.callbacks.onSelectorChange&&"function"==typeof n.callbacks.onSelectorChange?n.callbacks.onSelectorChange.call(this):n.callbacks.onUpdate&&"function"==typeof n.callbacks.onUpdate&&n.callbacks.onUpdate.call(this)),V.call(this)}})},scrollTo:function(e,i){if("undefined"!=typeof e&&null!=e){var o=p.call(this);return t(o).each(function(){var o=t(this);if(o.data(s)){var n=o.data(s),r=n.opt,a={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},l=t.extend(!0,{},a,i),c=W.call(this,e),d=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;c[0]=q.call(this,c[0],"y"),c[1]=q.call(this,c[1],"x"),l.moveDragger&&(c[0]*=n.scrollRatio.y,c[1]*=n.scrollRatio.x),l.dur=d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&n.overflowed[0]&&(l.dir="y",l.overwrite="all",Y(o,c[0].toString(),l)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&n.overflowed[1]&&(l.dir="x",l.overwrite="none",Y(o,c[1].toString(),l))},l.timeout)}})}},stop:function(){var e=p.call(this);return t(e).each(function(){var e=t(this);e.data(s)&&U(e)})},disable:function(e){var i=p.call(this);return t(i).each(function(){var i=t(this);i.data(s)&&(i.data(s),V.call(this,"remove"),P.call(this),e&&j.call(this),$.call(this,!0),i.addClass(u[3]))})},destroy:function(){var e=p.call(this);return t(e).each(function(){var i=t(this);if(i.data(s)){var n=i.data(s),r=n.opt,a=t("#mCSB_"+n.idx),l=t("#mCSB_"+n.idx+"_container"),c=t(".mCSB_"+n.idx+"_scrollbar");r.live&&v(r.liveSelector||t(e).selector),V.call(this,"remove"),P.call(this),j.call(this),i.removeData(s),G(this,"mcs"),c.remove(),l.find("img."+u[2]).removeClass(u[2]),a.replaceWith(l.contents()),i.removeClass(o+" _"+s+"_"+n.idx+" "+u[6]+" "+u[7]+" "+u[5]+" "+u[3]).addClass(u[4])}})}},p=function(){return"object"!=typeof t(this)||t(this).length<1?n:this},f=function(e){var i=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],o=["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"],s=["minimal","minimal-dark"],n=["minimal","minimal-dark"],r=["minimal","minimal-dark"];e.autoDraggerLength=t.inArray(e.theme,i)>-1?!1:e.autoDraggerLength,e.autoExpandScrollbar=t.inArray(e.theme,o)>-1?!1:e.autoExpandScrollbar,e.scrollButtons.enable=t.inArray(e.theme,s)>-1?!1:e.scrollButtons.enable,e.autoHideScrollbar=t.inArray(e.theme,n)>-1?!0:e.autoHideScrollbar,e.scrollbarPosition=t.inArray(e.theme,r)>-1?"outside":e.scrollbarPosition},v=function(t){l[t]&&(clearTimeout(l[t]),G(l,t))},m=function(t){return"yx"===t||"xy"===t||"auto"===t?"yx":"x"===t||"horizontal"===t?"x":"y"},g=function(t){return"stepped"===t||"pixels"===t||"step"===t||"click"===t?"stepped":"stepless"},y=function(){var e=t(this),i=e.data(s),n=i.opt,r=n.autoExpandScrollbar?" "+u[1]+"_expand":"",a=["",""],l="yx"===n.axis?"mCSB_vertical_horizontal":"x"===n.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===n.axis?a[0]+a[1]:"x"===n.axis?a[1]:a[0],d="yx"===n.axis?"":"",h=n.autoHideScrollbar?" "+u[6]:"",p="x"!==n.axis&&"rtl"===i.langDir?" "+u[7]:"";n.setWidth&&e.css("width",n.setWidth),n.setHeight&&e.css("height",n.setHeight),n.setLeft="y"!==n.axis&&"rtl"===i.langDir?"989999px":n.setLeft,e.addClass(o+" _"+s+"_"+i.idx+h+p).wrapInner("");var f=t("#mCSB_"+i.idx),v=t("#mCSB_"+i.idx+"_container");"y"===n.axis||n.advanced.autoExpandHorizontalScroll||v.css("width",b(v.children())),"outside"===n.scrollbarPosition?("static"===e.css("position")&&e.css("position","relative"),e.css("overflow","visible"),f.addClass("mCSB_outside").after(c)):(f.addClass("mCSB_inside").append(c),v.wrap(d)),S.call(this);var m=[t("#mCSB_"+i.idx+"_dragger_vertical"),t("#mCSB_"+i.idx+"_dragger_horizontal")];m[0].css("min-height",m[0].height()),m[1].css("min-width",m[1].width())},b=function(e){return Math.max.apply(Math,e.map(function(){return t(this).outerWidth(!0)}).get())},w=function(){var e=t(this),i=e.data(s),o=i.opt,n=t("#mCSB_"+i.idx+"_container");o.advanced.autoExpandHorizontalScroll&&"y"!==o.axis&&n.css({position:"absolute",width:"auto"}).wrap("").css({width:Math.ceil(n[0].getBoundingClientRect().right+.4)-Math.floor(n[0].getBoundingClientRect().left),position:"relative"}).unwrap()},S=function(){var e=t(this),i=e.data(s),o=i.opt,n=t(".mCSB_"+i.idx+"_scrollbar:first"),r=ee(o.scrollButtons.tabindex)?"tabindex='"+o.scrollButtons.tabindex+"'":"",a=["","","",""],l=["x"===o.axis?a[2]:a[0],"x"===o.axis?a[3]:a[1],a[2],a[3]];o.scrollButtons.enable&&n.prepend(l[0]).append(l[1]).next(".mCSB_scrollTools").prepend(l[2]).append(l[3])},k=function(){var e=t(this),i=e.data(s),o=t("#mCSB_"+i.idx),n=e.css("max-height")||"none",r=-1!==n.indexOf("%"),a=e.css("box-sizing");if("none"!==n){var l=r?e.parent().height()*parseInt(n)/100:parseInt(n);"border-box"===a&&(l-=e.innerHeight()-e.height()+(e.outerHeight()-e.innerHeight())),o.css("max-height",Math.round(l))}},T=function(){var e=t(this),i=e.data(s),o=t("#mCSB_"+i.idx),n=t("#mCSB_"+i.idx+"_container"),r=[t("#mCSB_"+i.idx+"_dragger_vertical"),t("#mCSB_"+i.idx+"_dragger_horizontal")],a=[o.height()/n.outerHeight(!1),o.width()/n.outerWidth(!1)],l=[parseInt(r[0].css("min-height")),Math.round(a[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(a[1]*r[1].parent().width())],d=c&&l[1]o.height(),a>o.width()]},j=function(){var e=t(this),i=e.data(s),o=i.opt,n=t("#mCSB_"+i.idx),r=t("#mCSB_"+i.idx+"_container"),a=[t("#mCSB_"+i.idx+"_dragger_vertical"),t("#mCSB_"+i.idx+"_dragger_horizontal")];if(U(e),("x"!==o.axis&&!i.overflowed[0]||"y"===o.axis&&i.overflowed[0])&&(a[0].add(r).css("top",0),Y(e,"_resetY")),"y"!==o.axis&&!i.overflowed[1]||"x"===o.axis&&i.overflowed[1]){var l=dx=0;"rtl"===i.langDir&&(l=n.width()-r.outerWidth(!1),dx=Math.abs(l/i.scrollRatio.x)),r.css("left",l),a[1].css("left",dx),Y(e,"_resetX")}},O=function(){function e(){r=setTimeout(function(){t.event.special.mousewheel?(clearTimeout(r),B.call(i[0])):e()},100)}var i=t(this),o=i.data(s),n=o.opt;if(!o.bindEvents){if(L.call(this),n.contentTouchScroll&&E.call(this),A.call(this),n.mouseWheel.enable){var r;e()}H.call(this),D.call(this),n.advanced.autoScrollOnFocus&&F.call(this),n.scrollButtons.enable&&z.call(this),n.keyboard.enable&&N.call(this),o.bindEvents=!0}},P=function(){var e=t(this),o=e.data(s),n=o.opt,r=s+"_"+o.idx,a=".mCSB_"+o.idx+"_scrollbar",l=t("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+a+" ."+u[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+a+">a"),c=t("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(t(n.advanced.releaseDraggableSelectors)),o.bindEvents&&(t(i).unbind("."+r),l.each(function(){t(this).unbind("."+r)}),clearTimeout(e[0]._focusTimeout),G(e[0],"_focusTimeout"),clearTimeout(o.sequential.step),G(o.sequential,"step"),clearTimeout(c[0].onCompleteTimeout),G(c[0],"onCompleteTimeout"),o.bindEvents=!1)},$=function(e){var i=t(this),o=i.data(s),n=o.opt,r=t("#mCSB_"+o.idx+"_container_wrapper"),a=r.length?r:t("#mCSB_"+o.idx+"_container"),l=[t("#mCSB_"+o.idx+"_scrollbar_vertical"),t("#mCSB_"+o.idx+"_scrollbar_horizontal")],c=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==n.axis&&(o.overflowed[0]&&!e?(l[0].add(c[0]).add(l[0].children("a")).css("display","block"),a.removeClass(u[8]+" "+u[10])):(n.alwaysShowScrollbar?(2!==n.alwaysShowScrollbar&&c[0].add(l[0].children("a")).css("display","none"),a.removeClass(u[10])):(l[0].css("display","none"),a.addClass(u[10])),a.addClass(u[8]))),"y"!==n.axis&&(o.overflowed[1]&&!e?(l[1].add(c[1]).add(l[1].children("a")).css("display","block"),a.removeClass(u[9]+" "+u[11])):(n.alwaysShowScrollbar?(2!==n.alwaysShowScrollbar&&c[1].add(l[1].children("a")).css("display","none"),a.removeClass(u[11])):(l[1].css("display","none"),a.addClass(u[11])),a.addClass(u[9]))),o.overflowed[0]||o.overflowed[1]?i.removeClass(u[5]):i.addClass(u[5])},M=function(t){var e=t.type;switch(e){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],o=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return[i.pageY,i.pageX,o>1];default:return[t.pageY,t.pageX,!1]}},L=function(){function e(t){var e=v.find("iframe");if(e.length){var i=t?"auto":"none";e.css("pointer-events",i)}}function o(t,e,i,o){if(v[0].idleTimer=h.scrollInertia<233?250:0,n.attr("id")===f[1])var s="x",r=(n[0].offsetLeft-e+o)*u.scrollRatio.x;else var s="y",r=(n[0].offsetTop-t+i)*u.scrollRatio.y;Y(l,r.toString(),{dir:s,drag:!0})}var n,r,a,l=t(this),u=l.data(s),h=u.opt,p=s+"_"+u.idx,f=["mCSB_"+u.idx+"_dragger_vertical","mCSB_"+u.idx+"_dragger_horizontal"],v=t("#mCSB_"+u.idx+"_container"),m=t("#"+f[0]+",#"+f[1]),g=h.advanced.releaseDraggableSelectors?m.add(t(h.advanced.releaseDraggableSelectors)):m;m.bind("mousedown."+p+" touchstart."+p+" pointerdown."+p+" MSPointerDown."+p,function(o){if(o.stopImmediatePropagation(),o.preventDefault(),Z(o)){d=!0,c&&(i.onselectstart=function(){return!1}),e(!1),U(l),n=t(this);var s=n.offset(),u=M(o)[0]-s.top,p=M(o)[1]-s.left,f=n.height()+s.top,v=n.width()+s.left;f>u&&u>0&&v>p&&p>0&&(r=u,a=p),_(n,"active",h.autoExpandScrollbar)}}).bind("touchmove."+p,function(t){t.stopImmediatePropagation(),t.preventDefault();var e=n.offset(),i=M(t)[0]-e.top,s=M(t)[1]-e.left;o(r,a,i,s)}),t(i).bind("mousemove."+p+" pointermove."+p+" MSPointerMove."+p,function(t){if(n){var e=n.offset(),i=M(t)[0]-e.top,s=M(t)[1]-e.left;if(r===i)return;o(r,a,i,s)}}).add(g).bind("mouseup."+p+" touchend."+p+" pointerup."+p+" MSPointerUp."+p,function(){n&&(_(n,"active",h.autoExpandScrollbar),n=null),d=!1,c&&(i.onselectstart=null),e(!0)})},E=function(){function e(t,e){var i=[1.5*e,2*e,e/1.5,e/2];return t>90?e>4?i[0]:i[3]:t>60?e>3?i[3]:i[2]:t>30?e>8?i[1]:e>6?i[0]:e>4?e:i[2]:e>8?e:i[3]}function i(t,e,i,o,s,n){t&&Y(m,t.toString(),{dur:e,scrollEasing:i,dir:o,overwrite:s,drag:n})}var o,n,r,a,l,c,u,h,p,f,v,m=t(this),g=m.data(s),y=g.opt,b=s+"_"+g.idx,w=t("#mCSB_"+g.idx),S=t("#mCSB_"+g.idx+"_container"),k=[t("#mCSB_"+g.idx+"_dragger_vertical"),t("#mCSB_"+g.idx+"_dragger_horizontal")],T=[],x=[],_=0,C="yx"===y.axis?"none":"all",j=[];S.bind("touchstart."+b+" pointerdown."+b+" MSPointerDown."+b,function(t){if(te(t)&&!d&&!M(t)[2]){var e=S.offset();o=M(t)[0]-e.top,n=M(t)[1]-e.left,j=[M(t)[0],M(t)[1]]}}).bind("touchmove."+b+" pointermove."+b+" MSPointerMove."+b,function(t){if(te(t)&&!d&&!M(t)[2]){t.stopImmediatePropagation(),c=J();var e=w.offset(),s=M(t)[0]-e.top,r=M(t)[1]-e.left,a="mcsLinearOut";if(T.push(s),x.push(r),j[2]=Math.abs(M(t)[0]-j[0]),j[3]=Math.abs(M(t)[1]-j[1]),g.overflowed[0])var l=k[0].parent().height()-k[0].height(),u=o-s>0&&s-o>-(l*g.scrollRatio.y)&&(2*j[3]0&&r-n>-(h*g.scrollRatio.x)&&(2*j[2]30)){p=1e3/(u-l);var m="mcsEaseOut",b=2.5>p,k=b?[T[T.length-2],x[x.length-2]]:[0,0];h=b?[s-k[0],n-k[1]]:[s-r,n-a];var _=[Math.abs(h[0]),Math.abs(h[1])];p=b?[Math.abs(h[0]/4),Math.abs(h[1]/4)]:[p,p];var j=[Math.abs(S[0].offsetTop)-h[0]*e(_[0]/p[0],p[0]),Math.abs(S[0].offsetLeft)-h[1]*e(_[1]/p[1],p[1])];f="yx"===y.axis?[j[0],j[1]]:"x"===y.axis?[null,j[1]]:[j[0],null],v=[4*_[0]+y.scrollInertia,4*_[1]+y.scrollInertia];var O=parseInt(y.contentTouchScroll)||0;f[0]=_[0]>O?f[0]:0,f[1]=_[1]>O?f[1]:0,g.overflowed[0]&&i(f[0],v[0],m,"y",C,!1),g.overflowed[1]&&i(f[1],v[1],m,"x",C,!1)}}})},A=function(){function o(){return e.getSelection?e.getSelection().toString():i.selection&&"Control"!=i.selection.type?i.selection.createRange().text:0}function n(t,e,i){u.type=i&&r?"stepped":"stepless",u.scrollAmount=10,R(a,t,e,"mcsLinearOut",i?60:null)}var r,a=t(this),l=a.data(s),c=l.opt,u=l.sequential,h=s+"_"+l.idx,p=t("#mCSB_"+l.idx+"_container"),f=p.parent();p.bind("mousedown."+h,function(){r||(r=1,d=!0)}).add(i).bind("mousemove."+h,function(t){if(r&&o()){var e=p.offset(),i=M(t)[0]-e.top+p[0].offsetTop,s=M(t)[1]-e.left+p[0].offsetLeft;i>0&&i0&&si?n("on",38):i>f.height()&&n("on",40)),"y"!==c.axis&&l.overflowed[1]&&(0>s?n("on",37):s>f.width()&&n("on",39)))}}).bind("mouseup."+h,function(){r&&(r=0,n("off",null)),d=!1})},B=function(){function e(t){var e=null;try{var i=t.contentDocument||t.contentWindow.document;e=i.body.innerHTML}catch(o){}return null!==e}var i=t(this),o=i.data(s);if(o){var n=o.opt,r=s+"_"+o.idx,a=t("#mCSB_"+o.idx),l=[t("#mCSB_"+o.idx+"_dragger_vertical"),t("#mCSB_"+o.idx+"_dragger_horizontal")],d=t("#mCSB_"+o.idx+"_container").find("iframe"),u=a;d.length&&d.each(function(){var i=this;e(i)&&(u=u.add(t(i).contents().find("body")))}),u.bind("mousewheel."+r,function(e,s){if(U(i),!I(i,e.target)){var r="auto"!==n.mouseWheel.deltaFactor?parseInt(n.mouseWheel.deltaFactor):c&&e.deltaFactor<100?100:e.deltaFactor||100;if("x"===n.axis||"x"===n.mouseWheel.axis)var d="x",u=[Math.round(r*o.scrollRatio.x),parseInt(n.mouseWheel.scrollAmount)],h="auto"!==n.mouseWheel.scrollAmount?u[1]:u[0]>=a.width()?.9*a.width():u[0],p=Math.abs(t("#mCSB_"+o.idx+"_container")[0].offsetLeft),f=l[1][0].offsetLeft,v=l[1].parent().width()-l[1].width(),m=e.deltaX||e.deltaY||s;else var d="y",u=[Math.round(r*o.scrollRatio.y),parseInt(n.mouseWheel.scrollAmount)],h="auto"!==n.mouseWheel.scrollAmount?u[1]:u[0]>=a.height()?.9*a.height():u[0],p=Math.abs(t("#mCSB_"+o.idx+"_container")[0].offsetTop),f=l[0][0].offsetTop,v=l[0].parent().height()-l[0].height(),m=e.deltaY||s;"y"===d&&!o.overflowed[0]||"x"===d&&!o.overflowed[1]||(n.mouseWheel.invert&&(m=-m),n.mouseWheel.normalizeDelta&&(m=0>m?-1:1),(m>0&&0!==f||0>m&&f!==v||n.mouseWheel.preventDefault)&&(e.stopImmediatePropagation(),e.preventDefault()),Y(i,(p-m*h).toString(),{dir:d}))}})}},I=function(e,i){var o=i.nodeName.toLowerCase(),n=e.data(s).opt.mouseWheel.disableOver,r=["select","textarea"];return t.inArray(o,n)>-1&&!(t.inArray(o,r)>-1&&!t(i).is(":focus"))},H=function(){var e=t(this),i=e.data(s),o=s+"_"+i.idx,n=t("#mCSB_"+i.idx+"_container"),r=n.parent(),a=t(".mCSB_"+i.idx+"_scrollbar ."+u[12]);a.bind("touchstart."+o+" pointerdown."+o+" MSPointerDown."+o,function(){d=!0}).bind("touchend."+o+" pointerup."+o+" MSPointerUp."+o,function(){d=!1}).bind("click."+o,function(o){if(t(o.target).hasClass(u[12])||t(o.target).hasClass("mCSB_draggerRail")){U(e);var s=t(this),a=s.find(".mCSB_dragger");if(s.parent(".mCSB_scrollTools_horizontal").length>0){if(!i.overflowed[1])return;var l="x",c=o.pageX>a.offset().left?-1:1,d=Math.abs(n[0].offsetLeft)-.9*c*r.width()}else{if(!i.overflowed[0])return;var l="y",c=o.pageY>a.offset().top?-1:1,d=Math.abs(n[0].offsetTop)-.9*c*r.height()}Y(e,d.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})}})},F=function(){var e=t(this),o=e.data(s),n=o.opt,r=s+"_"+o.idx,a=t("#mCSB_"+o.idx+"_container"),l=a.parent();a.bind("focusin."+r,function(){var o=t(i.activeElement),s=a.find(".mCustomScrollBox").length,r=0;o.is(n.advanced.autoScrollOnFocus)&&(U(e),clearTimeout(e[0]._focusTimeout),e[0]._focusTimer=s?(r+17)*s:0,e[0]._focusTimeout=setTimeout(function(){var t=[ie(o)[0],ie(o)[1]],i=[a[0].offsetTop,a[0].offsetLeft],s=[i[0]+t[0]>=0&&i[0]+t[0]=0&&i[0]+t[1]a");l.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(s){function r(t,i){n.scrollAmount=o.snapAmount||o.scrollButtons.scrollAmount,R(e,t,i)}if(s.preventDefault(),Z(s)){var a=t(this).attr("class");switch(n.type=o.scrollButtons.scrollType,s.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===n.type)return;d=!0,i.tweenRunning=!1,r("on",a);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===n.type)return;d=!1,n.dir&&r("off",a);break;case"click":if("stepped"!==n.type||i.tweenRunning)return;r("on",a)}}})},N=function(){var e=t(this),o=e.data(s),n=o.opt,r=o.sequential,a=s+"_"+o.idx,l=t("#mCSB_"+o.idx),c=t("#mCSB_"+o.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']";l.attr("tabindex","0").bind("blur."+a+" keydown."+a+" keyup."+a,function(s){function a(t,i){r.type=n.keyboard.scrollType,r.scrollAmount=n.snapAmount||n.keyboard.scrollAmount,"stepped"===r.type&&o.tweenRunning||R(e,t,i)}switch(s.type){case"blur":o.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=s.keyCode?s.keyCode:s.which,h="on";if("x"!==n.axis&&(38===l||40===l)||"y"!==n.axis&&(37===l||39===l)){if((38===l||40===l)&&!o.overflowed[0]||(37===l||39===l)&&!o.overflowed[1])return;"keyup"===s.type&&(h="off"),t(i.activeElement).is(u)||(s.preventDefault(),s.stopImmediatePropagation(),a(h,l))}else if(33===l||34===l){if((o.overflowed[0]||o.overflowed[1])&&(s.preventDefault(),s.stopImmediatePropagation()),"keyup"===s.type){U(e);var p=34===l?-1:1;if("x"===n.axis||"yx"===n.axis&&o.overflowed[1]&&!o.overflowed[0])var f="x",v=Math.abs(c[0].offsetLeft)-.9*p*d.width();else var f="y",v=Math.abs(c[0].offsetTop)-.9*p*d.height();Y(e,v.toString(),{dir:f,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!t(i.activeElement).is(u)&&((o.overflowed[0]||o.overflowed[1])&&(s.preventDefault(),s.stopImmediatePropagation()),"keyup"===s.type)){if("x"===n.axis||"yx"===n.axis&&o.overflowed[1]&&!o.overflowed[0])var f="x",v=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var f="y",v=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;Y(e,v.toString(),{dir:f,scrollEasing:"mcsEaseInOut"})}}})},R=function(e,i,o,n,r){function a(t){var i="stepped"!==h.type,o=r?r:t?i?d.scrollInertia/1.5:d.scrollInertia:1e3/60,s=t?i?7.5:40:2.5,l=[Math.abs(p[0].offsetTop),Math.abs(p[0].offsetLeft)],u=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],f="x"===h.dir[0]?l[1]+h.dir[1]*u[1]*s:l[0]+h.dir[1]*u[0]*s,v="x"===h.dir[0]?l[1]+h.dir[1]*parseInt(h.scrollAmount):l[0]+h.dir[1]*parseInt(h.scrollAmount),m="auto"!==h.scrollAmount?v:f,g=n?n:t?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",y=t?!0:!1;return t&&17>o&&(m="x"===h.dir[0]?l[1]:l[0]),Y(e,m.toString(),{dir:h.dir[0],scrollEasing:g,dur:o,onComplete:y}),t?void(h.dir=!1):(clearTimeout(h.step),void(h.step=setTimeout(function(){a()},o)))}function l(){clearTimeout(h.step),G(h,"step"),U(e)}var c=e.data(s),d=c.opt,h=c.sequential,p=t("#mCSB_"+c.idx+"_container"),f="stepped"===h.type?!0:!1;switch(i){case"on":if(h.dir=[o===u[16]||o===u[15]||39===o||37===o?"x":"y",o===u[13]||o===u[15]||38===o||37===o?-1:1],U(e),ee(o)&&"stepped"===h.type)return;a(f);break;case"off":l(),(f||c.tweenRunning&&h.dir)&&a(!0)}},W=function(e){var i=t(this).data(s).opt,o=[];return"function"==typeof e&&(e=e()),e instanceof Array?o=e.length>1?[e[0],e[1]]:"x"===i.axis?[null,e[0]]:[e[0],null]:(o[0]=e.y?e.y:e.x||"x"===i.axis?null:e,o[1]=e.x?e.x:e.y||"y"===i.axis?null:e),"function"==typeof o[0]&&(o[0]=o[0]()),"function"==typeof o[1]&&(o[1]=o[1]()),o},q=function(e,i){if(null!=e&&"undefined"!=typeof e){var o=t(this),n=o.data(s),r=n.opt,a=t("#mCSB_"+n.idx+"_container"),l=a.parent(),c=typeof e;i||(i="x"===r.axis?"x":"y");var d="x"===i?a.outerWidth(!1):a.outerHeight(!1),u="x"===i?a[0].offsetLeft:a[0].offsetTop,p="x"===i?"left":"top";switch(c){case"function":return e();case"object":var f=e.jquery?e:t(e);if(!f.length)return;return"x"===i?ie(f)[1]:ie(f)[0];case"string":case"number":if(ee(e))return Math.abs(e);if(-1!==e.indexOf("%"))return Math.abs(d*parseInt(e)/100);if(-1!==e.indexOf("-="))return Math.abs(u-parseInt(e.split("-=")[1]));if(-1!==e.indexOf("+=")){var v=u+parseInt(e.split("+=")[1]);return v>=0?0:Math.abs(v)}if(-1!==e.indexOf("px")&&ee(e.split("px")[0]))return Math.abs(e.split("px")[0]);if("top"===e||"left"===e)return 0;if("bottom"===e)return Math.abs(l.height()-a.outerHeight(!1));if("right"===e)return Math.abs(l.width()-a.outerWidth(!1));if("first"===e||"last"===e){var f=a.find(":"+e);return"x"===i?ie(f)[1]:ie(f)[0]}return t(e).length?"x"===i?ie(t(e))[1]:ie(t(e))[0]:(a.css(p,e),void h.update.call(null,o[0]))}}},V=function(e){function i(){clearTimeout(p[0].autoUpdate),p[0].autoUpdate=setTimeout(function(){return d.advanced.updateOnSelectorChange&&(f=r(),f!==w)?(a(3),void(w=f)):(d.advanced.updateOnContentResize&&(v=[p.outerHeight(!1),p.outerWidth(!1),g.height(),g.width(),b()[0],b()[1]],(v[0]!==S[0]||v[1]!==S[1]||v[2]!==S[2]||v[3]!==S[3]||v[4]!==S[4]||v[5]!==S[5])&&(a(v[0]!==S[0]||v[1]!==S[1]),S=v)),d.advanced.updateOnImageLoad&&(m=o(),m!==k&&(p.find("img").each(function(){n(this)}),k=m)),void((d.advanced.updateOnSelectorChange||d.advanced.updateOnContentResize||d.advanced.updateOnImageLoad)&&i()))},60)}function o(){var t=0;return d.advanced.updateOnImageLoad&&(t=p.find("img").length),t}function n(e){function i(t,e){return function(){return e.apply(t,arguments)}}function o(){this.onload=null,t(e).addClass(u[2]),a(2)}if(t(e).hasClass(u[2]))return void a();var s=new Image;s.onload=i(s,o),s.src=e.src}function r(){d.advanced.updateOnSelectorChange===!0&&(d.advanced.updateOnSelectorChange="*");var e=0,i=p.find(d.advanced.updateOnSelectorChange);return d.advanced.updateOnSelectorChange&&i.length>0&&i.each(function(){e+=t(this).height()+t(this).width()}),e}function a(t){clearTimeout(p[0].autoUpdate),h.update.call(null,l[0],t)}var l=t(this),c=l.data(s),d=c.opt,p=t("#mCSB_"+c.idx+"_container");if(e)return clearTimeout(p[0].autoUpdate),void G(p[0],"autoUpdate");var f,v,m,g=p.parent(),y=[t("#mCSB_"+c.idx+"_scrollbar_vertical"),t("#mCSB_"+c.idx+"_scrollbar_horizontal")],b=function(){return[y[0].is(":visible")?y[0].outerHeight(!0):0,y[1].is(":visible")?y[1].outerWidth(!0):0]},w=r(),S=[p.outerHeight(!1),p.outerWidth(!1),g.height(),g.width(),b()[0],b()[1]],k=o();i()},X=function(t,e,i){return Math.round(t/e)*e-i},U=function(e){var i=e.data(s),o=t("#mCSB_"+i.idx+"_container,#mCSB_"+i.idx+"_container_wrapper,#mCSB_"+i.idx+"_dragger_vertical,#mCSB_"+i.idx+"_dragger_horizontal");o.each(function(){K.call(this)})},Y=function(e,i,o){function n(t){return l&&c.callbacks[t]&&"function"==typeof c.callbacks[t]}function r(){return[c.callbacks.alwaysTriggerOffsets||b>=w[0]+k,c.callbacks.alwaysTriggerOffsets||-T>=b]}function a(){var t=[p[0].offsetTop,p[0].offsetLeft],i=[g[0].offsetTop,g[0].offsetLeft],s=[p.outerHeight(!1),p.outerWidth(!1)],n=[h.height(),h.width()];e[0].mcs={content:p,top:t[0],left:t[1],draggerTop:i[0],draggerLeft:i[1],topPct:Math.round(100*Math.abs(t[0])/(Math.abs(s[0])-n[0])),leftPct:Math.round(100*Math.abs(t[1])/(Math.abs(s[1])-n[1])),direction:o.dir}}var l=e.data(s),c=l.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},o=t.extend(d,o),u=[o.dur,o.drag?0:o.dur],h=t("#mCSB_"+l.idx),p=t("#mCSB_"+l.idx+"_container"),f=p.parent(),v=c.callbacks.onTotalScrollOffset?W.call(e,c.callbacks.onTotalScrollOffset):[0,0],m=c.callbacks.onTotalScrollBackOffset?W.call(e,c.callbacks.onTotalScrollBackOffset):[0,0];if(l.trigger=o.trigger,(0!==f.scrollTop()||0!==f.scrollLeft())&&(t(".mCSB_"+l.idx+"_scrollbar").css("visibility","visible"),f.scrollTop(0).scrollLeft(0)),"_resetY"!==i||l.contentReset.y||(n("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(e[0]),l.contentReset.y=1),"_resetX"!==i||l.contentReset.x||(n("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(e[0]),l.contentReset.x=1),"_resetY"!==i&&"_resetX"!==i){switch(!l.contentReset.y&&e[0].mcs||!l.overflowed[0]||(n("onOverflowY")&&c.callbacks.onOverflowY.call(e[0]),l.contentReset.x=null),!l.contentReset.x&&e[0].mcs||!l.overflowed[1]||(n("onOverflowX")&&c.callbacks.onOverflowX.call(e[0]),l.contentReset.x=null),c.snapAmount&&(i=X(i,c.snapAmount,c.snapOffset)),o.dir){case"x":var g=t("#mCSB_"+l.idx+"_dragger_horizontal"),y="left",b=p[0].offsetLeft,w=[h.width()-p.outerWidth(!1),g.parent().width()-g.width()],S=[i,0===i?0:i/l.scrollRatio.x],k=v[1],T=m[1],x=k>0?k/l.scrollRatio.x:0,C=T>0?T/l.scrollRatio.x:0;break;case"y":var g=t("#mCSB_"+l.idx+"_dragger_vertical"),y="top",b=p[0].offsetTop,w=[h.height()-p.outerHeight(!1),g.parent().height()-g.height()],S=[i,0===i?0:i/l.scrollRatio.y],k=v[0],T=m[0],x=k>0?k/l.scrollRatio.y:0,C=T>0?T/l.scrollRatio.y:0}S[1]<0||0===S[0]&&0===S[1]?S=[0,0]:S[1]>=w[1]?S=[w[0],w[1]]:S[0]=-S[0],e[0].mcs||(a(),n("onInit")&&c.callbacks.onInit.call(e[0])),clearTimeout(p[0].onCompleteTimeout),(l.tweenRunning||!(0===b&&S[0]>=0||b===w[0]&&S[0]<=w[0]))&&(Q(g[0],y,Math.round(S[1]),u[1],o.scrollEasing),Q(p[0],y,Math.round(S[0]),u[0],o.scrollEasing,o.overwrite,{onStart:function(){o.callbacks&&o.onStart&&!l.tweenRunning&&(n("onScrollStart")&&(a(),c.callbacks.onScrollStart.call(e[0])),l.tweenRunning=!0,_(g),l.cbOffsets=r())},onUpdate:function(){o.callbacks&&o.onUpdate&&n("whileScrolling")&&(a(),c.callbacks.whileScrolling.call(e[0]))},onComplete:function(){if(o.callbacks&&o.onComplete){"yx"===c.axis&&clearTimeout(p[0].onCompleteTimeout);var t=p[0].idleTimer||0;p[0].onCompleteTimeout=setTimeout(function(){n("onScroll")&&(a(),c.callbacks.onScroll.call(e[0])),n("onTotalScroll")&&S[1]>=w[1]-x&&l.cbOffsets[0]&&(a(),c.callbacks.onTotalScroll.call(e[0])),n("onTotalScrollBack")&&S[1]<=C&&l.cbOffsets[1]&&(a(),c.callbacks.onTotalScrollBack.call(e[0])),l.tweenRunning=!1,p[0].idleTimer=0,_(g,"hide")},t)}}}))}},Q=function(t,i,o,s,n,r,a){function l(){k.stop||(b||v.call(),b=J()-y,c(),b>=k.time&&(k.time=b>k.time?b+p-(b-k.time):b+p-1,k.time0?(k.currVal=h(k.time,w,T,s,n),S[i]=Math.round(k.currVal)+"px"):S[i]=o+"px",m.call()}function d(){p=1e3/60,k.time=b+p,f=e.requestAnimationFrame?e.requestAnimationFrame:function(t){return c(),setTimeout(t,.01)},k.id=f(l)}function u(){null!=k.id&&(e.requestAnimationFrame?e.cancelAnimationFrame(k.id):clearTimeout(k.id),k.id=null)}function h(t,e,i,o,s){switch(s){case"linear":case"mcsLinear":return i*t/o+e;case"mcsLinearOut":return t/=o,t--,i*Math.sqrt(1-t*t)+e;case"easeInOutSmooth":return t/=o/2,1>t?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e);case"easeInOutStrong":return t/=o/2,1>t?i/2*Math.pow(2,10*(t-1))+e:(t--,i/2*(-Math.pow(2,-10*t)+2)+e);case"easeInOut":case"mcsEaseInOut":return t/=o/2,1>t?i/2*t*t*t+e:(t-=2,i/2*(t*t*t+2)+e);case"easeOutSmooth":return t/=o,t--,-i*(t*t*t*t-1)+e;case"easeOutStrong":return i*(-Math.pow(2,-10*t/o)+1)+e;case"easeOut":case"mcsEaseOut":default:var n=(t/=o)*t,r=n*t;return e+i*(.499999999999997*r*n+-2.5*n*n+5.5*r+-6.5*n+4*t)}}t._mTween||(t._mTween={top:{},left:{}});var p,f,a=a||{},v=a.onStart||function(){},m=a.onUpdate||function(){},g=a.onComplete||function(){},y=J(),b=0,w=t.offsetTop,S=t.style,k=t._mTween[i];"left"===i&&(w=t.offsetLeft);var T=o-w;k.stop=0,"none"!==r&&u(),d()},J=function(){return e.performance&&e.performance.now?e.performance.now():e.performance&&e.performance.webkitNow?e.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},K=function(){var t=this;t._mTween||(t._mTween={top:{},left:{}});for(var i=["top","left"],o=0;o=0&&o[0]+ie(s)[0]=0&&o[1]+ie(s)[1]e;e++)if(e in this&&this[e]===t)return e;return-1},e=[].slice;!function(t,e){return"function"==typeof define&&define.amd?define("waypoints",["jquery"],function(i){return e(i,t)}):e(t.jQuery,t)}(window,function(i,o){var s,n,r,a,l,c,d,u,h,p,f,v,m,g,y,b;return s=i(o),u=t.call(o,"ontouchstart")>=0,a={horizontal:{},vertical:{}},l=1,d={},c="waypoints-context-id",f="resize.waypoints",v="scroll.waypoints",m=1,g="waypoints-waypoint-ids",y="waypoint",b="waypoints",n=function(){function t(t){var e=this;this.$element=t,this.element=t[0],this.didResize=!1,this.didScroll=!1,this.id="context"+l++,this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()},this.waypoints={horizontal:{},vertical:{}},this.element[c]=this.id,d[this.id]=this,t.bind(v,function(){var t;return e.didScroll||u?void 0:(e.didScroll=!0,t=function(){return e.doScroll(),e.didScroll=!1},o.setTimeout(t,i[b].settings.scrollThrottle))}),t.bind(f,function(){var t;return e.didResize?void 0:(e.didResize=!0,t=function(){return i[b]("refresh"),e.didResize=!1},o.setTimeout(t,i[b].settings.resizeThrottle))})}return t.prototype.doScroll=function(){var t,e=this;return t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}},!u||t.vertical.oldScroll&&t.vertical.newScroll||i[b]("refresh"),i.each(t,function(t,o){var s,n,r;return r=[],n=o.newScroll>o.oldScroll,s=n?o.forward:o.backward,i.each(e.waypoints[t],function(t,e){var i,s;return o.oldScroll<(i=e.offset)&&i<=o.newScroll?r.push(e):o.newScroll<(s=e.offset)&&s<=o.oldScroll?r.push(e):void 0}),r.sort(function(t,e){return t.offset-e.offset}),n||r.reverse(),i.each(r,function(t,e){return e.options.continuous||t===r.length-1?e.trigger([s]):void 0})}),this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}},t.prototype.refresh=function(){var t,e,o,s=this;return o=i.isWindow(this.element),e=this.$element.offset(),this.doScroll(),t={horizontal:{contextOffset:o?0:e.left,contextScroll:o?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:o?0:e.top,contextScroll:o?0:this.oldScroll.y,contextDimension:o?i[b]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},i.each(t,function(t,e){return i.each(s.waypoints[t],function(t,o){var s,n,r,a,l;return s=o.options.offset,r=o.offset,n=i.isWindow(o.element)?0:o.$element.offset()[e.offsetProp],i.isFunction(s)?s=s.apply(o.element):"string"==typeof s&&(s=parseFloat(s),o.options.offset.indexOf("%")>-1&&(s=Math.ceil(e.contextDimension*s/100))),o.offset=n-e.contextOffset+e.contextScroll-s,o.options.onlyOnScroll&&null!=r||!o.enabled?void 0:null!==r&&r<(a=e.oldScroll)&&a<=o.offset?o.trigger([e.backward]):null!==r&&r>(l=e.oldScroll)&&l>=o.offset?o.trigger([e.forward]):null===r&&e.oldScroll>=o.offset?o.trigger([e.forward]):void 0})})},t.prototype.checkEmpty=function(){return i.isEmptyObject(this.waypoints.horizontal)&&i.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([f,v].join(" ")),delete d[this.id]):void 0},t}(),r=function(){function t(t,e,o){var s,n;"bottom-in-view"===o.offset&&(o.offset=function(){var t;return t=i[b]("viewportHeight"),i.isWindow(e.element)||(t=e.$element.height()),t-i(this).outerHeight()}),this.$element=t,this.element=t[0],this.axis=o.horizontal?"horizontal":"vertical",this.callback=o.handler,this.context=e,this.enabled=o.enabled,this.id="waypoints"+m++,this.offset=null,this.options=o,e.waypoints[this.axis][this.id]=this,a[this.axis][this.id]=this,s=null!=(n=this.element[g])?n:[],s.push(this.id),this.element[g]=s}return t.prototype.trigger=function(t){return this.enabled?(null!=this.callback&&this.callback.apply(this.element,t),this.options.triggerOnce?this.destroy():void 0):void 0},t.prototype.disable=function(){return this.enabled=!1},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0},t.prototype.destroy=function(){return delete a[this.axis][this.id],delete this.context.waypoints[this.axis][this.id],this.context.checkEmpty()},t.getWaypointsByElement=function(t){var e,o;return(o=t[g])?(e=i.extend({},a.horizontal,a.vertical),i.map(o,function(t){return e[t]})):[]},t}(),p={init:function(t,e){var o;return e=i.extend({},i.fn[y].defaults,e),null==(o=e.handler)&&(e.handler=t),this.each(function(){var t,o,s,a;return t=i(this),s=null!=(a=e.context)?a:i.fn[y].defaults.context,i.isWindow(s)||(s=t.closest(s)),s=i(s),o=d[s[0][c]],o||(o=new n(s)),new r(t,o,e)}),i[b]("refresh"),this},disable:function(){return p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(t,e){return p._traverse.call(this,t,e,function(t,e,i){return e>0?t.push(i[e-1]):void 0})},next:function(t,e){return p._traverse.call(this,t,e,function(t,e,i){return et.oldScroll.y})},left:function(t){return null==t&&(t=o),h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){return null==t&&(t=o),h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return p[t]=e},_invoke:function(t){var e;return e=i.extend({},a.vertical,a.horizontal),i.each(e,function(e,i){return i[t](),!0})},_filter:function(t,e,o){var s,n;return(s=d[i(t)[0][c]])?(n=[],i.each(s.waypoints[e],function(t,e){return o(s,e)?n.push(e):void 0}),n.sort(function(t,e){return t.offset-e.offset}),i.map(n,function(t){return t.element})):[]}},i[b]=function(){var t,i;return i=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],h[i]?h[i].apply(null,t):h.aggregate.call(null,i)},i[b].settings={resizeThrottle:100,scrollThrottle:30},s.on("load.waypoints",function(){return i[b]("refresh")})})}.call(this);
/* ------------------------------------------------------------------------
Class: prettyPhoto
Use: Lightbox clone for jQuery
Author: Stephane Caron (http://www.no-margin-for-errors.com)
Version: 3.1.5
------------------------------------------------------------------------- */
(function(e){function t(){var e=location.href;hashtag=e.indexOf("#prettyPhoto")!==-1?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):false;return hashtag}function n(){if(typeof theRel=="undefined")return;location.hash=theRel+"/"+rel_index+"/"}function r(){if(location.href.indexOf("#prettyPhoto")!==-1)location.hash="prettyPhoto"}function i(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+e+"=([^]*)";var r=new RegExp(n);var i=r.exec(t);return i==null?"":i[1]}e.prettyPhoto={version:"3.1.5"};e.fn.prettyPhoto=function(s){function g(){e(".pp_loaderIcon").hide();projectedTop=scroll_pos["scrollTop"]+(d/2-a["containerHeight"]/2);if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:a["contentHeight"],width:a["contentWidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:v/2-a["containerWidth"]/2<0?0:v/2-a["containerWidth"]/2,width:a["containerWidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);if(isSet&&S(pp_images[set_position])=="image"){$pp_pic_holder.find(".pp_hoverContainer").show()}else{$pp_pic_holder.find(".pp_hoverContainer").hide()}if(settings.allow_expand){if(a["resized"]){e("a.pp_expand,a.pp_contract").show()}else{e("a.pp_expand").hide()}}if(settings.autoplay_slideshow&&!m&&!f)e.prettyPhoto.startSlideshow();settings.changepicturecallback();f=true});C();s.ajaxcallback()}function y(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show();t()})}function b(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;E(e,t);imageWidth=e,imageHeight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imageWidth=v-200;imageHeight=t/e*imageWidth}else if(h>d){imageHeight=d-200;imageWidth=e/t*imageHeight}else{fitting=true}h=imageHeight,p=imageWidth}if(p>v||h>d){w(p,h)}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(h),containerWidth:Math.floor(p)+settings.horizontal_padding*2,contentHeight:Math.floor(l),contentWidth:Math.floor(c),resized:resized}}function E(t,n){t=parseFloat(t);n=parseFloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();l=n+detailsHeight;c=t;h=l+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function S(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=T();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=d/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:v/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function T(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}function N(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function C(){if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((a["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyPhoto.changeGalleryPage("next");e.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyPhoto.changeGalleryPage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=52+5;$pp_gallery_li.each(function(t){e(this).find("a").click(function(){e.prettyPhoto.changePage(t);e.prettyPhoto.stopSlideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('Play');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyPhoto.close()});e("a.pp_close").bind("click",function(){e.prettyPhoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasClass("pp_expand")){e(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{e(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}y(function(){e.prettyPhoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyPhoto.changePage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyPhoto.changePage("next");e.prettyPhoto.stopSlideshow();return false});x()}s=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:' ',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'{content}
',custom_markup:"",social_tools:''},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=T();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();N()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous");t.preventDefault();break;case 39:e.prettyPhoto.changePage("next");t.preventDefault();break;case 27:if(!settings.modal)e.prettyPhoto.close();t.preventDefault();break}}}})}e.prettyPhoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;theRel=e(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href")}):e.makeArray(e(this).attr("href"));pp_titles=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makeArray(e(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makeArray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray(e(this).attr("href"),pp_images);rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyPhoto.open();return false};e.prettyPhoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makeArray(arguments[0]);pp_titles=arguments[1]?e.makeArray(arguments[1]):e.makeArray("");pp_descriptions=arguments[2]?e.makeArray(arguments[2]):e.makeArray("");isSet=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loaderIcon").show();if(settings.deeplinking)n();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size());if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parseFloat(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.toString();u=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150);u=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150);u=true}$pp_pic_holder.fadeIn(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html("Â ");imgPreloader="";skipInjection=false;switch(S(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position0)movie_id=movie_id.substr(0,movie_id.indexOf("?"));if(movie_id.indexOf("&")>0)movie_id=movie_id.substr(0,movie_id.indexOf("&"))}movie="http://www.youtube.com/embed/"+movie_id;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentHeight"]+=15;a["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipInjection=true;e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()});break;case"custom":a=w(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('
').css({width:settings.default_width}).wrapInner('').appendTo(e("body")).show();doresize=false;a=w(e(myClone).width(),e(myClone).height());doresize=true;e(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()}});return false};e.prettyPhoto.changePage=function(t){currentGalleryPage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")}y(function(){e.prettyPhoto.open()})};e.prettyPhoto.changeGalleryPage=function(e){if(e=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(e=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyPhoto.startSlideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){e.prettyPhoto.stopSlideshow();return false});m=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)}else{e.prettyPhoto.changePage("next")}};e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){e.prettyPhoto.startSlideshow();return false});clearInterval(m);m=undefined};e.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyInitialized&&t()){pp_alreadyInitialized=true;hashIndex=t();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){e("a["+s.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false;
// source --> https://restauranteaquarius.com.br/wp-content/themes/tuscany/js/min/main-dist.js?ver=1.0
(function($) {
'use strict';
$(window).scroll(function(){
if ($(this).scrollTop() > 400) {
$('.goTop').fadeIn();
} else {
$('.goTop').fadeOut();
}
});
$('.goTop').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
if (!Modernizr.touch) {
$('.element-animate').css({
opacity: 0
});
}
$(document).ready(function() {
$('.recipes-slider-mobile').slick({
slidesToShow : 1,
slidesToScroll : 1,
infinite : true,
dots : true,
});
$("a[rel^='prettyPhoto']").prettyPhoto();
$('.ava_themes_block').parents('.vc_row').addClass('ava_block_wrapp');
});
$('.product_list_widget img, .woocommerce ul.products li .thumbnail-img-hold img, .cart_list li img, #content div.product div.images div.thumbnails img').addClass('img-thumbnail');
$('.widget_search .search-field, .comment-form-author input, .comment-form-url input, .comment-form-comment textarea, .comment-form-email input, .widget_product_search input[type="text"], .woocommerce-checkout form input[type="text"], .woocommerce-checkout textarea').addClass('form-control');
$('.widget_search .search-submit, .widget_product_search input[type="submit"]').addClass('btn-tuscany-submit pull-right');
$('.comment-form #submit').addClass('btn-tuscany-submit');
$('.author-post .avatar').addClass('hidden-xs hidden-sm');
$(window).load(function() {
$('.loader-wrapp').fadeOut('slow', function() {
$(this).remove();
});
$('.match-me').matchHeight({
byRow: true,
property: 'height',
target: null,
remove: false
});
setTimeout(function() {
$.stellar();
}, 100);
var wHeight = $(window).height(),
hHeight = $('.tuscany-header').outerHeight();
$('.video-fix').css({
height: wHeight - hHeight
});
$('.sizable-div').css({
height : wHeight
});
$('#big-video-wrap').append('');
$('#big-video-wrap').append('');
var $animateEl = $('.animate-element').toArray();
$.each($animateEl, function(index, val) {
$(val).addClass('animated ' + $(val).data('animation'));
});
$(".tus-scroll").mCustomScrollbar({
axis:"y", // vertical and horizontal scrollbar
theme:"dark"
});
if (!Modernizr.touch) {
setTimeout(function() {
$('.animation-text-div').waypoint(function() {
$(this).addClass('animate-it');
}, { offset: '40%' });
$('.great-elements').waypoint(function() {
$(this).addClass('animate-it');
}, { offset: '40%' });
$('.schedule-holder').waypoint(function() {
$(this).addClass('animate-it');
}, { offset: '70%' });
$('.element-animate').waypoint(function() {
var animationType = $(this).data('animation');
$(this).addClass('animated ' + animationType);
}, { offset: '70%' });
$('.adittional-tissue-text').waypoint(function() {
$(this).addClass('animate-images');
}, { offset: '70%' });
}, 50);
setTimeout(function() {
$('.animation-about-food').waypoint(function() {
$(this).addClass('animate-about');
}, { offset: '70%' });
}, 1000);
}
});
var $testimonialClients = $('.clients-speaks-slider');
if ($testimonialClients.length > 0) {
$testimonialClients.slick({
infinite : false,
slidesToShow : 1,
slidesToScroll : 1,
dots : false,
arrows : false
})
}
var $ourGallerySlider = $('.our-gallery-slider');
if ($ourGallerySlider.length > 0) {
$ourGallerySlider.slick({
infinite : false,
slidesToShow : 1,
slidesToScroll : 1,
})
}
var $bigPoppa = $('.gallery-big-pappa');
if ($bigPoppa.length > 0) {
$bigPoppa.slick({
slidesToShow: 1,
slidesToScroll: 1,
infinite: false,
arrows: false,
fade: true,
asNavFor: '.gallery-thumb-pappa'
});
$('.gallery-thumb-pappa').slick({
slidesToShow: 4,
slidesToScroll: 2,
infinite: false,
asNavFor: '.gallery-big-pappa',
dots: true,
focusOnSelect: true
});
}
var $dishesSlider = $('.best-dishes');
if ($dishesSlider.length > 0) {
$dishesSlider.slick({
infinite : false,
slidesToShow : 4,
slidesToScroll : 2,
responsive: [
{
breakpoint: 1200,
settings: {
slidesToShow: 3,
slidesToScroll: 2,
}
},
{
breakpoint: 993,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: 650,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
})
}
var $greatDishes = $('.great-dishes');
if ($greatDishes.length > 0) {
$greatDishes.slick({
infinite : false,
slidesToShow : 1,
slidesToScroll : 1
})
}
var $memberSlider = $('.team-members-slides');
if ($memberSlider.length > 0) {
$memberSlider.slick({
infinite : false,
slidesToShow : 3,
slidesToScroll : 3,
responsive: [
{
breakpoint: 1200,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 993,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
})
}
$('#open-canvas, #close-canvas').on('click', function(event) {
event.preventDefault();
$('.mobile-nav').toggleClass('open-menu');
});
$('.scroll-down').on('click', function(event) {
event.preventDefault();
$("html, body").animate({ scrollTop: $('.video-fix').height() + $('.tuscany-header').outerHeight() }, 1000);
});
$('.scroll-place').on('click', function(event) {
event.preventDefault();
$("html, body").animate({ scrollTop: $('#rev_slider_1_1_wrapper').height() + $('.tuscany-header').outerHeight() }, 1000);
});
var $newsSlider = $('.news-slider');
if ($newsSlider.length > 0) {
$newsSlider.slick({
infinite : true,
slidesToShow : 4,
slidesToScroll : 2,
arrows : false,
dots : false,
responsive: [
{
breakpoint: 993,
settings: {
slidesToShow: 3,
slidesToScroll: 2
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
})
}
var $gallerySlide = $('.gallery-slider');
if ($gallerySlide.length > 0) {
$gallerySlide.slick({
infinite : true,
slidesToShow : 4,
slidesToScroll : 2,
responsive: [
{
breakpoint: 993,
settings: {
slidesToShow: 3,
slidesToScroll: 2
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
})
}
var $latestSlider = $('.latest-slider');
if ($latestSlider.length > 0) {
$latestSlider.slick({
infinite : false,
slidesToShow : 3,
slidesToScroll : 3,
responsive: [
{
breakpoint: 1050,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: 700,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
})
}
$('.custom-menu-nav-news a').click(function(event) {
event.preventDefault();
var dir = $(this).data('dir');
if (dir == 'next') {
$gallerySlide.slickNext();
$newsSlider.slickNext();
} else {
$gallerySlide.slickPrev();
$newsSlider.slickPrev();
}
});
var $testimonialSlider = $('.testimonial-content');
if ($testimonialSlider.length > 0) {
$testimonialSlider.slick({
infinite : true,
vertical : true,
slidesToShow : 1,
slidesToScroll : 1,
arrows : false,
dots : false,
})
}
$('.nav-arrows a, .testimonials-nav-arrows a').click(function(event) {
event.preventDefault();
var dir = $(this).data('dir');
if (dir == 'down') {
$testimonialSlider.slickNext();
} else {
$testimonialSlider.slickPrev();
}
});
var $menuSlider = $('.menu-slides');
if ($menuSlider.length > 0) {
$menuSlider.slick({
infinite : true,
slidesToShow : 3,
slidesToScroll : 2,
arrows : false,
dots : false,
responsive: [
{
breakpoint: 1200,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 993,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
})
}
$('.custom-menu-nav-1 a').click(function(event) {
event.preventDefault();
var dir = $(this).data('dir');
if (dir == 'next') {
$('.menu-slides-1').slickNext();
} else {
$('.menu-slides-1').slickPrev();
}
});
$('.custom-menu-nav-2 a').click(function(event) {
event.preventDefault();
var dir = $(this).data('dir');
if (dir == 'next') {
$('.menu-slides-2').slickNext();
} else {
$('.menu-slides-2').slickPrev();
}
});
$('.custom-menu-nav-3 a').click(function(event) {
event.preventDefault();
var dir = $(this).data('dir');
if (dir == 'next') {
$('.menu-slides-3').slickNext();
} else {
$('.menu-slides-3').slickPrev();
}
});
})(jQuery);
// source --> https://restauranteaquarius.com.br/wp-includes/js/wp-embed.min.js?ver=4.7.15
!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);
// source --> https://restauranteaquarius.com.br/wp-content/plugins/wd-instagram-feed/frontend/../js/wdi_instagram.js?ver=1.1.21
/**
* WDIInstagram is jQuery based plugin which handles communication
* with instagram API endpoints
*
* Plugin Version: 1.0.0
* Author: Melik Karapetyan
* License: GPLv2 or later
*
*
*
*
*
* Methods:
* getSelfInfo = function( args ) : Get information about the owner of the access_token.
* searchForUsersByName = function( username, args ) : Get a list of users matching the query.
* searchForTagsByName = function(tagname, args) : Search for tags by name.
* getTagRecentMedia = function(tagname, args) : Gets recent media based on tagname
*
*/
/**
* example of arg
* @type {Object}
*/
// var args = {
// access_tokens: ['227416602.145c5c2.302096fa9b3b4a8bbe0cee9341a6d7f5'],
// filters: [{
// where: 'getTagRecentMedia',
// what: function(r) {
// return r;
// },
// }, {
// where: 'searchForUsersByName',
// what: 'bbb',
// }],
// }
/**
* WDIInstagram object constructor
* @param {Object} args
*
* @param {Array} [args.access_tokens] [array of lavid instagram access tokens]
* @param {Array} [args.filters] [array of object defining filters]
* @param {Object} [args.filters[i] ] [ filter object which contain 'where' : 'what' pair ]
* @param {String} [args.filters.filter[i].where] [name of function where filter must be applied]
* @param {String or Array} [args.filters.filter[i].what] [name of filtering function,
* if function is in global scope then it should be name of the funtion
* else if function in method of some object then it should be an array
* ['parent_object_name','filtering_function_name']]
*/
function WDIInstagram(args)
{
this.access_tokens = [];
this.filters = [];
if (typeof args != 'undefined') {
if (typeof args.access_tokens != 'undefined') {
this.access_tokens = args.access_tokens;
}
if (typeof args.filters != 'undefined') {
this.filters = args.filters;
}
}
var _this = this;
/**
* Default object for handling status codes
* @type {Object}
*/
this.statusCode = {
429: function ()
{
console.log(' 429: Too many requests. Try after one hour');
},
}
/**
* gets filter function defined for specific method
* this function is internal function and cannot be called outside of this object
*
* @param {String} methodName [name of WDIInstagram method]
* @return {Function} [filtering function for {methodName}]
*/
this.getFilter = function (methodName)
{
var filters = _this.filters;
if (typeof filters == "undefined") {
return false;
}
for (var i = 0; i < filters.length; i++) {
if (filters[i].where == methodName) {
if (typeof filters[i].what == 'object' && filters[i].what.length == 2) {
if (typeof window[filters[i].what[0]] != 'undefined') {
if (typeof window[filters[i].what[0]][filters[i].what[1]] == 'function') {
return window[filters[i].what[0]][filters[i].what[1]];
}
}
} else
if (typeof filters[i].what == 'string') {
if (typeof window[filters[i].what] == 'function') {
return window[filters[i].what];
}
} else
if (typeof filters[i].what == 'function') {
return filters[i].what;
} else {
return false;
}
}
}
return false;
}
function getAccessToken()
{
var access_tokens = _this.access_tokens,
index = parseInt(Math.random(0, 1) * access_tokens.length);
return access_tokens[index];
}
/**
* Adds access token to this.access_tokens array
* non string values are not allowed
* @param {String} token [Instagram API access token]
*/
this.addToken = function (token)
{
if (typeof token == 'string') {
_this.access_tokens.push(token);
}
}
/**
* Gets recent media based on tagname
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition media_count => number of media to request
* @definition min_tag_id => Return media before this min_tag_id.
* @definition max_tag_id => Return media after this max_tag_id.
* @definition statusCode => StatusCode object.
*
* @param tagname => A valid tag name without a leading #. (eg. snowy, nofilter)
* @param args = {
* success : 'success_callback',
* error : 'error_callback',
* statusCode : statusCode
* count : 'media_count',
* min_tag_id : 'min_tag_id',
* max_tag_id : 'max_tag_id',
* args : arguments to be passed to filtering function
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded media
*/
this.getTagRecentMedia = function (tagname, args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode,
errorFlag = false,
argFlag = false,
filter = this.getFilter('getTagRecentMedia'),
baseUrl = 'https://api.instagram.com/v1/tags/' + tagname + '/media/recent?access_token=' + getAccessToken();
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
if ('error' in args) {
errorFlag = true;
}
//
if ('args' in args) {
argFlag = true;
} else {
args.args = {};
}
//
if ('count' in args) {
args['count'] = parseInt(args['count']);
if (!Number.isInteger(args['count']) || args['count'] <= 0) {
args.count = 33;
}
} else {
args.count = 33;
}
baseUrl += '&count=' + args.count;
if ('min_tag_id' in args) {
baseUrl += '&min_tag_id=' + args.min_tag_id;
}
if ('max_tag_id' in args) {
baseUrl += '&max_tag_id=' + args.max_tag_id;
}
}
jQuery.ajax({
type: 'POST',
url: baseUrl,
dataType: 'jsonp',
success: function (response)
{
if (typeof response["data"] === "undefined") response["data"] = [];
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* Search for tags by name.
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition statusCode => StatusCode object.
*
* @param tagname => A valid tag name without a leading #. (eg. snowy, nofilter)
* @param args = {
* success: 'success_callback',
* error: 'error_callback',
* statusCode : statusCode,
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded media
*/
this.searchForTagsByName = function (tagname, args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode;
errorFlag = false;
filter = this.getFilter('searchForTagsByName');
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
}
jQuery.ajax({
type: 'POST',
url: 'https://api.instagram.com/v1/tags/search?q=' + tagname + '&access_token=' + getAccessToken(),
dataType: 'jsonp',
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* Get a list of users matching the query.
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition statusCode => StatusCode object.
*
* @param username
* @param args = {
* success: 'success_callback',
* error: 'error_callback',
* statusCode : statusCode
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded users
*/
this.searchForUsersByName = function (username, args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode,
errorFlag = false,
filter = this.getFilter('searchForUsersByName');
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: 'https://api.instagram.com/v1/users/search?q=' + username + '&access_token=' + getAccessToken(),
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
response.args = args;
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
response.args = args;
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
response.args = args;
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: this.statusCode
});
}
/**
* Get the list of recent media liked by the owner of the access_token.
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition statusCode => StatusCode object.
* @param args = {
* success: 'success_callback',
* error: 'error_callback',
* statusCode : statusCode
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
* @return object of founded media
*/
this.getRecentLikedMedia = function (args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode,
errorFlag = false,
filter = this.getFilter('getRecentLikedMedia'),
baseUrl = 'https://api.instagram.com/v1/users/self/media/liked?access_token=' + getAccessToken();
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
if ('args' in args) {
argFlag = true;
} else {
args.args = {};
}
if ('count' in args) {
args['count'] = parseInt(args['count']);
if (!Number.isInteger(args['count']) || args['count'] <= 0) {
args.count = 20;
}
} else {
args.count = 20;
}
baseUrl += '&count=' + args.count;
if ('next_max_like_id' in args) {
baseUrl += '&next_max_like_id=' + args.next_max_like_id;
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: baseUrl,
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* Get the most recent media published by a user.
* This endpoint requires the public_content scope if the user-id is not the owner of the access_token.
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition media_count => number of media to request
* @definition min_id => Return media before this min_id.
* @definition max_id => Return media after this max_id.
* @definition statusCode => StatusCode object.
*
* @param args = {
* success : 'success_callback',
* error : 'error_callback',
* statusCode : statusCode,
* count : 'media_count',
* min_id : 'min_id',
* max_id : 'max_id',
* args: arguments to be passed to filtering function
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded media
*/
this.getUserRecentMedia = function (user_id, args)
{
var instagram = this,
noArgument = false,
successFlag = false,
argFlag = false,
//internal default object for statusCode handling
statusCode = this.statusCode,
errorFlag = false,
filter = this.getFilter('getUserRecentMedia'),
baseUrl = 'https://api.instagram.com/v1/users/' + user_id + '/media/recent/?access_token=' + getAccessToken();
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
if ('args' in args) {
argFlag = true;
} else {
args.args = {};
}
if ('error' in args) {
errorFlag = true;
}
if ('count' in args) {
args['count'] = parseInt(args['count']);
if (!Number.isInteger(args['count']) || args['count'] <= 0) {
args.count = 33;
}
} else {
args.count = 33;
}
baseUrl += '&count=' + args.count;
if ('min_id' in args) {
baseUrl += '&min_id=' + args.min_id;
}
if ('max_id' in args) {
baseUrl += '&max_id=' + args.max_id;
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: baseUrl,
success: function (response)
{
if (typeof response["data"] === "undefined") response["data"] = [];
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* Get the most recent media published by the owner of the access_token.
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition media_count => number of media to request
* @definition min_id => Return media before this min_id.
* @definition max_id => Return media after this max_id.
* @definition statusCode => StatusCode object.
*
* @param args = {
* success : 'success_callback',
* error : 'error_callback',
* count : 'media_count',
* min_id : 'min_id'
* max_id : 'max_id'
* statusCode : statusCode
*
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded media
*/
this.getSelfRecentMedia = function (args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode;
errorFlag = false,
filter = this.getFilter('getSelfRecentMedia'),
baseUrl = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' + getAccessToken();
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
if ('count' in args) {
args['count'] = parseInt(args['count']);
if (!Number.isInteger(args['count']) || args['count'] <= 0) {
args.count = 33;
}
} else {
args.count = 33;
}
baseUrl += '&count=' + args.count;
if ('min_id' in args) {
baseUrl += '&min_id=' + args.min_id;
}
if ('max_id' in args) {
baseUrl += '&max_id=' + args.max_id;
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: baseUrl,
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* Get information about a user.
* This endpoint requires the public_content scope if the user-id is not the owner of the access_token.
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition statusCode => StatusCode object.
*
* @param args = {
* success : 'success_callback',
* error : 'error_callback'
* statusCode : statusCode
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded info
*/
this.getUserInfo = function (user_id, args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode,
errorFlag = false,
filter = this.getFilter('getUserInfo');
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: 'https://api.instagram.com/v1/users/' + user_id + '/?access_token=' + getAccessToken(),
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* Get information about the owner of the access_token.
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition statusCode => StatusCode object.
*
* @param args = {
* success : 'success_callback',
* error : 'error_callback'
* statusCode : statusCode
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded info
*/
this.getSelfInfo = function (args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode,
errorFlag = false,
filter = this.getFilter('getSelfInfo');
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: 'https://api.instagram.com/v1/users/self/?access_token=' + getAccessToken(),
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* Get a list of recent comments on a media object.
* The public_content permission scope is required to get comments for a media
* that does not belong to the owner of the access_token.
*
* @media_id => id of the media which comments must be getted
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition statusCode => StatusCode object.
*
* @param args = {
* success : 'success_callback',
* error : 'error_callback'
* statusCode : statusCode
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded comments
*/
this.getRecentMediaComments = function (media_id, args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode,
errorFlag = false,
filter = this.getFilter('getRecentMediaComments');
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: 'https://api.instagram.com/v1/media/' + media_id + '/comments?access_token=' + getAccessToken(),
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* Get a list of users who have liked this media.
*
* @media_id => id of the media which comments must be getted
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition statusCode => StatusCode object.
*
* @param args = {
* success : 'success_callback',
* error : 'error_callback'
* statusCode : statusCode
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded comments
*/
this.getRecentMediaLikes = function (media_id, args)
{
var instagram = this,
noArgument = false,
successFlag = false,
statusCode = this.statusCode,
errorFlag = false,
filter = this.getFilter('getRecentMediaLikes');
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: 'https://api.instagram.com/v1/media/' + media_id + '/likes?access_token=' + getAccessToken(),
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
/**
* make an ajax request based on url
*
*
* @definition success_callback => which function to call in case of success
* @definition error_callback => which function to call in case of error
* @definition statusCode => StatusCode object.
*
* @param args = {
* success : 'success_callback',
* error : 'error_callback',
* statusCode : statusCode,
* args.args : arguments to be passed to filter function
* }
*
*
* if callback function is property of any other object just give it as array [ 'parent_object', 'callback_function']
* or you can pass as callback function an anonymous function
*
*
* @return object of founded media
*/
this.requestByUrl = function (requestUrl, args)
{
var instagram = this,
noArgument = false,
successFlag = false,
errorFlag = false,
argFlag = false,
statusCode = this.statusCode,
filter = this.getFilter('requestByUrl'),
urlParts,
urlPart;
//changing access token to random one
urlParts = requestUrl.split('?')[1].split('&');
for (var i = 0; i < urlParts.length; i++) {
urlParts[i] = urlParts[i].split('=');
if (urlParts[i][0] == 'access_token') {
urlParts[i][1] = getAccessToken();
}
urlParts[i] = urlParts[i].join('=');
}
urlParts = urlParts.join('&');
requestUrl = requestUrl.split('?')[0] + '?' + urlParts;
if (typeof args == 'undefined' || args.length === 0) {
noArgument = true;
} else {
if ('success' in args) {
successFlag = true;
}
if ('args' in args) {
argFlag = true;
} else {
args.args = {};
}
if ('error' in args) {
errorFlag = true;
}
if ('statusCode' in args) {
statusCode = args['statusCode'];
}
}
jQuery.ajax({
type: 'POST',
dataType: 'jsonp',
url: requestUrl,
success: function (response)
{
if (successFlag) {
if (typeof args.success == 'object' && args.success.length == 2) {
if (typeof window[args.success[0]] != 'undefined') {
if (typeof window[args.success[0]][args.success[1]] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
window[args.success[0]][args.success[1]](response);
}
}
} else
if (typeof args.success == 'string') {
if (typeof window[args.success] == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
window[args.success](response);
}
} else
if (typeof args.success == 'function') {
if (filter) {
response = filter(response, instagram.filterArguments, args.args);
}
args.success(response);
}
}
},
error: function (response)
{
if (errorFlag) {
if (typeof args['error'] == 'object' && args['error'].length == 2) {
if (typeof window[args['error'][0]][args['error'][1]] == 'function') {
window[args['error'][0]][args['error'][1]](response);
}
} else
if (typeof args['error'] == 'string') {
if (typeof window[args['error']] == 'function') {
window[args['error']](response);
}
} else
if (typeof args['error'] == 'function') {
args['error'](response);
}
}
},
statusCode: statusCode
});
}
};
// source --> https://restauranteaquarius.com.br/wp-includes/js/underscore.min.js?ver=1.8.3
// Underscore.js 1.8.3
// http://underscorejs.org
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this);