(function($,window,document){var Owl2A11y=function(carousel){this._core=carousel;this._initialized=!1;this._core._options=$.extend(Owl2A11y.defaults,this._core.options);this.$element=this._core.$element;var setCurrent=$.proxy(function(e){this.setCurrent(e)},this);this._handlers={'initialized.owl.carousel':$.proxy(function(e){this.setupRoot();if(e.namespace&&!this._initialized){this.setupFocus();this.setupKeyboard()} this.setCurrent(e)},this),'changed.owl.carousel':setCurrent,'translated.owl.carousel':setCurrent,'refreshed.owl.carousel':setCurrent,'resized.owl.carousel':setCurrent};this.$element.on(this._handlers)};Owl2A11y.defaults={};Owl2A11y.eventHandlers={};Owl2A11y.prototype.getDocumentKeyUp=function(){var self=this;return function(e){var eventTarg=$(e.target),targ=self.focused(eventTarg),action=null;if(!!targ){if(e.keyCode==37||e.keyCode==38){action='prev.owl.carousel'} else if(e.keyCode==39||e.keyCode==40){action='next.owl.carousel'} else if(e.keyCode==13){if(eventTarg.hasClass('owl-prev'))action='prev.owl.carousel';else if(eventTarg.hasClass('owl-next'))action='next.owl.carousel';else if(eventTarg.hasClass('owl-dot'))action='click'} if(!!action)targ.trigger(action)}}};Owl2A11y.prototype.setupRoot=function(){this.$element.attr({role:'listbox',tabindex:'0'})};Owl2A11y.prototype.setupKeyboard=function(){if(!this.$element.attr('data-owl-access-keyup')){this.$element.bind('keyup',this.getDocumentKeyUp()).attr('data-owl-access-keyup','1')} this.$element.attr('data-owl-carousel-focusable','1')};Owl2A11y.prototype.setupFocus=function(){this.$element.bind('focusin',function(){$(this).attr({'data-owl-carousel-focused':'1','aria-live':'polite'}).trigger('stop.owl.autoplay')}).bind('focusout',function(){$(this).attr({'data-owl-carousel-focused':'0','aria-live':'off'}).trigger('play.owl.autoplay')});if(!!this._core._plugins.navigation){var navPlugin=this._core._plugins.navigation,toFocus=[];if(!!navPlugin._controls.$previous){toFocus.push(navPlugin._controls.$previous)} if(!!navPlugin._controls.$next){toFocus.push(navPlugin._controls.$next)} if(!!navPlugin._controls.$indicators){toFocus.push(navPlugin._controls.$indicators.children())} $.each(toFocus,function(){this.attr('tabindex','0')})}};Owl2A11y.prototype.destroy=function(){this.$element.unbind('keyup',this.eventHandlers.documentKeyUp).removeAttr('data-owl-access-keyup data-owl-carousel-focusable').unbind('focusin focusout')};Owl2A11y.prototype.focusableElems=function(elem){return $(elem).find('a, input, select, button, *[tabindex]')};Owl2A11y.prototype.adjustFocus=function(elems,enable){elems.each(function(){var item=$(this);var newTabIndex='0',storeTabIndex='0';currentTabIndex=item.attr('tabindex'),storedTabIndex=item.attr('data-owl-temp-tabindex');if(enable){newTabIndex=(typeof(storedTabIndex)!='undefined'&&(storedTabIndex!='-1')?item.attr('data-owl-temp-tabindex'):'0');storedTabIndex=newTabIndex} else{newTabIndex='-1';storedTabIndex=((typeof(currentTabIndex)!='undefined')||(currentTabIndex!='-1')?currentTabIndex:'0')} item.attr({tabindex:newTabIndex,'data-owl-temp-tabindex':storeTabIndex})})};Owl2A11y.prototype.focused=function(targ){var targ=$(targ);if(targ.attr('data-owl-carousel-focused')==1){return targ} var closest=targ.closest('[data-owl-carousel-focused="1"]');if(closest.length>0)return closest;return null};Owl2A11y.prototype.setCurrent=function(e){var targ=this.focused($(':focus')),element=this._core.$element,stage=this._core.$stage,focusableElems=this.focusableElems,adjustFocus=this.adjustFocus;if(!!stage){var offs=stage.offset();this._core.$stage.children().each(function(i){var item=$(this);var focusable=focusableElems(this);if(item.hasClass('active')){item.attr('aria-hidden','false');adjustFocus(focusable,!0)} else{item.attr('aria-hidden','true');adjustFocus(focusable,!1)}})}};$.fn.owlCarousel.Constructor.Plugins.Owl2A11y=Owl2A11y})(window.Zepto||window.jQuery,window,document)