!function(l,c,s,a){function e(t){console.log(t)}var d=!1;function h(t){0!=d&&e(t)}function p(t,e){this.settings=null,this.options=l.extend({},p.Defaults,e),this.$element=l(t),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this.getItemWidth=function(){switch(this.settings.paddingType){case"left":case"right":case"both":default:var t=Math.floor((this.width()/this.settings.items).toFixed(3)-this.settings.margin)}return this.settings.item_size_gap&&(t+=this.settings.item_size_gap),t},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},l.each(["onResize","onThrottledResize"],l.proxy(function(t,e){this._handlers[e]=l.proxy(this[e],this)},this)),l.each(p.Plugins,l.proxy(function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)},this)),l.each(p.Workers,l.proxy(function(t,e){this._pipe.push({filter:e.filter,run:l.proxy(e.run,this)})},this)),this.setup(),this.initialize()}p.Defaults={items:3,loop:!1,center:!1,disableNoncenteredLinks:!1,rewind:!1,checkVisibility:!0,setActiveClass:!0,setActiveClassOnMobile:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,paddingType:"none",stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:c,progressScroll:!1,progressScrollDistance:200,progressScrollDistanceTablet:200,progressScrollDistanceMobile:200,fallbackEasing:"swing",slideTransition:"",info:!1,scrollToHead:!1,scrollToHeadForceOnMobile:!1,scrollToHeadOffset:0,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab",shuffle:!1,item_size_gap:0,pixel_gap_fix:!1,delayBeforeLoad:200,debug:!1},p.Width={Default:"default",Inner:"inner",Outer:"outer"},p.Type={Event:"event",State:"state"},p.Plugins={},p.Workers=[{filter:["width","settings"],run:function(){this._width=Math.floor(this.$element.width()),h("set total width this._width: "+this._width)}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,s=this.settings.rtl,e={width:"auto","margin-left":s?e:"","margin-right":s?"":e};i||this.$stage.children().css(e),t.css=e}},{filter:["width","items","settings"],run:function(t){!0===this.settings.debug&&(d=!0),h("run!"),1==this.settings.items&&1==this.settings.pixel_gap_fix&&(this.settings.item_size_gap=1,h("set items size gap: 1")),h("settings - stage padding type: "+this.settings.paddingType),h("settings - stage padding: "+this.settings.stagePadding),this.settings.paddingType&&"none"!=this.settings.paddingType||!this.settings.stagePadding||(this.settings.paddingType="both",h("set stage padding type - both"));var e,i=this.getItemWidth();for(h("Item width: "+i),this.settings.stagePadding>i&&(this.settings.stagePadding=0,e=this.getItemWidth(),this.settings.stagePadding=Math.floor(.5*e),i=this.getItemWidth(),h("set new stagePadding: "+this.settings.stagePadding+" and item width: "+i)),merge=null,iterator=this._items.length,grid=!this.settings.autoWidth,widths=[],t.items={merge:!1,width:i};iterator--;)merge=this._mergers[iterator],merge=this.settings.mergeFit&&Math.min(merge,this.settings.items)||merge,t.items.merge=1<merge||t.items.merge,widths[iterator]=grid?i*merge:this._items[iterator].width();this._widths=widths}},{filter:["items","settings"],run:function(){var t=[],e=this._items,i=this.settings,s=Math.max(2*i.items,4),n=2*Math.ceil(e.length/2),o=i.loop&&e.length?i.rewind?s:Math.max(s,n):0,r="",a="";for(o/=2;0<o;)t.push(this.normalize(t.length/2,!0)),r+=e[t[t.length-1]][0].outerHTML,t.push(this.normalize(e.length-1-(t.length-1)/2,!0)),a=e[t[t.length-1]][0].outerHTML+a,--o;this._clones=t,l(r).addClass("cloned").appendTo(this.$stage),l(a).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,s=[];++i<e;){var n=(s[i-1]||0)+(this._widths[this.relative(i)]+this.settings.margin)*t;s.push(n)}if(this.settings.item_size_gap)for(var o in s)s[o]-=this.settings.item_size_gap;h("Set coordinates"),h(s),this._coordinates=s}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i=this.settings.paddingType,s=this.$stage.parent(),n=s.width();h("parent Outer Stage Width: "+s.width()),h("element width this.$element.width(): "+this.$element.width());var o={width:Math.ceil(Math.abs(e[e.length-1])),"padding-left":"","padding-right":""},r={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""},a={width:Math.ceil(Math.abs(e[e.length-1]))+t,"padding-left":t||"","padding-right":""},t={width:Math.ceil(Math.abs(e[e.length-1]))+t,"padding-left":"","padding-right":t||""},n={width:n};h("set outer stage css"),h(n),"none"==i?(this.$stage.css(o),s.width(n)):"both"==i?(this.$stage.css(r),s.css(n),h("Set stage width css (both)"),h(r)):"left"==i?(this.$stage.css(a),s.css(n),h("Set stage width css (left)"),h(a)):"right"==i&&(this.$stage.css(t),s.css(n),h("Set stage width css (right)"),h(t))}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,s=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],s.eq(e).css(t.css);else i&&(t.css.width=t.items.width,s.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,s,n=this.settings.rtl?1:-1,o=2*this.settings.stagePadding,r=this.coordinates(this.current())+o,a=r+this.width()*n,h=[];for("left"!=this.settings.paddingType&&"right"!=this.settings.paddingType||(o=this.settings.stagePadding),i=0,s=this._coordinates.length;i<s;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+o*n,(this.op(t,"<=",r)&&this.op(t,">",a)||this.op(e,"<",r)&&this.op(e,">",a))&&h.push(i);if(this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+h.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center){if(this.$stage.children().eq(this.current()).addClass("center"),0==this.settings.disableNoncenteredLinks)return!1;var l=this.$stage.children().not(".center").find("a"),c=this.$stage.find(".center a");l.css({cursor:"default","pointer-events":"none"}),c.css({cursor:"","pointer-events":""})}}},{filter:["width","position","items","settings"],run:function(){var t;this.settings.setActiveClass&&this.settings.setActiveClass&&(t=!0,this.settings.setActiveClassOnMobile?1==this.$stage.children(".active").length&&(t=!0):this.settings.setActiveClassOnMobile||1==this.$stage.children(".active").length&&(t=!1),1==t?this.$stage.children().eq(this.current()).addClass("uc-active-item").siblings().removeClass("uc-active-item"):0==t&&this.$stage.children().removeClass("uc-active-item"))}}],p.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=l("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(l("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},p.prototype.initializeItems=function(){var t=this.$element.find(".owl-item");if(t.length)return this._items=t.get().map(function(t){return l(t)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},p.prototype.initialize=function(){var t,e,i;this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.shuffle&&(t=this.$element).children().sort(function(){return Math.round(Math.random())-.5}).each(function(){t.append(this)}),this.settings.autoWidth&&!this.is("pre-loading")&&(e=this.$element.find("img"),i=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:a,i=this.$element.children(i).width(),e.length&&i<=0&&this.preloadAutoWidthImages(e)),this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized");var s=this._handlers;setTimeout(function(){s.onResize()},this.settings.delayBeforeLoad);var n=this;this.$stage.children().each(function(){if(1==n.settings.lazyLoad)return!1;var t,e=jQuery(this),i=e.find("img");1!=i.hasClass("lazyloading")&&1!=i.hasClass("lazy-loaded")&&1!=i.hasClass("lazy-hidden")||(i.removeClass("lazyloading"),i.removeClass("lazy-loaded"),i.removeClass("lazy-hidden"),(t=i.data("src"))&&i.attr("src",t),t="data-src",jQuery.removeData(i,t));e=e.find('[loading="lazy"]');e&&0!=e.length&&e.removeAttr("loading")})},p.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},p.prototype.setup=function(){var e=this.viewport(),t=this.options.responsive,i=-1,s=null;t?(l.each(t,function(t){t<=e&&i<t&&(i=Number(t))}),"function"==typeof(s=l.extend({},this.options,t[i])).stagePadding&&(s.stagePadding=s.stagePadding()),delete s.responsive,s.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+i))):s=l.extend({},this.options),this.trigger("change",{property:{name:"settings",value:s}}),this._breakpoint=i,this.settings=s,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}),this.setupScroll()},p.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},p.prototype.prepare=function(t){var e=this.trigger("prepare",{content:t});return e.data||(e.data=l("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(t)),this.trigger("prepared",{content:e.data}),e.data},p.prototype.update=function(){for(var t=0,e=this._pipe.length,i=l.proxy(function(t){return this[t]},this._invalidated),s={};t<e;)(this._invalidated.all||0<l.grep(this._pipe[t].filter,i).length)&&this._pipe[t].run(s),t++;this._invalidated={},this.is("valid")||this.enter("valid")},p.prototype.width=function(t){var e;switch(t=t||p.Width.Default){case p.Width.Inner:case p.Width.Outer:e=this._width,h("calc width for dimention: "+t);default:switch(this.settings.paddingType){case"left":case"right":h("calc width with stagePadding: "+this.settings.paddingType),e=this._width-this.settings.stagePadding+this.settings.margin;break;case"both":h("calc width with stagePadding: "+this.settings.paddingType),e=this._width-2*this.settings.stagePadding+this.settings.margin;break;default:e=this._width+this.settings.margin,h("calc width without stagePadding for dimention: "+t)}}return h("carousel width (no stagepadding and margins): "+e),e},p.prototype.refresh=function(){h("---------------------refresh carousel-----------------------"),h("window width: "+c.innerWidth),h("element width: "+this.$element.width()),h("stage width: "+this.$stage.width()),this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},p.prototype.onThrottledResize=function(){c.clearTimeout(this.resizeTimer),this.resizeTimer=c.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},p.prototype.onResize=function(){return h("---------------------resize carousel-----------------------"),this._items.length?this.isVisible()?(h("resizing"),this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.$stage.parent().css({width:""}),this.refresh(),this.update(),this.leave("resizing"),void this.trigger("resized"))):(h("not visible"),!1):(h("same length"),!1)},p.prototype.registerEventHandlers=function(){l.support.transition&&this.$stage.on(l.support.transition.end+".owl.core",l.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(c,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",l.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",l.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",l.proxy(this.onDragEnd,this)))},p.prototype.onDragStart=function(t){var e=null;3!==t.which&&(e=l.support.transform?{x:(e=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===e.length?12:4],y:e[16===e.length?13:5]}:(e=this.$stage.position(),{x:this.settings.rtl?e.left+this.$stage.width()-this.width()+this.settings.margin:e.left,y:e.top}),this.is("animating")&&(l.support.transform?this.animate(e.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===t.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=l(t.target),this._drag.stage.start=e,this._drag.stage.current=e,this._drag.pointer=this.pointer(t),l(s).on("mouseup.owl.core touchend.owl.core",l.proxy(this.onDragEnd,this)),l(s).one("mousemove.owl.core touchmove.owl.core",l.proxy(function(t){var e=this.difference(this._drag.pointer,this.pointer(t));l(s).on("mousemove.owl.core touchmove.owl.core",l.proxy(this.onDragMove,this)),Math.abs(e.x)<Math.abs(e.y)&&this.is("valid")||(t.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},p.prototype.onDragMove=function(t){var e,i=null,s=null,n=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,n);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(i=this.coordinates(this.minimum()),s=this.coordinates(this.maximum()+1)-i,o.x=((o.x-i)%s+s)%s+i):(i=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),s=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),e=this.settings.pullDrag?-1*n.x/5:0,o.x=Math.max(Math.min(o.x,i+e),s+e)),this._drag.stage.current=o,this.animate(o.x))},p.prototype.onDragEnd=function(t){var e=this.difference(this._drag.pointer,this.pointer(t)),i=this._drag.stage.current,t=0<e.x^this.settings.rtl?"left":"right";l(s).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==e.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(i.x,0!==e.x?t:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=t,(3<Math.abs(e.x)||300<(new Date).getTime()-this._drag.time)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},p.prototype.closest=function(i,s){var n=-1,o=this.width(),r=this.coordinates();return this.settings.freeDrag||l.each(r,l.proxy(function(t,e){return"left"===s&&e-30<i&&i<e+30?n=t:"right"===s&&e-o-30<i&&i<e-o+30?n=t+1:this.op(i,"<",e)&&this.op(i,">",r[t+1]!==a?r[t+1]:e-o)&&(n="left"===s?t+1:t),-1===n},this)),this.settings.loop||(this.op(i,">",r[this.minimum()])?n=i=this.minimum():this.op(i,"<",r[this.maximum()])&&(n=i=this.maximum())),n},p.prototype.animate=function(t){var e=0<this.speed();this.is("animating")&&this.onTransitionEnd(),e&&(this.enter("animating"),this.trigger("translate")),l.support.transition?(h("Go to coordinate: "+t),this.$stage.css({transform:"translateX("+t+"px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")})):e?this.$stage.animate({left:t+"px"},this.speed(),this.settings.fallbackEasing,l.proxy(this.onTransitionEnd,this)):this.$stage.css({left:t+"px"}),this.scrollToHead()},p.prototype.is=function(t){return this._states.current[t]&&0<this._states.current[t]},p.prototype.current=function(t){return t===a?this._current:0===this._items.length?a:(t=this.normalize(t),this._current!==t&&((e=this.trigger("change",{property:{name:"position",value:t}})).data!==a&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})),this._current);var e},p.prototype.invalidate=function(t){return"string"===l.type(t)&&(this._invalidated[t]=!0,this.is("valid")&&this.leave("valid")),l.map(this._invalidated,function(t,e){return e})},p.prototype.reset=function(t){(t=this.normalize(t))!==a&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},p.prototype.normalize=function(t,e){var i=this._items.length,e=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=a:(t<0||i+e<=t)&&(t=((t-e/2)%i+i)%i+e/2),t},p.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},p.prototype.maximum=function(t){var e,i,s,n=this.settings,o=this._coordinates.length;if(n.loop)o=this._clones.length/2+this._items.length-1;else if(n.autoWidth||n.merge){if(e=this._items.length)for(i=this._items[--e].width(),s=Math.floor(this.$element.width());e--&&!(s<(i+=this._items[e].width()+this.settings.margin)););o=e+1}else o=n.center?this._items.length-1:this._items.length-n.items;return t&&(o-=this._clones.length/2),Math.max(o,0)},p.prototype.minimum=function(t){return t?0:this._clones.length/2},p.prototype.items=function(t){return t===a?this._items.slice():(t=this.normalize(t,!0),this._items[t])},p.prototype.mergers=function(t){return t===a?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},p.prototype.clones=function(i){function s(t){return t%2==0?n+t/2:e-(t+1)/2}var e=this._clones.length/2,n=e+this._items.length;return i===a?l.map(this._clones,function(t,e){return s(e)}):l.map(this._clones,function(t,e){return t===i?s(e):null})},p.prototype.speed=function(t){return t!==a&&(this._speed=t),this._speed},p.prototype.coordinates=function(t){var e,i=1,s=t-1;return t===a?l.map(this._coordinates,l.proxy(function(t,e){return this.coordinates(e)},this)):(this.settings.center?(this.settings.rtl&&(i=-1,s=t+1),e=this._coordinates[t],e+=(this.width()-e+(this._coordinates[s]||0))/2*i):e=this._coordinates[s]||0,e=Math.ceil(e))},p.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},p.prototype.to=function(t,e){var i,s=this.current(),n=t-this.relative(s),o=(0<n)-(n<0),r=this._items.length,a=this.minimum(),h=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(n)>r/2&&(n+=-1*o*r),(i=(((t=s+n)-a)%r+r)%r+a)!==t&&i-n<=h&&0<i-n&&(s=i-n,t=i,this.reset(s))):t=this.settings.rewind?(t%(h+=1)+h)%h:Math.max(a,Math.min(h,t)),this.speed(this.duration(s,t,e)),this.current(t),this.isVisible()&&this.update()},p.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},p.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},p.prototype.onTransitionEnd=function(t){if(t!==a&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},p.prototype.viewport=function(){var t;return this.options.responsiveBaseElement!==c?t=l(this.options.responsiveBaseElement).width():c.innerWidth?t=c.innerWidth:s.documentElement&&s.documentElement.clientWidth?t=s.documentElement.clientWidth:console.warn("Can not detect viewport width."),t},p.prototype.replace=function(t){this.$stage.empty(),this._items=[],t=t&&(t instanceof jQuery?t:l(t)),this.settings.nestedItemSelector&&(t=t.find("."+this.settings.nestedItemSelector)),t&&t.length&&t.filter(function(){return 1===this.nodeType}).each(l.proxy(function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(+e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items");t=this.settings.startPosition;l(this.$element).trigger("to.owl.carousel",t)},p.prototype.add=function(t,e){var i=this.relative(this._current);e=e===a?this._items.length:this.normalize(e,!0),t=t instanceof jQuery?t:l(t),this.trigger("add",{content:t,position:e}),t=this.prepare(t),0===this._items.length||e===this._items.length?(0===this._items.length&&this.$stage.append(t),0!==this._items.length&&this._items[e-1].after(t),this._items.push(t),this._mergers.push(+t.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[e].before(t),this._items.splice(e,0,t),this._mergers.splice(e,0,+t.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[i]&&this.reset(this._items[i].index()),this.invalidate("items"),this.trigger("added",{content:t,position:e})},p.prototype.remove=function(t){(t=this.normalize(t,!0))!==a&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},p.prototype.preloadAutoWidthImages=function(t){t.each(l.proxy(function(t,e){this.enter("pre-loading"),e=l(e),l(new Image).one("load",l.proxy(function(t){e.attr("src",t.target.src),e.css("opacity",1),this.leave("pre-loading"),this.is("pre-loading")||this.is("initializing")||this.refresh()},this)).attr("src",e.attr("src")||e.attr("data-src")||e.attr("data-src-retina"))},this))},p.prototype.isElementInViewport=function(t){var e=t.offset().top,i=e+t.outerHeight(),s=jQuery(c).scrollTop(),t=s+jQuery(c).height();return s<i&&e<t},p.prototype.scrollToTop=function(t,e){jQuery("html, body").animate({scrollTop:t+e},400)},p.prototype.scrollToHead=function(){if(1==this.settings.autoplay)return!1;if(this.is("initializing"))return!1;if(this.is("resizing"))return!1;if(0==this.settings.scrollToHead)return!1;var t=this.$element;if(0==this.settings.scrollToHeadForceOnMobile&&1==this.isElementInViewport(t))return!1;var e=this.$element.offset().top,t=this.settings.scrollToHeadOffset;this.scrollToTop(e,t)},p.prototype.setupScroll=function(){this.settings.progressScroll&&(this._scroll={lastScrollTop:0,distanceScrolled:0,lastDirection:null},l(c).on("scroll.owl.progress",l.proxy(this.onScrollProgress,this)))},p.prototype.onScrollProgress=function(t){var e,i,s,n,o,r,a,h;!1!==this.settings.progressScroll&&(this.isTransitioning||this.isAnimating||this.isDragging?this._scroll.lastScrollTop=l(c).scrollTop():(e=l(c).scrollTop(),i=this._scroll.lastScrollTop,(n=l(c).width())<767&&this.settings.progressScrollDistanceMobile?s=this.settings.progressScrollDistanceMobile:767<=n&&n<1024&&this.settings.progressScrollDistanceTablet?s=this.settings.progressScrollDistanceTablet:1024<=n&&this.settings.progressScrollDistance&&(s=this.settings.progressScrollDistance),0!=(o=e-i)&&(r=Math.abs(o),n=i<e?"down":"up",(o=this._scroll.lastDirection!==n)&&(this._scroll.distanceScrolled=0,this._scroll.lastDirection=n),o&&s<r&&(r=0,1==d&&(a='<div class="owl-debug" style="position: fixed; background: #960; color: #FFF; z-index: 1000; padding: 10px; left: 20px; top: 20px; border-radius: 4px; font-family: monospace; line-height: 1.4;">NaN'+n+'<span style="color: #FF0;">(SPIKE ZEROED)</span> <br>NaN'+Math.abs(e-i).toFixed(0)+"px <br>NaN"+s+"pxNaN",(h=jQuery(".owl-debug")).length?h.html(a):jQuery("body").append(a))),this._scroll.distanceScrolled+=r,this._scroll.distanceScrolled>=s?(r="down"===n?"next.owl":"prev.owl",this.$element.trigger(r),this._scroll.distanceScrolled=0,1==d&&(a='<div class="owl-debug" style="position: fixed; background: #060; color: #FFF; z-index: 1000; padding: 10px; left: 20px; top: 20px; border-radius: 4px; font-family: monospace; line-height: 1.4;">NaN'+n+'<span style="color: #FF0;">(TRIGGERED)</span> <br>NaN'+this._scroll.distanceScrolled.toFixed(0)+"px <br>NaN"+s+"px + </div>",(h=jQuery(".owl-debug")).length&&h.remove(),jQuery("body").append(a))):1==d&&(a='<div class="owl-debug" style="position: fixed; background: #666; color: #FFF; z-index: 1000; padding: 10px; left: 20px; top: 20px; border-radius: 4px; font-family: monospace; line-height: 1.4;">NaN'+n+"<br>NaN"+this._scroll.distanceScrolled.toFixed(0)+"px <br>NaN"+s+"pxNaN",(h=jQuery(".owl-debug")).length?h.html(a):jQuery("body").append(a)),this._scroll.lastScrollTop=e)))},p.prototype.destroy=function(){for(var t in this.$element.off(".owl.core"),this.$stage.off(".owl.core"),l(s).off(".owl.core"),!1!==this.settings.responsive&&(c.clearTimeout(this.resizeTimer),this.off(c,"resize",this._handlers.onThrottledResize)),this._plugins)this._plugins[t].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel"),l(c).off("scroll.owl.progress")},p.prototype.op=function(t,e,i){var s=this.settings.rtl;switch(e){case"<":return s?i<t:t<i;case">":return s?t<i:i<t;case">=":return s?t<=i:i<=t;case"<=":return s?i<=t:t<=i}},p.prototype.on=function(t,e,i,s){t.addEventListener?t.addEventListener(e,i,s):t.attachEvent&&t.attachEvent("on"+e,i)},p.prototype.off=function(t,e,i,s){t.removeEventListener?t.removeEventListener(e,i,s):t.detachEvent&&t.detachEvent("on"+e,i)},p.prototype.trigger=function(t,e,i,s,n){var o={item:{count:this._items.length,index:this.current()}},r=l.camelCase(l.grep(["on",t,i],function(t){return t}).join("-").toLowerCase()),a=l.Event([t,"owl",i||"carousel"].join(".").toLowerCase(),l.extend({relatedTarget:this},o,e));return this._supress[t]||(l.each(this._plugins,function(t,e){e.onTrigger&&e.onTrigger(a)}),this.register({type:p.Type.Event,name:t}),this.$element.trigger(a),this.settings&&"function"==typeof this.settings[r]&&this.settings[r].call(this,a)),a},p.prototype.enter=function(t){l.each([t].concat(this._states.tags[t]||[]),l.proxy(function(t,e){this._states.current[e]===a&&(this._states.current[e]=0),this._states.current[e]++},this))},p.prototype.leave=function(t){l.each([t].concat(this._states.tags[t]||[]),l.proxy(function(t,e){this._states.current[e]--},this))},p.prototype.register=function(i){var e;i.type===p.Type.Event?(l.event.special[i.name]||(l.event.special[i.name]={}),l.event.special[i.name].owl||(e=l.event.special[i.name]._default,l.event.special[i.name]._default=function(t){return!e||!e.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&-1<t.namespace.indexOf("owl"):e.apply(this,arguments)},l.event.special[i.name].owl=!0)):i.type===p.Type.State&&(this._states.tags[i.name]?this._states.tags[i.name]=this._states.tags[i.name].concat(i.tags):this._states.tags[i.name]=i.tags,this._states.tags[i.name]=l.grep(this._states.tags[i.name],l.proxy(function(t,e){return l.inArray(t,this._states.tags[i.name])===e},this)))},p.prototype.suppress=function(t){l.each(t,l.proxy(function(t,e){this._supress[e]=!0},this))},p.prototype.release=function(t){l.each(t,l.proxy(function(t,e){delete this._supress[e]},this))},p.prototype.pointer=function(t){var e={x:null,y:null};return(t=(t=t.originalEvent||t||c.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(e.x=t.pageX,e.y=t.pageY):(e.x=t.clientX,e.y=t.clientY),e},p.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},p.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},l.fn.owlCarousel=function(e){var s=Array.prototype.slice.call(arguments,1);return this.each(function(){var t=l(this),i=t.data("owl.carousel");i||(i=new p(this,"object"==typeof e&&e),t.data("owl.carousel",i),l.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(t,e){i.register({type:p.Type.Event,name:e}),i.$element.on(e+".owl.carousel.core",l.proxy(function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([e]),i[e].apply(this,[].slice.call(arguments,1)),this.release([e]))},i))})),"string"==typeof e&&"_"!==e.charAt(0)&&i[e].apply(i,s)})},l.fn.owlCarousel.Constructor=p}(window.Zepto||window.jQuery,window,document),function(e,i){var s=function(t){this._core=t,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":e.proxy(function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=e.extend({},s.Defaults,this._core.options),this._core.$element.on(this._handlers)};s.Defaults={autoRefresh:!0,autoRefreshInterval:500},s.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=i.setInterval(e.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},s.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},s.prototype.destroy=function(){var t,e;for(t in i.clearInterval(this._interval),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},e.fn.owlCarousel.Constructor.Plugins.AutoRefresh=s}(window.Zepto||window.jQuery,window,document),function(a,n){var e=function(t){this._core=t,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(t){if(t.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(t.property&&"position"==t.property.name||"initialized"==t.type)){var e=this._core.settings,i=e.center&&Math.ceil(e.items/2)||e.items,s=e.center&&-1*i||0,n=(t.property&&void 0!==t.property.value?t.property.value:this._core.current())+s,o=this._core.clones().length,r=a.proxy(function(t,e){this.load(e)},this);for(0<e.lazyLoadEager&&(i+=e.lazyLoadEager,e.loop&&(n-=e.lazyLoadEager,i++));s++<i;)this.load(o/2+this._core.relative(n)),o&&a.each(this._core.clones(this._core.relative(n)),r),n++}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1,lazyLoadEager:0},e.prototype.load=function(t){var e=this._core.$stage.children().eq(t),t=e&&e.find(".owl-lazy");!t||-1<a.inArray(e.get(0),this._loaded)||(t.each(a.proxy(function(t,e){var i=a(e),s=1<n.devicePixelRatio&&i.attr("data-src-retina")||i.attr("data-src")||i.attr("data-srcset");this._core.trigger("load",{element:i,url:s},"lazy"),i.is("img")?i.one("load.owl.lazy",a.proxy(function(){i.css("opacity",1),this._core.trigger("loaded",{element:i,url:s},"lazy")},this)).attr("src",s):i.is("source")?i.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:i,url:s},"lazy")},this)).attr("srcset",s):((e=new Image).onload=a.proxy(function(){i.css({"background-image":'url("'+s+'")',opacity:"1"}),this._core.trigger("loaded",{element:i,url:s},"lazy")},this),e.src=s)},this)),this._loaded.push(e.get(0)))},e.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(n,i){var s=function(t){this._core=t,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&"position"===t.property.name&&this.update()},this),"loaded.owl.lazy":n.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=n.extend({},s.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var e=this;n(i).on("load",function(){e._core.settings.autoHeight&&e.update()}),n(i).resize(function(){e._core.settings.autoHeight&&(null!=e._intervalId&&clearTimeout(e._intervalId),e._intervalId=setTimeout(function(){e.update()},250))})};s.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},s.prototype.update=function(){var t=this._core._current,e=t+this._core.settings.items,i=this._core.settings.lazyLoad,t=this._core.$stage.children().toArray().slice(t,e),s=[],e=0;n.each(t,function(t,e){s.push(n(e).height())}),(e=Math.max.apply(null,s))<=1&&i&&this._previousHeight&&(e=this._previousHeight),this._previousHeight=e,this._core.$stage.parent().height(e).addClass(this._core.settings.autoHeightClass)},s.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},n.fn.owlCarousel.Constructor.Plugins.AutoHeight=s}(window.Zepto||window.jQuery,window,document),function(c,e){var i=function(t){this._core=t,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":c.proxy(function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":c.proxy(function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()},this),"refreshed.owl.carousel":c.proxy(function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":c.proxy(function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":c.proxy(function(t){var e;!t.namespace||(e=c(t.content).find(".owl-video")).length&&(e.css("display","none"),this.fetch(e,c(t.content)))},this)},this._core.options=c.extend({},i.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",c.proxy(function(t){this.play(t)},this))};i.Defaults={video:!1,videoHeight:!1,videoWidth:!1},i.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",s=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),n=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,r=t.attr("href");if(!r)throw new Error("Missing video URL.");if(-1<(s=r.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu"))i="youtube";else if(-1<s[3].indexOf("vimeo"))i="vimeo";else{if(!(-1<s[3].indexOf("vzaar")))throw new Error("Video URL not supported.");i="vzaar"}s=s[6],this._videos[r]={type:i,id:s,width:n,height:o},e.attr("data-video",r),this.thumbnail(t,this._videos[r])},i.prototype.thumbnail=function(e,t){function i(t){s=l.lazyLoad?c("<div/>",{class:"owl-video-tn "+h,srcType:t}):c("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+t+")"}),e.after(s),e.after('<div class="owl-video-play-icon"></div>')}var s,n,o=t.width&&t.height?"width:"+t.width+"px;height:"+t.height+"px;":"",r=e.find("img"),a="src",h="",l=this._core.settings;if(e.wrap(c("<div/>",{class:"owl-video-wrapper",style:o})),this._core.settings.lazyLoad&&(a="data-src",h="owl-lazy"),r.length)return i(r.attr(a)),r.remove(),!1;"youtube"===t.type?(n="//img.youtube.com/vi/"+t.id+"/hqdefault.jpg",i(n)):"vimeo"===t.type?c.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+t.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t[0].thumbnail_large,i(n)}}):"vzaar"===t.type&&c.ajax({type:"GET",url:"//vzaar.com/api/videos/"+t.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){n=t.framegrab_url,i(n)}})},i.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},i.prototype.play=function(t){var e=c(t.target).closest("."+this._core.settings.itemClass),i=this._videos[e.attr("data-video")],s=i.width||"100%",n=i.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),(t=c('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>')).attr("height",n),t.attr("width",s),"youtube"===i.type?t.attr("src","//www.youtube.com/embed/"+i.id+"?autoplay=1&rel=0&v="+i.id):"vimeo"===i.type?t.attr("src","//player.vimeo.com/video/"+i.id+"?autoplay=1"):"vzaar"===i.type&&t.attr("src","//view.vzaar.com/"+i.id+"/player?autoplay=true"),c(t).wrap('<div class="owl-video-frame" />').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},i.prototype.isInFullScreen=function(){var t=e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement;return t&&c(t).parent().hasClass("owl-video-frame")},i.prototype.destroy=function(){var t,e;for(t in this._core.$element.off("click.owl.video"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},c.fn.owlCarousel.Constructor.Plugins.Video=i}(window.Zepto||window.jQuery,(window,document)),function(r){var e=function(t){this.core=t,this.core.options=r.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=void 0,this.next=void 0,this.handlers={"change.owl.carousel":r.proxy(function(t){t.namespace&&t.property.name&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":r.proxy(function(t){t.namespace&&(this.swapping="translated"==t.type)},this),"translate.owl.carousel":r.proxy(function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&r.support.animation&&r.support.transition){var t=this.core._speed;this.core.speed(0),t=t||1e3;var e=r.proxy(this.clear,this),i=this.core.$stage.children().eq(this.previous),s=this.core.$stage.children().eq(this.next),n=this.core.settings.animateIn,o=this.core.settings.animateOut;if(this.core.current()!==this.previous){if(o){if(i.one(r.support.animation.end,e).addClass("animated owl-animated-out").addClass(o),"none"==jQuery("."+o).css("animation-name"))return void this.core.speed(t);t=this.core.coordinates(this.previous)-this.core.coordinates(this.next),i.css({left:t+"px"})}n&&s.one(r.support.animation.end,e).addClass("animated owl-animated-in").addClass(n)}}},e.prototype.clear=function(t){r(t.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},r.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,(window,document)),function(s,n,e){var i=function(t){this._core=t,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"change.owl.carousel":s.proxy(function(t){void 0!==t.property&&"position"===t.property.name&&1==this._core.settings.autoplay&&n.clearTimeout(this._call)},this),"changed.owl.carousel":s.proxy(function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&1==this._core.settings.autoplay&&(this._call=n.setTimeout(s.proxy(this._next,this,this._core.settings.autoplaySpeed),this._core.settings.autoplayTimeout))},this),"initialized.owl.carousel":s.proxy(function(t){t.namespace&&this._core.settings.autoplay&&this.play()},this),"start_autoplay.owl.autoplay":s.proxy(function(t){t.namespace&&this.start_autoplay()},this),"play.owl.autoplay":s.proxy(function(t,e,i){t.namespace&&this.play(e,i)},this),"stop.owl.autoplay":s.proxy(function(t){t.namespace&&this.stop()},this),"mouseover.owl.autoplay":s.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":s.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":s.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":s.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=s.extend({},i.Defaults,this._core.options)};i.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1,autoplayDevice:"both"},i.prototype._next=function(t){n.clearTimeout(this._call),this._call=n.setTimeout(s.proxy(this._next,this,t),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||e.hidden||this._core.next(t||this._core.settings.autoplaySpeed)},i.prototype.read=function(){return(new Date).getTime()-this._time},i.prototype.start_autoplay=function(){this._core.settings.autoplay=!0,this.play()},i.prototype.play=function(t,e){var i;if(0==this._core.settings.autoplay)return!1;this._core.is("rotating")||this._core.enter("rotating"),t=t||this._core.settings.autoplayTimeout,i=Math.min(this._time%(this._timeout||t),t),n.clearTimeout(this._call),this._paused?(this._time=this.read(),this._paused=!1):n.clearTimeout(this._call),this._time+=this.read()%t-i,this._timeout=t,this._call=n.setTimeout(s.proxy(this._next,this,e),t-i),this._core.trigger("play_autoplay"),this.autoplay_device()},i.prototype.stop=function(){this._core.settings.autoplay,this._core.is("rotating")&&(this._time=0,this._paused=!0,n.clearTimeout(this._call),this._core.leave("rotating"),this._core.trigger("stop_autoplay"))},i.prototype.autoplay_device=function(){if(0==this._core.settings.autoplay)return!1;var t=this._core.settings.autoplayDevice;if("both"==t)return!1;var e=this._core.viewport(),i=767<e;1==e<=767&&"desktop"==t&&this.stop(),1==i&&"mobile"==t&&this.stop()},i.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,n.clearTimeout(this._call),this._core.trigger("pause_autoplay")),n.clearTimeout(this._call)},i.prototype.destroy=function(){var t,e;for(t in this.stop(),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},s.fn.owlCarousel.Constructor.Plugins.autoplay=i}(window.Zepto||window.jQuery,window,document),function(n){"use strict";var e=function(t){this._core=t,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element;var i=!(this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to});this._handlers={"prepared.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+n(t.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())},this),"remove.owl.carousel":n.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)},this),"changed.owl.carousel":n.proxy(function(t){t.namespace&&"position"==t.property.name&&this.draw()},this),"initialized.owl.carousel":n.proxy(function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":n.proxy(function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this),"mousewheel wheel DOMMouseScroll MozMousePixelScroll":n.proxy(function(t){if(0==this._core.settings.mousewheelControl)return!0;var e=this.$element;0==i&&(0<t.originalEvent.deltaY&&0==i&&e.trigger("next.owl"),t.originalEvent.deltaY<0&&0==i&&e.trigger("prev.owl"),i=!0),clearTimeout(n.data(this,"timer")),n.data(this,"timer",setTimeout(function(){i=!1},250))},this)},this._core.options=n.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,changeItemOnClick:!1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1,mousewheelControl:!1},e.prototype.initialize=function(){var t,e,i,s=this._core.settings;for(t in this._controls.$relative=s.navContainer?n(s.navContainer):n("<div>").addClass(s.navContainerClass).appendTo(this.$element),this._controls.$previous=n("<"+s.navElement+' value="previous item" title="previous item">').addClass(s.navClass[0]).html(s.navText[0]).prependTo(this._controls.$relative).on("click",n.proxy(function(t){this.prev(s.navSpeed)},this)),this._controls.$next=n("<"+s.navElement+' value="next item" title="next item">').addClass(s.navClass[1]).html(s.navText[1]).appendTo(this._controls.$relative).on("click",n.proxy(function(t){this.next(s.navSpeed)},this)),s.changeItemOnClick&&(i=(e=this)._core.clones().length/2,setTimeout(function(){e._core.$stage.children().on("click",n.proxy(function(t){t=n(t.currentTarget).index();e.to(t-i,s.navSpeed,!0)},e))},300)),s.dotsData||(this._templates=[n('<button role="button">').addClass(s.dotClass).append(n("<span>")).prop("outerHTML")]),this._controls.$absolute=s.dotsContainer?n(s.dotsContainer):n("<div>").addClass(s.dotsClass).appendTo(this.$element),this._controls.$absolute.on("click","button",n.proxy(function(t){var e=(n(t.target).parent().is(this._controls.$absolute)?n(t.target):n(t.target).parent()).index();t.preventDefault(),this.to(e,s.dotsSpeed)},this)),this._overrides)this._core[t]=n.proxy(this[t],this)},e.prototype.destroy=function(){var t,e,i,s,n=this._core.settings;for(t in this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)"$relative"===e&&n.navContainer?this._controls[e].html(""):this._controls[e].remove();for(s in this.overides)this._core[s]=this._overrides[s];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},e.prototype.update=function(){var t,e,i=this._core.clones().length/2,s=i+this._core.items().length,n=this._core.maximum(!0),o=this._core.settings,r=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0;t<s;t++){if(r<=e||0===e){if(this._pages.push({start:Math.min(n,t-i),end:t-i+r-1}),Math.min(n,t-i)===n)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},e.prototype.draw=function(){var t=this._core.settings,e=(this._core.items().length,t.items,this._core.relative(this._core.current())),i=t.loop||t.rewind,s=this._core.$stage.children().children().children();0!=t.nav&&0!=this._core.items().length&&0!=s.length||this._controls.$relative.remove(),1==t.nav&&(this._controls.$previous.toggleClass("disabled",!i&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!i&&e>=this._core.maximum(!0))),0!=t.dots&&0!=this._core.items().length&&0!=s.length||this._controls.$absolute.remove(),t.dots&&(s=this._pages.length-this._controls.$absolute.children().length,t.dotsData&&0!=s?this._controls.$absolute.html(this._templates.join("")):0<s?this._controls.$absolute.append(new Array(1+s).join(this._templates[0])):s<0&&this._controls.$absolute.children().slice(s).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(n.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(t){var e=this._core.settings;t.page={index:n.inArray(this.current(),this._pages),count:this._pages.length,size:e&&(e.center||e.autoWidth||e.dotsData?1:e.dotsEach||e.items)}},e.prototype.current=function(){var i=this._core.relative(this._core.current());return n.grep(this._pages,n.proxy(function(t,e){return t.start<=i&&t.end>=i},this)).pop()},e.prototype.getPosition=function(t){var e,i,s=this._core.settings;return"page"==s.slideBy?(e=n.inArray(this.current(),this._pages),i=this._pages.length,t?++e:--e,e=this._pages[(e%i+i)%i].start):(e=this._core.relative(this._core.current()),i=this._core.items().length,t?e+=s.slideBy:e-=s.slideBy),e},e.prototype.next=function(t){n.proxy(this._overrides.to,this._core)(this.getPosition(!0),t)},e.prototype.prev=function(t){n.proxy(this._overrides.to,this._core)(this.getPosition(!1),t)},e.prototype.to=function(t,e,i){!i&&this._pages.length?(i=this._pages.length,n.proxy(this._overrides.to,this._core)(this._pages[(t%i+i)%i].start,e)):n.proxy(this._overrides.to,this._core)(t,e)},n.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,(window,document)),function(s,n){"use strict";var e=function(t){this._core=t,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":s.proxy(function(t){t.namespace&&"URLHash"===this._core.settings.startPosition&&s(n).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":s.proxy(function(t){var e;!t.namespace||(e=s(t.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash"))&&(this._hashes[e]=t.content)},this),"changed.owl.carousel":s.proxy(function(t){var i;t.namespace&&"position"===t.property.name&&(i=this._core.items(this._core.relative(this._core.current())),(t=s.map(this._hashes,function(t,e){return t===i?e:null}).join())&&n.location.hash.slice(1)!==t&&(n.location.hash=t))},this)},this._core.options=s.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),s(n).on("hashchange.owl.navigation",s.proxy(function(t){var e=n.location.hash.substring(1),i=this._core.$stage.children(),e=this._hashes[e]&&i.index(this._hashes[e]);void 0!==e&&e!==this._core.current()&&this._core.to(this._core.relative(e),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var t,e;for(t in s(n).off("hashchange.owl.navigation"),this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},s.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(n,o){var r=n("<support>").get(0).style,a="Webkit Moz O ms".split(" "),t={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},e=function(){return!!h("transform")},i=function(){return!!h("perspective")},s=function(){return!!h("animation")};function h(t,i){var s=!1,e=t.charAt(0).toUpperCase()+t.slice(1);return n.each((t+" "+a.join(e+" ")+e).split(" "),function(t,e){if(r[e]!==o)return s=!i||e,!1}),s}function l(t){return h(t,!0)}!function(){return!!h("transition")}()||(n.support.transition=new String(l("transition")),n.support.transition.end=t.transition.end[n.support.transition]),s()&&(n.support.animation=new String(l("animation")),n.support.animation.end=t.animation.end[n.support.animation]),e()&&(n.support.transform=new String(l("transform")),n.support.transform3d=i())}(window.Zepto||window.jQuery,(window,void document));
!function(t,e,n,o){"use strict";function i(t,e){var o,i,a,s=[],r=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},t&&t.data&&(e=h(t.data.options,e)),o=e.$target||n(t.currentTarget).trigger("blur"),(a=n.fancybox.getInstance())&&a.$trigger&&a.$trigger.is(o)||(e.selector?s=n(e.selector):(i=o.attr("data-fancybox")||"",i?(s=t.data?t.data.items:[],s=s.length?s.filter('[data-fancybox="'+i+'"]'):n('[data-fancybox="'+i+'"]')):s=[o]),r=n(s).index(o),r<0&&(r=0),a=n.fancybox.open(s,e,r),a.$trigger=o))}if(t.console=t.console||{info:function(t){}},n){if(n.fn.fancybox)return void console.info("fancyBox already initialized");var a={closeExisting:!1,loop:!1,gutter:50,keyboard:!0,preventCaptionOverlap:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","slideShow","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},video:{tpl:'<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}"><source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!</video>',format:"",autoStart:!0},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"><div class="fancybox-caption__body"></div></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div></button>',smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg></button>'},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{preventCaptionOverlap:!1,idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schlie&szlig;en",NEXT:"Weiter",PREV:"Zur&uuml;ck",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es sp&auml;ter nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Vergr&ouml;&szlig;ern"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),f=function(){var t,n=e.createElement("fakeelement"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in o)if(void 0!==n.style[t])return o[t];return"transitionend"}(),p=function(t){return t&&t.length&&t[0].offsetHeight},h=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},g=function(t){var o,i;return!(!t||t.ownerDocument!==e)&&(n(".fancybox-container").css("pointer-events","none"),o={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2},i=e.elementFromPoint(o.x,o.y)===t,n(".fancybox-container").css("pointer-events",""),i)},b=function(t,e,o){var i=this;i.opts=h({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(i.opts=h(i.opts,e)),n.fancybox.isMobile&&(i.opts=h(i.opts,i.opts.mobile)),i.id=i.opts.id||++c,i.currIndex=parseInt(i.opts.index,10)||0,i.prevIndex=null,i.prevPos=null,i.currPos=0,i.firstRun=!0,i.group=[],i.slides={},i.addContent(t),i.group.length&&i.init()};n.extend(b.prototype,{init:function(){var o,i,a=this,s=a.group[a.currIndex],r=s.opts;r.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&!1!==r.hideScrollbar&&!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:'+(t.innerWidth-e.documentElement.clientWidth)+"px;}</style>"),n("body").addClass("compensate-for-scrollbar")),i="",n.each(r.buttons,function(t,e){i+=r.btnTpl[e]||""}),o=n(a.translate(a,r.baseTpl.replace("{{buttons}}",i).replace("{{arrows}}",r.btnTpl.arrowLeft+r.btnTpl.arrowRight))).attr("id","fancybox-container-"+a.id).addClass(r.baseClass).data("FancyBox",a).appendTo(r.parentEl),a.$refs={container:o},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){a.$refs[t]=o.find(".fancybox-"+t)}),a.trigger("onInit"),a.activate(),a.jumpTo(a.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang]||t.opts.i18n.en;return e.replace(/\{\{(\w+)\}\}/g,function(t,e){return void 0===n[e]?t:n[e]})},addContent:function(t){var e,o=this,i=n.makeArray(t);n.each(i,function(t,e){var i,a,s,r,c,l={},d={};n.isPlainObject(e)?(l=e,d=e.opts||e):"object"===n.type(e)&&n(e).length?(i=n(e),d=i.data()||{},d=n.extend(!0,{},d,d.options),d.$orig=i,l.src=o.opts.src||d.src||i.attr("href"),l.type||l.src||(l.type="inline",l.src=e)):l={type:"html",src:e+""},l.opts=n.extend(!0,{},o.opts,d),n.isArray(d.buttons)&&(l.opts.buttons=d.buttons),n.fancybox.isMobile&&l.opts.mobile&&(l.opts=h(l.opts,l.opts.mobile)),a=l.type||l.opts.type,r=l.src||"",!a&&r&&((s=r.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(a="video",l.opts.video.format||(l.opts.video.format="video/"+("ogv"===s[1]?"ogg":s[1]))):r.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?a="image":r.match(/\.(pdf)((\?|#).*)?$/i)?(a="iframe",l=n.extend(!0,l,{contentType:"pdf",opts:{iframe:{preload:!1}}})):"#"===r.charAt(0)&&(a="inline")),a?l.type=a:o.trigger("objectNeedsType",l),l.contentType||(l.contentType=n.inArray(l.type,["html","inline","ajax"])>-1?"html":l.type),l.index=o.group.length,"auto"==l.opts.smallBtn&&(l.opts.smallBtn=n.inArray(l.type,["html","inline","ajax"])>-1),"auto"===l.opts.toolbar&&(l.opts.toolbar=!l.opts.smallBtn),l.$thumb=l.opts.$thumb||null,l.opts.$trigger&&l.index===o.opts.index&&(l.$thumb=l.opts.$trigger.find("img:first"),l.$thumb.length&&(l.opts.$orig=l.opts.$trigger)),l.$thumb&&l.$thumb.length||!l.opts.$orig||(l.$thumb=l.opts.$orig.find("img:first")),l.$thumb&&!l.$thumb.length&&(l.$thumb=null),l.thumb=l.opts.thumb||(l.$thumb?l.$thumb[0].src:null),"function"===n.type(l.opts.caption)&&(l.opts.caption=l.opts.caption.apply(e,[o,l])),"function"===n.type(o.opts.caption)&&(l.opts.caption=o.opts.caption.apply(e,[o,l])),l.opts.caption instanceof n||(l.opts.caption=void 0===l.opts.caption?"":l.opts.caption+""),"ajax"===l.type&&(c=r.split(/\s+/,2),c.length>1&&(l.src=c.shift(),l.opts.filter=c.shift())),l.opts.modal&&(l.opts=n.extend(!0,l.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),o.group.push(l)}),Object.keys(o.slides).length&&(o.updateControls(),(e=o.Thumbs)&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var e=this;e.removeEvents(),e.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),e.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),e.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),e.next()}).on("click.fb","[data-fancybox-zoom]",function(t){e[e.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(e.requestId&&u(e.requestId),e.requestId=d(function(){e.update(t)})):(e.current&&"iframe"===e.current.type&&e.$refs.stage.hide(),setTimeout(function(){e.$refs.stage.show(),e.update(t)},n.fancybox.isMobile?600:250))}),r.on("keydown.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null,i=o.current,a=t.keyCode||t.which;if(9==a)return void(i.opts.trapFocus&&e.focus(t));if(!(!i.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input,textarea,video,audio,select")))return 8===a||27===a?(t.preventDefault(),void e.close(t)):37===a||38===a?(t.preventDefault(),void e.previous()):39===a||40===a?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,a)}),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){e.idleSecondsCounter=0,e.isIdle&&e.showControls(),e.isIdle=!1}),e.idleInterval=t.setInterval(function(){++e.idleSecondsCounter>=e.group[e.currIndex].opts.idleTime&&!e.isDragging&&(e.isIdle=!0,e.idleSecondsCounter=0,e.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var o,i,a,s,r,c,l,d,u,f=this,h=f.group.length;if(!(f.isDragging||f.isClosing||f.isAnimating&&f.firstRun)){if(t=parseInt(t,10),!(a=f.current?f.current.opts.loop:f.opts.loop)&&(t<0||t>=h))return!1;if(o=f.firstRun=!Object.keys(f.slides).length,r=f.current,f.prevIndex=f.currIndex,f.prevPos=f.currPos,s=f.createSlide(t),h>1&&((a||s.index<h-1)&&f.createSlide(t+1),(a||s.index>0)&&f.createSlide(t-1)),f.current=s,f.currIndex=s.index,f.currPos=s.pos,f.trigger("beforeShow",o),f.updateControls(),s.forcedDuration=void 0,n.isNumeric(e)?s.forcedDuration=e:e=s.opts[o?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=f.isMoved(s),s.$slide.addClass("fancybox-slide--current"),o)return s.opts.animationEffect&&e&&f.$refs.container.css("transition-duration",e+"ms"),f.$refs.container.addClass("fancybox-is-open").trigger("focus"),f.loadSlide(s),void f.preload("image");c=n.fancybox.getTranslate(r.$slide),l=n.fancybox.getTranslate(f.$refs.stage),n.each(f.slides,function(t,e){n.fancybox.stop(e.$slide,!0)}),r.pos!==s.pos&&(r.isComplete=!1),r.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"),i?(u=c.left-(r.pos*c.width+r.pos*r.opts.gutter),n.each(f.slides,function(t,o){o.$slide.removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});var i=o.pos*c.width+o.pos*o.opts.gutter;n.fancybox.setTranslate(o.$slide,{top:0,left:i-l.left+u}),o.pos!==s.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>s.pos?"next":"previous")),p(o.$slide),n.fancybox.animate(o.$slide,{top:0,left:(o.pos-s.pos)*c.width+(o.pos-s.pos)*o.opts.gutter},e,function(){o.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===f.currPos&&f.complete()})})):e&&s.opts.transitionEffect&&(d="fancybox-animated fancybox-fx-"+s.opts.transitionEffect,r.$slide.addClass("fancybox-slide--"+(r.pos>s.pos?"next":"previous")),n.fancybox.animate(r.$slide,d,e,function(){r.$slide.removeClass(d).removeClass("fancybox-slide--next fancybox-slide--previous")},!1)),s.isLoaded?f.revealContent(s):f.loadSlide(s),f.preload("image")}},createSlide:function(t){var e,o,i=this;return o=t%i.group.length,o=o<0?i.group.length+o:o,!i.slides[t]&&i.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(i.$refs.stage),i.slides[t]=n.extend(!0,{},i.group[o],{pos:t,$slide:e,isLoaded:!1}),i.updateSlide(i.slides[t])),i.slides[t]},scaleToActual:function(t,e,o){var i,a,s,r,c,l=this,d=l.current,u=d.$content,f=n.fancybox.getTranslate(d.$slide).width,p=n.fancybox.getTranslate(d.$slide).height,h=d.width,g=d.height;l.isAnimating||l.isMoved()||!u||"image"!=d.type||!d.isLoaded||d.hasError||(l.isAnimating=!0,n.fancybox.stop(u),t=void 0===t?.5*f:t,e=void 0===e?.5*p:e,i=n.fancybox.getTranslate(u),i.top-=n.fancybox.getTranslate(d.$slide).top,i.left-=n.fancybox.getTranslate(d.$slide).left,r=h/i.width,c=g/i.height,a=.5*f-.5*h,s=.5*p-.5*g,h>f&&(a=i.left*r-(t*r-t),a>0&&(a=0),a<f-h&&(a=f-h)),g>p&&(s=i.top*c-(e*c-e),s>0&&(s=0),s<p-g&&(s=p-g)),l.updateCursor(h,g),n.fancybox.animate(u,{top:s,left:a,scaleX:r,scaleY:c},o||366,function(){l.isAnimating=!1}),l.SlideShow&&l.SlideShow.isActive&&l.SlideShow.stop())},scaleToFit:function(t){var e,o=this,i=o.current,a=i.$content;o.isAnimating||o.isMoved()||!a||"image"!=i.type||!i.isLoaded||i.hasError||(o.isAnimating=!0,n.fancybox.stop(a),e=o.getFitPos(i),o.updateCursor(e.width,e.height),n.fancybox.animate(a,{top:e.top,left:e.left,scaleX:e.width/a.width(),scaleY:e.height/a.height()},t||366,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,i,a,s=this,r=t.$content,c=t.$slide,l=t.width||t.opts.width,d=t.height||t.opts.height,u={};return!!(t.isLoaded&&r&&r.length)&&(e=n.fancybox.getTranslate(s.$refs.stage).width,o=n.fancybox.getTranslate(s.$refs.stage).height,e-=parseFloat(c.css("paddingLeft"))+parseFloat(c.css("paddingRight"))+parseFloat(r.css("marginLeft"))+parseFloat(r.css("marginRight")),o-=parseFloat(c.css("paddingTop"))+parseFloat(c.css("paddingBottom"))+parseFloat(r.css("marginTop"))+parseFloat(r.css("marginBottom")),l&&d||(l=e,d=o),i=Math.min(1,e/l,o/d),l*=i,d*=i,l>e-.5&&(l=e),d>o-.5&&(d=o),"image"===t.type?(u.top=Math.floor(.5*(o-d))+parseFloat(c.css("paddingTop")),u.left=Math.floor(.5*(e-l))+parseFloat(c.css("paddingLeft"))):"video"===t.contentType&&(a=t.opts.width&&t.opts.height?l/d:t.opts.ratio||16/9,d>l/a?d=l/a:l>d*a&&(l=d*a)),u.width=l,u.height=d,u)},update:function(t){var e=this;n.each(e.slides,function(n,o){e.updateSlide(o,t)})},updateSlide:function(t,e){var o=this,i=t&&t.$content,a=t.width||t.opts.width,s=t.height||t.opts.height,r=t.$slide;o.adjustCaption(t),i&&(a||s||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(i),n.fancybox.setTranslate(i,o.getFitPos(t)),t.pos===o.currPos&&(o.isAnimating=!1,o.updateCursor())),o.adjustLayout(t),r.length&&(r.trigger("refresh"),t.pos===o.currPos&&o.$refs.toolbar.add(o.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",r.get(0).scrollHeight>r.get(0).clientHeight)),o.trigger("onUpdate",t,e)},centerSlide:function(t){var e=this,o=e.current,i=o.$slide;!e.isClosing&&o&&(i.siblings().css({transform:"",opacity:""}),i.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next"),n.fancybox.animate(i,{top:0,left:0,opacity:1},void 0===t?0:t,function(){i.css({transform:"",opacity:""}),o.isComplete||e.complete()},!1))},isMoved:function(t){var e,o,i=t||this.current;return!!i&&(o=n.fancybox.getTranslate(this.$refs.stage),e=n.fancybox.getTranslate(i.$slide),!i.$slide.hasClass("fancybox-animated")&&(Math.abs(e.top-o.top)>.5||Math.abs(e.left-o.left)>.5))},updateCursor:function(t,e){var o,i,a=this,s=a.current,r=a.$refs.container;s&&!a.isClosing&&a.Guestures&&(r.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),o=a.canPan(t,e),i=!!o||a.isZoomable(),r.toggleClass("fancybox-is-zoomable",i),n("[data-fancybox-zoom]").prop("disabled",!i),o?r.addClass("fancybox-can-pan"):i&&("zoom"===s.opts.clickContent||n.isFunction(s.opts.clickContent)&&"zoom"==s.opts.clickContent(s))?r.addClass("fancybox-can-zoomIn"):s.opts.touch&&(s.opts.touch.vertical||a.group.length>1)&&"video"!==s.contentType&&r.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if((t=e.getFitPos(n))&&(n.width>t.width||n.height>t.height))return!0}return!1},isScaledDown:function(t,e){var o=this,i=!1,a=o.current,s=a.$content;return void 0!==t&&void 0!==e?i=t<a.width&&e<a.height:s&&(i=n.fancybox.getTranslate(s),i=i.width<a.width&&i.height<a.height),i},canPan:function(t,e){var o=this,i=o.current,a=null,s=!1;return"image"===i.type&&(i.isComplete||t&&e)&&!i.hasError&&(s=o.getFitPos(i),void 0!==t&&void 0!==e?a={width:t,height:e}:i.isComplete&&(a=n.fancybox.getTranslate(i.$content)),a&&s&&(s=Math.abs(a.width-s.width)>1.5||Math.abs(a.height-s.height)>1.5)),s},loadSlide:function(t){var e,o,i,a=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,!1===a.trigger("beforeLoad",t))return t.isLoading=!1,!1;switch(e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":a.setImage(t);break;case"iframe":a.setIframe(t);break;case"html":a.setContent(t,t.src||t.content);break;case"video":a.setContent(t,t.opts.video.tpl.replace(/\{\{src\}\}/gi,t.src).replace("{{format}}",t.opts.videoFormat||t.opts.video.format||"").replace("{{poster}}",t.thumb||""));break;case"inline":n(t.src).length?a.setContent(t,n(t.src)):a.setError(t);break;case"ajax":a.showLoading(t),i=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&a.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&a.setError(t)}})),o.one("onReset",function(){i.abort()});break;default:a.setError(t)}return!0}},setImage:function(t){var o,i=this;setTimeout(function(){var e=t.$image;i.isClosing||!t.isLoading||e&&e.length&&e[0].complete||t.hasError||i.showLoading(t)},50),i.checkSrcset(t),t.$content=n('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(t.$slide.addClass("fancybox-slide--image")),!1!==t.opts.preload&&t.opts.width&&t.opts.height&&t.thumb&&(t.width=t.opts.width,t.height=t.opts.height,o=e.createElement("img"),o.onerror=function(){n(this).remove(),t.$ghost=null},o.onload=function(){i.afterLoad(t)},t.$ghost=n(o).addClass("fancybox-image").appendTo(t.$content).attr("src",t.thumb)),i.setBigImage(t)},checkSrcset:function(e){var n,o,i,a,s=e.opts.srcset||e.opts.image.srcset;if(s){i=t.devicePixelRatio||1,a=t.innerWidth*i,o=s.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);if(0===n)return e.url=t;o&&(e.value=o,e.postfix=t[t.length-1])}),e}),o.sort(function(t,e){return t.value-e.value});for(var r=0;r<o.length;r++){var c=o[r];if("w"===c.postfix&&c.value>=a||"x"===c.postfix&&c.value>=i){n=c;break}}!n&&o.length&&(n=o[o.length-1]),n&&(e.src=n.url,e.width&&e.height&&"w"==n.postfix&&(e.height=e.width/e.height*n.value,e.width=n.value),e.opts.srcset=s)}},setBigImage:function(t){var o=this,i=e.createElement("img"),a=n(i);t.$image=a.one("error",function(){o.setError(t)}).one("load",function(){var e;t.$ghost||(o.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),o.afterLoad(t)),o.isClosing||(t.opts.srcset&&(e=t.opts.sizes,e&&"auto"!==e||(e=(t.width/t.height>1&&s.width()/s.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),a.attr("sizes",e).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout(function(){t.$ghost&&!o.isClosing&&t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))),o.hideLoading(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(i.complete||"complete"==i.readyState)&&a.naturalWidth&&a.naturalHeight?a.trigger("load"):i.error&&a.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),i=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),i>0&&(t.width=Math.floor(i*e/n),t.height=i)},setIframe:function(t){var e,o=this,i=t.opts.iframe,a=t.$slide;t.$content=n('<div class="fancybox-content'+(i.preload?" fancybox-is-hidden":"")+'"></div>').css(i.css).appendTo(a),a.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(i.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(i.attr).appendTo(t.$content),i.preload?(o.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),o.afterLoad(t)}),a.on("refresh.fb",function(){var n,o,s=t.$content,r=i.css.width,c=i.css.height;if(1===e[0].isReady){try{n=e.contents(),o=n.find("body")}catch(t){}o&&o.length&&o.children().length&&(a.css("overflow","visible"),s.css({width:"100%","max-width":"100%",height:"9999px"}),void 0===r&&(r=Math.ceil(Math.max(o[0].clientWidth,o.outerWidth(!0)))),s.css("width",r||"").css("max-width",""),void 0===c&&(c=Math.ceil(Math.max(o[0].clientHeight,o.outerHeight(!0)))),s.css("height",c||""),a.css("overflow","auto")),s.removeClass("fancybox-is-hidden")}})):o.afterLoad(t),e.attr("src",t.src),a.one("onReset",function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1,t.isRevealed=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&e.parent().length?((e.hasClass("fancybox-content")||e.parent().hasClass("fancybox-content"))&&e.parents(".fancybox-slide").trigger("onReset"),t.$placeholder=n("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents()),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("<div></div>").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),o.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;(t=t||e.current)&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){var e=this;(t=t||e.current)&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e,n=this,o=t||n.current,i=o.opts.caption,a=o.opts.preventCaptionOverlap,s=n.$refs.caption,r=!1;s.toggleClass("fancybox-caption--separate",a),a&&i&&i.length&&(o.pos!==n.currPos?(e=s.clone().appendTo(s.parent()),e.children().eq(0).empty().html(i),r=e.outerHeight(!0),e.empty().remove()):n.$caption&&(r=n.$caption.outerHeight(!0)),o.$slide.css("padding-bottom",r||""))},adjustLayout:function(t){var e,n,o,i,a=this,s=t||a.current;s.isLoaded&&!0!==s.opts.disableLayoutFix&&(s.$content.css("margin-bottom",""),s.$content.outerHeight()>s.$slide.height()+.5&&(o=s.$slide[0].style["padding-bottom"],i=s.$slide.css("padding-bottom"),parseFloat(i)>0&&(e=s.$slide[0].scrollHeight,s.$slide.css("padding-bottom",0),Math.abs(e-s.$slide[0].scrollHeight)<1&&(n=i),s.$slide.css("padding-bottom",o))),s.$content.css("margin-bottom",n))},revealContent:function(t){var e,o,i,a,s=this,r=t.$slide,c=!1,l=!1,d=s.isMoved(t),u=t.isRevealed;return t.isRevealed=!0,e=t.opts[s.firstRun?"animationEffect":"transitionEffect"],i=t.opts[s.firstRun?"animationDuration":"transitionDuration"],i=parseInt(void 0===t.forcedDuration?i:t.forcedDuration,10),!d&&t.pos===s.currPos&&i||(e=!1),"zoom"===e&&(t.pos===s.currPos&&i&&"image"===t.type&&!t.hasError&&(l=s.getThumbPos(t))?c=s.getFitPos(t):e="fade"),"zoom"===e?(s.isAnimating=!0,c.scaleX=c.width/l.width,c.scaleY=c.height/l.height,a=t.opts.zoomOpacity,"auto"==a&&(a=Math.abs(t.width/t.height-l.width/l.height)>.1),a&&(l.opacity=.1,c.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),l),p(t.$content),void n.fancybox.animate(t.$content,c,i,function(){s.isAnimating=!1,s.complete()})):(s.updateSlide(t),e?(n.fancybox.stop(r),o="fancybox-slide--"+(t.pos>=s.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,r.addClass(o).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),p(r),"image"!==t.type&&t.$content.hide().show(0),void n.fancybox.animate(r,"fancybox-slide--current",i,function(){r.removeClass(o).css({transform:"",opacity:""}),t.pos===s.currPos&&s.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),u||!d||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===s.currPos&&s.complete())))},getThumbPos:function(t){var e,o,i,a,s,r=!1,c=t.$thumb;return!(!c||!g(c[0]))&&(e=n.fancybox.getTranslate(c),o=parseFloat(c.css("border-top-width")||0),i=parseFloat(c.css("border-right-width")||0),a=parseFloat(c.css("border-bottom-width")||0),s=parseFloat(c.css("border-left-width")||0),r={top:e.top+o,left:e.left+s,width:e.width-i-s,height:e.height-o-a,scaleX:1,scaleY:1},e.width>0&&e.height>0&&r)},complete:function(){var t,e=this,o=e.current,i={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),p(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?i[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),e.slides=i),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){Document.exitFullscreen?Document.exitFullscreen():this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()}),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],e=o.slides[o.currPos-1],e&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,o){var i,a,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(i=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),i=i.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),i.length?(a=i.index(e.activeElement),t&&t.shiftKey?(a<0||0==a)&&(t.preventDefault(),i.eq(i.length-1).trigger("focus")):(a<0||a==i.length-1)&&(t&&t.preventDefault(),i.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,i,a,s,r,c,l,u=this,f=u.current,h=function(){u.cleanUp(t)};return!u.isClosing&&(u.isClosing=!0,!1===u.trigger("beforeClose",t)?(u.isClosing=!1,d(function(){u.update()}),!1):(u.removeEvents(),a=f.$content,o=f.opts.animationEffect,i=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),!0!==t?n.fancybox.stop(f.$slide):o=!1,f.$slide.siblings().trigger("onReset").remove(),i&&u.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",i+"ms"),u.hideLoading(f),u.hideControls(!0),u.updateCursor(),"zoom"!==o||a&&i&&"image"===f.type&&!u.isMoved()&&!f.hasError&&(l=u.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(a),s=n.fancybox.getTranslate(a),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=f.opts.zoomOpacity,
"auto"==r&&(r=Math.abs(f.width/f.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(a,c),p(a),n.fancybox.animate(a,l,i,h),!0):(o&&i?n.fancybox.animate(f.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,i,h):!0===t?setTimeout(h,i):h(),!0)))},cleanUp:function(e){var o,i,a,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(i=t.scrollX,a=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(a).scrollLeft(i))),s.current=null,o=n.fancybox.getInstance(),o?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,i=Array.prototype.slice.call(arguments,1),a=this,s=e&&e.opts?e:a.current;if(s?i.unshift(s):s=a,i.unshift(a),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,i)),!1===o)return o;"afterClose"!==t&&a.$refs?a.$refs.container.trigger(t+".fb",i):r.trigger(t+".fb",i)},updateControls:function(){var t=this,o=t.current,i=o.index,a=t.$refs.container,s=t.$refs.caption,r=o.opts.caption;o.$slide.trigger("refresh"),r&&r.length?(t.$caption=s,s.children().eq(0).html(r)):t.$caption=null,t.hasHiddenControls||t.isIdle||t.showControls(),a.find("[data-fancybox-count]").html(t.group.length),a.find("[data-fancybox-index]").html(i+1),a.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&i<=0),a.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&i>=t.group.length-1),"image"===o.type?a.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&a.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=this,n=["infobar","toolbar","nav"];!t&&e.current.opts.preventCaptionOverlap||n.push("caption"),this.$refs.container.removeClass(n.map(function(t){return"fancybox-show-"+t}).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.5.7",defaults:a,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof b&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new b(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),!0===t&&this.close(t))},destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",o={};if(t&&e)return void 0===e.left&&void 0===e.top||(n=(void 0===e.left?t.position().left:e.left)+"px, "+(void 0===e.top?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),void 0!==e.scaleX&&void 0!==e.scaleY?n+=" scale("+e.scaleX+", "+e.scaleY+")":void 0!==e.scaleX&&(n+=" scaleX("+e.scaleX+")"),n.length&&(o.transform=n),void 0!==e.opacity&&(o.opacity=e.opacity),void 0!==e.width&&(o.width=e.width),void 0!==e.height&&(o.height=e.height),t.css(o)},animate:function(t,e,o,i,a){var s,r=this;n.isFunction(o)&&(i=o,o=null),r.stop(t),s=r.getTranslate(t),t.on(f,function(c){(!c||!c.originalEvent||t.is(c.originalEvent.target)&&"z-index"!=c.originalEvent.propertyName)&&(r.stop(t),n.isNumeric(o)&&t.css("transition-duration",""),n.isPlainObject(e)?void 0!==e.scaleX&&void 0!==e.scaleY&&r.setTranslate(t,{top:e.top,left:e.left,width:s.width*e.scaleX,height:s.height*e.scaleY,scaleX:1,scaleY:1}):!0!==a&&t.removeClass(e),n.isFunction(i)&&i(c))}),n.isNumeric(o)&&t.css("transition-duration",o+"ms"),n.isPlainObject(e)?(void 0!==e.scaleX&&void 0!==e.scaleY&&(delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger(f)},o+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(f),t.off(f).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},i):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},i),this},r.on("click.fb-start","[data-fancybox]",i),r.on("click.fb-start","[data-fancybox-trigger]",function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})}),function(){var t=null;r.on("mousedown mouseup focus blur",".fancybox-button",function(e){switch(e.type){case"mousedown":t=n(this);break;case"mouseup":t=null;break;case"focusin":n(".fancybox-button").removeClass("fancybox-focus"),n(this).is(t)||n(this).is("[disabled]")||n(this).addClass("fancybox-focus");break;case"focusout":n(".fancybox-button").removeClass("fancybox-focus")}})}()}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"https://www.youtube-nocookie.com/embed/$4",thumb:"https://img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",function(o,i,a){var s,r,c,l,d,u,f,p=a.src||"",h=!1;s=t.extend(!0,{},e,a.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var i=0;i<d.length;++i){var s=d[i].split("=",2);2==s.length&&(u[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,a.opts[e],u),p="function"===t.type(o.url)?o.url.call(this,c,l,a):n(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,a):n(o.thumb,c),"youtube"===e?p=p.replace(/&t=((\d+)m)?(\d+)s/,function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))}):"vimeo"===e&&(p=p.replace("&%23","#")),!1}}),h?(a.opts.thumb||a.opts.$thumb&&a.opts.$thumb.length||(a.opts.thumb=r),"iframe"===h&&(a.opts=t.extend(!0,a.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}})),t.extend(a,{type:h,src:p,origSrc:a.src,contentSource:f,contentType:"image"===h?"image":"gmap_place"==f||"gmap_search"==f?"map":"video"})):p&&(a.type=a.opts.defaultType)});var o={youtube:{src:"https://www.youtube.com/iframe_api",class:"YT",loading:!1,loaded:!1},vimeo:{src:"https://player.vimeo.com/api/player.js",class:"Vimeo",loading:!1,loaded:!1},load:function(t){var e,n=this;if(this[t].loaded)return void setTimeout(function(){n.done(t)});this[t].loading||(this[t].loading=!0,e=document.createElement("script"),e.type="text/javascript",e.src=this[t].src,"youtube"===t?window.onYouTubeIframeAPIReady=function(){n[t].loaded=!0,n.done(t)}:e.onload=function(){n[t].loaded=!0,n.done(t)},document.body.appendChild(e))},done:function(e){var n,o,i;"youtube"===e&&delete window.onYouTubeIframeAPIReady,(n=t.fancybox.getInstance())&&(o=n.current.$content.find("iframe"),"youtube"===e&&void 0!==YT&&YT?i=new YT.Player(o.attr("id"),{events:{onStateChange:function(t){0==t.data&&n.next()}}}):"vimeo"===e&&void 0!==Vimeo&&Vimeo&&(i=new Vimeo.Player(o),i.on("ended",function(){n.next()})))}};t(document).on({"afterShow.fb":function(t,e,n){e.group.length>1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),i=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),a=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,i=o.length;e<i;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],i=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,a=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||a},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),n(e).off(".fb.touch"),t.requestId&&(i(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},d.prototype.ontouchstart=function(o){var i=this,c=n(o.target),d=i.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&i.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||u.$slide.hasClass("fancybox-animated"))return o.stopPropagation(),void o.preventDefault();i.realPoints=i.startPoints=a(o),i.startPoints.length&&(u.touch&&o.stopPropagation(),i.startEvent=o,i.canTap=!0,i.$target=c,i.$content=p,i.opts=u.opts.touch,i.isPanning=!1,i.isSwiping=!1,i.isZooming=!1,i.isScrolling=!1,i.canPan=d.canPan(),i.startTime=(new Date).getTime(),i.distanceX=i.distanceY=i.distance=0,i.canvasWidth=Math.round(f[0].clientWidth),i.canvasHeight=Math.round(f[0].clientHeight),i.contentLastPos=null,i.contentStartPos=n.fancybox.getTranslate(i.$content)||{top:0,left:0},i.sliderStartPos=n.fancybox.getTranslate(f),i.stagePos=n.fancybox.getTranslate(d.$refs.stage),i.sliderStartPos.top-=i.stagePos.top,i.sliderStartPos.left-=i.stagePos.left,i.contentStartPos.top-=i.stagePos.top,i.contentStartPos.left-=i.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(i,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(i,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",i.onscroll,!0),((i.opts||i.canPan)&&(c.is(i.$stage)||i.$stage.find(c).length)||(c.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&c.parents(".fancybox-caption").length))&&(i.isScrollable=l(c)||l(c.parent()),n.fancybox.isMobile&&i.isScrollable||o.preventDefault(),(1===i.startPoints.length||u.hasError)&&(i.canPan?(n.fancybox.stop(i.$content),i.isPanning=!0):i.isSwiping=!0,i.$container.addClass("fancybox-is-grabbing")),2===i.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(i.canTap=!1,i.isSwiping=!1,i.isPanning=!1,i.isZooming=!0,n.fancybox.stop(i.$content),i.centerPointStartX=.5*(i.startPoints[0].x+i.startPoints[1].x)-n(t).scrollLeft(),i.centerPointStartY=.5*(i.startPoints[0].y+i.startPoints[1].y)-n(t).scrollTop(),i.percentageOfImageAtPinchPointX=(i.centerPointStartX-i.contentStartPos.left)/i.contentStartPos.width,i.percentageOfImageAtPinchPointY=(i.centerPointStartY-i.contentStartPos.top)/i.contentStartPos.height,i.startDistanceBetweenFingers=s(i.startPoints[0],i.startPoints[1]))))}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=a(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&!0===e.isSwiping||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var a,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(!0!==c)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(i(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||!1===s.opts.vertical||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(a=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=a>45&&a<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,function(t,e){var o,i;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),i=n.fancybox.getTranslate(r.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===r.current.pos&&(s.sliderStartPos.top=o.top-i.top,s.sliderStartPos.left=o.left-i.left),n.fancybox.setTranslate(e.$slide,{top:o.top-i.top,left:o.left-i.left})}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;if(s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5))return void(t.startPoints=t.newPoints);t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&i(t.requestId),t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})},d.prototype.limitMovement=function(){var t,e,n,o,i,a,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return i=h>r?f+l:f,a=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&i>t&&(i=t-1+Math.pow(-t+f+l,.8)||0),l<0&&i<n&&(i=n+1-Math.pow(n-f-l,.8)||0),d>0&&a>e&&(a=e-1+Math.pow(-e+p+d,.8)||0),d<0&&a<o&&(a=o+1-Math.pow(o-p-d,.8)||0),{top:a,left:i}},d.prototype.limitPosition=function(t,e,n,o){var i=this,a=i.canvasWidth,s=i.canvasHeight;return n>a?(t=t>0?0:t,t=t<a-n?a-n:t):t=Math.max(0,a/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},d.prototype.onZoom=function(){var e=this,a=e.contentStartPos,r=a.width,c=a.height,l=a.left,d=a.top,u=s(e.newPoints[0],e.newPoints[1]),f=u/e.startDistanceBetweenFingers,p=Math.floor(r*f),h=Math.floor(c*f),g=(r-p)*e.percentageOfImageAtPinchPointX,b=(c-h)*e.percentageOfImageAtPinchPointY,m=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),v=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=m-e.centerPointStartX,x=v-e.centerPointStartY,w=l+(g+y),$=d+(b+x),S={top:$,left:w,scaleX:f,scaleY:f};e.canTap=!1,e.newWidth=p,e.newHeight=h,e.contentLastPos=S,e.requestId&&i(e.requestId),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},d.prototype.ontouchend=function(t){var o=this,s=o.isSwiping,r=o.isPanning,c=o.isZooming,l=o.isScrolling;if(o.endPoints=a(t),o.dMs=Math.max((new Date).getTime()-o.startTime,1),o.$container.removeClass("fancybox-is-grabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(i(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap)return o.onTap(t);o.speed=100,o.velocityX=o.distanceX/o.dMs*.5,o.velocityY=o.distanceY/o.dMs*.5,r?o.endPanning():c?o.endZooming():o.endSwiping(s,l)},d.prototype.endSwiping=function(t,e){var o=this,i=!1,a=o.instance.group.length,s=Math.abs(o.distanceX),r="x"==t&&a>1&&(o.dMs>130&&s>10||s>50);o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),i=o.instance.close(!0,250)):r&&o.distanceX>0?i=o.instance.previous(300):r&&o.distanceX<0&&(i=o.instance.next(300)),!1!==i||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,i=this;i.contentLastPos&&(!1===i.opts.momentum||i.dMs>350?(t=i.contentLastPos.left,e=i.contentLastPos.top):(t=i.contentLastPos.left+500*i.velocityX,e=i.contentLastPos.top+500*i.velocityY),o=i.limitPosition(t,e,i.contentStartPos.width,i.contentStartPos.height),o.width=i.contentStartPos.width,o.height=i.contentStartPos.height,n.fancybox.animate(i.$content,o,366))},d.prototype.endZooming=function(){var t,e,o,i,a=this,s=a.instance.current,r=a.newWidth,c=a.newHeight;a.contentLastPos&&(t=a.contentLastPos.left,e=a.contentLastPos.top,i={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(a.$content,i),r<a.canvasWidth&&c<a.canvasHeight?a.instance.scaleToFit(150):r>s.width||c>s.height?a.instance.scaleToActual(a.centerPointStartX,a.centerPointStartY,150):(o=a.limitPosition(t,e,r,c),n.fancybox.animate(a.$content,o,150)))},d.prototype.onTap=function(e){var o,i=this,s=n(e.target),r=i.instance,c=r.current,l=e&&a(e)||i.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-i.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-i.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close":r.close(i.startEvent);break;case"toggleControls":r.toggleControls();break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(i.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(i.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(i.tapped){if(clearTimeout(i.tapped),i.tapped=null,Math.abs(d-i.tapX)>50||Math.abs(u-i.tapY)>50)return this;f("dblclick"+o)}else i.tapX=d,i.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?i.tapped=setTimeout(function(){i.tapped=null,r.isAnimating||f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))}).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg></button>'},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('<div class="fancybox-progress"></div>').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,i=o.current;i&&(!0===t||i.opts.loop||o.currIndex<o.group.length-1)?n.isActive&&"video"!==i.contentType&&(n.$progress&&e.fancybox.animate(n.$progress.show(),{scaleX:1},i.opts.slideShow.speed),n.timer=setTimeout(function(){o.current.opts.loop||o.current.index!=o.group.length-1?o.next():o.jumpTo(0)},i.opts.slideShow.speed)):(n.stop(),o.idleSecondsCounter=0,o.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null,t.$progress&&t.$progress.removeAttr("style").hide()},start:function(){var t=this,e=t.instance.current;e&&(t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.isActive=!0,e.isComplete&&t.set(!0),t.instance.trigger("onSlideShowChange",!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1,t.instance.trigger("onSlideShowChange",!1),t.$progress&&t.$progress.removeAttr("style").hide()},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var i=e&&e.SlideShow;o?i&&n.opts.slideShow.autoStart&&i.start():i&&i.isActive&&i.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,i,a,s){var r=o&&o.SlideShow;!r||!i.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(a.preventDefault(),r.toggle())},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,jQuery),function(t,e){"use strict";var n=function(){for(var e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n={},o=0;o<e.length;o++){var i=e[o];if(i&&i[1]in t){for(var a=0;a<i.length;a++)n[e[0][a]]=i[a];return n}}return!1}();if(n){var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.isAnimating=!1,n.update(!0,!0,0),n.isComplete||n.complete()),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})}e(t).on({"onInit.fb":function(t,e){var i;if(!n)return void e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove();e&&e.group[e.currIndex].opts.fullScreen?(i=e.$refs.container,i.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&!0===e.opts.fullScreen.autoStart&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()},"afterKeydown.fb":function(t,e,n,o,i){e&&e.FullScreen&&70===i&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var o=function(t){this.init(t)};e.extend(o.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,t.Thumbs=e,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var i=0,a=n.length;i<a&&(n[i].thumb&&o++,!(o>1));i++);o>1&&e.opts?(e.$button.removeAttr("style").on("click",function(){e.toggle()}),e.isActive=!0):e.$button.hide()},create:function(){var t,o=this,i=o.instance,a=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('<div class="'+n+" "+n+"-"+o.opts.axis+'"></div>').appendTo(i.$refs.container.find(a).addBack().filter(a)),o.$grid.on("click","a",function(){i.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e('<div class="'+n+'__list">').appendTo(o.$grid)),e.each(i.group,function(e,n){t=n.thumb,t||"image"!==n.type||(t=n.src),s.push('<a href="javascript:;" tabindex="0" data-index="'+e+'"'+(t&&t.length?' style="background-image:url('+t+')"':'class="fancybox-thumbs-missing"')+"></a>")}),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+i.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,o=this,i=o.$list,a=o.$grid;o.instance.current&&(e=i.children().removeClass("fancybox-thumbs-active").filter('[data-index="'+o.instance.current.index+'"]').addClass("fancybox-thumbs-active"),n=e.position(),"y"===o.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===o.opts.axis&&(n.left<a.scrollLeft()||n.left>a.scrollLeft()+(a.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new o(e),n.isActive&&!0===n.opts.autoStart&&n.show())},"beforeShow.fb":function(t,e,n,o){var i=e&&e.Thumbs;i&&i.isVisible&&i.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,i){var a=e&&e.Thumbs;a&&a.isActive&&71===i&&(o.preventDefault(),a.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&!1!==n.opts.hideOnClose&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},
tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p></div>'}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,i=e.fancybox.getInstance(),a=i.current||null;a&&("function"===e.type(a.opts.share.url)&&(t=a.opts.share.url.apply(a,[i,a])),o=a.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===a.type?encodeURIComponent(a.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,i.$caption?encodeURIComponent(i.$caption.text()):""),e.fancybox.open({src:i.translate(i,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){i.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})},mobile:{autoFocus:!1}}}))})}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,i=n.join("-");return{hash:e,index:o<1?1:o,gallery:i}}function i(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function a(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,""!==(n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""))&&n)}n.escapeSelector||(n.escapeSelector=function(t){return(t+"").replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t})}),n(function(){!1!==n.fancybox.defaults.hash&&(n(e).on({"onInit.fb":function(t,e){var n,i;!1!==e.group[e.currIndex].opts.hash&&(n=o(),(i=a(e))&&n.gallery&&i==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,i,s){var r;i&&!1!==i.opts.hash&&(r=a(o))&&(o.currentHash=r+(o.group.length>1?"-"+(i.index+1):""),t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null},300)))},"beforeClose.fb":function(n,o,i){i&&!1!==i.opts.hash&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),function(t,o){var i=n(o).data("FancyBox");if(i&&i.currentHash)return e=i,!1}),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&i(t)}),setTimeout(function(){n.fancybox.getInstance()||i(o())},50))})}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,i=(new Date).getTime();e.group.length<2||!1===o.opts.wheel||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,i-n<250||(n=i,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery);
function UERemoteGeneralAPI(){
var t=this, g_objParent;
var g_isTypeEvents=false;
var g_options=null;
var g_vars={
parent_id:"",
class_items:"",
class_active:"",
selector_item_trigger:"",
add_set_active_code:false,
active_code_first_unselected:false,
listen_class_change:true,
enableDebug:false,
is_editor:false,
trigger_event: "click"
};
var g_temp={
handle:null,
trashold:50
};
function trace(str){
console.log(str);
}
function getVal(obj, name, defaultValue){
return window.ueRemoteConnection.getVal(obj, name, defaultValue);
}
function runWithTrashold(func, trashold){
if(g_temp.handle)
clearTimeout(g_temp.handle);
g_temp.handle=setTimeout(func, g_temp.trashold);
};
function validateInited(){
var isInited=g_objParent.data("remote_inited");
if(isInited==false)
throw new Error("The remote parent not inited");
}
function getObjItems(){
var objItems=g_objParent.find("."+g_vars.class_items);
return(objItems);
}
function getNumTotal(){
var objItems=g_objParent.find("."+g_vars.class_items);
var numTotal=objItems.length;
return(numTotal);
}
function getObjCurrentItem(){
var selector="."+g_vars.class_items+"."+g_vars.class_active;
var objCurrent=g_objParent.find(selector);
return(objCurrent);
}
function getNumCurrent(){
var objCurrent=getObjCurrentItem();
if(objCurrent.length==0)
return(-1);
var index=objCurrent.index();
return(index);
}
function getItem(index){
if(index < 0)
index=0;
var objItems=getObjItems();
if(objItems.length==0)
return(null);
if(index >=objItems.length)
index=objItems.length-1;
var objItem=jQuery(objItems[index]);
return(objItem);
}
function getItemNum(num){
var total=getNumTotal();
if(jQuery.isNumeric(num)==false)
throw new Error("num item should be numeric");
if(num >=total)
num=total-1;
if(num < 0)
num=0;
if(!num)
num=0;
if(typeof num=="undefined")
num=0;
return(num);
}
function unselectItems(){
var objItem=getObjCurrentItem();
if(objItem.length==null){
if(g_vars.enableDebug)
trace("Unselect Item - Selected Item not found "+g_vars.parent_id);
return(false);
}
objItem.removeClass(g_vars.class_active);
if(g_vars.enableDebug)
trace("Items Unselected: " + g_vars.parent_id);
}
function changeItem(mixed){
var numItem=getItemNum(mixed);
var objItem=getItem(numItem);
if(objItem==null){
if(g_vars.enableDebug)
trace("General API: changeItem - item not found");
return(false);
}
var numCurrent=getNumCurrent();
if(numCurrent===numItem){
if(g_vars.enableDebug)
trace("General API: changeItem - num current==numitem - skip (" + numItem+")");
return(false);
}
if(!g_vars.selector_item_trigger){
objItem.trigger(g_vars.trigger_event);
return(false);
}
var objInner=objItem.find(g_vars.selector_item_trigger);
if(objInner.length==0){
trace(objItem);
throw new Error("Can't find inner by selector:"+g_vars.selector_item_trigger);
}
objInner.trigger(g_vars.trigger_event);
}
this.onEvent=function(name, func){
validateInited();
switch(name){
case "change":
g_objParent.on("uc_change", func);
break;
case "pause":
break;
default:
throw new Error("General API: Wrong event: "+name);
break;
}}
this.doAction=function(action, arg1, arg2){
validateInited();
if(g_isTypeEvents==true){
var funcRunAction=getVal(g_options, "func_doAction");
if(!funcRunAction)
throw new Error("Missing option: 'func_doAction' ");
var response=g_options.func_doAction(action, arg1, arg2);
return(response);
}
if(g_vars.enableDebug){
trace("Action (General): " + action+" arg1: "+arg1+" arg2: "+arg2);
}
switch(action){
case 'get_num_current':
var current=getNumCurrent();
if(g_vars.enableDebug)
trace("response: "+current);
return(current);
break;
case "get_total_items":
var total=getNumTotal();
if(g_vars.enableDebug)
trace("response: "+total);
return(total);
break;
case 'change_item':
changeItem(arg1);
break;
case "unselect_items":
unselectItems();
break;
case "pause":
case "play":
break;
default:
throw new Error("General API: Wrong action: "+action);
break;
}}
function initEvents_listenClassChange(){
var objItems=getObjItems();
if(g_vars.enableDebug==true){
trace("generalAPI: listen class change: ");
trace(objItems);
}
jQuery.each(objItems, function(index, item){
var objItem=jQuery(item);
var isSetObserver=objItem.data("uc_set_observer");
if(isSetObserver===true){
return(true);
}
var observer=new MutationObserver(function(records){
runWithTrashold(function(){
if(g_vars.enableDebug==true)
trace("generalAPI: trigger item change");
g_objParent.trigger("uc_change");
});
});
var config={ attributes: true};
observer.observe(item, config);
objItem.data("uc_set_observer", true);
});
}
function initEvents_setActive(){
if(g_vars.enableDebug==true)
trace("start initEvents_setActive")
var objItems=getObjItems();
if(objItems.length==0){
if(g_vars.enableDebug==true)
trace("no items, exit")
return(false);
}
var objFirstItem=getItem(0);
if(objFirstItem==null){
if(g_vars.enableDebug==true)
trace("empty first item - exit")
return(false);
}
if(g_vars.active_code_first_unselected!==true)
objFirstItem.addClass(g_vars.class_active);
else if(g_vars.enableDebug==true)
trace("skip activating first item: g_vars.active_code_first_unselected=true");
objItems.on(g_vars.trigger_event, function(event){
var objItem=jQuery(this);
var objElement=jQuery(event.target);
var isLink=objElement.is("a");
if(isLink==true&&objElement.hasClass(g_vars.class_items)==false){
return(true);
}
objItems.not(objItem).removeClass(g_vars.class_active);
objItem.addClass(g_vars.class_active);
g_objParent.trigger("uc_change");
event.preventDefault();
});
}
function initEvents(){
if(g_vars.enableDebug==true){
trace("generalAPI: init events");
trace(g_objParent);
}
if(g_vars.listen_class_change==true)
initEvents_listenClassChange();
if(g_vars.add_set_active_code==true){
initEvents_setActive();
}}
this.getElement=function(){
return(g_objParent);
}
this.getAPIType=function(){
return("general");
}
function initByClasses(){
try{
var widgetName=g_objParent.data("widgetname");
g_vars.class_items=getVal(g_options, "class_items");
if(!g_vars.class_items){
var widgetID=g_objParent.attr("id");
trace("missing class_items in "+widgetID);
trace(g_vars);
throw new Error(widgetName +" - missing 'class_items' option");
}
g_vars.class_active=getVal(g_options, "class_active");
if(!g_vars.class_active)
throw new Error(widgetName +" - missing 'class_active' in options");
g_vars.parent_id=g_objParent.attr("id");
g_vars.selector_item_trigger=getVal(g_options, "selector_item_trigger");
g_vars.add_set_active_code=getVal(g_options, "add_set_active_code");
g_vars.active_code_first_unselected=getVal(g_options, "active_code_first_unselected");
if(g_vars.add_set_active_code===true)
g_vars.listen_class_change=false;
}
catch(e){
trace("ERROR: "+e);
trace("passed options: ");
trace(g_options);
throw e;
}}
this.init=function(objParent, options, isEditor){
if(!options)
return(false);
g_vars.is_editor=isEditor;
g_objParent=objParent;
var connectType=getVal(options, "connect_type");
if(connectType=="events")
g_isTypeEvents=true;
g_options=options;
var enableDebug=getVal(options, "trace_debug");
if(enableDebug==true)
g_vars.enableDebug=true;
if(g_vars.enableDebug==true){
trace("init general api");
trace(objParent);
trace(options);
}
if(isEditor==true)
g_vars.trigger_event="ucclick";
if(g_isTypeEvents==false)
initByClasses();
g_objParent.data("remote_inited", true);
if(g_isTypeEvents==false){
if(g_vars.listen_class_change==true)
setTimeout(initEvents, 1000);
else
initEvents();
g_objParent.on("uc_ajax_refreshed", function(){
setTimeout(initEvents,500)
});
}
return(true);
}}
function UERemoteGalleryAPI(){
var g_api, g_isInited;
var g_objParent;
var t=this;
function trace(str){
console.log(str);
}
function validateInited(){
if(g_isInited==false)
throw new Error("The owl carousel API is not inited");
}
this.doAction=function(action, arg1, arg2){
validateInited();
switch(action){
case 'get_num_current':
var current=g_api.getNumCurrent();
return(current);
break;
case "get_total_items":
var total=g_api.getNumItems();
return(total);
break;
case 'change_item':
if(arg1 < 0)
arg1=0;
g_api.selectItem(arg1);
break;
case "unselect_items":
g_api.selectItem(0);
break;
case "is_playing":
var isPlaying=g_api.isPlaying();
return(isPlaying);
break;
case "pause":
g_api.stop();
break;
case "play":
g_api.play();
break;
default:
throw new Error("GALLERY API: Wrong action: "+action);
break;
}}
this.onEvent=function(name, func){
validateInited();
switch(name){
case "change":
g_api.on("item_change", func);
break;
case "play":
g_api.on("play",func);
break;
case "pause":
g_api.on("stop",func);
break;
default:
throw new Error("Gallery API: Wrong event: "+name);
break;
}}
this.getElement=function(){
return(g_objParent);
}
this.getAPIType=function(){
return("gallery");
}
this.init=function(objParent, options){
g_api=objParent.data("unitegallery-api");
if(!g_api)
return(false);
g_objParent=objParent;
g_isInited=true;
return(true);
}}
function UERemoteCarouselAPI(){
var g_owlCarousel, g_owl, g_isInited;
var t=this;
var g_enableDebug=false;
function trace(str){
console.log(str);
}
function validateInited(){
if(g_isInited==false)
throw new Error("The owl carousel API is not inited");
}
function getTotalItems(){
var total=g_owlCarousel.find(".owl-item:not(.cloned)").length;
return(total);
}
function resetAutoplay(){
if(g_owl.settings.autoplay==false)
return(false);
g_owlCarousel.trigger('stop.owl.autoplay');
g_owlCarousel.trigger('play.owl.autoplay');
}
this.doAction=function(action, arg1, arg2){
validateInited();
if(g_enableDebug==true){
var strAction=action;
if(arg1)
strAction +=" "+arg1;
if(arg2)
strAction +=" "+arg2;
trace("carousel action: "+strAction);
}
switch(action){
case "next":
g_owlCarousel.trigger('next.owl.carousel');
break;
case "prev":
g_owlCarousel.trigger('prev.owl.carousel');
break;
case "play":
g_owlCarousel.trigger('start_autoplay.owl.autoplay');
break;
case "pause":
g_owlCarousel.trigger('stop.owl.autoplay');
break;
case "is_playing":
if(g_owl.settings.autoplay==true)
return(true)
else
return(false);
break;
case "get_total_items":
var total=getTotalItems()
return(total);
break;
case "get_progress_time":
var progressTime=g_owl.settings.autoplayTimeout / 1000;
return(progressTime);
break;
case "get_modified_progress_time":
var progressTime=(g_owl.settings.autoplayTimeout - g_owl.settings.smartSpeed) / 1000;
return(progressTime);
break;
case 'get_num_current':
var currentItem=g_owl.relative(g_owl.current());
if(g_enableDebug===true){
trace("num current: " + currentItem);
}
return(currentItem);
break;
case "get_total_text":
var owlTotalItems=g_owlCarousel.find(".owl-item:not(.cloned)").length;
if(owlTotalItems.toString().length < 2){
owlTotalItems="0" + owlTotalItems;
}
return(owlTotalItems);
break;
case "get_current_text":
var owlCurrentItem=g_owl.relative(g_owl.current()) + 1;
if(owlCurrentItem.toString().length < 2){
owlCurrentItem="0" + owlCurrentItem;
}
return(owlCurrentItem);
break;
case 'change_item':
var total=getTotalItems()
var currentItem=g_owl.relative(g_owl.current());
var slideNum=arg1;
if(slideNum==currentItem)
return(false);
if(slideNum >=total)
slideNum=(total-1);
else
if(slideNum < 0)
slideNum=0;
g_owlCarousel.trigger('to.owl.carousel', [slideNum, null, true]);
resetAutoplay();
break;
case "unselect_items":
break;
default:
throw new Error("Carousel API: Wrong action: "+action);
break;
}}
this.onEvent=function(name, func){
validateInited();
switch(name){
case "play":
g_owlCarousel.on("play_autoplay.owl.carousel", func);
break;
case "pause":
g_owlCarousel.on("stop_autoplay.owl.carousel", func);
break;
case "change":
g_owlCarousel.on("changed.owl.carousel", func);
break;
case "transition_start":
g_owlCarousel.on("translate.owl.carousel", func);
break;
case "transition_end":
g_owlCarousel.on("translated.owl.carousel", func);
break;
case "refreshed":
g_owlCarousel.on("refreshed.owl.carousel", func);
break;
default:
console.error("Carousel API: Wrong event: "+name);
throw new Error("Carousel API: Wrong event: "+name);
break;
}}
this.getAPIType=function(){
return("carousel");
}
this.getElement=function(){
return(g_owlCarousel);
}
this.init=function(objParent){
if(typeof ucRemoteDebugEnabled!="undefined")
g_enableDebug=true;
if(objParent.hasClass("owl-carousel")==false)
throw new Error("owl-carousel class not found");
g_owlCarousel=objParent;
g_owl=g_owlCarousel.data("owl.carousel");
g_owlCarousel.on("uc_ajax_refreshed", onAjaxRefreshed);
if(!g_owl)
return(false);
g_isInited=true;
return(true);
}
function onAjaxRefreshed(){
g_owl=g_owlCarousel.data("owl.carousel");
}}
function UESyncObject(){
var g_objApis={};
var g_groupName, g_objIDs;
var t=this;
var g_vars={
is_editor:false,
is_editor_func_started:false,
show_debug:false
};
function trace(str){
console.log(str);
}
function validate(objAPI){
if(g_objApis.length==0)
return(false);
var numItems=objAPI.doAction("get_total_items");
for(var elID in g_objApis){
var firstExistingAPI=g_objApis[elID];
var numItemsExisting=firstExistingAPI.doAction("get_total_items");
if(numItemsExisting!==numItems){
var objElement=objAPI.getElement();
var elementID=objElement.attr("id");
trace("Sync failed "+elementID+" has "+numItems+" items and "+elID+" has "+numItemsExisting+ " items");
throw new Error("Sync failed, number of items should be the same. Now it's "+numItems+" and "+numItemsExisting);
}
return(false);
}}
this.setOptions=function(groupName, isEditor){
if(isEditor===true)
g_vars.is_editor=true;
if(!g_groupName)
g_groupName=groupName;
}
function getElementID(objAPI){
var objElement=objAPI.getElement();
var elementID=objElement.attr("id");
return(elementID);
}
function mapAPIs(func, objElement){
if(typeof ucRemoteDebugEnabled!="undefined")
g_vars.show_debug=true;
var elementID=null;
if(objElement){
var elementID=objElement.attr("id");
if(g_objApis.length==1)
return(null);
}
for(var elID in g_objApis){
var api=g_objApis[elID];
if(elementID&&elID==elementID)
continue;
func(api);
}}
function onItemChange(objAPI){
var numCurrent=objAPI.doAction("get_num_current");
var objElement=objAPI.getElement();
if(g_vars.show_debug==true){
trace("sync onchange: " + numCurrent);
trace(objElement);
trace(g_objApis);
}
mapAPIs(function(api){
if(numCurrent < 0)
api.doAction("unselect_items");
else
api.doAction("change_item", numCurrent);
}, objElement);
}
function onPause(objAPI){
var objElement=objAPI.getElement();
mapAPIs(function(api){
api.doAction("pause");
}, objElement);
}
function trigger(action, params){
var realAction="uc_remote_sync_"+g_groupName+"_action_"+action;
jQuery("body").trigger(realAction, params);
}
this.on=function(action, func){
var realAction="uc_remote_sync_"+g_groupName+"_action_"+action;
jQuery("body").on(realAction, func);
}
this.getDebugText=function(objElement){
var text="sync group: <b>" + g_groupName+"</b>, ";
var textWidgets="";
mapAPIs(function(api){
var objElement=api.getElement();
var widgetName=objElement.data("widgetname");
var widgetID=objElement.attr("id");
if(textWidgets)
textWidgets +=", ";
textWidgets +="<a href='#"+widgetID+"' style='color:green;text-decoration:underline'><b>" + widgetName + "</b></a>";
}, objElement);
if(textWidgets)
text +="sync with: " + textWidgets;
return(text);
}
function removeDeletedAPIs(){
var objAPIsNew={};
mapAPIs(function(api){
var elementID=getElementID(api);
var objElement=jQuery("#"+elementID);
if(objElement.length==0)
return(false);
var parent=objElement.parent();
objAPIsNew[elementID]=api;
});
g_objApis=objAPIsNew;
}
function onEditorCheck(){
removeDeletedAPIs();
trigger("update_debug", g_groupName);
}
this.getGroupName=function(){
return(g_groupName);
}
this.addAPI=function(objAPI){
var id=getElementID(objAPI);
if(g_objApis.hasOwnProperty(id))
return(false);
g_objApis[id]=objAPI;
if(g_vars.is_editor==true)
removeDeletedAPIs();
validate(objAPI);
var objElement=objAPI.getElement();
trigger("update_debug", g_groupName);
objAPI.onEvent("change", function(){
onItemChange(objAPI);
});
objAPI.onEvent("pause", function(){
onPause(objAPI);
});
if(g_vars.is_editor==true&&g_vars.is_editor_func_started==false){
setInterval(onEditorCheck, 700);
g_vars.is_editor_func_started=false;
}}
this.getElements=function(exceptID){
if(!g_objApis)
return(null);
var arrElements=[];
for(var elID in g_objApis){
if(exceptID&&exceptID==elID)
continue;
var objApi=g_objApis[elID];
var objElement=objApi.getElement();
arrElements.push(objElement);
}
if(arrElements.length==0)
return(null);
return(arrElements);
}}
function UERemoteWidgets(){
var g_objParent, g_objWidget, g_parentID;
var g_api, g_objSync, g_remoteConnection=window.ueRemoteConnection;
var t=this;
var g_vars={
is_inited:false,
funcOnInit:null,
is_editor:null,
widget_id:null,
init_options:null,
is_parent_mode: false,
syncid:null,
options_api:null,
show_connection_debug:false,
debug_show_ids:false,
debug_show_widget: "",
trace_debug:false
};
var g_types={
CAROUSEL:"carousel",
GALLERY:"gallery",
GENERAL:"general"
};
function trace(str){
console.log(str);
}
function getVal(obj, name, defaultValue){
return window.ueRemoteConnection.getVal(obj, name, defaultValue);
}
function _______INIT_________(){}
function initWidget(widgetID){
g_objWidget=jQuery("#"+widgetID);
if(g_objWidget.length==0)
throw new Error("Widget not found by id: "+widgetID);
g_vars.widget_id=widgetID;
var forceID=getVal(g_vars.init_options, "force_parentid");
if(forceID)
g_parentID=forceID;
else
g_parentID=g_objWidget.data("parentid");
if(!g_parentID)
throw new Error("Parent controlled ID not set");
}
function getParentType(){
if(!g_objParent||g_objParent.length==0)
throw new Error("getParentType: no parent found");
if(g_objParent.hasClass("owl-carousel"))
return(g_types.CAROUSEL);
var dataType=g_objParent.data("remote-type");
switch(dataType){
case "gallery":
return g_types.GALLERY;
break;
}
return(g_types.GENERAL);
}
function getOffsetsDistance(offset1, offset2){
var dx=offset2.left-offset1.left;
var dy=offset2.top-offset1.top;
return Math.sqrt(dx*dx+dy*dy);
}
function getClosestByOffset(objParents, objElement){
var objClosest=null;
var minDiff=1000000;
var elementOffset=objElement.offset();
if(g_vars.trace_debug){
trace("Widget Offset: ");
trace(elementOffset);
}
jQuery.each(objParents, function(index, parent){
var objParent=jQuery(parent);
var parentOffset=objParent.offset();
if(parentOffset.top==0){
var firstParent=getWidgetContainer(objParent);
var parentOffset=firstParent.offset();
}
var distance=getOffsetsDistance(parentOffset, elementOffset);
if(g_vars.trace_debug){
trace("Parent offset: ");
trace(objParent);
trace(parentOffset);
trace("distance: " + distance);
}
if(distance < minDiff){
minDiff=distance;
objClosest=objParent;
}});
return(objClosest);
}
function filterParentsBySection(objParents, objElement){
var objSection=objElement.closest(".elementor-top-section");
if(objSection.length==0)
return(objParents);
var section=objSection[0];
var objFiltered=objParents.filter(function(index, parent){
var isContains=jQuery.contains(section, parent);
return isContains;
});
if(objFiltered.length)
return(objFiltered);
return(objParents);
}
function detectClosestParent(objParents){
var objContainer=jQuery("body");
var objTemplateHolder=g_objWidget.closest(".uc-template-holder");
if(objTemplateHolder.length)
objContainer=objTemplateHolder;
if(!objParents)
var objParents=objContainer.find(".uc-remote-parent").not(g_objWidget);
if(g_vars.trace_debug){
trace("detect closest start. group:");
trace(objParents);
}
var numParents=objParents.length;
if(numParents==0)
return(null);
if(numParents==1)
return(objParents);
if(g_vars.trace_debug)
trace("filter auto");
var objParentsFiltered=objParents.filter("[data-remoteid='"+g_parentID+"']");
if(objParentsFiltered.length==1)
return(objParentsFiltered);
if(g_vars.trace_debug){
trace("filter by section");
}
var objParents=filterParentsBySection(objParents, g_objWidget);
if(g_vars.trace_debug){
trace(objParents);
}
if(objParents.length==1)
return(objParents);
if(g_vars.trace_debug)
trace("get closest by parent");
var objClosest=getClosestByOffset(objParents, g_objWidget);
if(objClosest)
return(objClosest);
if(g_vars.trace_debug)
trace("get first");
var firstParent=jQuery(objParentsFiltered[0]);
return(firstParent);
}
function setParentObject(){
var objForceParent=getVal(g_vars.init_options, "force_parent_obj");
var widgetID=g_objWidget.attr("id");
if(g_vars.trace_debug)
trace("start set parent for: "+widgetID+", parent name: "+g_parentID);
if(objForceParent){
g_objParent=objForceParent;
if(g_vars.trace_debug){
trace("set force parent");
trace(g_objParent);
}
return(true);
}
if(!g_parentID)
throw new Error("Parent controller ID not found");
if(!g_objParent||g_objParent.length==0){
if(g_parentID=="auto"){
if(g_vars.trace_debug){
trace("auto detect selected");
}
g_objParent=detectClosestParent();
if(g_vars.trace_debug){
trace("detect closest");
trace(g_objParent);
}
if(!g_objParent)
throw new Error("Can't detect remote parent");
}else{
var objParents=jQuery(".uc-remote-parent[data-remoteid='"+g_parentID+"']").not(g_objWidget);
if(g_vars.trace_debug)
trace("Detect from group: "+g_parentID);
g_objParent=detectClosestParent(objParents);
if(g_vars.trace_debug){
trace("detected from group");
trace(g_objParent);
}
if(!g_objParent||g_objParent.length==0){
var isAnotherTry=g_objWidget.data("uc_parent_detect_another_try");
if(!isAnotherTry){
g_objWidget.data("uc_parent_detect_another_try", true);
if(g_vars.trace_debug)
trace("Set another try for parent detect");
return(false);
}
throw new Error("Parent widget with remote name: '"+g_parentID+"' not found");
}}
}
if(g_objParent&&g_objParent.length > 1){
g_objParent=jQuery(g_objParent[0]);
}
if(g_vars.trace_debug==true){
var parentID=g_objParent.attr("id");
var widgetID=g_objWidget.attr("id");
trace("widget: "+widgetID+" connected to: "+parentID);
}
if(!g_objParent||g_objParent.length==0)
throw new Error("Remote parent not found");
return(true);
}
function initAPI(){
if(g_vars.trace_debug==true){
trace("start init api function");
}
if(!g_api){
var parentType=getParentType();
if(!parentType){
trace(g_objParent);
throw new Error("No parent type found");
}
if(g_vars.trace_debug==true){
trace("init api: " + parentType);
trace(g_objParent);
}
switch(parentType){
case g_types.CAROUSEL:
g_api=new UERemoteCarouselAPI();
break;
case g_types.GENERAL:
g_api=new UERemoteGeneralAPI();
break;
case g_types.TABS:
g_api=new UERemoteGeneralAPI();
break;
case g_types.GALLERY:
g_api=new UERemoteGalleryAPI();
break;
default:
throw new Error("Wrong parent type: "+parentType);
break;
}}
var optionsFromData=g_objParent.data("uc-remote-options");
var isEditor=isInsideEditor();
if(optionsFromData)
g_vars.options_api=optionsFromData;
var optionsAPI={};
var optionsAPI=jQuery.extend({},g_vars.options_api);
if(jQuery.isEmptyObject(g_vars.options_api)==false)
jQuery.extend({},optionsAPI, g_vars.options_api);
if(g_vars.trace_debug==true){
if(optionsAPI)
trace(optionsAPI);
optionsAPI["trace_debug"]=true;
}
var isInited=g_api.init(g_objParent, g_vars.options_api, isEditor);
if(g_vars.trace_debug==true){
trace("inited: " + isInited);
}
return(isInited);
}
function initParent(){
var isParentSet=setParentObject();
if(isParentSet==false)
return(false);
var isInited=initAPI();
return(isInited);
}
function initGlobal(widgetID, func){
if(!g_objWidget)
initWidget(widgetID);
var isDebug=g_objWidget.data("debug");
if(isDebug===true||typeof ucRemoteDebugEnabled!="undefined"){
g_vars.trace_debug=true;
g_vars.show_connection_debug=true;
}
if(g_vars.trace_debug){
if(!widgetID)
widgetID=g_objWidget.attr("id");
trace("Initing Remote Widget: "+widgetID);
}
g_vars.is_inited=initParent();
if(g_vars.is_inited==false){
if(!g_objParent){
setTimeout(func, 1000);
}else{
if(g_vars.trace_debug==true){
trace(g_objParent);
trace("set object ready event");
}
g_objParent.on("uc-object-ready", func);
}}
}
this.setAction=function(action, objElement, allowMultiple){
if(g_vars.trace_debug==true){
trace("set action: "+action);
}
if(g_vars.is_inited==false)
throw new Error("Widget not inited");
if(typeof objElement=="string"){
var selector=objElement;
objElement=g_objWidget.find(objElement);
if(objElement.length==0)
throw new Error("Remote '"+action+"' action error: element: "+selector+" not found");
}
if(!objElement||objElement.length==0)
throw new Error("Element not inited");
if(!g_api)
throw new Error("API not inited!");
var linkedAction=objElement.data("uc-action");
if(allowMultiple!==true)
if(linkedAction){
trace("not allow multiple action: "+action);
return(false);
}
objElement.data("uc-action", action);
objElement.on("click",function(){
var objElement=jQuery(this);
if(objElement.hasClass("uc-disabled"))
return(true);
t.doAction(action);
});
}
function onWidgetReady(){
checkWidgetDebug();
var isEditorMode=isInsideEditor();
if(isEditorMode==true){
hideErrorOnWidget();
setInterval(checkWidgetInsideEditor, 700);
}}
function _______TEXT_ON_WIDGET_________(){}
function hideErrorOnWidget(){
if(!g_objWidget||g_objWidget.length==0)
return(false);
var objParent=getWidgetContainer(g_objWidget);
var objError=objParent.find('.uc-remote-error');
if(objError.length==0)
return(false);
if(objError.is(":visible")==false)
return(false);
objError.hide();
g_objWidget.css({
"border":"none"
});
checkWidgetDebug();
}
function getWidgetContainer(objWidget){
objParent=objWidget.parent();
return(objParent);
}
function addTextDiv(objWidget, type){
var objParent=getWidgetContainer(objWidget);
var isDebug=(type=="debug");
var className="uc-remote-error";
if(isDebug==true)
className="uc-remote-debug";
var divText="<div class='"+className+"'></div>";
objParent.append(divText);
var objError=objParent.find('.'+className+'');
var css={
"position":"absolute",
"color":"red",
"top":"-30px",
"left":"0px",
"z-index":"999999",
"background-color":"#ffffff"
};
if(isDebug==true){
css["color"]="green";
css["z-index"]="999998";
}
var objParentsBG=objParent.parents(".unlimited-elements-background-overlay");
if(objParentsBG.length){
css["top"]="0px";
}
objError.css(css);
var objError=objParent.find('.'+className+'');
return(objError);
}
function displayTextOnWidget(objWidget, message, type){
var isDebug=(type=="debug");
var className="uc-remote-error";
if(isDebug==true)
className="uc-remote-debug";
var objParent=getWidgetContainer(objWidget);
objText=objParent.find("."+className);
if(objText.length==0){
objText=addTextDiv(objWidget, type);
if(isDebug==false){
var isInEditor=isInsideEditor();
if(isInEditor==true){
setTimeout(function(){
displayTextOnWidget(objWidget, message, type);
},2000);
return(false);
}}
}
if(isDebug==false){
objWidget.css({
"border":"2px solid red",
"position":"relative"
});
}
objText.show();
objText.html(message);
}
function displayErrorMessage(message){
if(typeof g_ucRemoteHideErrors!=="undefined"&&g_ucRemoteHideErrors===true){
trace("UE Remote Error: "+message);
return(false);
}
if(g_vars.is_parent_mode==false){
if(g_objWidget&&g_objWidget.length)
displayTextOnWidget(g_objWidget, message,"error");
}else{
displayTextOnWidget(g_objParent, message, "error");
}}
function _______DEBUG_________(){}
function isDebugActive(objWidget){
if(!objWidget)
objWidget=g_objWidget;
var isActive=objWidget.data("debug_active");
if(isActive===true)
return(true);
return(false);
}
function removeDebugVisual(objWidget){
if(!objWidget)
objWidget=g_objWidget;
g_objWidget.data("debug_active", false);
g_objWidget.css({
"border-style":"none"
});
}
function setDebugVisual(color, objWidget){
if(!objWidget)
objWidget=g_objWidget;
objWidget.data("debug_active", true);
objWidget.css({
"border-style":"solid",
"border-width":"3px",
"border-color":color
});
}
function isParentDebugActive(objParent){
var dataDebug=objParent.data("debug");
var isDebug=(dataDebug===true);
return(isDebug);
}
function checkWidgetDebugWork(objWidget, objParent){
if(!objWidget)
objWidget=g_objWidget;
if(!objParent)
objParent=g_objParent;
var isDebug=isParentDebugActive(objParent);
var isActive=isDebugActive(objWidget);
if(isDebug==false){
if(isActive==true)
removeDebugVisual(objWidget);
return(false);
}
if(isActive==false){
var color=addParentDebug(objParent);
setDebugVisual(color, objWidget);
}}
function checkDebugConnectionText(){
if(!g_objWidget)
return(false);
if(g_vars.show_connection_debug==false)
return(false);
if(!g_objParent||g_objParent.length==0)
throw new Error("Not conneted to no parent");
var widgetName=g_objParent.data("widgetname");
var widgetID=g_objParent.attr("id");
var text="connected to <a href='#"+widgetID+"' style='color:green;text-decoration:underline'><b>" + widgetName + "</b></a>";
displayTextOnWidget(g_objWidget, text, "debug");
}
function checkWidgetDebug(){
var noDebugCheck=getVal(g_vars.init_options, "no_debug_check");
if(noDebugCheck===true)
return(false);
if(!g_objParent||g_vars.is_inited==false){
removeDebugVisual();
return(false);
}
checkWidgetDebugWork();
checkDebugConnectionText();
}
this.onEvent=function(name, func){
g_api.onEvent(name,func);
}
function changeItemByAction(dir){
var current=t.doAction("get_num_current");
var total=t.doAction("get_total_items");
switch(dir){
case "next":
var num=current+1;
if(num >=total)
num=0;
break;
case "prev":
var num=current-1;
if(num < 0)
num=total-1;
break;
default:
throw new Error("wrong direction type: "+dir);
break;
}
t.doAction("change_item", num);
}
this.doAction=function(action, arg1, arg2){
if(g_vars.trace_debug){
var strAction=action;
if(arg1)
strAction +=" "+arg1;
if(arg2)
strAction +=" "+arg2;
trace("Do Action: ");
trace(strAction);
}
if(!g_api){
if(g_vars.trace_debug)
trace("empty g_api, exit");
return(false);
}
switch(action){
case "prev":
case "next":
var apiType=g_api.getAPIType();
if(apiType=="carousel"){
g_api.doAction(action);
return(false);
}
changeItemByAction(action);
return(false);
break;
}
var response=g_api.doAction(action, arg1, arg2);
if(g_vars.trace_debug){
trace("Response: ");
trace(response);
}
return(response);
}
function addParentDebug(objParent){
if(!objParent)
objParent=g_objParent;
var color=g_objParent.data("uc-debug-color");
if(color)
return(color);
var objBody=jQuery("body");
var dataColors="uc-remote-debug-colors";
var objColors=objBody.data(dataColors);
if(!objColors){
objColors=["#ffeb00","blue","#808000","#d1e231","#01796f","#8e4585","#ff33cc","#436b95","#eaa221","#b86d29"];
}
var color=objColors.pop();
g_objParent.data("uc-debug-color", color);
objBody.data(dataColors, objColors);
g_objParent.css("border","3px solid "+color);
return(color);
}
function updateSyncDebug(event, syncID){
if(g_vars.debug_show_ids==true)
return(false);
try{
if(syncID!=g_vars.syncid){
var name=g_objParent.data("widgetname");
throw new Error("Wrong sync group mishmash "+g_vars.syncid+" and " + syncID);
}
var debugText=g_objSync.getDebugText(g_objParent);
if(!debugText)
return(false);
displayTextOnWidget(g_objParent, debugText, "debug");
}catch(error){
displayErrorMessage(error);
}}
function _______EDITOR_RELATED_________(){}
function isInsideEditor(){
if(g_vars.is_editor!==null)
return g_vars.is_editor;
if(typeof g_ucAdmin!=="undefined"){
g_vars.is_editor=true;
return(true);
}
if(window.self!==window.top&&typeof window.parent.elementor!=="undefined"){
g_vars.is_editor=true;
return true;
}
g_vars.is_editor=false;
return false;
}
function resetSettingsInsideEditor(){
g_objParent=null;
g_api=null;
g_vars.is_inited=false;
}
function checkWidgetInsideEditor(){
try{
hideErrorOnWidget();
if(g_vars.is_inited==true){
if(g_objParent.is(":hidden")){
resetSettingsInsideEditor();
}}else{
g_vars.is_inited=initParent();
if(g_vars.is_inited==true){
g_vars.funcOnInit();
}
else
if(g_vars.is_inited==false){
g_objParent.on("uc-object-ready", function(){
g_vars.is_inited=true;
g_vars.funcOnInit();
});
}}
checkWidgetDebug();
}catch(message){
displayErrorMessage(message);
return(false);
}}
this.onWidgetInit=function(widgetID, func, options){
try{
if(g_vars.is_inited==true)
return(false);
if(g_vars.trace_debug==true){
trace("on widget init: " + widgetID);
}
if(!g_vars.funcOnInit){
if(typeof func!="function")
throw new Error("onWidgetInit error: the second parameter should be a function");
g_vars.funcOnInit=func;
}
if(options&&g_vars.init_options==null)
g_vars.init_options=options;
if(g_vars.debug_show_widget&&g_vars.debug_show_widget==widgetID)
g_vars.trace_debug=true;
initGlobal(widgetID, t.onWidgetInit);
if(g_vars.is_inited==false){
if(g_vars.trace_debug==true){
trace(widgetID+" not inited yet, waiting for parent init");
}
return(false);
}
if(g_vars.debug_show_ids==true){
trace("start debug show id's");
displayTextOnWidget(g_objWidget, g_objWidget.attr("id"), "debug");
}
if(g_vars.trace_debug==true)
trace("start debug - show connect");
if(g_objParent.length > 1){
trace(g_objWidget);
trace(g_objParent);
throw new Error("Remote widget can't connect to more then 1 parents");
}
onWidgetReady();
if(g_vars.funcOnInit){
g_vars.is_inited=true;
g_vars.funcOnInit(g_objWidget);
}}catch(message){
displayErrorMessage(message);
var isEditorMode=isInsideEditor();
if(isEditorMode==true)
setInterval(checkWidgetInsideEditor, 700);
return(false);
}}
function startParentSync(){
var syncID=g_objParent.data("syncid");
if(g_vars.trace_debug==true){
trace("Start parent sync");
trace(g_objParent);
}
if(!syncID){
if(g_vars.trace_debug==true){
trace("no sync id");
}
return(false);
}
var objSync=g_remoteConnection.getSyncObject(syncID);
var isEditorMode=isInsideEditor();
objSync.setOptions(syncID, isEditorMode);
var isInited=initAPI();
if(isInited==false){
var widgetID=g_objParent.attr("id");
var parentType=getParentType();
var message="Sync Error - can't init api for "+widgetID;
if(parentType==g_types.CAROUSEL){
message +=", please check that the owl carousel js file loading from unlimited elements plugin.";
}else{
message +=", please check if the widget is inited and working.";
}
throw new Error(message);
}
g_vars.syncid=syncID;
if(g_vars.trace_debug===true)
objSync.on("update_debug", updateSyncDebug);
g_objSync=objSync;
objSync.addAPI(g_api);
}
this.onParentInit=function(objParent, optionsAPI){
try{
g_objParent=objParent;
if(!g_objParent)
return(false);
if(g_objParent.length==0)
return(false);
g_vars.is_parent_mode=true;
var optionsFromData=g_objParent.data("uc-remote-options");
if(optionsFromData)
optionsAPI=optionsFromData;
if(optionsAPI)
g_vars.options_api=optionsAPI;
var isDebug=g_objParent.data("debug");
if(typeof ucRemoteDebugEnabled!="undefined")
isDebug=true;
g_vars.trace_debug=isDebug;
if(isDebug===true)
addParentDebug(objParent);
var isSync=objParent.data("sync");
if(isSync==true)
startParentSync();
if(g_vars.debug_show_ids==true){
displayTextOnWidget(g_objParent, g_objParent.attr("id"), "debug");
}}catch(message){
displayErrorMessage(message);
return(false);
}}
this.showInfo=function(){
trace("parent");
trace(g_objParent);
trace("current widget");
trace(g_objWidget);
}
this.getParent=function(){
return(g_objParent);
}}
function UERemoteConnection(){
var t=this;
this.getVal=function(obj, name, defaultValue){
if(!defaultValue)
var defaultValue="";
var val="";
if(!obj||typeof obj!="object")
val=defaultValue;
else if(obj.hasOwnProperty(name)==false){
val=defaultValue;
}else{
val=obj[name];
}
return(val);
}
this.getSyncObject=function(syncID){
var syncRealID="uc_sync_"+syncID;
var objSync=t.getVal(window, syncRealID);
if(objSync)
return(objSync);
var objSync=new UESyncObject();
window[syncRealID]=objSync;
return(objSync);
}
this.getSyncedElements=function(objElement){
if(!objElement)
return(null);
if(objElement.length==0)
return(null);
if(objElement.hasClass("uc-remote-parent")==false)
return(null);
var isSync=objElement.data("sync");
if(isSync!==true)
return(null);
var syncID=objElement.data("syncid");
if(!syncID)
return(null);
var objSync=t.getSyncObject(syncID);
var currentID=objElement.attr("id");
var arrElements=objSync.getElements(currentID);
return(arrElements);
}}
jQuery(document).on("uc-remote-parent-init",function(event, objParent, optionsAPI){
var objRemote=new UERemoteWidgets();
objRemote.onParentInit(objParent, optionsAPI);
});
window.ueRemoteConnection=new UERemoteConnection();