');
}
item.inlineElement=el;
return el;
}
mfp.updateStatus('ready');
mfp._parseMarkup(template, {}, item);
return template;
}}
});
var AJAX_NS='ajax',
_ajaxCur,
_removeAjaxCursor=function(){
if(_ajaxCur){
$(document.body).removeClass(_ajaxCur);
}},
_destroyAjaxRequest=function(){
_removeAjaxCursor();
if(mfp.req){
mfp.req.abort();
}};
$.magnificPopup.registerModule(AJAX_NS, {
options: {
settings: null,
cursor: 'mfp-ajax-cur',
tError: '
The content could not be loaded.'
},
proto: {
initAjax: function(){
mfp.types.push(AJAX_NS);
_ajaxCur=mfp.st.ajax.cursor;
_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
},
getAjax: function(item){
if(_ajaxCur){
$(document.body).addClass(_ajaxCur);
}
mfp.updateStatus('loading');
var opts=$.extend({
url: item.src,
success: function(data, textStatus, jqXHR){
var temp={
data:data,
xhr:jqXHR
};
_mfpTrigger('ParseAjax', temp);
mfp.appendContent($(temp.data), AJAX_NS);
item.finished=true;
_removeAjaxCursor();
mfp._setFocus();
setTimeout(function(){
mfp.wrap.addClass(READY_CLASS);
}, 16);
mfp.updateStatus('ready');
_mfpTrigger('AjaxContentAdded');
},
error: function(){
_removeAjaxCursor();
item.finished=item.loadError=true;
mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
}}, mfp.st.ajax.settings);
mfp.req=$.ajax(opts);
return '';
}}
});
var _imgInterval,
_getTitle=function(item){
if(item.data&&item.data.title!==undefined)
return item.data.title;
var src=mfp.st.image.titleSrc;
if(src){
if($.isFunction(src)){
return src.call(mfp, item);
}else if(item.el){
return item.el.attr(src)||'';
}}
return '';
};
$.magnificPopup.registerModule('image', {
options: {
markup: '
',
cursor: 'mfp-zoom-out-cur',
titleSrc: 'title',
verticalFit: true,
tError: '
The image could not be loaded.'
},
proto: {
initImage: function(){
var imgSt=mfp.st.image,
ns='.image';
mfp.types.push('image');
_mfpOn(OPEN_EVENT+ns, function(){
if(mfp.currItem.type==='image'&&imgSt.cursor){
$(document.body).addClass(imgSt.cursor);
}});
_mfpOn(CLOSE_EVENT+ns, function(){
if(imgSt.cursor){
$(document.body).removeClass(imgSt.cursor);
}
_window.off('resize' + EVENT_NS);
});
_mfpOn('Resize'+ns, mfp.resizeImage);
if(mfp.isLowIE){
_mfpOn('AfterChange', mfp.resizeImage);
}},
resizeImage: function(){
var item=mfp.currItem;
if(!item||!item.img) return;
if(mfp.st.image.verticalFit){
var decr=0;
if(mfp.isLowIE){
decr=parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
}
item.img.css('max-height', mfp.wH-decr);
}},
_onImageHasSize: function(item){
if(item.img){
item.hasSize=true;
if(_imgInterval){
clearInterval(_imgInterval);
}
item.isCheckingImgSize=false;
_mfpTrigger('ImageHasSize', item);
if(item.imgHidden){
if(mfp.content)
mfp.content.removeClass('mfp-loading');
item.imgHidden=false;
}}
},
findImageSize: function(item){
var counter=0,
img=item.img[0],
mfpSetInterval=function(delay){
if(_imgInterval){
clearInterval(_imgInterval);
}
_imgInterval=setInterval(function(){
if(img.naturalWidth > 0){
mfp._onImageHasSize(item);
return;
}
if(counter > 200){
clearInterval(_imgInterval);
}
counter++;
if(counter===3){
mfpSetInterval(10);
}else if(counter===40){
mfpSetInterval(50);
}else if(counter===100){
mfpSetInterval(500);
}}, delay);
};
mfpSetInterval(1);
},
getImage: function(item, template){
var guard=0,
onLoadComplete=function(){
if(item){
if(item.img[0].complete){
item.img.off('.mfploader');
if(item===mfp.currItem){
mfp._onImageHasSize(item);
mfp.updateStatus('ready');
}
item.hasSize=true;
item.loaded=true;
_mfpTrigger('ImageLoadComplete');
}else{
guard++;
if(guard < 200){
setTimeout(onLoadComplete,100);
}else{
onLoadError();
}}
}},
onLoadError=function(){
if(item){
item.img.off('.mfploader');
if(item===mfp.currItem){
mfp._onImageHasSize(item);
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src));
}
item.hasSize=true;
item.loaded=true;
item.loadError=true;
}},
imgSt=mfp.st.image;
var el=template.find('.mfp-img');
if(el.length){
var img=document.createElement('img');
img.className='mfp-img';
if(item.el&&item.el.find('img').length){
img.alt=item.el.find('img').attr('alt');
}
item.img=$(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
img.src=item.src;
if(el.is('img')){
item.img=item.img.clone();
}
img=item.img[0];
if(img.naturalWidth > 0){
item.hasSize=true;
}else if(!img.width){
item.hasSize=false;
}}
mfp._parseMarkup(template, {
title: _getTitle(item),
img_replaceWith: item.img
}, item);
mfp.resizeImage();
if(item.hasSize){
if(_imgInterval) clearInterval(_imgInterval);
if(item.loadError){
template.addClass('mfp-loading');
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src));
}else{
template.removeClass('mfp-loading');
mfp.updateStatus('ready');
}
return template;
}
mfp.updateStatus('loading');
item.loading=true;
if(!item.hasSize){
item.imgHidden=true;
template.addClass('mfp-loading');
mfp.findImageSize(item);
}
return template;
}}
});
var hasMozTransform,
getHasMozTransform=function(){
if(hasMozTransform===undefined){
hasMozTransform=document.createElement('p').style.MozTransform!==undefined;
}
return hasMozTransform;
};
$.magnificPopup.registerModule('zoom', {
options: {
enabled: false,
easing: 'ease-in-out',
duration: 300,
opener: function(element){
return element.is('img') ? element:element.find('img');
}},
proto: {
initZoom: function(){
var zoomSt=mfp.st.zoom,
ns='.zoom',
image;
if(!zoomSt.enabled||!mfp.supportsTransition){
return;
}
var duration=zoomSt.duration,
getElToAnimate=function(image){
var newImg=image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
transition='all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
cssObj={
position: 'fixed',
zIndex: 9999,
left: 0,
top: 0,
'-webkit-backface-visibility': 'hidden'
},
t='transition';
cssObj['-webkit-'+t]=cssObj['-moz-'+t]=cssObj['-o-'+t]=cssObj[t]=transition;
newImg.css(cssObj);
return newImg;
},
showMainContent=function(){
mfp.content.css('visibility', 'visible');
},
openTimeout,
animatedImg;
_mfpOn('BuildControls'+ns, function(){
if(mfp._allowZoom()){
clearTimeout(openTimeout);
mfp.content.css('visibility', 'hidden');
image=mfp._getItemToZoom();
if(!image){
showMainContent();
return;
}
animatedImg=getElToAnimate(image);
animatedImg.css(mfp._getOffset());
mfp.wrap.append(animatedImg);
openTimeout=setTimeout(function(){
animatedImg.css(mfp._getOffset(true));
openTimeout=setTimeout(function(){
showMainContent();
setTimeout(function(){
animatedImg.remove();
image=animatedImg=null;
_mfpTrigger('ZoomAnimationEnded');
}, 16);
}, duration);
}, 16);
}});
_mfpOn(BEFORE_CLOSE_EVENT+ns, function(){
if(mfp._allowZoom()){
clearTimeout(openTimeout);
mfp.st.removalDelay=duration;
if(!image){
image=mfp._getItemToZoom();
if(!image){
return;
}
animatedImg=getElToAnimate(image);
}
animatedImg.css(mfp._getOffset(true));
mfp.wrap.append(animatedImg);
mfp.content.css('visibility', 'hidden');
setTimeout(function(){
animatedImg.css(mfp._getOffset());
}, 16);
}});
_mfpOn(CLOSE_EVENT+ns, function(){
if(mfp._allowZoom()){
showMainContent();
if(animatedImg){
animatedImg.remove();
}
image=null;
}});
},
_allowZoom: function(){
return mfp.currItem.type==='image';
},
_getItemToZoom: function(){
if(mfp.currItem.hasSize){
return mfp.currItem.img;
}else{
return false;
}},
_getOffset: function(isLarge){
var el;
if(isLarge){
el=mfp.currItem.img;
}else{
el=mfp.st.zoom.opener(mfp.currItem.el||mfp.currItem);
}
var offset=el.offset();
var paddingTop=parseInt(el.css('padding-top'),10);
var paddingBottom=parseInt(el.css('padding-bottom'),10);
offset.top -=($(window).scrollTop() - paddingTop);
var obj={
width: el.width(),
height: (_isJQ ? el.innerHeight():el[0].offsetHeight) - paddingBottom - paddingTop
};
if(getHasMozTransform()){
obj['-moz-transform']=obj['transform']='translate(' + offset.left + 'px,' + offset.top + 'px)';
}else{
obj.left=offset.left;
obj.top=offset.top;
}
return obj;
}}
});
var IFRAME_NS='iframe',
_emptyPage='//about:blank',
_fixIframeBugs=function(isShowing){
if(mfp.currTemplate[IFRAME_NS]){
var el=mfp.currTemplate[IFRAME_NS].find('iframe');
if(el.length){
if(!isShowing){
el[0].src=_emptyPage;
}
if(mfp.isIE8){
el.css('display', isShowing ? 'block':'none');
}}
}};
$.magnificPopup.registerModule(IFRAME_NS, {
options: {
markup: '
',
srcAction: 'iframe_src',
patterns: {
youtube: {
index: 'youtube.com',
id: 'v=',
src: '//www.youtube.com/embed/%id%?autoplay=1'
},
vimeo: {
index: 'vimeo.com/',
id: '/',
src: '//player.vimeo.com/video/%id%?autoplay=1'
},
gmaps: {
index: '//maps.google.',
src: '%id%&output=embed'
}}
},
proto: {
initIframe: function(){
mfp.types.push(IFRAME_NS);
_mfpOn('BeforeChange', function(e, prevType, newType){
if(prevType!==newType){
if(prevType===IFRAME_NS){
_fixIframeBugs();
}else if(newType===IFRAME_NS){
_fixIframeBugs(true);
}}
});
_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function(){
_fixIframeBugs();
});
},
getIframe: function(item, template){
var embedSrc=item.src;
var iframeSt=mfp.st.iframe;
$.each(iframeSt.patterns, function(){
if(embedSrc.indexOf(this.index) > -1){
if(this.id){
if(typeof this.id==='string'){
embedSrc=embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
}else{
embedSrc=this.id.call(this, embedSrc);
}}
embedSrc=this.src.replace('%id%', embedSrc);
return false;
}});
var dataObj={};
if(iframeSt.srcAction){
dataObj[iframeSt.srcAction]=embedSrc;
}
mfp._parseMarkup(template, dataObj, item);
mfp.updateStatus('ready');
return template;
}}
});
var _getLoopedId=function(index){
var numSlides=mfp.items.length;
if(index > numSlides - 1){
return index - numSlides;
}else if(index < 0){
return numSlides + index;
}
return index;
},
_replaceCurrTotal=function(text, curr, total){
return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
};
$.magnificPopup.registerModule('gallery', {
options: {
enabled: false,
arrowMarkup: '
',
preload: [0,2],
navigateByImgClick: true,
arrows: true,
tPrev: 'Previous (Left arrow key)',
tNext: 'Next (Right arrow key)',
tCounter: '%curr% of %total%'
},
proto: {
initGallery: function(){
var gSt=mfp.st.gallery,
ns='.mfp-gallery',
supportsFastClick=Boolean($.fn.mfpFastClick);
mfp.direction=true;
if(!gSt||!gSt.enabled) return false;
_wrapClasses +=' mfp-gallery';
_mfpOn(OPEN_EVENT+ns, function(){
if(gSt.navigateByImgClick){
mfp.wrap.on('click'+ns, '.mfp-img', function(){
if(mfp.items.length > 1){
mfp.next();
return false;
}});
}
_document.on('keydown'+ns, function(e){
if(e.keyCode===37){
mfp.prev();
}else if(e.keyCode===39){
mfp.next();
}});
});
_mfpOn('UpdateStatus'+ns, function(e, data){
if(data.text){
data.text=_replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
}});
_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item){
var l=mfp.items.length;
values.counter=l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l):'';
});
_mfpOn('BuildControls' + ns, function(){
if(mfp.items.length > 1&&gSt.arrows&&!mfp.arrowLeft){
var markup=gSt.arrowMarkup,
arrowLeft=mfp.arrowLeft=$(markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left')).addClass(PREVENT_CLOSE_CLASS),
arrowRight=mfp.arrowRight=$(markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right')).addClass(PREVENT_CLOSE_CLASS);
var eName=supportsFastClick ? 'mfpFastClick':'click';
arrowLeft[eName](function(){
mfp.prev();
});
arrowRight[eName](function(){
mfp.next();
});
if(mfp.isIE7){
_getEl('b', arrowLeft[0], false, true);
_getEl('a', arrowLeft[0], false, true);
_getEl('b', arrowRight[0], false, true);
_getEl('a', arrowRight[0], false, true);
}
mfp.container.append(arrowLeft.add(arrowRight));
}});
_mfpOn(CHANGE_EVENT+ns, function(){
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
mfp._preloadTimeout=setTimeout(function(){
mfp.preloadNearbyImages();
mfp._preloadTimeout=null;
}, 16);
});
_mfpOn(CLOSE_EVENT+ns, function(){
_document.off(ns);
mfp.wrap.off('click'+ns);
if(mfp.arrowLeft&&supportsFastClick){
mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
}
mfp.arrowRight=mfp.arrowLeft=null;
});
},
next: function(){
mfp.direction=true;
mfp.index=_getLoopedId(mfp.index + 1);
mfp.updateItemHTML();
},
prev: function(){
mfp.direction=false;
mfp.index=_getLoopedId(mfp.index - 1);
mfp.updateItemHTML();
},
goTo: function(newIndex){
mfp.direction=(newIndex >=mfp.index);
mfp.index=newIndex;
mfp.updateItemHTML();
},
preloadNearbyImages: function(){
var p=mfp.st.gallery.preload,
preloadBefore=Math.min(p[0], mfp.items.length),
preloadAfter=Math.min(p[1], mfp.items.length),
i;
for(i=1; i <=(mfp.direction ? preloadAfter:preloadBefore); i++){
mfp._preloadItem(mfp.index+i);
}
for(i=1; i <=(mfp.direction ? preloadBefore:preloadAfter); i++){
mfp._preloadItem(mfp.index-i);
}},
_preloadItem: function(index){
index=_getLoopedId(index);
if(mfp.items[index].preloaded){
return;
}
var item=mfp.items[index];
if(!item.parsed){
item=mfp.parseEl(index);
}
_mfpTrigger('LazyLoad', item);
if(item.type==='image'){
item.img=$('
').on('load.mfploader', function(){
item.hasSize=true;
}).on('error.mfploader', function(){
item.hasSize=true;
item.loadError=true;
_mfpTrigger('LazyLoadError', item);
}).attr('src', item.src);
}
item.preloaded=true;
}}
});
/*
Touch Support that might be implemented some day
addSwipeGesture: function(){
var startX,
moved,
multipleTouches;
return;
var namespace='.mfp',
addEventNames=function(pref, down, move, up, cancel){
mfp._tStart=pref + down + namespace;
mfp._tMove=pref + move + namespace;
mfp._tEnd=pref + up + namespace;
mfp._tCancel=pref + cancel + namespace;
};
if(window.navigator.msPointerEnabled){
addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');
}else if('ontouchstart' in window){
addEventNames('touch', 'start', 'move', 'end', 'cancel');
}else{
return;
}
_window.on(mfp._tStart, function(e){
var oE=e.originalEvent;
multipleTouches=moved=false;
startX=oE.pageX||oE.changedTouches[0].pageX;
}).on(mfp._tMove, function(e){
if(e.originalEvent.touches.length > 1){
multipleTouches=e.originalEvent.touches.length;
}else{
moved=true;
}}).on(mfp._tEnd + ' ' + mfp._tCancel, function(e){
if(moved&&!multipleTouches){
var oE=e.originalEvent,
diff=startX - (oE.pageX||oE.changedTouches[0].pageX);
if(diff > 20){
mfp.next();
}else if(diff < -20){
mfp.prev();
}}
});
},
*/
var RETINA_NS='retina';
$.magnificPopup.registerModule(RETINA_NS, {
options: {
replaceSrc: function(item){
return item.src.replace(/\.\w+$/, function(m){ return '@2x' + m; });
},
ratio: 1
},
proto: {
initRetina: function(){
if(window.devicePixelRatio > 1){
var st=mfp.st.retina,
ratio=st.ratio;
ratio = !isNaN(ratio) ? ratio:ratio();
if(ratio > 1){
_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item){
item.img.css({
'max-width': item.img[0].naturalWidth / ratio,
'width': '100%'
});
});
_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item){
item.src=st.replaceSrc(item, ratio);
});
}}
}}
});
/**
* FastClick event implementation. (removes 300ms delay on touch devices)
* Based on https://developers.google.com/mobile/articles/fast_buttons
*
* You may use it outside the Magnific Popup by calling just:
*
* $('.your-el').mfpFastClick(function(){
* console.log('Clicked!');
* });
*
* To unbind:
* $('.your-el').destroyMfpFastClick();
*
*
* Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound.
* If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick
*
*/
(function(){
var ghostClickDelay=1000,
supportsTouch='ontouchstart' in window,
unbindTouchMove=function(){
_window.off('touchmove'+ns+' touchend'+ns);
},
eName='mfpFastClick',
ns='.'+eName;
$.fn.mfpFastClick=function(callback){
return $(this).each(function(){
var elem=$(this),
lock;
if(supportsTouch){
var timeout,
startX,
startY,
pointerMoved,
point,
numPointers;
elem.on('touchstart' + ns, function(e){
pointerMoved=false;
numPointers=1;
point=e.originalEvent ? e.originalEvent.touches[0]:e.touches[0];
startX=point.clientX;
startY=point.clientY;
_window.on('touchmove'+ns, function(e){
point=e.originalEvent ? e.originalEvent.touches:e.touches;
numPointers=point.length;
point=point[0];
if(Math.abs(point.clientX - startX) > 10 ||
Math.abs(point.clientY - startY) > 10){
pointerMoved=true;
unbindTouchMove();
}}).on('touchend'+ns, function(e){
unbindTouchMove();
if(pointerMoved||numPointers > 1){
return;
}
lock=true;
e.preventDefault();
clearTimeout(timeout);
timeout=setTimeout(function(){
lock=false;
}, ghostClickDelay);
callback();
});
});
}
elem.on('click' + ns, function(){
if(!lock){
callback();
}});
});
};
$.fn.destroyMfpFastClick=function(){
$(this).off('touchstart' + ns + ' click' + ns);
if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns);
};})();
_checkInstance(); }));
;(function($){
'use strict';
$.fn.fitVids=function(options){
var settings={
customSelector: null,
ignore: null
};
if(!document.getElementById('fit-vids-style')){
var head=document.head||document.getElementsByTagName('head')[0];
var css='.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
var div=document.createElement("div");
div.innerHTML='
x
';
head.appendChild(div.childNodes[1]);
}
if(options){
$.extend(settings, options);
}
return this.each(function(){
var selectors=[
'iframe[src*="player.vimeo.com"]',
'iframe[src*="youtube.com"]',
'iframe[src*="youtube-nocookie.com"]',
'iframe[src*="kickstarter.com"][src*="video.html"]',
'object',
'embed'
];
if(settings.customSelector){
selectors.push(settings.customSelector);
}
var ignoreList='.fitvidsignore';
if(settings.ignore){
ignoreList=ignoreList + ', ' + settings.ignore;
}
var $allVideos=$(this).find(selectors.join(','));
$allVideos=$allVideos.not('object object');
$allVideos=$allVideos.not(ignoreList);
$allVideos.each(function(){
var $this=$(this);
if($this.parents(ignoreList).length > 0){
return;
}
if(this.tagName.toLowerCase()==='embed'&&$this.parent('object').length||$this.parent('.fluid-width-video-wrapper').length){ return; }
if((!$this.css('height')&&!$this.css('width'))&&(isNaN($this.attr('height'))||isNaN($this.attr('width')))){
$this.attr('height', 9);
$this.attr('width', 16);
}
var height=(this.tagName.toLowerCase()==='object'||($this.attr('height')&&!isNaN(parseInt($this.attr('height'), 10)))) ? parseInt($this.attr('height'), 10):$this.height(),
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10):$this.width(),
aspectRatio=height / width;
if(!$this.attr('name')){
var videoName='fitvid' + $.fn.fitVids._count;
$this.attr('name', videoName);
$.fn.fitVids._count++;
}
$this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');
$this.removeAttr('height').removeAttr('width');
});
});
};
$.fn.fitVids._count=0;
})(window.jQuery||window.Zepto);
(function($){
var liveUpdatingTargetSelectors={};
var liveUpdaterIntervalId;
var liveUpdaterRunning=false;
var defaultSettings={
ellipsis: '...',
setTitle: 'never',
live: false
};
$.fn.ellipsis=function(selector, options){
var subjectElements, settings;
subjectElements=$(this);
if(typeof selector!=='string'){
options=selector;
selector=undefined;
}
settings=$.extend({}, defaultSettings, options);
settings.selector=selector;
subjectElements.each(function(){
var elem=$(this);
ellipsisOnElement(elem, settings);
});
if(settings.live){
addToLiveUpdater(subjectElements.selector, settings);
}else{
removeFromLiveUpdater(subjectElements.selector);
}
return this;
};
function ellipsisOnElement(containerElement, settings){
var containerData=containerElement.data('jqae');
if(!containerData) containerData={};
var wrapperElement=containerData.wrapperElement;
if(!wrapperElement){
wrapperElement=containerElement.wrapInner('
').find('>div');
wrapperElement.css({
margin: 0,
padding: 0,
border: 0
});
}
var wrapperElementData=wrapperElement.data('jqae');
if(!wrapperElementData) wrapperElementData={};
var wrapperOriginalContent=wrapperElementData.originalContent;
if(wrapperOriginalContent){
wrapperElement=wrapperElementData.originalContent.clone(true)
.data('jqae', {originalContent: wrapperOriginalContent}).replaceAll(wrapperElement);
}else{
wrapperElement.data('jqae', {originalContent: wrapperElement.clone(true)});
}
containerElement.data('jqae', {
wrapperElement: wrapperElement,
containerWidth: containerElement.width(),
containerHeight: containerElement.height()
});
var containerElementHeight=containerElement.height();
var wrapperOffset=(parseInt(containerElement.css('padding-top'), 10)||0) + (parseInt(containerElement.css('border-top-width'), 10)||0) - (wrapperElement.offset().top - containerElement.offset().top);
var deferAppendEllipsis=false;
var selectedElements=wrapperElement;
if(settings.selector) selectedElements=$(wrapperElement.find(settings.selector).get().reverse());
selectedElements.each(function(){
var selectedElement=$(this),
originalText=selectedElement.text(),
ellipsisApplied=false;
if(wrapperElement.innerHeight() - selectedElement.innerHeight() > containerElementHeight + wrapperOffset){
selectedElement.remove();
}else{
removeLastEmptyElements(selectedElement);
if(selectedElement.contents().length){
if(deferAppendEllipsis){
getLastTextNode(selectedElement).get(0).nodeValue +=settings.ellipsis;
deferAppendEllipsis=false;
}
while (wrapperElement.innerHeight() > containerElementHeight + wrapperOffset){
ellipsisApplied=ellipsisOnLastTextNode(selectedElement);
if(ellipsisApplied){
removeLastEmptyElements(selectedElement);
if(selectedElement.contents().length){
getLastTextNode(selectedElement).get(0).nodeValue +=settings.ellipsis;
}else{
deferAppendEllipsis=true;
selectedElement.remove();
break;
}}else{
deferAppendEllipsis=true;
selectedElement.remove();
break;
}}
if(((settings.setTitle=='onEllipsis')&&ellipsisApplied)||(settings.setTitle=='always')){
selectedElement.attr('title', originalText);
}else if(settings.setTitle!='never'){
selectedElement.removeAttr('title');
}}
}});
}
function ellipsisOnLastTextNode(element){
var lastTextNode=getLastTextNode(element);
if(lastTextNode.length){
var text=lastTextNode.get(0).nodeValue;
var pos=text.lastIndexOf(' ');
if(pos > -1){
text=$.trim(text.substring(0, pos));
lastTextNode.get(0).nodeValue=text;
}else{
lastTextNode.get(0).nodeValue='';
}
return true;
}
return false;
}
function getLastTextNode(element){
if(element.contents().length){
var contents=element.contents();
var lastNode=contents.eq(contents.length - 1);
if(lastNode.filter(textNodeFilter).length){
return lastNode;
}else{
return getLastTextNode(lastNode);
}}else{
element.append('');
var contents=element.contents();
return contents.eq(contents.length - 1);
}}
function removeLastEmptyElements(element){
if(element.contents().length){
var contents=element.contents();
var lastNode=contents.eq(contents.length - 1);
if(lastNode.filter(textNodeFilter).length){
var text=lastNode.get(0).nodeValue;
text=$.trim(text);
if(text==''){
lastNode.remove();
return true;
}else{
return false;
}}else{
while (removeLastEmptyElements(lastNode)){
}
if(lastNode.contents().length){
return false;
}else{
lastNode.remove();
return true;
}}
}
return false;
}
function textNodeFilter(){
return this.nodeType===3;
}
function addToLiveUpdater(targetSelector, settings){
liveUpdatingTargetSelectors[targetSelector]=settings;
if(!liveUpdaterIntervalId){
liveUpdaterIntervalId=window.setInterval(function(){
doLiveUpdater();
}, 200);
}}
function removeFromLiveUpdater(targetSelector){
if(liveUpdatingTargetSelectors[targetSelector]){
delete liveUpdatingTargetSelectors[targetSelector];
if(!liveUpdatingTargetSelectors.length){
if(liveUpdaterIntervalId){
window.clearInterval(liveUpdaterIntervalId);
liveUpdaterIntervalId=undefined;
}}
}};
function doLiveUpdater(){
if(!liveUpdaterRunning){
liveUpdaterRunning=true;
for (var targetSelector in liveUpdatingTargetSelectors){
$(targetSelector).each(function(){
var containerElement, containerData;
containerElement=$(this);
containerData=containerElement.data('jqae');
if((containerData.containerWidth!=containerElement.width()) ||
(containerData.containerHeight!=containerElement.height())){
ellipsisOnElement(containerElement, liveUpdatingTargetSelectors[targetSelector]);
}});
}
liveUpdaterRunning=false;
}};})(jQuery);
(function(){
var $, win;
$=this.jQuery||window.jQuery;
win=$(window);
$.fn.stick_in_parent=function(opts){
var doc, elm, enable_bottoming, inner_scrolling, manual_spacer, offset_top, outer_width, parent_selector, recalc_every, sticky_class, _fn, _i, _len;
if(opts==null){
opts={};}
sticky_class=opts.sticky_class, inner_scrolling=opts.inner_scrolling, recalc_every=opts.recalc_every, parent_selector=opts.parent, offset_top=opts.offset_top, manual_spacer=opts.spacer, enable_bottoming=opts.bottoming;
if(offset_top==null){
offset_top=0;
}
if(parent_selector==null){
parent_selector=void 0;
}
if(inner_scrolling==null){
inner_scrolling=true;
}
if(sticky_class==null){
sticky_class="is_stuck";
}
doc=$(document);
if(enable_bottoming==null){
enable_bottoming=true;
}
outer_width=function(el){
var computed, w, _el;
if(window.getComputedStyle){
_el=el[0];
computed=window.getComputedStyle(el[0]);
w=parseFloat(computed.getPropertyValue("width")) + parseFloat(computed.getPropertyValue("margin-left")) + parseFloat(computed.getPropertyValue("margin-right"));
if(computed.getPropertyValue("box-sizing")!=="border-box"){
w +=parseFloat(computed.getPropertyValue("border-left-width")) + parseFloat(computed.getPropertyValue("border-right-width")) + parseFloat(computed.getPropertyValue("padding-left")) + parseFloat(computed.getPropertyValue("padding-right"));
}
return w;
}else{
return el.outerWidth(true);
}};
_fn=function(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached){
var bottomed, detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick;
if(elm.data("sticky_kit")){
return;
}
elm.data("sticky_kit", true);
last_scroll_height=doc.height();
parent=elm.parent();
if(parent_selector!=null){
parent=parent.closest(parent_selector);
}
if(!parent.length){
throw "failed to find stick parent";
}
fixed=false;
bottomed=false;
spacer=manual_spacer!=null ? manual_spacer&&elm.closest(manual_spacer):$("
");
if(spacer){
spacer.css('position', elm.css('position'));
}
recalc=function(){
var border_top, padding_top, restore;
if(detached){
return;
}
last_scroll_height=doc.height();
border_top=parseInt(parent.css("border-top-width"), 10);
padding_top=parseInt(parent.css("padding-top"), 10);
padding_bottom=parseInt(parent.css("padding-bottom"), 10);
parent_top=parent.offset().top + border_top + padding_top;
parent_height=parent.height();
if(fixed){
fixed=false;
bottomed=false;
if(manual_spacer==null){
elm.insertAfter(spacer);
spacer.detach();
}
elm.css({
position: "",
top: "",
width: "",
bottom: ""
}).removeClass(sticky_class);
restore=true;
}
top=elm.offset().top - (parseInt(elm.css("margin-top"), 10)||0) - offset_top;
height=elm.outerHeight(true);
el_float=elm.css("float");
if(spacer){
spacer.css({
width: outer_width(elm),
height: height,
display: elm.css("display"),
"vertical-align": elm.css("vertical-align"),
"float": el_float
});
}
if(restore){
return tick();
}};
recalc();
if(height===parent_height){
return;
}
last_pos=void 0;
offset=offset_top;
recalc_counter=recalc_every;
tick=function(){
var css, delta, recalced, scroll, will_bottom, win_height;
if(detached){
return;
}
recalced=false;
if(recalc_counter!=null){
recalc_counter -=1;
if(recalc_counter <=0){
recalc_counter=recalc_every;
recalc();
recalced=true;
}}
if(!recalced&&doc.height()!==last_scroll_height){
recalc();
recalced=true;
}
scroll=win.scrollTop();
if(last_pos!=null){
delta=scroll - last_pos;
}
last_pos=scroll;
if(fixed){
if(enable_bottoming){
will_bottom=scroll + height + offset > parent_height + parent_top;
if(bottomed&&!will_bottom){
bottomed=false;
elm.css({
position: "fixed",
bottom: "",
top: offset
}).trigger("sticky_kit:unbottom");
}}
if(scroll < top){
fixed=false;
offset=offset_top;
if(manual_spacer==null){
if(el_float==="left"||el_float==="right"){
elm.insertAfter(spacer);
}
spacer.detach();
}
css={
position: "",
width: "",
top: ""
};
elm.css(css).removeClass(sticky_class).trigger("sticky_kit:unstick");
}
if(inner_scrolling){
win_height=win.height();
if(height + offset_top > win_height){
if(!bottomed){
offset -=delta;
offset=Math.max(win_height - height, offset);
offset=Math.min(offset_top, offset);
if(fixed){
elm.css({
top: offset + "px"
});
}}
}}
}else{
if(scroll > top){
fixed=true;
css={
position: "fixed",
top: offset
};
css.width=elm.css("box-sizing")==="border-box" ? elm.outerWidth() + "px":elm.width() + "px";
elm.css(css).addClass(sticky_class);
if(manual_spacer==null){
elm.after(spacer);
if(el_float==="left"||el_float==="right"){
spacer.append(elm);
}}
elm.trigger("sticky_kit:stick");
}}
if(fixed&&enable_bottoming){
if(will_bottom==null){
will_bottom=scroll + height + offset > parent_height + parent_top;
}
if(!bottomed&&will_bottom){
bottomed=true;
if(parent.css("position")==="static"){
parent.css({
position: "relative"
});
}
return elm.css({
position: "absolute",
bottom: padding_bottom,
top: "auto"
}).trigger("sticky_kit:bottom");
}}
};
recalc_and_tick=function(){
if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement){
return;
}
recalc();
return tick();
};
detach=function(){
detached=true;
win.off("touchmove", tick);
win.off("scroll", tick);
win.off("resize", recalc_and_tick);
$(document.body).off("sticky_kit:recalc", recalc_and_tick);
elm.off("sticky_kit:detach", detach);
elm.removeData("sticky_kit");
elm.css({
position: "",
bottom: "",
top: "",
width: ""
});
parent.position("position", "");
if(fixed){
if(manual_spacer==null){
if(el_float==="left"||el_float==="right"){
elm.insertAfter(spacer);
}
spacer.remove();
}
return elm.removeClass(sticky_class);
}};
win.on("touchmove", tick);
win.on("scroll", tick);
win.on("resize", recalc_and_tick);
$(document.body).on("sticky_kit:recalc", recalc_and_tick);
elm.on("sticky_kit:detach", detach);
return setTimeout(tick, 0);
};
for (_i=0, _len=this.length; _i < _len; _i++){
elm=this[_i];
_fn($(elm));
}
return this;
};}).call(this);
!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this.drag=a.extend({},m),this.state=a.extend({},n),this.e=a.extend({},o),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._invalidated={},this._pipe=[],a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a[0].toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Pipe,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}function f(a){if(a.touches!==d)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(a.touches===d){if(a.pageX!==d)return{x:a.pageX,y:a.pageY};if(a.pageX===d)return{x:a.clientX,y:a.clientY}}}function g(a){var b,d,e=c.createElement("div"),f=a;for(b in f)if(d=f[b],"undefined"!=typeof e.style[d])return e=null,[d,b];return[!1]}function h(){return g(["transition","WebkitTransition","MozTransition","OTransition"])[1]}function i(){return g(["transform","WebkitTransform","MozTransform","OTransform","msTransform"])[0]}function j(){return g(["perspective","webkitPerspective","MozPerspective","OPerspective","MsPerspective"])[0]}function k(){return"ontouchstart"in b||!!navigator.msMaxTouchPoints}function l(){return b.navigator.msPointerEnabled}var m,n,o;m={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,offsetX:0,offsetY:0,distance:null,startTime:0,endTime:0,updatedX:0,targetEl:null},n={isTouch:!1,isScrolling:!1,isSwiping:!1,direction:!1,inMotion:!1},o={_onDragStart:null,_onDragMove:null,_onDragEnd:null,_transitionEnd:null,_resizer:null,_responsiveCall:null,_goToLoop:null,_checkVisibile:null},e.Defaults={items:3,loop:!1,center:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,responsiveClass:!1,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",themeClass:"owl-theme",baseClass:"owl-carousel",itemClass:"owl-item",centerClass:"center",activeClass:"active"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Plugins={},e.Pipe=[{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){var a=this._clones,b=this.$stage.children(".cloned");(b.length!==a.length||!this.settings.loop&&a.length>0)&&(this.$stage.children(".cloned").remove(),this._clones=[])}},{filter:["items","settings"],run:function(){var a,b,c=this._clones,d=this._items,e=this.settings.loop?c.length-Math.max(2*this.settings.items,4):0;for(a=0,b=Math.abs(e/2);b>a;a++)e>0?(this.$stage.children().eq(d.length+c.length-1).remove(),c.pop(),this.$stage.children().eq(0).remove(),c.pop()):(c.push(c.length/2),this.$stage.append(d[c[c.length-1]].clone().addClass("cloned")),c.push(d.length-1-(c.length-1)/2),this.$stage.prepend(d[c[c.length-1]].clone().addClass("cloned")))}},{filter:["width","items","settings"],run:function(){var a,b,c,d=this.settings.rtl?1:-1,e=(this.width()/this.settings.items).toFixed(3),f=0;for(this._coordinates=[],b=0,c=this._clones.length+this._items.length;c>b;b++)a=this._mergers[this.relative(b)],a=this.settings.mergeFit&&Math.min(a,this.settings.items)||a,f+=(this.settings.autoWidth?this._items[this.relative(b)].width()+this.settings.margin:e*a)*d,this._coordinates.push(f)}},{filter:["width","items","settings"],run:function(){var b,c,d=(this.width()/this.settings.items).toFixed(3),e={width:Math.abs(this._coordinates[this._coordinates.length-1])+2*this.settings.stagePadding,"padding-left":this.settings.stagePadding||"","padding-right":this.settings.stagePadding||""};if(this.$stage.css(e),e={width:this.settings.autoWidth?"auto":d-this.settings.margin},e[this.settings.rtl?"margin-left":"margin-right"]=this.settings.margin,!this.settings.autoWidth&&a.grep(this._mergers,function(a){return a>1}).length>0)for(b=0,c=this._coordinates.length;c>b;b++)e.width=Math.abs(this._coordinates[b])-Math.abs(this._coordinates[b-1]||0)-this.settings.margin,this.$stage.children().eq(b).css(e);else this.$stage.children().css(e)}},{filter:["width","items","settings"],run:function(a){a.current&&this.reset(this.$stage.children().index(a.current))}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;d>c;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children("."+this.settings.activeClass).removeClass(this.settings.activeClass),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass(this.settings.activeClass),this.settings.center&&(this.$stage.children("."+this.settings.centerClass).removeClass(this.settings.centerClass),this.$stage.children().eq(this.current()).addClass(this.settings.centerClass))}}],e.prototype.initialize=function(){if(this.trigger("initialize"),this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass("owl-rtl",this.settings.rtl),this.browserSupport(),this.settings.autoWidth&&this.state.imagesLoaded!==!0){var b,c,e;if(b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&0>=e)return this.preloadAutoWidthImages(b),!1}this.$element.addClass("owl-loading"),this.$stage=a("<"+this.settings.stageElement+' class="owl-stage"/>').wrap('
'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this._width=this.$element.width(),this.refresh(),this.$element.removeClass("owl-loading").addClass("owl-loaded"),this.eventsCall(),this.internalEvents(),this.addTriggerableEvents(),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),delete e.responsive,e.responsiveClass&&this.$element.attr("class",function(a,b){return b.replace(/\b owl-responsive-\S+/g,"")}).addClass("owl-responsive-"+d)):e=a.extend({},this.options),(null===this.settings||this._breakpoint!==d)&&(this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}))},e.prototype.optionsLogic=function(){this.$element.toggleClass("owl-center",this.settings.center),this.settings.loop&&this._items.length
").addClass(this.settings.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={}},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){if(0===this._items.length)return!1;(new Date).getTime();this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$stage.addClass("owl-refresh"),this.update(),this.$stage.removeClass("owl-refresh"),this.state.orientation=b.orientation,this.watchVisibility(),this.trigger("refreshed")},e.prototype.eventsCall=function(){this.e._onDragStart=a.proxy(function(a){this.onDragStart(a)},this),this.e._onDragMove=a.proxy(function(a){this.onDragMove(a)},this),this.e._onDragEnd=a.proxy(function(a){this.onDragEnd(a)},this),this.e._onResize=a.proxy(function(a){this.onResize(a)},this),this.e._transitionEnd=a.proxy(function(a){this.transitionEnd(a)},this),this.e._preventClick=a.proxy(function(a){this.preventClick(a)},this)},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this.e._onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.trigger("resize").isDefaultPrevented()?!1:(this._width=this.$element.width(),this.invalidate("width"),this.refresh(),void this.trigger("resized")):!1},e.prototype.eventsRouter=function(a){var b=a.type;"mousedown"===b||"touchstart"===b?this.onDragStart(a):"mousemove"===b||"touchmove"===b?this.onDragMove(a):"mouseup"===b||"touchend"===b?this.onDragEnd(a):"touchcancel"===b&&this.onDragEnd(a)},e.prototype.internalEvents=function(){var c=(k(),l());this.settings.mouseDrag?(this.$stage.on("mousedown",a.proxy(function(a){this.eventsRouter(a)},this)),this.$stage.on("dragstart",function(){return!1}),this.$stage.get(0).onselectstart=function(){return!1}):this.$element.addClass("owl-text-select-on"),this.settings.touchDrag&&!c&&this.$stage.on("touchstart touchcancel",a.proxy(function(a){this.eventsRouter(a)},this)),this.transitionEndVendor&&this.on(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd,!1),this.settings.responsive!==!1&&this.on(b,"resize",a.proxy(this.onThrottledResize,this))},e.prototype.onDragStart=function(d){var e,g,h,i;if(e=d.originalEvent||d||b.event,3===e.which||this.state.isTouch)return!1;if("mousedown"===e.type&&this.$stage.addClass("owl-grab"),this.trigger("drag"),this.drag.startTime=(new Date).getTime(),this.speed(0),this.state.isTouch=!0,this.state.isScrolling=!1,this.state.isSwiping=!1,this.drag.distance=0,g=f(e).x,h=f(e).y,this.drag.offsetX=this.$stage.position().left,this.drag.offsetY=this.$stage.position().top,this.settings.rtl&&(this.drag.offsetX=this.$stage.position().left+this.$stage.width()-this.width()+this.settings.margin),this.state.inMotion&&this.support3d)i=this.getTransformProperty(),this.drag.offsetX=i,this.animate(i),this.state.inMotion=!0;else if(this.state.inMotion&&!this.support3d)return this.state.inMotion=!1,!1;this.drag.startX=g-this.drag.offsetX,this.drag.startY=h-this.drag.offsetY,this.drag.start=g-this.drag.startX,this.drag.targetEl=e.target||e.srcElement,this.drag.updatedX=this.drag.start,("IMG"===this.drag.targetEl.tagName||"A"===this.drag.targetEl.tagName)&&(this.drag.targetEl.draggable=!1),a(c).on("mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents",a.proxy(function(a){this.eventsRouter(a)},this))},e.prototype.onDragMove=function(a){var c,e,g,h,i,j;this.state.isTouch&&(this.state.isScrolling||(c=a.originalEvent||a||b.event,e=f(c).x,g=f(c).y,this.drag.currentX=e-this.drag.startX,this.drag.currentY=g-this.drag.startY,this.drag.distance=this.drag.currentX-this.drag.offsetX,this.drag.distance<0?this.state.direction=this.settings.rtl?"right":"left":this.drag.distance>0&&(this.state.direction=this.settings.rtl?"left":"right"),this.settings.loop?this.op(this.drag.currentX,">",this.coordinates(this.minimum()))&&"right"===this.state.direction?this.drag.currentX-=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length):this.op(this.drag.currentX,"<",this.coordinates(this.maximum()))&&"left"===this.state.direction&&(this.drag.currentX+=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length)):(h=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),i=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),j=this.settings.pullDrag?this.drag.distance/5:0,this.drag.currentX=Math.max(Math.min(this.drag.currentX,h+j),i+j)),(this.drag.distance>8||this.drag.distance<-8)&&(c.preventDefault!==d?c.preventDefault():c.returnValue=!1,this.state.isSwiping=!0),this.drag.updatedX=this.drag.currentX,(this.drag.currentY>16||this.drag.currentY<-16)&&this.state.isSwiping===!1&&(this.state.isScrolling=!0,this.drag.updatedX=this.drag.start),this.animate(this.drag.updatedX)))},e.prototype.onDragEnd=function(b){var d,e,f;if(this.state.isTouch){if("mouseup"===b.type&&this.$stage.removeClass("owl-grab"),this.trigger("dragged"),this.drag.targetEl.removeAttribute("draggable"),this.state.isTouch=!1,this.state.isScrolling=!1,this.state.isSwiping=!1,0===this.drag.distance&&this.state.inMotion!==!0)return this.state.inMotion=!1,!1;this.drag.endTime=(new Date).getTime(),d=this.drag.endTime-this.drag.startTime,e=Math.abs(this.drag.distance),(e>3||d>300)&&this.removeClick(this.drag.targetEl),f=this.closest(this.drag.updatedX),this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(f),this.invalidate("position"),this.update(),this.settings.pullDrag||this.drag.updatedX!==this.coordinates(f)||this.transitionEnd(),this.drag.distance=0,a(c).off(".owl.dragEvents")}},e.prototype.removeClick=function(c){this.drag.targetEl=c,a(c).on("click.preventClick",this.e._preventClick),b.setTimeout(function(){a(c).off("click.preventClick")},300)},e.prototype.preventClick=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),a(b.target).off("click.preventClick")},e.prototype.getTransformProperty=function(){var a,c;return a=b.getComputedStyle(this.$stage.get(0),null).getPropertyValue(this.vendorName+"transform"),a=a.replace(/matrix(3d)?\(|\)/g,"").split(","),c=16===a.length,c!==!0?a[4]:a[12]},e.prototype.closest=function(b){var c=-1,d=30,e=this.width(),f=this.coordinates();return this.settings.freeDrag||a.each(f,a.proxy(function(a,g){return b>g-d&&g+d>b?c=a:this.op(b,"<",g)&&this.op(b,">",f[a+1]||g-e)&&(c="left"===this.state.direction?a+1:a),-1===c},this)),this.settings.loop||(this.op(b,">",f[this.minimum()])?c=b=this.minimum():this.op(b,"<",f[this.maximum()])&&(c=b=this.maximum())),c},e.prototype.animate=function(b){this.trigger("translate"),this.state.inMotion=this.speed()>0,this.support3d?this.$stage.css({transform:"translate3d("+Math.round(b)+"px,0px, 0px)",transition:this.speed()/1e3+"s"}):this.state.isTouch?this.$stage.css({left:b+"px"}):this.$stage.animate({left:b},this.speed()/1e3,this.settings.fallbackEasing,a.proxy(function(){this.state.inMotion&&this.transitionEnd()},this))},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(a){this._invalidated[a]=!0},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(b,c){var e=c?this._items.length:this._items.length+this._clones.length;return!a.isNumeric(b)||1>e?d:b=this._clones.length?(b%e+e)%e:Math.max(this.minimum(c),Math.min(this.maximum(c),b))},e.prototype.relative=function(a){return a=this.normalize(a),a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=0,f=this.settings;if(a)return this._items.length-1;if(!f.loop&&f.center)b=this._items.length-1;else if(f.loop||f.center)if(f.loop||f.center)b=this._items.length+f.items;else{if(!f.autoWidth&&!f.merge)throw"Can not detect maximum absolute position.";for(revert=f.rtl?1:-1,c=this.$stage.width()-this.$element.width();(d=this.coordinates(e))&&!(d*revert>=c);)b=++e}else b=this._items.length-f.items;return b},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c=null;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[b-1]||0))/2*(this.settings.rtl?-1:1)):c=this._coordinates[b-1]||0,c)},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(c,d){if(this.settings.loop){var e=c-this.relative(this.current()),f=this.current(),g=this.current(),h=this.current()+e,i=0>g-h?!0:!1,j=this._clones.length+this._items.length;h
=j-this.settings.items&&i===!0&&(f=g-this._items.length,this.reset(f)),b.clearTimeout(this.e._goToLoop),this.e._goToLoop=b.setTimeout(a.proxy(function(){this.speed(this.duration(this.current(),f+e,d)),this.current(f+e),this.update()},this),30)}else this.speed(this.duration(this.current(),c,d)),this.current(c),this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.transitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.state.inMotion=!1,void this.trigger("translated"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)},this)),this.reset(a.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(a,b){b=b===d?this._items.length:this.normalize(b,!0),this.trigger("add",{content:a,position:b}),0===this._items.length||b===this._items.length?(this.$stage.append(a),this._items.push(a),this._mergers.push(1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)):(this._items[b].before(a),this._items.splice(b,0,a),this._mergers.splice(b,0,1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)),this.invalidate("items"),this.trigger("added",{content:a,position:b})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.addTriggerableEvents=function(){var b=a.proxy(function(b,c){return a.proxy(function(a){a.relatedTarget!==this&&(this.suppress([c]),b.apply(this,[].slice.call(arguments,1)),this.release([c]))},this)},this);a.each({next:this.next,prev:this.prev,to:this.to,destroy:this.destroy,refresh:this.refresh,replace:this.replace,add:this.add,remove:this.remove},a.proxy(function(a,c){this.$element.on(a+".owl.carousel",b(c,a+".owl.carousel"))},this))},e.prototype.watchVisibility=function(){function c(a){return a.offsetWidth>0&&a.offsetHeight>0}function d(){c(this.$element.get(0))&&(this.$element.removeClass("owl-hidden"),this.refresh(),b.clearInterval(this.e._checkVisibile))}c(this.$element.get(0))||(this.$element.addClass("owl-hidden"),b.clearInterval(this.e._checkVisibile),this.e._checkVisibile=b.setInterval(a.proxy(d,this),500))},e.prototype.preloadAutoWidthImages=function(b){var c,d,e,f;c=0,d=this,b.each(function(g,h){e=a(h),f=new Image,f.onload=function(){c++,e.attr("src",f.src),e.css("opacity",1),c>=b.length&&(d.state.imagesLoaded=!0,d.initialize())},f.src=e.attr("src")||e.attr("data-src")||e.attr("data-src-retina")})},e.prototype.destroy=function(){this.$element.hasClass(this.settings.themeClass)&&this.$element.removeClass(this.settings.themeClass),this.settings.responsive!==!1&&a(b).off("resize.owl.carousel"),this.transitionEndVendor&&this.off(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd);for(var d in this._plugins)this._plugins[d].destroy();(this.settings.mouseDrag||this.settings.touchDrag)&&(this.$stage.off("mousedown touchstart touchcancel"),a(c).off(".owl.dragEvents"),this.$stage.get(0).onselectstart=function(){},this.$stage.off("dragstart",function(){return!1})),this.$element.off(".owl"),this.$stage.children(".cloned").remove(),this.e=null,this.$element.removeData("owlCarousel"),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.unwrap()},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d){var e={item:{count:this._items.length,index:this.current()}},f=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),g=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},e,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(g)}),this.$element.trigger(g),this.settings&&"function"==typeof this.settings[f]&&this.settings[f].apply(this,g)),g},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.browserSupport=function(){if(this.support3d=j(),this.support3d){this.transformVendor=i();var a=["transitionend","webkitTransitionEnd","transitionend","oTransitionEnd"];this.transitionEndVendor=a[h()],this.vendorName=this.transformVendor.replace(/Transform/i,""),this.vendorName=""!==this.vendorName?"-"+this.vendorName.toLowerCase()+"-":""}this.state.orientation=b.orientation},a.fn.owlCarousel=function(b){return this.each(function(){a(this).data("owlCarousel")||a(this).data("owlCarousel",new e(this,b))})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b){var c=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,d=c.center&&Math.ceil(c.items/2)||c.items,e=c.center&&-1*d||0,f=(b.property&&b.property.value||this._core.current())+e,g=this._core.clones().length,h=a.proxy(function(a,b){this.load(b)},this);e++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":"url("+g+")",opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},c.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=c}(window.Zepto||window.jQuery,window,document),function(a){var b=function(c){this._core=c,this._handlers={"initialized.owl.carousel":a.proxy(function(){this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())&&this.update()},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this._core.$element.on(this._handlers)};b.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},b.prototype.update=function(){this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass)},b.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=b}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this._core=b,this._videos={},this._playing=null,this._fullscreen=!1,this._handlers={"resize.owl.carousel":a.proxy(function(a){this._core.settings.video&&!this.isInFullScreen()&&a.preventDefault()},this),"refresh.owl.carousel changed.owl.carousel":a.proxy(function(){this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))},this)},this._core.options=a.extend({},d.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};d.Defaults={video:!1,videoHeight:!1,videoWidth:!1},d.prototype.fetch=function(a,b){var c=a.attr("data-vimeo-id")?"vimeo":"youtube",d=a.attr("data-vimeo-id")||a.attr("data-youtube-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else{if(!(d[3].indexOf("vimeo")>-1))throw new Error("Video URL not supported.");c="vimeo"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},d.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='',d=k.lazyLoad?'':'',b.after(d),b.after(e)};return b.wrap('"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(l(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(f="http://img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type&&a.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}))},d.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},d.prototype.play=function(b){this._core.trigger("play",null,"video"),this._playing&&this.stop();var c,d,e=a(b.target||b.srcElement),f=e.closest("."+this._core.settings.itemClass),g=this._videos[f.attr("data-video")],h=g.width||"100%",i=g.height||this._core.$stage.height();"youtube"===g.type?c='':"vimeo"===g.type&&(c=''),f.addClass("owl-video-playing"),this._playing=f,d=a(''+c+"
"),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass("owl-video-frame")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=d}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){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&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.transitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay()
},this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this._core=c,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"add.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"remove.owl.carousel prepared.owl.carousel":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value").addClass(d.dotClass).append(a("")).prop("outerHTML")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a("").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("
").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on("click","div",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("
").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a("<"+d.navElement+">"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||"page"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d="",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass("disabled",0>=f),this._controls.$next.toggleClass("disabled",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c
0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(".active").removeClass("active"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass("active")}this._controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){"use strict";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(){"URLHash"==this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=c}(window.Zepto||window.jQuery,window,document);
var objectFitImages=(function (){
'use strict';
var OFI='bfred-it:object-fit-images';
var propRegex=/(object-fit|object-position)\s*:\s*([-\w\s%]+)/g;
var testImg=new Image();
var supportsObjectFit='object-fit' in testImg.style;
var supportsObjectPosition='object-position' in testImg.style;
var supportsOFI='background-size' in testImg.style;
var supportsCurrentSrc=typeof testImg.currentSrc==='string';
var nativeGetAttribute=testImg.getAttribute;
var nativeSetAttribute=testImg.setAttribute;
var autoModeEnabled=false;
function createPlaceholder(w, h){
return ("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" + w + "' height='" + h + "'%3E%3C/svg%3E");
}
function polyfillCurrentSrc(el){
if(el.srcset&&!supportsCurrentSrc&&window.picturefill){
var pf=window.picturefill._;
if(!el[pf.ns]||!el[pf.ns].evaled){
pf.fillImg(el, {reselect: true});
}
if(!el[pf.ns].curSrc){
el[pf.ns].supported=false;
pf.fillImg(el, {reselect: true});
}
el.currentSrc=el[pf.ns].curSrc||el.src;
}}
function getStyle(el){
var style=getComputedStyle(el).fontFamily;
var parsed;
var props={};
while ((parsed=propRegex.exec(style))!==null){
props[parsed[1]]=parsed[2];
}
return props;
}
function setPlaceholder(img, width, height){
var placeholder=createPlaceholder(width||1, height||0);
if(nativeGetAttribute.call(img, 'src')!==placeholder){
nativeSetAttribute.call(img, 'src', placeholder);
}}
function onImageReady(img, callback){
if(img.naturalWidth){
callback(img);
}else{
setTimeout(onImageReady, 100, img, callback);
}}
function fixOne(el){
var style=getStyle(el);
var ofi=el[OFI];
style['object-fit']=style['object-fit']||'fill';
if(!ofi.img){
if(style['object-fit']==='fill'){
return;
}
if(!ofi.skipTest &&
supportsObjectFit &&
!style['object-position']
){
return;
}}
if(!ofi.img){
ofi.img=new Image(el.width, el.height);
ofi.img.srcset=nativeGetAttribute.call(el, "data-ofi-srcset")||el.srcset;
ofi.img.src=nativeGetAttribute.call(el, "data-ofi-src")||el.src;
nativeSetAttribute.call(el, "data-ofi-src", el.src);
if(el.srcset){
nativeSetAttribute.call(el, "data-ofi-srcset", el.srcset);
}
setPlaceholder(el, el.naturalWidth||el.width, el.naturalHeight||el.height);
if(el.srcset){
el.srcset='';
}
try {
keepSrcUsable(el);
} catch (err){
if(window.console){
console.log('http://bit.ly/ofi-old-browser');
}}
}
polyfillCurrentSrc(ofi.img);
el.style.backgroundImage="url(" + ((ofi.img.currentSrc||ofi.img.src).replace('(', '%28').replace(')', '%29')) + ")";
el.style.backgroundPosition=style['object-position']||'center';
el.style.backgroundRepeat='no-repeat';
if(/scale-down/.test(style['object-fit'])){
onImageReady(ofi.img, function (){
if(ofi.img.naturalWidth > el.width||ofi.img.naturalHeight > el.height){
el.style.backgroundSize='contain';
}else{
el.style.backgroundSize='auto';
}});
}else{
el.style.backgroundSize=style['object-fit'].replace('none', 'auto').replace('fill', '100% 100%');
}
onImageReady(ofi.img, function (img){
setPlaceholder(el, img.naturalWidth, img.naturalHeight);
});
}
function keepSrcUsable(el){
var descriptors={
get: function get(prop){
return el[OFI].img[prop ? prop:'src'];
},
set: function set(value, prop){
el[OFI].img[prop ? prop:'src']=value;
nativeSetAttribute.call(el, ("data-ofi-" + prop), value);
fixOne(el);
return value;
}};
Object.defineProperty(el, 'src', descriptors);
Object.defineProperty(el, 'currentSrc', {
get: function (){ return descriptors.get('currentSrc'); }});
Object.defineProperty(el, 'srcset', {
get: function (){ return descriptors.get('srcset'); },
set: function (ss){ return descriptors.set(ss, 'srcset'); }});
}
function hijackAttributes(){
function getOfiImageMaybe(el, name){
return el[OFI]&&el[OFI].img&&(name==='src'||name==='srcset') ? el[OFI].img:el;
}
if(!supportsObjectPosition){
HTMLImageElement.prototype.getAttribute=function (name){
return nativeGetAttribute.call(getOfiImageMaybe(this, name), name);
};
HTMLImageElement.prototype.setAttribute=function (name, value){
return nativeSetAttribute.call(getOfiImageMaybe(this, name), name, String(value));
};}}
function fix(imgs, opts){
var startAutoMode = !autoModeEnabled&&!imgs;
opts=opts||{};
imgs=imgs||'img';
if((supportsObjectPosition&&!opts.skipTest)||!supportsOFI){
return false;
}
if(typeof imgs==='string'){
imgs=document.querySelectorAll(imgs);
}else if(!('length' in imgs)){
imgs=[imgs];
}
for (var i=0; i < imgs.length; i++){
imgs[i][OFI]=imgs[i][OFI]||{
skipTest: opts.skipTest
};
fixOne(imgs[i]);
}
if(startAutoMode){
document.body.addEventListener('load', function (e){
if(e.target.tagName==='IMG'){
fix(e.target, {
skipTest: opts.skipTest
});
}}, true);
autoModeEnabled=true;
imgs='img';
}
if(opts.watchMQ){
window.addEventListener('resize', fix.bind(null, imgs, {
skipTest: opts.skipTest
}));
}}
fix.supportsObjectFit=supportsObjectFit;
fix.supportsObjectPosition=supportsObjectPosition;
hijackAttributes();
return fix;
}());
(function($){
"use strict";
$(document).ready(function(){
gridlove_logo_setup();
var gridlove_admin_top_bar_height=0;
gridlove_top_bar_check();
gridlove_responsive_header();
$('body').on('click', '.gridlove-sidebar-action', function(){
$('body').addClass('gridlove-sidebar-action-open gridlove-lock');
$('.gridlove-sidebar-action-wrapper').css('top', gridlove_admin_top_bar_height);
});
$('body').on('click', '.gridlove-action-close, .gridlove-sidebar-action-overlay', function(){
$('body').removeClass('gridlove-sidebar-action-open gridlove-lock');
});
$(document).keyup(function(e){
if(e.keyCode==27&&$('body').hasClass('gridlove-sidebar-action-open')){
$('body').removeClass('gridlove-sidebar-action-open gridlove-lock');
}});
$('body').on('click', '.gridlove-action-search span', function(){
$(this).find('i').toggleClass('fa-close', 'fa-search');
$(this).closest('.gridlove-action-search').toggleClass('active');
setTimeout(function(){
$('.active input[type="text"]').focus();
}, 150);
if($('.gridlove-responsive-header .gridlove-watch-later').hasClass('active')){
$('.gridlove-responsive-header .gridlove-watch-later').removeClass('active');
}});
$(document).on('click', function(evt){
if(!$(evt.target).is('.gridlove-action-search span')&&$(window).width() < 580){
$('.gridlove-action-search.active .sub-menu').css('width', $(window).width());
}});
$(".gridlove-cover-slider").each(function(){
var lg_items=parseInt($(this).attr('data-items'));
var md_items=lg_items > 2 ? 2:1;
var autoplay_time=parseInt($(this).attr('data-autoplay'));
var autoplay=autoplay_time ? true:false;
var gridlove_auto_width=true;
if(lg_items==1){
gridlove_auto_width=false;
}
$(this).owlCarousel({
rtl: gridlove_js_settings.rtl_mode ? true:false,
loop: true,
autoHeight: false,
autoWidth: gridlove_auto_width,
items: lg_items,
margin: 30,
nav: true,
center: false,
fluidSpeed: 100,
autoplayHoverPause: true,
autoplay: autoplay,
autoplayTimeout: autoplay_time,
navText: ['', ''],
responsive: {
0: {
items: 1,
autoWidth: false
},
580: {
items: md_items,
autoWidth: false
},
1024: {
items: lg_items,
autoWidth: false
},
1230: {
items: lg_items,
autoWidth: gridlove_auto_width
}}
});
});
$(".gridlove-slider").each(function(){
var controls=$(this).closest('.gridlove-module').find('.gridlove-slider-controls');
var lg_items=parseInt(controls.attr('data-items'));
var md_items=lg_items > 2 ? 2:1;
var autoplay_time=parseInt(controls.attr('data-autoplay'));
var autoplay=autoplay_time ? true:false;
$(this).owlCarousel({
rtl: gridlove_js_settings.rtl_mode ? true:false,
loop: true,
autoHeight: false,
autoWidth: true,
items: lg_items,
margin: 30,
nav: true,
center: false,
fluidSpeed: 100,
navContainer: controls,
autoplay: autoplay,
autoplayTimeout: autoplay_time,
navText: ['', ''],
responsive: {
0: {
items: 1,
autoWidth: false
},
580: {
items: md_items,
autoWidth: false
},
1024: {
items: lg_items,
autoWidth: false
},
1230: {
items: lg_items,
autoWidth: true
}}
});
});
gridlove_widget_slider($('body'));
if(gridlove_js_settings.header_sticky){
var gridlove_last_top;
$('.gridlove-header-sticky').css('top', gridlove_admin_top_bar_height);
$(window).scroll(function(){
var top=$(window).scrollTop();
if(gridlove_js_settings.header_sticky_up){
if(gridlove_last_top > top&&top >=gridlove_js_settings.header_sticky_offset){
if(!$("body").hasClass('gridlove-header-sticky-on')){
$("body").addClass("gridlove-header-sticky-on");
}}else{
if($("body").hasClass('gridlove-header-sticky-on')){
$("body").removeClass("gridlove-header-sticky-on");
}}
}else{
if(top >=gridlove_js_settings.header_sticky_offset){
if(!$("body").hasClass('gridlove-header-sticky-on')){
$("body").addClass("gridlove-header-sticky-on");
}}else{
if($("body").hasClass('gridlove-header-sticky-on')){
$("body").removeClass("gridlove-header-sticky-on");
}}
}
gridlove_last_top=top;
});
}
$(window).scroll(function(){
gridlove_responsive_header();
});
$('body').on('click', '.gridlove-share-item', function(e){
e.preventDefault();
var data=$(this).attr('data-url');
gridlove_social_share(data);
});
if($('.gridlove-infinite-scroll').length||$('.gridlove-load-more').length||$('.gridlove-infinite-scroll-single').length){
var gridlove_url_pushes=[];
var gridlove_pushes_up=0;
var gridlove_pushes_down=0;
var push_obj={
prev: window.location.href,
next: '',
offset: $(window).scrollTop(),
prev_title: window.document.title,
next_title: window.document.title
};
gridlove_url_pushes.push(push_obj);
window.history.pushState(push_obj, '', window.location.href);
var last_up, last_down=0;
$(window).scroll(function(){
if(gridlove_url_pushes[gridlove_pushes_up].offset!=last_up&&$(window).scrollTop() < gridlove_url_pushes[gridlove_pushes_up].offset){
last_up=gridlove_url_pushes[gridlove_pushes_up].offset;
last_down=0;
window.document.title=gridlove_url_pushes[gridlove_pushes_up].prev_title;
window.history.replaceState(gridlove_url_pushes, '', gridlove_url_pushes[gridlove_pushes_up].prev);
gridlove_pushes_down=gridlove_pushes_up;
if(gridlove_pushes_up!=0){
gridlove_pushes_up--;
}}
if(gridlove_url_pushes[gridlove_pushes_down].offset!=last_down&&$(window).scrollTop() > gridlove_url_pushes[gridlove_pushes_down].offset){
last_down=gridlove_url_pushes[gridlove_pushes_down].offset;
last_up=0;
window.document.title=gridlove_url_pushes[gridlove_pushes_down].next_title;
window.history.replaceState(gridlove_url_pushes, '', gridlove_url_pushes[gridlove_pushes_down].next);
gridlove_pushes_up=gridlove_pushes_down;
if(gridlove_pushes_down < gridlove_url_pushes.length - 1){
gridlove_pushes_down++;
}}
});
}
var gridlove_load_ajax_new_count=0;
$("body").on('click', '.gridlove-load-more a', function(e){
e.preventDefault();
var start_url=window.location.href;
var prev_title=window.document.title;
var $link=$(this);
var page_url=$link.attr("href");
$link.parent().addClass('gridlove-loader-active');
$('.gridlove-loader').show();
$("").load(page_url, function(){
var n=gridlove_load_ajax_new_count.toString();
var $wrap=$link.closest('.gridlove-load-more').prev().find('.gridlove-posts');
var $new=$(this).find('.gridlove-posts').last().children().addClass('gridlove-new-' + n);
var $this_div=$(this);
$new.imagesLoaded(function(){
if($wrap.find('.gridlove-masonry-wrapper').length > 0){
$new.hide().appendTo($wrap.find('.gridlove-masonry-wrapper')).fadeIn(400);
$wrap.find('.gridlove-masonry-wrapper').masonry('appended', $new);
}else{
$new.hide().appendTo($wrap).fadeIn(400);
if($wrap.hasClass('masonry')){
$wrap.masonry('appended', $new);
}}
$('.gridlove-new-' + n + ' .box-inner-ellipsis').ellipsis();
if($this_div.find('.gridlove-load-more').length){
$('.gridlove-load-more').html($this_div.find('.gridlove-load-more').html());
$('.gridlove-loader').hide();
$('.gridlove-load-more').removeClass('gridlove-loader-active');
}else{
$('.gridlove-load-more').fadeOut('fast').remove();
}
if(page_url!=window.location){
gridlove_pushes_up++;
gridlove_pushes_down++;
var next_title=$this_div.find('title').text();
var push_obj={
prev: start_url,
next: page_url,
offset: $(window).scrollTop(),
prev_title: prev_title,
next_title: next_title
};
gridlove_url_pushes.push(push_obj);
window.document.title=next_title;
window.history.pushState(push_obj, '', page_url);
}
gridlove_load_ajax_new_count++;
return false;
});
});
});
var gridlove_infinite_allow=true;
if($('.gridlove-infinite-scroll').length){
$(window).scroll(function(){
if(gridlove_infinite_allow&&$('.gridlove-infinite-scroll').length&&($(this).scrollTop() > ($('.gridlove-infinite-scroll').offset().top) - $(this).height() - 200)){
var $link=$('.gridlove-infinite-scroll a');
var start_url=window.location.href;
var prev_title=window.document.title;
$link.parent().addClass('gridlove-loader-active');
var page_url=$link.attr("href");
if(page_url!=undefined){
gridlove_infinite_allow=false;
$('.gridlove-loader').show();
$("
").load(page_url, function(){
var n=gridlove_load_ajax_new_count.toString();
var $wrap=$('.gridlove-posts').last();
var $new=$(this).find('.gridlove-posts').last().children().addClass('gridlove-new-' + n);
var $this_div=$(this);
$new.imagesLoaded(function(){
if($wrap.find('.gridlove-masonry-wrapper').length > 0){
$new.removeClass('layout-combo').addClass('layout-masonry');
$new.hide().appendTo($wrap.find('.gridlove-masonry-wrapper')).fadeIn(400);
$wrap.find('.gridlove-masonry-wrapper').masonry('appended', $new);
}else{
$new.hide().appendTo($wrap).fadeIn(400);
if($wrap.hasClass('masonry')){
$wrap.masonry('appended', $new);
}}
$('.gridlove-new-' + n + ' .box-inner-ellipsis').ellipsis();
if($this_div.find('.gridlove-infinite-scroll').length){
$('.gridlove-infinite-scroll').html($this_div.find('.gridlove-infinite-scroll').html());
$('.gridlove-loader').hide();
$('.gridlove-infinite-scroll').removeClass('gridlove-loader-active');
gridlove_infinite_allow=true;
}else{
$('.gridlove-infinite-scroll').fadeOut('fast').remove();
}
if(page_url!=window.location){
gridlove_pushes_up++;
gridlove_pushes_down++;
var next_title=$this_div.find('title').text();
var push_obj={
prev: start_url,
next: page_url,
offset: $(window).scrollTop(),
prev_title: prev_title,
next_title: next_title
};
gridlove_url_pushes.push(push_obj);
window.document.title=next_title;
window.history.pushState(push_obj, '', page_url);
}
gridlove_load_ajax_new_count++;
return false;
});
});
}}
});
}
if($('.gridlove-infinite-scroll-single').length){
$(window).scroll(function(){
if(gridlove_infinite_allow&&$('.gridlove-infinite-scroll-single').length&&($(this).scrollTop() > ($('.gridlove-infinite-scroll-single').offset().top) - $(this).height() - 200)){
var $link=$('.gridlove-infinite-scroll-single a');
$link.parent().addClass('gridlove-loader-active');
var page_url=$link.attr("href");
var start_url=window.location.href;
var prev_title=window.document.title;
if(page_url!=undefined){
gridlove_infinite_allow=false;
$('.gridlove-loader').show();
$("
").load(page_url, function(){
var n=gridlove_load_ajax_new_count.toString();
var $wrap=$('.gridlove-site-content').last();
var $this_div=$(this);
var coverArea=$this_div.find('.gridlove-cover-area').last().addClass('gridlove-cover-new' + n);
var newContent=$this_div.find('.gridlove-site-content').last().addClass('gridlove-new-' + n);
newContent.imagesLoaded(function(){
if($this_div.find('.attachment-gridlove-cover').hasClass('size-gridlove-cover')){
coverArea.hide().insertAfter($wrap).fadeIn(400);
newContent.hide().insertAfter(coverArea).fadeIn(400);
}else{
newContent.hide().insertAfter($wrap).fadeIn(400);
}
gridlove_sticky_sidebar(newContent);
gridlove_sticky_share(newContent);
gridlove_widget_slider(newContent);
newContent.find('.box-inner-ellipsis').ellipsis();
gridlove_gallery_slider(newContent);
gridlove_popup_gallery(newContent);
gridlove_popup_image(newContent);
if($this_div.find('.gridlove-infinite-scroll-single').length){
$('.gridlove-infinite-scroll-single').html($this_div.find('.gridlove-infinite-scroll-single').html());
$('.gridlove-loader').hide();
$('.gridlove-infinite-scroll-single').removeClass('gridlove-loader-active');
gridlove_infinite_allow=true;
}else{
$('.gridlove-infinite-scroll-single').fadeOut('fast').remove();
}
if(page_url!=window.location){
gridlove_pushes_up++;
gridlove_pushes_down++;
var next_title=$this_div.find('title').text();
var push_obj={
prev: start_url,
next: page_url,
offset: $(window).scrollTop(),
prev_title: prev_title,
next_title: next_title
};
gridlove_url_pushes.push(push_obj);
window.document.title=next_title;
window.history.pushState(push_obj, '', page_url);
}
gridlove_load_ajax_new_count++;
return false;
});
});
}}
});
}
gridlove_fit_videos($('.entry-content, .entry-media'));
gridlove_popup_gallery($('.gridlove-content, .gridlove-text-module-content'));
gridlove_popup_image($('.gridlove-content'));
gridlove_gallery_slider($('.gridlove-content, .gridlove-text-module-content'));
$(".widget_nav_menu").each(function(){
var menu_item=$(this).find('.menu-item-has-children > a');
menu_item.after('');
});
$(".widget_pages").each(function(){
var menu_item=$(this).find('.page_item_has_children > a');
menu_item.after('');
});
$('.widget_nav_menu .gridlove-nav-widget-acordion, .widget_pages .gridlove-nav-widget-acordion').click(function(){
$(this).next('ul.sub-menu:first, ul.children:first').slideToggle('fast').parent().toggleClass('active');
});
$('body').imagesLoaded(function(){
gridlove_sticky_sidebar($('.gridlove-site-content').last());
gridlove_sticky_share($('.gridlove-site-content').last());
objectFitImages('.gridlove-module .entry-image img, .gridlove-cover-area .gridlove-cover-bg img');
});
$('.gridlove-posts').imagesLoaded(function(){
$('.box-inner-ellipsis').ellipsis();
$('.gridlove-module-layout-masonry .gridlove-posts, .gridlove-masonry-wrapper').masonry();
});
$(window).resize(function(){
if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement){
return;
}
gridlove_logo_setup();
gridlove_top_bar_check();
gridlove_responsive_header();
$('.gridlove-site-content').each(function(){
gridlove_sticky_sidebar($(this));
gridlove_sticky_share($(this));
});
$('.box-inner-ellipsis').ellipsis();
});
$('body').on('click', '.gridlove-content .meta-comments a:first, .gridlove-cover-single .meta-comments a', function(e){
e.preventDefault();
var target=this.hash;
var $target=$(target);
var offset=gridlove_js_settings.header_sticky ? 100:0;
$('html, body').stop().animate({
'scrollTop': $target.offset().top - offset
}, 900, 'swing', function(){
window.location.hash=target;
});
});
if(window.location.hash=='#respond'){
var offset=gridlove_js_settings.header_sticky ? 100:0;
$('html, body').stop().animate({
'scrollTop': $('#respond').offset().top - offset
}, 900, 'swing', function(){
});
}
$('.gridlove-main-nav li').hover(function(e){
if($(this).closest('body').width() < $(document).width()){
$(this).find('ul').addClass('gridlove-rev');
}}, function(){
$(this).find('ul').removeClass('gridlove-rev');
});
function gridlove_gallery_slider(obj){
if(gridlove_js_settings.gridlove_gallery){
$('body').imagesLoaded(function(){
obj.each(function(){
$(this).find('.gallery-columns-1, .wp-block-gallery.columns-1').owlCarousel({
rtl: gridlove_js_settings.rtl_mode ? true:false,
loop: true,
nav: true,
autoWidth: false,
autoHeight: true,
center: false,
fluidSpeed: 100,
margin: 0,
items: 1,
navText: ['', '']
});
});
});
}}
function gridlove_widget_slider(obj){
obj.find(".gridlove-widget-slider").each(function(){
var $controls=$(this).closest('.widget').find('.gridlove-slider-controls');
var autoplay_time=parseInt($controls.attr('data-autoplay'));
var autoplay=autoplay_time ? true:false;
$(this).owlCarousel({
rtl: gridlove_js_settings.rtl_mode ? true:false,
loop: true,
autoHeight: false,
autoWidth: false,
items: 1,
nav: true,
center: false,
fluidSpeed: 100,
margin: 0,
navContainer: $controls,
autoplay: autoplay,
autoplayTimeout: autoplay_time,
navText: ['', '']
});
});
}
function gridlove_sticky_sidebar(obj){
if(obj.find('.gridlove-sticky-sidebar').length){
var stickySidebar=obj.find('.gridlove-sticky-sidebar');
var gridloveSidebar=obj.find('.gridlove-sidebar');
if(window.innerWidth >=1023){
var content_margin=0;
if(gridlove_is_single_layout_indent()){
content_margin=75;
}
var content_height=obj.find('.gridlove-content').height() - content_margin;
var sidebar_height=gridloveSidebar.height();
if(content_height > sidebar_height){
gridloveSidebar.css('height', content_height - 30);
var gridlove_sticky_header_height=0;
if($('.gridlove-header-sticky').length&&!gridlove_js_settings.header_sticky_up){
gridlove_sticky_header_height=$('.gridlove-header-sticky').height();
}
var sticky_top=30 + gridlove_admin_top_bar_height + gridlove_sticky_header_height;
stickySidebar.stick_in_parent({
parent: ".gridlove-sidebar",
inner_scrolling: true,
offset_top: sticky_top,
spacer: false
});
}}else{
gridloveSidebar.each(function(){
$(this).css('height', 'auto');
$(this).css('min-height', '1px');
});
stickySidebar.trigger("sticky_kit:detach");
}}
}
function gridlove_sticky_share(obj){
if(obj.find('.gridlove-sticky-share').length){
var shareWrapper=obj.find('.gridlove-share-wrapper').last();
var stickyShare=obj.find('.gridlove-sticky-share').last();
if(window.innerWidth >=900){
var content_margin=0;
if(gridlove_is_single_layout_indent()){
content_margin=75;
}
var content_height=obj.find('.gridlove-content').height() - content_margin;
var gridlove_sticky_header_height=0;
if((content_height-30) > shareWrapper.height()){
shareWrapper.css('height', content_height - 30);
}else{
shareWrapper.css('height', 'auto');
}
if($('.gridlove-header-sticky').length&&!gridlove_js_settings.header_sticky_up){
gridlove_sticky_header_height=$('.gridlove-header-sticky').height();
}
var sticky_top=30 + gridlove_admin_top_bar_height + gridlove_sticky_header_height;
stickyShare.prependTo(shareWrapper);
stickyShare.stick_in_parent({
parent: ".gridlove-share-wrapper",
inner_scrolling: true,
offset_top: sticky_top
});
}else{
shareWrapper.each(function(){
$(this).css('height', 'auto');
$(this).css('min-height', '1px');
});
obj.find('.box-single .entry-content').last().prepend(stickyShare);
stickyShare.trigger("sticky_kit:detach");
}}
}
function gridlove_social_share(data){
window.open(data, "Share", 'height=500,width=760,top=' + ($(window).height() / 2 - 250) + ', left=' + ($(window).width() / 2 - 380) + 'resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0');
}
function gridlove_fit_videos(obj){
obj.fitVids({
customSelector: "iframe[src^='https://www.dailymotion.com'], iframe[src^='https://player.twitch.tv'], iframe[src^='https://vine.co'], iframe[src^='https://videopress.com'], iframe[src^='//content.jwplatform.com']"
});
}
function gridlove_popup_image(obj){
if(obj.find("a.gridlove-popup-img").length){
var popupImg=obj.find("a.gridlove-popup-img");
popupImg.find('img').each(function(){
var $that=$(this);
if($that.hasClass('alignright')){
$that.removeClass('alignright').parent().addClass('alignright');
}
if($that.hasClass('alignleft')){
$that.removeClass('alignleft').parent().addClass('alignleft');
}});
popupImg.magnificPopup({
type: 'image',
gallery: {
enabled: true
},
image: {
titleSrc: function(item){
return item.el.closest('.wp-caption').find('figcaption').text();
}}
});
}}
function gridlove_popup_gallery(obj){
if(gridlove_js_settings.gridlove_gallery){
obj.each(function(){
$(this).find('.gallery, .wp-block-gallery').each(function(){
var gallery=$(this);
var selector=gallery.hasClass('wp-block-gallery') ? '.blocks-gallery-item a':'.gallery-icon a.gridlove-popup';
$(this).find(selector).magnificPopup({
type: 'image',
gallery: {
enabled: true
},
image: {
titleSrc: function(item){
var $caption=gallery.hasClass('wp-block-gallery') ? item.el.closest('figure').find('figcaption'):item.el.closest('.gallery-item').find('.gallery-caption');
if($caption!='undefined'){
return $caption.text();
}
return '';
}}
});
});
});
}}
var gridlove_retina_logo_done=false;
var gridlove_retina_mini_logo_done=false;
function gridlove_logo_setup(){
if(window.devicePixelRatio > 1){
if(gridlove_js_settings.logo_retina&&!gridlove_retina_logo_done&&$('.gridlove-logo').length){
$('.gridlove-logo').imagesLoaded(function(){
$('.gridlove-logo').each(function(){
if($(this).is(':visible')){
var width=$(this).width();
$(this).attr('src', gridlove_js_settings.logo_retina).css('width', width + 'px');
}});
});
gridlove_retina_logo_done=true;
}
if(gridlove_js_settings.logo_mini_retina&&!gridlove_retina_mini_logo_done&&$('.gridlove-logo-mini').length){
$('.gridlove-logo-mini').imagesLoaded(function(){
$('.gridlove-logo-mini').each(function(){
if($(this).is(':visible')){
var width=$(this).width();
$(this).attr('src', gridlove_js_settings.logo_mini_retina).css('width', width + 'px');
}});
});
gridlove_retina_mini_logo_done=true;
}}
}
function gridlove_top_bar_check(){
if($('#wpadminbar').length&&$('#wpadminbar').is(':visible')){
gridlove_admin_top_bar_height=$('#wpadminbar').height();
}}
function gridlove_responsive_header(){
if($('.gridlove-header-responsive').length){
$('.gridlove-header-responsive').css('top', gridlove_admin_top_bar_height);
if(gridlove_admin_top_bar_height > 0&&$('#wpadminbar').css('position')=='absolute'){
if($(window).scrollTop() <=gridlove_admin_top_bar_height){
$('.gridlove-header-responsive').css('position', 'absolute');
}else{
$('.gridlove-header-responsive').css('position', 'fixed').css('top', 0);
}}
}}
function gridlove_is_single_layout_indent(){
var content=$('.gridlove-content');
if(content.hasClass('gridlove-single-layout-7')||content.hasClass('gridlove-single-layout-8')||content.hasClass('gridlove-page-layout-4')||content.hasClass('gridlove-page-layout-5')){
return true;
}
return false;
}});
})(jQuery);
!function(d,l){"use strict";var e=!1,n=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,i,a,s=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=new RegExp("^https?:$","i"),c=0;c