(()=>{"use strict";const e=window.wp.i18n,t=e=>Math.abs(parseInt(e,10)),a=(e,t,a)=>{const n=new CustomEvent(`wpcf7${t}`,{bubbles:!0,detail:a});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(n)},n=(e,t)=>{const n=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["validating","validating"],["payment_required","payment-required"]]);n.has(t)&&(t=n.get(t)),Array.from(n.values()).includes(t)||(t=`custom-${t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")}`);const r=e.getAttribute("data-status");if(e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t){e.classList.remove(r);const t={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,prevStatus:r};a(e,"statuschanged",t)}return t},r=e=>{const{root:t,namespace:a="contact-form-7/v1"}=wpcf7.api;return c.reduceRight(((e,t)=>a=>t(a,e)),(e=>{let n,r,{url:c,path:o,endpoint:s,headers:i,body:l,data:p,...d}=e;"string"==typeof s&&(n=a.replace(/^\/|\/$/g,""),r=s.replace(/^\//,""),o=r?n+"/"+r:n),"string"==typeof o&&(-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),c=t+o),i={Accept:"application/json, */*;q=0.1",...i},delete i["X-WP-Nonce"],p&&(l=JSON.stringify(p),i["Content-Type"]="application/json");const f={code:"fetch_error",message:"You are probably offline."},u={code:"invalid_json",message:"The response is not a valid JSON response."};return window.fetch(c||o||window.location.href,{...d,headers:i,body:l}).then((e=>Promise.resolve(e).then((e=>{if(e.status>=200&&e.status<300)return e;throw e})).then((e=>{if(204===e.status)return null;if(e&&e.json)return e.json().catch((()=>{throw u}));throw u}))),(()=>{throw f}))}))(e)},c=[];function o(e,t={}){const{target:a,scope:r=e,...c}=t;if(void 0===e.wpcf7?.schema)return;const o={...e.wpcf7.schema};if(void 0!==a){if(!e.contains(a))return;if(!a.closest(".wpcf7-form-control-wrap[data-name]"))return;if(a.closest(".novalidate"))return}const p=r.querySelectorAll(".wpcf7-form-control-wrap"),d=Array.from(p).reduce(((e,t)=>(t.closest(".novalidate")||t.querySelectorAll(":where(input, textarea, select):enabled").forEach((t=>{if(t.name)switch(t.type){case"button":case"image":case"reset":case"submit":break;case"checkbox":case"radio":t.checked&&e.append(t.name,t.value);break;case"select-multiple":for(const a of t.selectedOptions)e.append(t.name,a.value);break;case"file":for(const a of t.files)e.append(t.name,a);break;default:e.append(t.name,t.value)}})),e)),new FormData),f=e.getAttribute("data-status");Promise.resolve(n(e,"validating")).then((n=>{if(void 0!==swv){const n=swv.validate(o,d,t);for(const t of p){if(void 0===t.dataset.name)continue;const c=t.dataset.name;if(n.has(c)){const{error:t,validInputs:a}=n.get(c);i(e,c),void 0!==t&&s(e,c,t,{scope:r}),l(e,c,null!=a?a:[])}if(t.contains(a))break}}})).finally((()=>{n(e,f)}))}r.use=e=>{c.unshift(e)};const s=(e,t,a,n)=>{const{scope:r=e,...c}=null!=n?n:{},o=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,""),s=e.querySelector(`.wpcf7-form-control-wrap[data-name="${t}"] .wpcf7-form-control`);(()=>{const t=document.createElement("li");t.setAttribute("id",o),s&&s.id?t.insertAdjacentHTML("beforeend",`<a href="#${s.id}">${a}</a>`):t.insertAdjacentText("beforeend",a),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(t)})(),r.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{const t=document.createElement("span");t.classList.add("wpcf7-not-valid-tip"),t.setAttribute("aria-hidden","true"),t.insertAdjacentText("beforeend",a),e.appendChild(t),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.classList.add("wpcf7-not-valid"),e.setAttribute("aria-describedby",o),"function"==typeof e.setCustomValidity&&e.setCustomValidity(a),e.closest(".use-floating-validation-tip")&&(e.addEventListener("focus",(e=>{t.setAttribute("style","display: none")})),t.addEventListener("click",(e=>{t.setAttribute("style","display: none")})))}))}))},i=(e,t)=>{const a=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,"");e.wpcf7.parent.querySelector(`.screen-reader-response ul li#${a}`)?.remove(),e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{e.querySelector(".wpcf7-not-valid-tip")?.remove(),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid"),"function"==typeof e.setCustomValidity&&e.setCustomValidity("")}))}))},l=(e,t,a)=>{e.querySelectorAll(`[data-reflection-of="${t}"]`).forEach((e=>{if("output"===e.tagName.toLowerCase()){const t=e;0===a.length&&a.push(t.dataset.default),a.slice(0,1).forEach((e=>{e instanceof File&&(e=e.name),t.textContent=e}))}else e.querySelectorAll("output").forEach((e=>{e.hasAttribute("data-default")?0===a.length?e.removeAttribute("hidden"):e.setAttribute("hidden","hidden"):e.remove()})),a.forEach((a=>{a instanceof File&&(a=a.name);const n=document.createElement("output");n.setAttribute("name",t),n.textContent=a,e.appendChild(n)}))}))};function p(e,t={}){if(wpcf7.blocked)return d(e),void n(e,"submitting");const c=new FormData(e);t.submitter&&t.submitter.name&&c.append(t.submitter.name,t.submitter.value);const o={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(c,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:c};r({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:c,wpcf7:{endpoint:"feedback",form:e,detail:o}}).then((t=>{const r=n(e,t.status);return o.status=t.status,o.apiResponse=t,["invalid","unaccepted","spam","aborted"].includes(r)?a(e,r,o):["sent","failed"].includes(r)&&a(e,`mail${r}`,o),a(e,"submit",o),t})).then((t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&t.invalid_fields.forEach((t=>{s(e,t.field,t.message)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=t.message}))})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:t,detail:r}=e.wpcf7;d(t),a(t,"beforesubmit",r),n(t,"submitting")}return t(e)}));const d=e=>{e.querySelectorAll(".wpcf7-form-control-wrap").forEach((t=>{t.dataset.name&&i(e,t.dataset.name)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=""}))};function f(e){const t=new FormData(e),c={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(t,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:t};r({endpoint:`contact-forms/${e.wpcf7.id}/refill`,method:"GET",wpcf7:{endpoint:"refill",form:e,detail:c}}).then((t=>{e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,n(e,"mail_sent")):n(e,"init"),c.apiResponse=t,a(e,"reset",c)})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"refill"===e.wpcf7.endpoint){const{form:t,detail:a}=e.wpcf7;d(t),n(t,"resetting")}return t(e)}));const u=(e,t)=>{for(const a in t){const n=t[a];e.querySelectorAll(`input[name="${a}"]`).forEach((e=>{e.value=""})),e.querySelectorAll(`img.wpcf7-captcha-${a.replaceAll(":","")}`).forEach((e=>{e.setAttribute("src",n)}));const r=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);r&&e.querySelectorAll(`input[name="_wpcf7_captcha_challenge_${a}"]`).forEach((e=>{e.value=r[1]}))}},m=(e,t)=>{for(const a in t){const n=t[a][0],r=t[a][1];e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${a}"]`).forEach((e=>{e.querySelector(`input[name="${a}"]`).value="",e.querySelector(".wpcf7-quiz-label").textContent=n,e.querySelector(`input[name="_wpcf7_quiz_answer_${a}"]`).value=r}))}};function w(e){const a=new FormData(e);e.wpcf7={id:t(a.get("_wpcf7")),status:e.getAttribute("data-status"),pluginVersion:a.get("_wpcf7_version"),locale:a.get("_wpcf7_locale"),unitTag:a.get("_wpcf7_unit_tag"),containerPost:t(a.get("_wpcf7_container_post")),parent:e.closest(".wpcf7"),get schema(){return wpcf7.schemas.get(this.id)}},wpcf7.schemas.set(e.wpcf7.id,void 0),e.querySelectorAll(".has-spinner").forEach((e=>{e.insertAdjacentHTML("afterend",'<span class="wpcf7-spinner"></span>')})),(e=>{e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((t=>{t.addEventListener("change",(t=>{const a=t.target.getAttribute("name");e.querySelectorAll(`input[type="checkbox"][name="${a}"]`).forEach((e=>{e!==t.target&&(e.checked=!1)}))}))}))})(e),(e=>{e.querySelectorAll(".has-free-text").forEach((t=>{const a=t.querySelector("input.wpcf7-free-text"),n=t.querySelector('input[type="checkbox"], input[type="radio"]');a.disabled=!n.checked,e.addEventListener("change",(e=>{a.disabled=!n.checked,e.target===n&&n.checked&&a.focus()}))}))})(e),(e=>{e.querySelectorAll(".wpcf7-validates-as-url").forEach((e=>{e.addEventListener("change",(t=>{let a=e.value.trim();a&&!a.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==a.indexOf(".")&&(a=a.replace(/^\/+/,""),a="http://"+a),e.value=a}))}))})(e),(e=>{if(!e.querySelector(".wpcf7-acceptance")||e.classList.contains("wpcf7-acceptance-as-validation"))return;const t=()=>{let t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((e=>{if(!t||e.classList.contains("optional"))return;const a=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&a.checked||!e.classList.contains("invert")&&!a.checked)&&(t=!1)})),e.querySelectorAll(".wpcf7-submit").forEach((e=>{e.disabled=!t}))};t(),e.addEventListener("change",(e=>{t()})),e.addEventListener("wpcf7reset",(e=>{t()}))})(e),(e=>{const a=(e,a)=>{const n=t(e.getAttribute("data-starting-value")),r=t(e.getAttribute("data-maximum-value")),c=t(e.getAttribute("data-minimum-value")),o=e.classList.contains("down")?n-a.value.trim().length:a.value.trim().length;e.setAttribute("data-current-value",o),e.innerText=o,r&&r<a.value.length?e.classList.add("too-long"):e.classList.remove("too-long"),c&&a.value.length<c?e.classList.add("too-short"):e.classList.remove("too-short")},n=t=>{t={init:!1,...t},e.querySelectorAll(".wpcf7-character-count").forEach((n=>{const r=n.getAttribute("data-target-name"),c=e.querySelector(`[name="${r}"]`);c&&(c.value=c.defaultValue,a(n,c),t.init&&c.addEventListener("keyup",(e=>{a(n,c)})))}))};n({init:!0}),e.addEventListener("wpcf7reset",(e=>{n()}))})(e),window.addEventListener("load",(t=>{wpcf7.cached&&e.reset()})),e.addEventListener("reset",(t=>{wpcf7.reset(e)})),e.addEventListener("submit",(t=>{wpcf7.submit(e,{submitter:t.submitter}),t.preventDefault()})),e.addEventListener("wpcf7submit",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("wpcf7reset",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("change",(t=>{t.target.closest(".wpcf7-form-control")&&wpcf7.validate(e,{target:t.target})})),e.addEventListener("wpcf7statuschanged",(t=>{const a=t.detail.status;e.querySelectorAll(".active-on-any").forEach((e=>{e.removeAttribute("inert"),e.classList.remove("active-on-any")})),e.querySelectorAll(`.inert-on-${a}`).forEach((e=>{e.setAttribute("inert","inert"),e.classList.add("active-on-any")}))}))}document.addEventListener("DOMContentLoaded",(t=>{var a;if("undefined"!=typeof wpcf7)if(void 0!==wpcf7.api)if("function"==typeof window.fetch)if("function"==typeof window.FormData)if("function"==typeof NodeList.prototype.forEach)if("function"==typeof String.prototype.replaceAll){wpcf7={init:w,submit:p,reset:f,validate:o,schemas:new Map,...null!==(a=wpcf7)&&void 0!==a?a:{}},document.querySelectorAll("form .wpcf7[data-wpcf7-id]").forEach((t=>{const a=document.createElement("p");a.setAttribute("class","wpcf7-form-in-wrong-place");const n=document.createElement("strong");n.append((0,e.__)("Error:","contact-form-7"));const r=(0,e.__)("This contact form is placed in the wrong place.","contact-form-7");a.append(n," ",r),t.replaceWith(a)})),document.querySelectorAll(".wpcf7 > form").forEach((e=>{wpcf7.init(e),e.closest(".wpcf7").classList.replace("no-js","js")}));for(const e of wpcf7.schemas.keys())r({endpoint:`contact-forms/${e}/feedback/schema`,method:"GET"}).then((t=>{wpcf7.schemas.set(e,t)}))}else console.error("Your browser does not support String.replaceAll().");else console.error("Your browser does not support NodeList.forEach().");else console.error("Your browser does not support window.FormData().");else console.error("Your browser does not support window.fetch().");else console.error("wpcf7.api is not defined.");else console.error("wpcf7 is not defined.")}))})();
(function(){
var win=window,
lastTime=0;
win.requestAnimationFrame=win.requestAnimationFrame||win.webkitRequestAnimationFrame;
if(!win.requestAnimationFrame){
win.requestAnimationFrame=function(callback){
var currTime=new Date().getTime(),
timeToCall=Math.max(0, 16 -(currTime - lastTime) ),
id=setTimeout(callback, timeToCall);
lastTime=currTime + timeToCall;
return id;
};}
if(!win.cancelAnimationFrame){
win.cancelAnimationFrame=function(id){
clearTimeout(id);
};}}());
(function(root, factory){
if(typeof define==='function'&&define.amd){
define(
'themeone-utils/utils',
factory
);
}else if(typeof module==='object'&&module.exports){
module.exports=factory();
}else{
root.ThemeoneUtils=factory();
}}(this, function(){
"use strict";
var utils={};
var Console=window.console;
utils.error=function(message){
if(typeof Console!=='undefined'){
Console.error(message);
}};
utils.extend=function(options, defaults){
if(options){
if(typeof options!=='object'){
this.error('Custom options must be an object');
}else{
for(var prop in defaults){
if(defaults.hasOwnProperty(prop)&&options.hasOwnProperty(prop) ){
defaults[prop]=options[prop];
}}
}}
return defaults;
};
utils.prop=function(prop){
var el=this.createEl(),
prefixes=['', 'Webkit', 'Moz', 'ms', 'O'];
for(var p=0, pl=prefixes.length; p < pl; p++){
var prefixedProp=prefixes[p] ? prefixes[p] + prop.charAt(0).toUpperCase() + prop.slice(1):prop;
if(el.style[prefixedProp]!==undefined){
return prefixedProp;
}}
return '';
};
utils.cloneObject=function(obj){
var copy={};
for(var attr in obj){
if(obj.hasOwnProperty(attr) ){
copy[attr]=obj[attr];
}}
return copy;
};
utils.createEl=function(tag, classes){
var el=document.createElement(tag||'div');
if(classes){
el.className=classes;
}
return el;
};
utils.camelize=function(string){
return string.replace(/-([a-z])/g, function(g){
return g[1].toUpperCase();
});
};
utils.handleEvents=function(_this, el, event, fn, isBind){
if(typeof this.event_handlers!=='object'){
this.event_handlers={};}
if(!this.event_handlers[fn]){
this.event_handlers[fn]=_this[fn].bind(_this);
}
isBind=isBind===undefined ? true:!!isBind;
var bindMethod=isBind ? 'addEventListener':'removeEventListener';
event.forEach(function(ev){
el[bindMethod](ev, this.event_handlers[fn], false);
}.bind(this) );
};
utils.dispatchEvent=function(_this, namespace, type, event, args){
type +=namespace ? '.' + namespace:'';
var emitArgs=event ? [event].concat(args):[args];
_this.emitEvent(type, emitArgs);
};
utils.throttle=function(func, delay){
var timestamp=null,
limit=delay;
return function(){
var self=this,
args=arguments,
now=Date.now();
if(!timestamp||now - timestamp >=limit){
timestamp=now;
func.apply(self, args);
}};};
utils.modulo=function(length, index){
return(length +(index % length) ) % length;
};
utils.classReg=function(className){
return new RegExp('(^|\\s+)' + className + '(\\s+|$)');
};
utils.hasClass=function(el, className){
return !!el.className.match(this.classReg(className) );
};
utils.addClass=function(el, className){
if(!this.hasClass(el, className) ){
el.className +=(el.className ? ' ':'')  + className;
}};
utils.removeClass=function(el, className){
if(this.hasClass(el, className) ){
el.className=el.className.replace(this.classReg(className), ' ').replace(/\s+$/, '');
}};
utils.translate=function(el, x, y, s){
var scale=s ? ' scale(' + s + ',' + s + ')':'';
el.style[this.browser.trans]=(this.browser.gpu) ?
'translate3d(' +(x||0) + 'px, ' +(y||0) + 'px, 0)' + scale :
'translate(' +(x||0) + 'px, ' +(y||0) + 'px)' + scale;
};
utils.browser={
trans:utils.prop('transform'),
gpu:utils.prop('perspective') ? true:false
};
return utils;
}));
(function(root, factory){
if(typeof define==='function'&&define.amd){
define(
'themeone-event/event',
factory
);
}else if(typeof module==='object'&&module.exports){
module.exports=factory();
}else{
root.ThemeoneEvent=factory();
}}(typeof window!=='undefined' ? window:this, function(){
"use strict";
var EvEmitter=function(){},
proto=EvEmitter.prototype;
proto.on=function(eventName, listener){
if(!eventName||!listener){
return null;
}
var events=this._events=this._events||{};
var listeners=events[eventName]=events[eventName]||[];
if(listeners.indexOf(listener)===-1){
listeners.push(listener);
}
return this;
};
proto.off=function(eventName, listener){
var listeners=this._events&&this._events[eventName];
if(!listeners||!listeners.length){
return null;
}
var index=listeners.indexOf(listener);
if(index!==-1){
listeners.splice(index, 1);
}
return this;
};
proto.emitEvent=function(eventName, args){
var listeners=this._events&&this._events[eventName];
if(!listeners||!listeners.length){
return null;
}
var i=0,
listener=listeners[i];
args=args||[];
var onceListeners=this._onceEvents&&this._onceEvents[eventName];
while(listener){
var isOnce=onceListeners&&onceListeners[listener];
if(isOnce){
this.off(eventName, listener);
delete onceListeners[listener];
}
listener.apply(this, args);
i +=isOnce ? 0:1;
listener=listeners[i];
}
return this;
};
return EvEmitter;
}));
(function(root, factory){
if(typeof define==='function'&&define.amd){
define(
'themeone-animate/animate',
['themeone-utils/utils',
'themeone-event/event'],
factory
);
}else if(typeof module==='object'&&module.exports){
module.exports=factory(
require('themeone-utils'),
require('themeone-event')
);
}else{
root.ThemeoneAnimate=factory(
root.ThemeoneUtils,
root.ThemeoneEvent
);
}}(this, function(utils, EvEmitter){
'use strict';
var Animate=function(element, positions, friction, attraction){
this.element=element;
this.defaults=positions;
this.forces={
friction:friction||0.28,
attraction:attraction||0.028
};
this.resetAnimate();
};
var proto=Animate.prototype=Object.create(EvEmitter.prototype);
proto.updateDrag=function(obj){
this.move=true;
this.drag=obj;
};
proto.releaseDrag=function(){
this.move=false;
};
proto.animateTo=function(obj){
this.attraction=obj;
};
proto.startAnimate=function(){
this.move=true;
this.settle=false;
this.restingFrames=0;
if(!this.RAF){
this.animate();
}};
proto.stopAnimate=function(){
this.move=false;
this.restingFrames=0;
if(this.RAF){
cancelAnimationFrame(this.RAF);
this.RAF=false;
}
this.start=utils.cloneObject(this.position);
this.velocity={
x:0,
y:0,
s:0
};};
proto.resetAnimate=function(){
this.stopAnimate();
this.settle=true;
this.drag=utils.cloneObject(this.defaults);
this.start=utils.cloneObject(this.defaults);
this.resting=utils.cloneObject(this.defaults);
this.position=utils.cloneObject(this.defaults);
this.attraction=utils.cloneObject(this.defaults);
};
proto.animate=function(){
var loop=(function(){
if(typeof this.position!=='undefined'){
var previous=utils.cloneObject(this.position);
this.applyDragForce();
this.applyAttractionForce();
utils.dispatchEvent(this, 'toanimate', 'render', this);
this.integratePhysics();
this.getRestingPosition();
this.render(100);
this.RAF=requestAnimationFrame(loop);
this.checkSettle(previous);
}}).bind(this);
this.RAF=requestAnimationFrame(loop);
};
proto.integratePhysics=function(){
for(var k in this.position){
if(typeof this.position[k]!=='undefined'){
this.position[k] +=this.velocity[k];
this.position[k]=(k==='s') ? Math.max(0.1, this.position[k]):this.position[k];
this.velocity[k] *=this.getFrictionFactor();
}}
};
proto.applyDragForce=function(){
if(this.move){
for(var k in this.drag){
if(typeof this.drag[k]!=='undefined'){
var dragVelocity=this.drag[k] - this.position[k];
var dragForce=dragVelocity - this.velocity[k];
this.applyForce(k, dragForce);
}}
}};
proto.applyAttractionForce=function(){
if(!this.move){
for(var k in this.attraction){
if(typeof this.attraction[k]!=='undefined'){
var distance=this.attraction[k] - this.position[k];
var force=distance * this.forces.attraction;
this.applyForce(k, force);
}}
}};
proto.getRestingPosition=function(){
for(var k in this.position){
if(typeof this.position[k]!=='undefined'){
this.resting[k]=this.position[k] + this.velocity[k] /(1 - this.getFrictionFactor());
}}
};
proto.applyForce=function(direction, force){
this.velocity[direction] +=force;
};
proto.getFrictionFactor=function(){
return 1 - this.forces.friction;
};
proto.roundValues=function(values, round){
for(var k in values){
if(typeof values[k]!=='undefined'){
round=k==='s' ? round * 100:round;
values[k]=Math.round(values[k] * round) / round;
}}
};
proto.checkSettle=function(previous){
if(!this.move){
var count=0;
for(var k in this.position){
if(typeof this.position[k]!=='undefined'){
var round=k==='s' ? 10000:100;
if(Math.round(this.position[k] * round)===Math.round(previous[k] * round) ){
count++;
if(count===Object.keys(this.position).length){
this.restingFrames++;
}}
}}
}
if(this.restingFrames > 2){
this.stopAnimate();
this.render(this.position.s > 1 ? 10:1);
this.settle=true;
if(JSON.stringify(this.start)!==JSON.stringify(this.position) ){
utils.dispatchEvent(this, 'toanimate', 'settle', this);
}}
};
proto.render=function(round){
this.roundValues(this.position, round);
utils.translate(this.element,
this.position.x,
this.position.y,
this.position.s
);
};
return Animate;
}));
(function(root, factory){
if(typeof define==='function'&&define.amd){
define(
['themeone-utils/utils',
'themeone-event/event',
'themeone-animate/animate'],
factory
);
}else if(typeof exports==='object'&&module.exports){
module.exports=factory(
require('themeone-utils'),
require('themeone-event'),
require('themeone-animate')
);
}else{
root.ModuloBox=factory(
root.ThemeoneUtils,
root.ThemeoneEvent,
root.ThemeoneAnimate
);
}}(this, function(utils, EvEmitter, Animate){
'use strict';
var version='1.5.0';
var GUID=0;
var instances={};
var expando='mobx' +(version + Math.random()).replace(/\D/g, '');
var cache={ uid:0 };
var defaults={
mediaSelector:'.mobx',
threshold:5,
attraction:{
slider:0.055,
slide:0.018,
thumbs:0.016 
},
friction:{
slider:0.62,
slide:0.18,
thumbs:0.22 
},
rightToLeft:false,
loop:3,
preload:1,
unload:false,
timeToIdle:4000,
history:false,
mouseWheel:true,
contextMenu:true,
scrollBar:true,
fadeIfSettle:false,
controls:['close'], // 'zoom', 'play', 'fullScreen', 'download', 'share', 'close'
prevNext:true,
prevNextTouch:false,
counterMessage:'[index] / [total]',
caption:true,
autoCaption:false,
captionSmallDevice:true,
thumbnails:true,
thumbnailsNav:'basic',
thumbnailSizes:{
1920:{
width:110,
height:80,
gutter:10 
},
1280:{
width:90,
height:65,
gutter:10
},
680:{
width:70,
height:50,
gutter:8
},
480:{
width:60,
height:44,
gutter:5
}},
spacing:0.1,
smartResize:true,
overflow:false,
loadError:'Sorry, an error occured while loading the content...',
noContent:'Sorry, no content was found!',
prevNextKey:true,
scrollToNav:false,
scrollSensitivity:15,
zoomTo:'auto',
minZoom:1.2,
maxZoom:4,
doubleTapToZoom:true,
scrollToZoom:false,
pinchToZoom:true,
escapeToClose:true,
scrollToClose:false,
pinchToClose:true,
dragToClose:true,
tapToClose:true,
shareButtons:['facebook', 'googleplus', 'twitter', 'pinterest', 'linkedin', 'reddit'], // 'facebook', 'googleplus', 'twitter', 'pinterest', 'linkedin', 'reddit', 'stumbleupon', 'tumblr', 'blogger', 'buffer', 'digg', 'evernote'
shareText:'Share on',
sharedUrl:'deeplink',
slideShowInterval:4000,
slideShowAutoPlay:false,
slideShowAutoStop:false,
countTimer:true,
countTimerBg:'rgba(255,255,255,0.25)',
countTimerColor:'rgba(255,255,255,0.75)',
mediaelement:false,
videoRatio:16 / 9,
videoMaxWidth:1180,
videoAutoPlay:false,
videoThumbnail:false
};
var ModuloBox=function(options){
var element=document.querySelector('.mobx-holder');
if(element&&element.GUID){
return instances[ element.GUID ];
}
this.options=utils.extend(options, defaults);
this.setVar();
};
var proto=ModuloBox.prototype=Object.create(EvEmitter.prototype);
proto.init=function(){
if(this.GUID){
return;
}
this.createDOM();
this.GUID=++GUID;
this.DOM.holder.GUID=GUID;
instances[this.GUID]=this;
this.setAnimation();
this.getGalleries();
this.openFromQuery();
};
proto.setVar=function(){
var win=window,
doc=document,
nav=navigator;
this.pre='mobx';
this.gesture={};
this.buttons={};
this.slider={};
this.slides={};
this.cells={};
this.states={};
this.pointers=[];
this.expando=expando;
this.cache=cache;
this.dragEvents=this.detectPointerEvents();
this.browser={
touchDevice:('ontouchstart' in win)||(nav.maxTouchPoints > 0)||(nav.msMaxTouchPoints > 0),
pushState:'history' in win&&'pushState' in history,
fullScreen:this.detectFullScreen(),
mouseWheel:'onwheel' in doc.createElement('div') ?
'wheel':doc.onmousewheel!==undefined ?
'mousewheel':'DOMMouseScroll'
};
this.iframeVideo=this.iframeVideo();
this.socialMedia=this.socialMedia();
};
proto.detectPointerEvents=function(){
var nav=navigator;
if(nav.pointerEnabled){
return {
start:['pointerdown'],
move:['pointermove'],
end:['pointerup', 'pointercancel']
};}
if(nav.msPointerEnabled){
return {
start:['MSPointerDown'],
move:['MSPointerMove'],
end:['MSPointerUp', 'MSPointerCancel']
};}
return {
start:['mousedown', 'touchstart'],
move:['mousemove', 'touchmove'],
end:['mouseup', 'mouseleave', 'touchend', 'touchcancel']
};};
proto.detectFullScreen=function(){
var fullScreen=['fullscreenEnabled', 'webkitFullscreenEnabled', 'mozFullScreenEnabled', 'msFullscreenEnabled'];
for(var i=0, l=fullScreen.length; i < l; i++){
if(document[fullScreen[i]]){
return {
element:['fullscreenElement', 'webkitFullscreenElement', 'mozFullScreenElement', 'msFullscreenElement'][i],
request:['requestFullscreen', 'webkitRequestFullscreen', 'mozRequestFullScreen', 'msRequestFullscreen'][i],
change:['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'][i],
exit:['exitFullscreen', 'webkitExitFullscreen', 'mozCancelFullScreen', 'msExitFullscreen'][i]
};}}
var controls=this.options.controls,
index=controls.indexOf('fullScreen');
if(index > -1){
controls.splice(index, 1);
}
return null;
};
proto.iframeVideo=function(){
return {
youtube:{
reg:/(?:www\.)?youtu\.?be(?:\.com)?\/?.*?(?:watch|embed)?(?:.*v=|v\/|watch%3Fv%3D|\/)([\w\-_]+)&?/i,
url:'https://www.youtube.com/embed/[ID]?enablejsapi=1&rel=0&autoplay=1',
share:'https://www.youtube.com/watch?v=[ID]',
poster:'https://img.youtube.com/vi/[ID]/maxresdefault.jpg',
thumb:'https://img.youtube.com/vi/[ID]/default.jpg',
play:{ event:'command', func:'playVideo' },
pause:{ event:'command', func:'pauseVideo' }},
vimeo:{
reg:/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/)?(\d+)(?:[a-zA-Z0-9_\-]+)?/i,
url:'https://player.vimeo.com/video/[ID]?autoplay=1&api=1',
share:'https://vimeo.com/[ID]',
poster:'https://vimeo.com/api/v2/video/[ID].json',
play:{ event:'command', method:'play' },
pause:{ event:'command', method:'pause' }},
dailymotion:{
reg:/(?:www\.)?(?:dailymotion\.com(?:\/embed)(?:\/video|\/hub)|dai\.ly)\/([0-9a-z]+)(?:[\-_0-9a-zA-Z]+#video=(?:[a-zA-Z0-9_\-]+))?/i,
url:'https://dailymotion.com/embed/video/[ID]?autoplay=1&api=postMessage',
share:'https://www.dailymotion.com/video/[ID]',
poster:'https://www.dailymotion.com/thumbnail/video/[ID]',
thumb:'https://www.dailymotion.com/thumbnail/video/[ID]',
play:'play',
pause:'pause'
},
wistia:{
reg:/(?:www\.)?(?:wistia\.(?:com|net)|wi\.st)\/(?:(?:m|medias|projects)|embed\/(?:iframe|playlists))\/([a-zA-Z0-9_\-]+)/i,
url:'https://fast.wistia.net/embed/iframe/[ID]?version=3&enablejsapi=1&html5=1&autoplay=1',
share:'https://fast.wistia.net/embed/iframe/[ID]',
poster:'https://fast.wistia.com/oembed?url=https://home.wistia.com/medias/[ID].json',
play:{ event:'cmd', method:'play' },
pause:{ event:'cmd', method:'pause' }}
};};
proto.socialMedia=function(){
return {
facebook:'https://www.facebook.com/sharer/sharer.php?u=[url]',
googleplus:'https://plus.google.com/share?url=[url]',
twitter:'https://twitter.com/intent/tweet?text=[text]&url=[url]',
pinterest:'https://www.pinterest.com/pin/create/button/?url=[url]&media=[image]&description=[text]',
linkedin:'https://www.linkedin.com/shareArticle?url=[url]&mini=true&title=[text]',
reddit:'https://www.reddit.com/submit?url=[url]&title=[text]',
stumbleupon:'https://www.stumbleupon.com/badge?url=[url]&title=[text]',
tumblr:'https://www.tumblr.com/share?v=3&u=[url]&t=[text]',
blogger:'https://www.blogger.com/blog_this.pyra?t&u=[url]&n=[text]',
buffer:'https://bufferapp.com/add?url=[url]title=[text]',
digg:'https://digg.com/submit?url=[url]&title=[text]',
evernote:'https://www.evernote.com/clip.action?url=[url]&title=[text]'
};};
proto.createDOM=function(){
this.DOM={};
var elements=[
'holder',
'overlay',
'slider',
'item',
'item-inner',
'ui',
'top-bar',
'bottom-bar',
'share-tooltip',
'counter',
'caption',
'caption-inner',
'thumbs-holder',
'thumbs-inner'
];
for(var i=0; i < elements.length; i++){
this.DOM[utils.camelize(elements[i])]=utils.createEl('div', this.pre + '-' + elements[i]);
}
this.appendDOM(this.DOM);
};
proto.appendDOM=function(dom){
var opt=this.options;
dom.holder.appendChild(dom.overlay);
dom.holder.appendChild(dom.slider);
dom.holder.appendChild(dom.ui);
for(var i=0; i < 5; i++){
var slide=dom.item.cloneNode(true);
slide.appendChild(dom.itemInner.cloneNode(true) );
dom.slider.appendChild(slide);
this.slides[i]=slide;
}
this.slides.length=dom.slider.children.length;
this.createUI(dom, opt);
dom.holder.setAttribute('tabindex', -1);
dom.holder.setAttribute('aria-hidden', true);
this.DOM.comment=document.createComment(' ModuloBox (v' + version + ') by Themeone ');
document.body.appendChild(this.DOM.comment);
utils.dispatchEvent(this, 'modulobox', 'beforeAppendDOM', dom);
document.body.appendChild(dom.holder);
dom.topBar.height=dom.topBar.clientHeight;
};
proto.createUI=function(dom, opt){
var shareIndex=opt.controls.indexOf('share');
if(shareIndex > -1){
var buttons=opt.shareButtons,
i=buttons.length;
while(i--){
if(!this.socialMedia.hasOwnProperty(buttons[i]) ){
buttons.splice(i, 1);
}}
if(buttons.length){
dom.ui.appendChild(dom.shareTooltip);
if(opt.shareText){
dom.shareTooltip.appendChild(utils.createEl('span') ).textContent=opt.shareText;
}
this.createButtons(buttons, dom.shareTooltip, 'shareOn');
}else{
opt.controls.splice(shareIndex, 1);
}}
if(opt.controls.length||opt.counterMessage){
var slideShow=opt.controls.indexOf('play');
dom.ui.appendChild(dom.topBar);
if(opt.counterMessage){
dom.topBar.appendChild(dom.counter);
}
if(opt.slideShowInterval < 1&&slideShow > -1){
opt.controls.splice(slideShow, 1);
}
if(opt.countTimer&&slideShow > -1){
var timer=this.DOM.timer=utils.createEl('canvas', this.pre + '-timer');
timer.setAttribute('width', 48);
timer.setAttribute('height', 48);
dom.topBar.appendChild(timer);
}
if(opt.controls.length){
var controls=opt.controls.slice();
this.createButtons(controls.reverse(), dom.topBar);
}}
if(opt.caption||opt.thumbnails){
dom.ui.appendChild(dom.bottomBar);
if(opt.caption){
dom.bottomBar.appendChild(dom.caption)
.appendChild(dom.captionInner);
}
if(opt.thumbnails){
dom.bottomBar.appendChild(dom.thumbsHolder)
.appendChild(dom.thumbsInner);
}}
if(opt.prevNext){
this.createButtons(['prev', 'next'], dom.ui);
}};
proto.createButtons=function(buttons, dom, event){
var length=buttons.length;
for(var i=0; i < length; i++){
var type=buttons[i];
this.buttons[type]=utils.createEl('BUTTON', this.pre + '-' + type.toLowerCase());
dom.appendChild(this.buttons[type]);
if(( type&&typeof this[type]==='function')||event){
this.buttons[type].event=event ? event:type;
this.buttons[type].action=type;
if(event==='shareOn'){
this.buttons[type].setAttribute('title', type.charAt(0).toUpperCase() + type.slice(1) );
}}
}};
proto.getGalleries=function(){
this.galleries={};
var selectors=this.options.mediaSelector,
sources='';
if(!selectors){
return false;
}
try {
sources=document.querySelectorAll(selectors);
} catch (error){
utils.error('Your current mediaSelector is not a valid selector: "' + selectors + '"');
}
for(var i=0, l=sources.length; i < l; i++){
var source=sources[i],
media={};
media.src=source.tagName==='A'   ? source.getAttribute('href'):null;
media.src=source.tagName==='IMG' ? source.currentSrc||source.src:media.src;
media.src=source.getAttribute('data-src')||media.src;
if(media.src){
this.getMediaAtts(source, media);
this.setMediaType(media);
if(media.type){
this.getMediaThumb(source, media);
this.getVideoThumb(media);
this.getMediaCaption(source, media);
this.setMediaCaption(media);
var gallery=this.setGalleryName(source);
this.setGalleryFeatures(gallery, media);
media.index=gallery.length;
gallery.push(media);
this.setMediaEvent(source, gallery.name, media.index);
}}
}
utils.dispatchEvent(this, 'modulobox', 'updateGalleries', this.galleries);
};
proto.addMedia=function(name, media){
if(!media||typeof media!=='object'){
utils.error('No media was found to addMedia() in a gallery');
return false;
}
name=name==='' ? 1:name;
var gallery=this.galleries[name];
gallery = !gallery ?(this.galleries[name]=[]):gallery;
gallery.name=name;
var length=media.length;
for(var i=0; i < length; i++){
var item=utils.cloneObject(media[i]);
if(item.src){
this.setMediaType(item);
this.getVideoThumb(item);
this.setMediaCaption(item);
this.setGalleryFeatures(gallery, item);
item.index=gallery.length;
gallery.push(item);
}}
};
proto.setMediaType=function(media){
if(['image', 'video', 'iframe', 'HTML'].indexOf(media.type) > -1){
return;
}
media.type=null;
var source=media.src ? media.src:null;
var extension=(source.split(/[?#]/)[0]||source).substr(( ~-source.lastIndexOf('.') >>> 0) + 2);
if(/(jpg|jpeg|png|bmp|gif|tif|tiff|jfi|jfif|exif|svg)/i.test(extension)||['external.xx.fbcdn', 'drscdn.500px.org'].indexOf(source) > -1){
media.type='image';
media.src=this.getSrc(source);
}else if(/(mp4|webm|ogv)/i.test(extension) ){
media.type='video';
media.format='html5';
}else{
var stream=this.iframeVideo;
for(var type in stream){
if(stream.hasOwnProperty(type) ){
var regs=source.match(stream[type].reg);
if(regs&&regs[1]){
var object=stream[type];
media.type='video';
media.format=type;
media.share=object.share.replace('[ID]', regs[1]);
media.src=object.url.replace('[ID]', regs[1]);
media.pause=object.pause;
media.play=object.play;
if(this.options.videoThumbnail){
media.poster = !media.poster&&object.poster ? object.poster.replace('[ID]', regs[1]):media.poster;
media.thumb  = !media.thumb&&object.poster ? object.poster.replace('[ID]', regs[1]):media.thumb;
}
break;
}}
}}
};
proto.getSrc=function(source){
var srcset=(source||'').split(/,/),
length=srcset.length,
width=0;
if(length <=1){
return source;
}
for(var i=0; i < length; i++){
var parts=srcset[i].replace(/\s+/g, ' ').trim().split(/ /),
value=parseFloat(parts[1])||0,
unit=parts[1] ? parts[1].slice(-1):null;
if(( unit==='w'&&screen.width >=value&&value > width)||!value||i===0){
width=value;
source=parts[0];
}}
return source;
};
proto.getMediaAtts=function(source, media){
var auto=this.options.autoCaption,
data=this.getAttr(source),
img=source.firstElementChild;
img=source.tagName!=='IMG'&&img&&img.tagName==='IMG' ? img:source;
media.type   = !media.type ? data.type||source.getAttribute('data-type'):media.type;
media.title=data.title||source.getAttribute('data-title')||(auto ? img.title:null);
media.desc=data.desc||source.getAttribute('data-desc')||(auto ? img.alt:null);
media.thumb=data.thumb||source.getAttribute('data-thumb');
media.poster=this.getSrc(data.poster||source.getAttribute('data-poster') );
media.width=data.width||source.getAttribute('data-width');
media.height=data.height||source.getAttribute('data-height');
if(media.title===media.desc){
media.desc=null;
}};
proto.getMediaThumb=function(source, media){
var thumbnail=source.getElementsByTagName('img');
if(!media.thumb&&thumbnail[0]){
media.thumb=thumbnail[0].src;
}};
proto.getVideoThumb=function(media){
if(!this.options.videoThumbnail||media.type!=='video'||media.format==='html5'){
return;
}
var hasPoster=media.poster&&media.poster.indexOf('.json') > -1,
hasThumb=media.thumb&&media.thumb.indexOf('.json') > -1;
if(hasPoster||hasThumb){
var uri=hasPoster ? media.poster:media.thumb,
xhr=new XMLHttpRequest();
xhr.onload=function(event){
var response=event.target.responseText;
response=JSON.parse(response);
response=response.hasOwnProperty(0) ? response[0]:response;
if(response){
media.poster=response.thumbnail_large||response.thumbnail_url;
if(media.dom){
media.dom.style.backgroundImage='url("' + media.poster + '")';
}
if(hasThumb){
var thumb=response.thumbnail_small||response.thumbnail_url;
if(typeof media.thumb==='object'){
media.thumb.style.backgroundImage='url("' + thumb + '")';
}else{
media.thumb=thumb;
}}
}}.bind(this);
xhr.open('GET', encodeURI(uri), true);
setTimeout(function(){
xhr.send();
}, 0);
}};
proto.getMediaCaption=function(source, media){
var next=source.nextElementSibling;
if(next&&next.tagName==='FIGCAPTION'){
var caption=next.innerHTML;
if(! media.title){
media.title=caption;
}else if(! media.desc){
media.desc=caption;
}}
};
proto.setMediaCaption=function(media){
media.title=media.title ? '<div class="' + this.pre + '-title">' + media.title.trim() + '</div>':'';
media.desc=media.desc ? '<div class="' + this.pre + '-desc">' + media.desc.trim() + '</div>':'';
media.caption=media.title + media.desc;
};
proto.getGalleryName=function(source){
var parent=source,
node=0;
while(parent&&node < 2){
parent=parent.parentNode;
if(parent&&parent.tagName==='FIGURE'&&parent.parentNode){
return parent.parentNode.getAttribute('id');
}
node++;
}};
proto.setGalleryName=function(source){
var data=this.getAttr(source);
var name=data.rel||source.getAttribute('data-rel');
name = !name ? this.getGalleryName(source):name;
name = !name ? Object.keys(this.galleries).length + 1:name;
var gallery=this.galleries[name];
gallery = !gallery ?(this.galleries[name]=[]):gallery;
gallery.name=name;
return gallery;
};
proto.setGalleryFeatures=function(gallery, media){
if(!gallery.zoom&&media.type==='image'){
gallery.zoom=true;
}
if(!gallery.download&&(media.type==='image'||media.format==='html5') ){
gallery.download=true;
}};
proto.setMediaEvent=function(source, name, index){
if(source.mobxListener){
source.removeEventListener('click', source.mobxListener, false);
}
source.mobxListener=this.open.bind(this, name, index);
source.addEventListener('click', source.mobxListener, false);
};
proto.open=function(name, index, event){
if(event){
event.preventDefault();
event.stopPropagation();
}
if(!this.GUID){
return false;
}
if(!this.galleries.hasOwnProperty(name) ){
utils.error('This gallery name:"' + name + '", does not exist!');
return false;
}
if(!this.galleries[name].length){
utils.error('Sorry, no media was found for the current gallery.');
return false;
}
if(!this.galleries[name][index]){
utils.error('Sorry, no media was found for the current media index: ' + index);
return false;
}
utils.dispatchEvent(this, 'modulobox', 'beforeOpen', name, index);
this.slides.index=index;
this.gallery=this.galleries[name];
this.gallery.name=name;
this.gallery.index=index;
this.gallery.loaded=false;
this.removeContent();
this.wrapAround();
this.hideScrollBar();
this.setSlider();
this.setThumbs();
this.setCaption();
this.setMedia(this.options.preload);
this.updateMediaInfo();
this.replaceState();
this.setControls();
this.bindEvents(true);
this.show();
if(this.options.videoAutoPlay){
this.appendVideo();
}
if(this.options.slideShowAutoPlay&&this.options.controls.indexOf('play') > -1 &&
(! this.options.videoAutoPlay||this.galleries[name][index].type!=='video') ){
this.startSlideShow();
}
this.states.zoom=false;
this.states.open=true;
};
proto.openFromQuery=function(){
var query=this.getQueryString(window.location.search);
if(query.hasOwnProperty('guid')&&query.hasOwnProperty('mid') ){
var open=this.open(decodeURIComponent(query.guid),
decodeURIComponent(query.mid) - 1
);
if(open===false){
this.replaceState(true);
}}
};
proto.show=function(){
var holder=this.DOM.holder,
method=this.options.rightToLeft ? 'add':'remove';
holder.setAttribute('aria-hidden', false);
utils.removeClass(holder, this.pre + '-idle');
utils.removeClass(holder, this.pre + '-panzoom');
utils.removeClass(holder, this.pre + '-will-close');
utils[method + 'Class'](holder, this.pre + '-rtl');
utils.addClass(holder, this.pre + '-open');
};
proto.close=function(event){
if(event){
event.preventDefault();
}
var holder=this.DOM.holder,
gallery=this.gallery,
index=gallery ? gallery.index:'undefined',
name=gallery ? gallery.name:'undefined';
utils.dispatchEvent(this, 'modulobox', 'beforeClose', name, index);
if(this.states.fullScreen){
this.exitFullScreen();
utils.removeClass(holder, this.pre + '-fullscreen');
}
this.share();
this.stopSlideShow();
this.pauseVideo();
this.bindEvents(false);
this.replaceState(true);
this.hideScrollBar();
holder.setAttribute('aria-hidden', true);
utils.removeClass(holder, this.pre + '-open');
this.states.open=false;
};
proto.setControls=function(){
var gallery=this.gallery,
options=this.options,
buttons=this.buttons;
if(this.DOM.counter){
this.DOM.counter.style.display=(gallery.initialLength > 1) ? '':'none';
}
if(options.controls.indexOf('play') > -1){
buttons.play.style.display=(gallery.initialLength > 1) ? '':'none';
}
if(options.controls.indexOf('zoom') > -1){
buttons.zoom.style.display = !gallery.zoom ? 'none':'';
}
if(options.controls.indexOf('download') > -1){
buttons.download.style.display = !gallery.download ? 'none':'';
}
this.setPrevNextButtons();
};
proto.setPrevNextButtons=function(){
if(this.options.prevNext){
var hide=this.slider.width < 680&&this.browser.touchDevice&&!this.options.prevNextTouch;
this.buttons.prev.style.display =
this.buttons.next.style.display=(this.gallery.length > 1&&!hide) ? '':'none';
}};
proto.setCaption=function(){
this.states.caption = !(!this.options.captionSmallDevice&&(this.slider.width <=480||this.slider.height <=480) );
this.DOM.caption.style.display=this.states.caption ? '':'none';
};
proto.hideScrollBar=function(){
if(!this.options.scrollBar){
var open=this.states.open,
scrollBar=open==='undefined'||!open ? true:false;
document.body.style.overflow =
document.documentElement.style.overflow=scrollBar ? 'hidden':'';
}};
proto.bindEvents=function(bind){
var win=window,
doc=document,
opt=this.options,
holder=this.DOM.holder,
buttons=this.buttons,
scrollMethod;
for(var type in buttons){
if(buttons.hasOwnProperty(type) ){
var DOM=(type!=='share') ? buttons[type]:win;
utils.handleEvents(this, DOM, ['click', 'touchend'], buttons[type].event, bind);
}}
utils.handleEvents(this, holder, this.dragEvents.start, 'touchStart', bind);
utils.handleEvents(this, win, ['keydown'], 'keyDown', bind);
utils.handleEvents(this, win, ['resize', 'orientationchange'], 'resize', bind);
utils.handleEvents(this, holder, ['transitionend', 'webkitTransitionEnd', 'oTransitionEnd', 'otransitionend', 'MSTransitionEnd'], 'opened');
utils.handleEvents(this, holder, ['touchend'], 'disableZoom', bind);
if(this.browser.fullScreen){
utils.handleEvents(this, doc, [this.browser.fullScreen.change], 'toggleFullScreen', bind);
}
if(opt.history){
utils.handleEvents(this, win, ['mouseout'], 'mouseOut', bind);
}
if(opt.timeToIdle > 0){
utils.handleEvents(this, holder, ['mousemove'], 'mouseMove', bind);
}
if(!opt.contextMenu){
utils.handleEvents(this, holder, ['contextmenu'], 'contextMenu', bind);
}
if(!opt.mouseWheel){
this.disableScroll(bind);
}
if(opt.scrollToZoom){
scrollMethod='scrollToZoom';
}
else if(opt.scrollToNav){
scrollMethod='scrollToNav';
}
else if(opt.scrollToClose){
scrollMethod='scrollToClose';
}
if(scrollMethod){
utils.handleEvents(this, holder, [this.browser.mouseWheel], scrollMethod, bind);
}};
proto.opened=function(event){
if(event.propertyName==='visibility'&&event.target===this.DOM.holder){
var name=this.gallery.name,
index=this.gallery.index;
if(!this.states.open){
this.removeContent();
utils.dispatchEvent(this, 'modulobox', 'afterClose', name, index);
}else{
utils.dispatchEvent(this, 'modulobox', 'afterOpen', name, index);
}}
};
proto.mouseOut=function(event){
var e=event ? event:window.event,
from=e.relatedTarget||e.toElement;
if(!from||from.nodeName==='HTML'){
this.replaceState();
}};
proto.mouseMove=function(){
var holder=this.DOM.holder,
idleClass=this.pre + '-idle';
clearTimeout(this.states.idle);
this.states.idle=setTimeout(function(){
if(!utils.hasClass(holder, this.pre + '-open-tooltip') ){
utils.addClass(holder, idleClass);
}}.bind(this), this.options.timeToIdle);
utils.removeClass(holder, idleClass);
};
proto.contextMenu=function(event){
var target=event.target,
tagName=target.tagName,
className=target.className;
if(tagName==='IMG'||tagName==='VIDEO' ||
className.indexOf(this.pre + '-video') > -1 ||
className.indexOf(this.pre + '-thumb-bg') > -1 ||
className===this.pre + '-thumb'){
event.preventDefault();
}};
proto.disableScroll=function(bind){
var doc=document,
win=window;
var prevent=function(e){
if(!this.isEl(e) ){
return;
}
e=e||win.event;
if(e.preventDefault){
e.preventDefault();
e.returnValue=false;
return false;
}};
win.onwheel      =
win.ontouchmove  =
win.onmousewheel =
doc.onmousewheel =
doc.onmousewheel=bind ? prevent.bind(this):null;
};
proto.scrollToZoom=function(event){
if(!this.isEl(event) ){
return;
}
var data=this.normalizeWheel(event);
if(data&&data.deltaY){
var cell=this.getCell(),
scale=cell.attraction.s||cell.position.s;
scale=Math.min(this.options.maxZoom, Math.max(1, scale - Math.abs(data.deltaY) / data.deltaY) );
this.stopSlideShow();
this.zoomTo(event.clientX, event.clientY, Math.round(scale * 10) / 10);
}};
proto.scrollToNav=function(event){
if(!this.isEl(event) ){
return;
}
var data=this.normalizeWheel(event);
if(data&&data.delta){
this[data.delta * this.isRTL() < 0 ? 'prev':'next']();
}};
proto.scrollToClose=function(event){
if(!this.isEl(event) ){
return;
}
event.preventDefault();
this.close();
};
proto.disableZoom=function(event){
var node=event.target;
while(node){
if(['VIDEO', 'INPUT', 'A'].indexOf(node.tagName) > -1){
return;
}
node=node.parentElement;
}
event.preventDefault();
};
proto.resize=function(event){
this.DOM.topBar.height=this.DOM.topBar.clientHeight;
this.share();
this.setSlider();
this.setThumbsPosition();
this.setCaption();
this.resizeMedia();
this.updateMediaInfo();
this.setPrevNextButtons();
this.states.zoom=false;
utils.removeClass(this.DOM.holder, this.pre + '-panzoom');
utils.dispatchEvent(this, 'modulobox', 'resize', event);
};
proto.resizeMedia=function(){
var slides=this.slides;
for(var i=0; i < slides.length; i++){
if(!this.gallery){
break;
}
var media=this.gallery[slides[i].media];
if(media&&(( media.dom&&media.dom.loaded)||(media.dom&&['video', 'iframe', 'HTML'].indexOf(media.type) > -1) )){
this.setMediaSize(media, slides[i]);
}}
};
proto.isEl=function(event){
var name=event.target.className;
name=typeof name==='string' ? name:name.baseVal;
return name.indexOf(this.pre) > -1;
};
proto.isZoomable=function(){
var media=this.getMedia(),
zoom=false;
if(media.type==='image'&&media.dom&&media.dom.size&&media.dom.size.scale > 1){
zoom=true;
}
this.DOM.holder.setAttribute('data-zoom', zoom);
return zoom;
};
proto.isDownloadable=function(){
var media=this.getMedia(),
download=true;
if(media.type!=='image'&&media.format!=='html5'){
download=false;
}
this.DOM.holder.setAttribute('data-download', download);
return download;
};
proto.isRTL=function(){
return this.options.rightToLeft ? - 1:1;
};
proto.addAttr=function(el, attrs){
var cacheID;
if(typeof el[this.expando]==='undefined'){
cacheID=this.cache.uid++;
el[this.expando]=cacheID;
this.cache[cacheID]={};}else{
cacheID=el[this.expando];
}
for(var attr in attrs){
if(attrs.hasOwnProperty(attr) ){
this.cache[cacheID][attr]=attrs[attr];
}}
};
proto.getAttr=function(el){
return this.cache[el[this.expando]]||{};};
proto.getThumbHeight=function(){
var thumb=this.thumbs;
return thumb.height > 0&&thumb.width > 0 ? thumb.height + Math.min(10, thumb.gutter) * 2:0;
};
proto.getMedia=function(){
var gallery=this.gallery;
return gallery ? gallery[gallery.index]:null;
};
proto.getCell=function(){
var slides=this.slides,
index=utils.modulo(slides.length, slides.index);
return this.cells[index];
};
proto.removeContent=function(){
for(var i=0; i < this.slides.length; i++){
var slide=this.slides[i];
this.unloadMedia(slide);
this.removeMedia(slide);
slide.index =
slide.media=null;
}
this.removeMedia(this.DOM.thumbsHolder);
};
proto.getQueryString=function(search){
var params={};
search.substr(1).split('&').forEach(function(param){
param=param.split('=');
params[decodeURIComponent(param[0])]=param.length > 1 ? decodeURIComponent(param[1]):'';
});
return params;
};
proto.setQueryString=function(key){
var search=window.location.search,
query=this.getQueryString(search);
search=decodeURI(search);
for(var prop in key){
if(key.hasOwnProperty(prop) ){
var replace=encodeURIComponent(key[prop]);
if(query.hasOwnProperty(prop) ){
var value=query[prop];
if(!replace){
search=search.replace('&' + prop + '=' + value, '');
search=search.replace(prop + '=' + value, '');
}else{
search=search.replace(prop + '=' + value, prop + '=' + replace);
}}else{
if(replace){
search=search +(!search ? '?':'&') + prop + '=' + replace;
}else{
search=search.replace(prop + '=', '');
}}
}}
var base=[location.protocol, '//', location.host, location.pathname].join('');
search = !search.substr(1) ? search.substr(1):search;
return encodeURI(base + search);
};
proto.replaceState=function(remove){
if(( this.options.history||remove)&&this.browser.pushState&&!this.states.push){
var prevData=window.history.state,
data={
guid:!remove ? this.gallery.name:'',
mid:!remove ? utils.modulo(this.gallery.initialLength, this.gallery.index) + 1:''
};
if(!prevData||prevData.mid!==data.mid){
var search=this.setQueryString(data);
try {
window.history.replaceState(data, '', search);
} catch (error){
this.options.history=false;
utils.error('SecurityError: A history state object with origin \'null\' cannot be created. Please run the script on a server.');
}}
}
this.states.push=false;
};
proto.normalizeWheel=function(event){
var ev=event||window.event,
data=null,
deltaX,
deltaY,
delta;
event.preventDefault();
if('detail' in ev){
deltaY=ev.detail * -1;
}
if('wheelDelta' in ev){
deltaY=ev.wheelDelta * -1;
}
if('wheelDeltaY' in ev){
deltaY=ev.wheelDeltaY * -1;
}
if('wheelDeltaX' in ev){
deltaX=ev.wheelDeltaX * -1;
}
if('deltaY' in ev){
deltaY=ev.deltaY;
}
if('deltaX' in ev){
deltaX=ev.deltaX * -1;
}
if(ev.deltaMode===1){
deltaX *=40;
deltaY *=40;
}else if(ev.deltaMode===2){
deltaX *=100;
deltaY *=100;
}
delta=Math.abs(deltaX) > Math.abs(deltaY) ? deltaX:deltaY;
delta=Math.min(100, Math.max(-100, delta) );
if(Math.abs(delta) < this.options.scrollSensitivity){
this.states.prevDelta=delta;
return data;
}
var time=+new Date();
if(Math.abs(delta) > Math.abs(this.states.prevDelta)||time - this.states.prevScroll > 60){
data={
'deltaX':deltaX,
'deltaY':deltaY,
'delta':delta
};}
this.states.prevDelta=delta;
this.states.prevScroll=time;
return data;
};
proto.share=function(event){
if(event&&event.target.tagName==='VIDEO'){
return;
}
var holder=this.DOM.holder,
className=this.pre + '-open-tooltip',
element=event ? event.target.className:null,
method=utils.hasClass(holder, className) ? 'remove':'add';
if(( method==='remove'&&(element!==this.pre + '-share'||!event) )||element===this.pre + '-share'){
if(method==='add'){
this.setShareTooltip();
}
utils[method + 'Class'](holder, className);
}};
proto.shareOn=function(event){
var type=event.target.action,
gallery=this.gallery,
media=this.getMedia(),
image=media.type==='image' ? media.src:media.poster,
url=this.socialMedia[type],
uri;
if(url){
if(this.options.sharedUrl==='page'){
uri=[location.protocol, '//', location.host, location.pathname].join('');
}else if(this.options.sharedUrl==='deeplink'||['iframe', 'HTML'].indexOf(media.type) > -1){
uri=this.setQueryString({
guid:gallery.name,
mid:gallery.index + 1
});
}else{
uri=media.src.replace(/\s/g, '').split(',')[0];
if(media.type==='video'&&media.format!=='html5'){
uri=media.share;
}}
var link=utils.createEl('a');
link.href=image;
image=link.href;
link.href=uri;
uri=link.href;
var tmp=utils.createEl('div');
tmp.innerHTML=media.caption;
var text=(tmp.textContent||tmp.innerText).replace(/\s+/g, ' ').trim()||'';
url=url.replace('[url]', encodeURIComponent(uri) )
.replace('[image]', encodeURIComponent(image) )
.replace('[text]', encodeURIComponent(text||document.title) );
if(url){
var left=Math.round(window.screenX +(window.outerWidth - 626) / 2),
top=Math.round(window.screenY +(window.outerHeight - 436) / 2);
window.open(url, this.pre + '_share', 'status=0,resizable=1,location=1,toolbar=0,width=626,height=436,top=' + top + ',left=' + left);
}}else{
utils.error('This social share media does not exist');
}
return false;
};
proto.setShareTooltip=function(){
if(this.options.controls.indexOf('share') > -1){
var attribute='right',
tooltip=this.DOM.shareTooltip,
width=tooltip.clientWidth,
button=this.buttons.share.getBoundingClientRect(),
position=button.left - width + button.width / 2 + 20;
if(position < 0){
attribute='left';
position=button.left + button.width / 2 - 20;
}
tooltip.setAttribute('data-position', attribute);
tooltip.style.top=this.DOM.topBar.height + 6 + 'px';
tooltip.style.left=position + 'px';
}};
proto.download=function(){
if(!this.isDownloadable()){
return false;
}
var media=this.getMedia(),
url=media.src.replace(/\s/g, '').split(',')[0],
link=document.createElement('a'),
group=url.split('/');
link.href=url;
link.download=group.pop().split('?')[0];
link.setAttribute('target', '_blank');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
proto.fullScreen=function(){
var fullScreenElement=this.browser.fullScreen.element;
if(!document[fullScreenElement]){
this.requestFullScreen();
}else{
this.exitFullScreen();
}};
proto.toggleFullScreen=function(){
var holder=this.DOM.holder,
fullScreenElement=document[this.browser.fullScreen.element];
if(!fullScreenElement){
this.share();
this.states.fullScreen=false;
utils.removeClass(holder, this.pre + '-fullscreen');
}else if(fullScreenElement===holder){
this.setShareTooltip();
this.states.fullScreen=true;
utils.addClass(holder, this.pre + '-fullscreen');
}
this.videoFullScreen();
};
proto.requestFullScreen=function(){
var request=this.browser.fullScreen.request;
if(document.documentElement[request]){
this.DOM.holder[request]();
}};
proto.exitFullScreen=function(){
var exit=this.browser.fullScreen.exit;
if(document[exit]){
document[exit]();
}};
proto.play=function(){
if(this.states.play){
this.stopSlideShow();
}else{
this.startSlideShow();
}};
proto.startSlideShow=function(){
var start=0,
gallery=this.gallery,
options=this.options,
loop=this.states.loop,
autoStop=options.slideShowAutoStop,
cycle=Math.max(120, options.slideShowInterval),
count=options.countTimer,
canvas=count&&this.DOM.timer ? this.DOM.timer.getContext('2d'):null;
var countDown=(function(now){
now = !now ? +new Date():now;
start = !start ? now:start;
if(!loop||autoStop){
if(gallery.index===gallery.initialLength - 1){
this.stopSlideShow();
return;
}}
if(count&&canvas){
var percent=Math.min(1,(now - start + cycle) / cycle - 1),
radians=percent * 360 *(Math.PI / 180);
canvas.clearRect(0, 0, 48, 48);
this.timerProgress(canvas, options.countTimerBg, 100);
this.timerProgress(canvas, options.countTimerColor, radians);
}
if(now >=start + cycle){
start=now;
this.slideTo(this.slides.index + 1, true);
}
this.timer=requestAnimationFrame(countDown);
}).bind(this);
utils.addClass(this.DOM.holder, this.pre + '-autoplay');
this.states.play=true;
this.timer=requestAnimationFrame(countDown);
};
proto.stopSlideShow=function(){
cancelAnimationFrame(this.timer);
utils.removeClass(this.DOM.holder, this.pre + '-autoplay');
this.states.play=false;
};
proto.timerProgress=function(canvas, color, end){
var start=1.5 * Math.PI;
canvas.strokeStyle=color;
canvas.lineWidth=5;
canvas.beginPath();
canvas.arc(24, 24, 18, start, start + end, false);
canvas.stroke();
};
proto.appendVideo=function(){
var media=this.getMedia();
if(media.type!=='video'){
return;
}
utils.addClass(media.dom, this.pre + '-loading');
utils.removeClass(media.dom, this.pre + '-playing');
if(!media.video){
if(media.format==='html5'){
media.video=utils.createEl('video');
media.video.setAttribute('controls', '');
media.video.setAttribute('autoplay', '');
var urls=media.src.replace(/\s/g, '').split(',');
for(var i=0; i < urls.length; i++){
var frag=document.createDocumentFragment(),
source=utils.createEl('source'),
type=(/^.+\.([^.]+)$/).exec(urls[i]);
if(type&&['mp4', 'webm', 'ogv'].indexOf(type[1]) > -1){
source.src=urls[i];
source.setAttribute('type', 'video/' +(type[1]==='ogv' ? 'ogg':type[1]) );
frag.appendChild(source);
}
media.video.appendChild(frag);
}}
else if(media.format){
media.video=utils.createEl('iframe');
media.video.src=media.src;
media.video.setAttribute('frameborder', 0);
media.video.setAttribute('allowfullscreen', '');
}
media.video.setAttribute('width', '100%');
media.video.setAttribute('height', '100%');
}
if(!media.dom.firstChild){
media.dom.appendChild(media.video);
if(media.format!=='html5'){
media.video.loaded=false;
}}
this.playVideo(media);
};
proto.onVideoLoaded=function(media){
media.video.loaded=true;
utils.removeClass(media.dom, this.pre + '-loading');
utils.addClass(media.dom, this.pre + '-playing');
this.cloneVideo(media);
};
proto.cloneVideo=function(media){
if(this.states.loop&&media.format==='html5'){
var gallery=this.gallery,
length=gallery.length,
initial=gallery.initialLength,
current=utils.modulo(initial, media.index);
for(var i=0; i < length; i++){
var index=utils.modulo(initial, gallery[i].index);
if(index===current&&gallery[i].index!==media.index){
gallery[i].video=media.video;
}}
}};
proto.videoFullScreen=function(){
var media=this.getMedia(),
fullScreen=this.states.fullScreen;
if(media.type==='video'&&media.format!=='html5'&&media.video){
media.video[fullScreen ? 'removeAttribute':'setAttribute']('allowfullscreen', '');
}};
proto.playVideo=function(media){
if(media.video.loaded){
media.video.getClientRects();
utils.removeClass(media.dom, this.pre + '-loading');
utils.addClass(media.dom, this.pre + '-playing');
if(media.format!=='html5'){
if(media.play){
var message=typeof media.play==='object' ? JSON.stringify(media.play):String(media.play);
media.video.contentWindow.postMessage(message, '*');
}}else if(!media.video.error){
if(typeof MediaElementPlayer==='function'&&this.options.mediaelement){
var mejs=(media.video.tagName==='VIDEO') ? media.video:media.video.getElementsByTagName('video')[0];
if(mejs.player){
mejs.player.setControlsSize();
}
mejs.play();
}else{
media.video.play();
}}
}else{
var _this=this;
if(typeof MediaElementPlayer==='function'&&!media.play&&this.options.mediaelement&&!media.video.player){
new MediaElementPlayer(media.video, {
features:['playpause', 'stop', 'current', 'progress', 'duration', 'volume', 'fullscreen'],
videoVolume:'horizontal',
startVolume:0.8,
classPrefix:'mejs-',
keyActions:[],
enableKeyboard:false,
iPadUseNativeControls:true,
iPhoneUseNativeControls:true,
AndroidUseNativeControls:true,
success:function(mejs){
mejs.addEventListener('loadeddata', function(){
media.video=media.dom.lastChild;
if(media.video){
var offScreen=media.video.previousSibling;
if(offScreen&&offScreen.parentNode){
offScreen.parentNode.removeChild(offScreen);
}
_this.onVideoLoaded(media);
}}, media, false);
},
error:function(){
_this.onVideoLoaded(media);
}});
}else if(!media.video.onload){
media.video.onload  =
media.video.onerror =
media.video.onloadedmetadata=function(){
if(media.dom.firstChild){
_this.onVideoLoaded(media);
_this.videoFullScreen();
}};
media.video.src=media.src.replace(/\s/g, '').split(',')[0];
}}
};
proto.pauseVideo=function(){
var media=this.getMedia();
if(media&&media.type==='video'&&media.video){
utils.removeClass(media.dom, this.pre + '-playing');
if(!media.video.loaded){
media.dom.innerHTML='';
utils.removeClass(media.dom, this.pre + '-loading');
return;
}
if(media.format==='html5'){
if(typeof MediaElementPlayer==='function'&&this.options.mediaelement){
var mejs=(media.video.tagName==='VIDEO') ? media.video:media.video.getElementsByTagName('video')[0];
mejs.pause();
}else{
media.video.pause();
}}else{
if(media.pause&&media.format!=='dailymotion'){
var message=typeof media.pause==='object' ? JSON.stringify(media.pause):String(media.pause);
media.video.contentWindow.postMessage(message, '*');
}else{
media.dom.innerHTML='';
media.video=null;
}}
}};
proto.insertMedia=function(media_index, slide_index){
var media=this.gallery[media_index];
if(!media){
return;
}
if(typeof media.index==='undefined'){
media.index=this.gallery.indexOf(media);
}
this.buildMedia(media);
this.appendMedia(media, slide_index);
this.loadMedia(media, slide_index);
};
proto.buildMedia=function(media){
if(typeof media.dom==='undefined'){
switch(media.type){
case 'image':
media.dom=utils.createEl('img', this.pre + '-img');
media.dom.src=media.src;
break;
case 'video':
media.dom=utils.createEl('div', this.pre + '-video');
if(media.poster){
media.dom.style.backgroundImage='url("' + media.poster + '")';
}else{
media.dom.loaded=true;
}
break;
case 'iframe':
media.dom=utils.createEl('iframe', this.pre + '-iframe');
media.dom.setAttribute('allowfullscreen', '');
media.dom.setAttribute('frameborder', 0);
media.dom.src=media.src;
break;
case 'HTML':
var element=media.src;
var content=document.querySelector(element);
media.dom=utils.createEl('div', this.pre + '-html');
media.dom.appendChild(utils.createEl('div', this.pre + '-html-inner') );
media.dom.firstChild.innerHTML=content ? content.innerHTML:null;
media.src=content ? content:'';
media.dom.loaded=true;
break;
}
if(!media.type||!media.src){
media.dom=utils.createEl('div', this.pre + '-error');
media.dom.textContent=this.options.noContent;
media.dom.loaded=true;
media.dom.error=true;
utils.dispatchEvent(this, 'modulobox', 'noContent', this.gallery.name, parseInt(media.index, 10) );
}}
};
proto.appendMedia=function(media, slide_index){
var slide=this.slides[slide_index],
holder=slide.firstChild,
loader;
if(!holder.childElementCount){
var fragment=document.createDocumentFragment();
loader=utils.createEl('div', this.pre + '-loader');
fragment.appendChild(loader);
fragment.appendChild(media.dom);
holder.appendChild(fragment);
}else{
var oldMedia=holder.lastChild;
loader=holder.firstChild;
loader.style.visibility='';
if(media.dom!==oldMedia){
var method=holder.childElementCount===1 ? 'appendChild':'replaceChild';
holder[method](media.dom, oldMedia);
}}
slide.media=media.index;
};
proto.loadMedia=function(media, slide_index){
if(media.dom.loaded){
this.showMedia(media, slide_index);
return;
}
var _this=this,
dom=media.type==='iframe' ? media.dom:media.dom.img=new Image();
var onComplete=function(){
if(!media.dom.error){
utils.dispatchEvent(_this, 'modulobox', 'loadComplete', _this.gallery.name, parseInt(media.index, 10) );
}
media.dom.loaded=media.type!=='iframe' ? true:false;
_this.showMedia(media, slide_index);
};
dom.onload=onComplete;
dom.onerror=function(e){
if(media.type!=='video'){
media.dom=utils.createEl('p', _this.pre + '-error');
media.dom.textContent=_this.options.loadError;
media.dom.error=true;
_this.appendMedia(media, slide_index);
}
utils.dispatchEvent(_this, 'modulobox', 'loadError', _this.gallery.name, parseInt(media.index, 10) );
onComplete();
};
dom.src=(media.type==='video') ? media.poster:media.src;
};
proto.unloadMedia=function(slide){
if(!this.gallery){
return;
}
var index=slide.media,
media=this.gallery[index];
if(!media||!media.dom){
return;
}
if(this.options.unload&&media.type==='image'&&!media.dom.loaded&&!media.dom.complete&&!media.dom.naturalWidth){
media.dom.onload=null;
media.dom.onerror=null;
media.dom.src='';
if(media.dom.img){
media.dom.img.onload=null;
media.dom.img.onerror=null;
media.dom.img.src='';
delete media.dom.img;
}
delete media.dom;
}
else if(media.type==='video'&&media.format!=='html5'&&media.dom.firstChild){
media.video=null;
media.dom.removeChild(media.dom.firstChild);
}};
proto.removeMedia=function(holder){
var content=holder.firstChild;
if(!content){
return;
}
while(content.firstChild){
content.removeChild(content.firstChild);
}};
proto.showMedia=function(media, slide_index){
var slider=this.slider;
if(this.options.fadeIfSettle&&!slider.settle&&!media.dom.revealed){
return;
}
var slide=this.slides[slide_index],
gallery=this.gallery,
holder=slide.firstChild,
loader=holder.firstChild,
preload=this.options.preload;
this.setMediaSize(media, slide);
if(media.index===gallery.index){
this.isZoomable();
}
utils.addClass(media.dom, this.pre + '-media-loaded');
media.dom.revealed=true;
if(slide.media===media.index){
loader.style.visibility='hidden';
gallery.loaded +=1;
if(gallery.loaded===preload&&preload < 4){
this.setMedia(preload + 2);
}}
if(media.type==='iframe'){
media.dom.loaded=false;
}};
proto.setMediaSize=function(media, slide){
var object=media.dom,
slider=this.slider,
viewport=object.viewport,
thumbs=this.getThumbHeight();
if(object.error){
return;
}
if(!viewport ||
viewport.width!==slider.width ||
viewport.height!==slider.height - thumbs){
this.getCaptionHeight(media, slide);
this.getMediaSize(media, slide);
this.fitMediaSize(media, slide);
this.setMediaOffset(media, slide);
}
var style=object.style;
style.width=object.size.width + 'px';
style.height=object.size.height + 'px';
style.left=object.offset.left + 'px';
style.top=object.offset.top + 'px';
};
proto.getCaptionHeight=function(media, slide){
var caption=this.DOM.captionInner,
topBar=this.DOM.topBar.height,
content=caption.innerHTML,
thumbs=this.getThumbHeight();
if(this.options.caption&&this.states.caption&&media.caption){
caption.innerHTML=media.caption;
caption.height=Math.max(topBar, parseInt(caption.clientHeight, 10) )||topBar;
caption.innerHTML=content;
}else{
caption.height=thumbs ? 0:topBar;
}
slide.width=this.slider.width;
slide.height=this.slider.height - topBar - caption.height - thumbs;
};
proto.getMediaSize=function(media, slide){
var size=media.dom.size={};
switch(media.type){
case 'image':
size.width=media.dom.naturalWidth;
size.height=media.dom.naturalHeight;
break;
case 'video':
size.width=this.options.videoMaxWidth;
size.height=size.width / this.options.videoRatio;
break;
case 'iframe':
size.width=media.width ? media.width:slide.width > 680 ? slide.width * 0.8:slide.width;
size.height=media.height ? media.height:slide.height;
break;
case 'HTML':
size.width=media.width ? media.width:slide.width;
size.height=media.height ? media.height:slide.height;
break;
}};
proto.fitMediaSize=function(media, slide){
var slider=this.slider,
options=this.options,
zoom=options.zoomTo,
size=media.dom.size,
ratio=size.width / size.height,
thumbs=this.getThumbHeight(),
smallDevice=slider.width <=480||slider.height <=680,
canOverflow=['video', 'iframe', 'HTML'].indexOf(media.type) < 0,
smartResize=options.smartResize&&smallDevice,
width, height;
var viewports=[slide.height];
if(( smartResize||options.overflow)&&canOverflow){
viewports.unshift(slider.height - thumbs);
}
viewports.forEach(function(viewport){
if(!height||height < slider.height - thumbs){
width=Math.min(size.width, ratio * viewport);
width=width > slide.width ? slide.width:Math.round(width);
height=Math.ceil(1 / ratio * width);
height=height % viewport < 2 ? viewport:height;
}});
var scale=Number(( size.width / width).toFixed(3) );
zoom=zoom==='auto' ? scale:zoom;
media.dom.size={
width:width,
height:height,
scale:scale >=options.minZoom ? Math.min(options.maxZoom, zoom):1
};};
proto.setMediaOffset=function(media, slide){
var size=media.dom.size,
slider=this.slider,
topBar=this.DOM.topBar.height,
thumbs=this.getThumbHeight(),
fromTop=0;
if(size.height <=slide.height){
fromTop=topBar +(slide.height - size.height) * 0.5;
}
media.dom.offset={
top:fromTop < 0 ? 0:Math.round(fromTop),
left:Math.round(( slide.width - size.width) * 0.5)
};
media.dom.viewport={
width:slider.width,
height:slider.height - thumbs
};};
proto.mediaViewport=function(scale){
var media=this.getMedia();
if(!media.dom||!media.dom.size){
return {
top:0,
bottom:0,
left:0,
right:0
};}
var size=media.dom.size,
offset=media.dom.offset,
height=this.slider.height,
width=this.slider.width,
hGap=(height - size.height) * 0.5,
vGap=offset.top * 2 - hGap,
cGap=(hGap - vGap) * 0.5,
sGap=cGap * scale - cGap * 2 - vGap,
left=size.width / 2 *(scale - 1) - offset.left,
top=size.height * scale <=height ? cGap * scale:-size.height / 2 *(scale - 1) + height - size.height + sGap,
bottom=size.height * scale <=height ? cGap * scale:size.height / 2 *(scale - 1) + sGap;
return {
top:scale <=1 ? 0:Math.round(top),
bottom:scale <=1 ? 0:Math.round(bottom),
left:size.width * scale < width ? 0:Math.round(left),
right:size.width * scale < width ? 0:Math.round(-left)
};};
proto.setMedia=function(number){
var gallery=this.gallery,
slides=this.slides,
loop=this.states.loop,
RTL=this.isRTL(),
index=Math.round(- RTL * this.slider.position.x / slides.width),
length=gallery.initialLength - 1,
adjust=0,
toLoad=[],
i;
if(!number&&!gallery.loaded){
number=0;
for(i=0; i < slides.length; i++){
if(slides[i].firstChild.childElementCount){
number++;
}}
number +=2;
gallery.loaded=this.options.preload;
}
switch(number){
case 0:
case 1:
toLoad=[0];
break;
case 2:
case 3:
toLoad=[-1, 0, 1];
break;
default:
number=5;
toLoad=[-2, -1, 0, 1, 2];
}
if(!loop){
var maxMedia=index + toLoad[number - 1],
minMedia=index + toLoad[0];
adjust=(minMedia < 0) ? -minMedia:0;
adjust=(maxMedia > length) ? length - maxMedia:adjust;
}
toLoad=toLoad.map(function(i){
return utils.modulo(gallery.length, i + adjust + index);
});
for(i=0; i < slides.length; i++){
var slide=slides[i],
media_index=utils.modulo(gallery.length, slide.index);
if(!loop&&slide.index > media_index){
continue;
}
if(toLoad.indexOf(media_index) > -1&&slide.media!==media_index){
this.unloadMedia(slide);
this.insertMedia(media_index, i);
}}
};
proto.updateMediaInfo=function(){
var slides=this.slides,
gallery=this.gallery;
gallery.index=utils.modulo(gallery.length, slides.index);
this.isZoomable();
this.isDownloadable();
this.updateCounter();
this.updateCaption();
this.updateThumbs();
utils.dispatchEvent(this, 'modulobox', 'updateMedia', this.getMedia());
};
proto.setThumbs=function(){
var gallery=this.gallery,
thumbs=this.thumbs,
length=gallery.initialLength,
thumbnails=this.options.thumbnails,
thumbsHolder=this.DOM.thumbsHolder;
if(!thumbnails||length < 2){
this.DOM.caption.style.bottom=0;
thumbsHolder.style.visibility='hidden';
thumbsHolder.style.height=0;
thumbs.height =
thumbs.gutter=0;
return;
}
var sizes=this.options.thumbnailSizes,
screenW=Math.max(window.innerWidth, Math.max(screen.width, screen.height) ),
thumbNb=0,
i;
var widths=Object.keys(sizes).sort(function(a, b){
return a - b;
});
for(i=0; i < widths.length; i++){
var size=widths[i],
width=i===widths.length - 1 ? screenW:Math.min(screenW, size),
number=Math.ceil(width /(sizes[size].width + sizes[size].gutter) * 2);
if(isFinite(number)&&number > thumbNb){
thumbNb=number;
}
if(size >=screenW){
break;
}}
var fragment=document.createDocumentFragment();
length=length > 50 ? Math.min(thumbNb, length):length;
for(i=0; i < length; i++){
var thumb=utils.createEl('div', this.pre + '-thumb');
fragment.appendChild(thumb);
}
this.DOM.thumbsInner.appendChild(fragment);
this.setThumbsPosition();
};
proto.thumbClick=function(event){
var target=event.target;
if(!utils.hasClass(target, this.pre + '-thumb') ){
target=target.parentNode;
}
if(parseInt(target.index, 10) >=0){
this.slideTo(target.index);
}};
proto.loadThumb=function(thumb, index){
var media=this.gallery[index],
src;
if(!media.thumb||typeof media.thumb!=='object'){
src=media.thumb;
media.thumb=utils.createEl('div', this.pre + '-thumb-bg');
media.thumb.style.backgroundImage=src&&src.indexOf('.json') < 0 ? 'url(' + src + ')':null;
if(media.type==='video'){
utils.addClass(media.thumb, this.pre + '-thumb-video');
utils.addClass(media.thumb, this.pre + '-thumb-loaded');
}}
var method=thumb.firstChild ? 'replaceChild':'appendChild';
thumb[method](media.thumb, thumb.firstChild);
thumb.media=index;
if(src){
var dom=new Image();
dom.onload=function(){
utils.addClass(media.thumb, this.pre + '-thumb-loaded');
}.bind(this);
dom.src=src;
}};
proto.updateThumbs=function(){
var gallery=this.gallery;
if(!this.options.thumbnails||gallery.initialLength < 2){
return;
}
var thumbs=this.thumbs,
position=this.getThumbPosition(thumbs);
thumbs.stopAnimate();
if(position===thumbs.position.x){
this.shiftThumbs(thumbs);
return;
}
if(Math.abs(position - thumbs.position.x) > 50 * thumbs.size){
this.DOM.thumbsHolder.style.visibility='hidden';
thumbs.position.x=position;
utils.translate(this.DOM.thumbsInner, position, 0);
this.renderThumbs(thumbs);
this.DOM.thumbsHolder.style.visibility='';
}else{
thumbs.startAnimate();
thumbs.releaseDrag();
thumbs.animateTo({
x:position
});
}};
proto.updateCaption=function(){
if(this.options.caption){
var media=this.getMedia(),
content=media.caption ? media.caption:'',
caption=this.DOM.captionInner;
if(caption.innerHTML!==content){
caption.innerHTML=content;
}}
};
proto.updateCounter=function(){
if(this.options.counterMessage){
var gallery=this.gallery,
length=gallery.initialLength,
index=utils.modulo(length, gallery.index),
message=this.options.counterMessage,
content=message.replace('[index]', index + 1).replace('[total]', length),
counter=this.DOM.counter;
if(counter.textContent!==content){
counter.textContent=content;
}}
};
proto.wrapAround=function(){
var loop=this.options.loop,
gallery=this.gallery,
length=gallery.length;
if(!gallery.initialLength){
gallery.initialLength=length;
}
this.states.loop=loop&&loop <=length ? true:false;
if(this.states.loop&&length < this.slides.length){
var add=Math.ceil(this.slides.length / length) * length - length;
for(var i=0; i < add; i++){
var index=length + i;
gallery[index]=utils.cloneObject(gallery[utils.modulo(length, i)]);
gallery[index].index=index;
}}
};
proto.setSlider=function(){
var slider=this.slider,
slides=this.slides;
this.setSizes(slider, slides);
this.setSliderPosition(slider, slides);
this.setSlidesPositions(slides);
this.DOM.overlay.style.opacity=1;
};
proto.setSizes=function(slider, slides){
slider.width=document.body.clientWidth;
slider.height=window.innerHeight;
slides.width=slider.width + Math.round(slider.width * this.options.spacing);
};
proto.setSlidesPositions=function(slides){
for(var i=0; i < slides.length; i++){
slides[i].position=null;
this.setCellPosition(i);
}
this.shiftSlides();
};
proto.setThumbsPosition=function(){
if(!this.options.thumbnails||this.gallery.initialLength < 2){
return;
}
var thumbs=this.thumbs,
slider=this.slider,
holder=this.DOM.thumbsHolder,
inner=this.DOM.thumbsInner,
sizes=this.options.thumbnailSizes,
RTL=this.options.rightToLeft,
widths=Object.keys(sizes).sort(function(a, b){ return b - a; }),
width=Math.max.apply(null, widths),
browser=window.innerWidth,
size;
for(var i=0; i < widths.length; i++){
size=Number(widths[i]);
if(browser <=size){
width=size;
}}
thumbs.width=Number(sizes[width].width);
thumbs.gutter=Number(sizes[width].gutter);
thumbs.height=Number(sizes[width].height);
thumbs.size=thumbs.width + thumbs.gutter;
thumbs.length=this.gallery.initialLength;
var totalWidth=thumbs.length * thumbs.size;
thumbs.bound={
left: 0,
right: totalWidth > slider.width ? slider.width - totalWidth:0
};
if(RTL){
thumbs.bound.right=totalWidth > slider.width ? slider.width - thumbs.size:totalWidth - thumbs.size;
thumbs.bound.left=totalWidth - thumbs.size;
}
if(this.options.thumbnailsNav==='centered'){
thumbs.bound={
left:totalWidth > slider.width ? Math.floor(slider.width * 0.5 - thumbs.size * 0.5):Math.floor(totalWidth * 0.5 - thumbs.size * 0.5),
right:totalWidth > slider.width ? Math.ceil(slider.width * 0.5 - totalWidth + thumbs.size * 0.5):-Math.ceil(totalWidth * 0.5 - thumbs.size * 0.5)
};
if(RTL){
thumbs.bound.right=thumbs.bound.left;
thumbs.bound.left=thumbs.bound.left + totalWidth - thumbs.size;
}}
thumbs.resetAnimate();
var position=this.getThumbPosition(thumbs);
thumbs.position.x=position;
utils.translate(inner, position, 0);
var hasHeight=this.getThumbHeight();
holder.style.visibility=hasHeight ? '':'hidden';
holder.style.height=hasHeight ? hasHeight + 'px':'';
inner.style.height=hasHeight ? thumbs.height + Math.min(10, thumbs.gutter) + 'px':'';
inner.style.width=thumbs.length * thumbs.size + 'px';
inner.style.right=totalWidth > slider.width&&RTL ? 'auto':'';
};
proto.getThumbPosition=function(thumbs){
var slider=this.slider,
gallery=this.gallery,
thumbNav=this.options.thumbnailsNav,
RTL=this.isRTL(),
left=RTL < 0 ? 'right':'left',
index=utils.modulo(gallery.initialLength, gallery.index),
centered=slider.width * 0.5 - thumbs.size * 0.5,
position=thumbs.bound[left] - index * thumbs.size * RTL;
position = !thumbs.bound[left] ? position + centered:position + (RTL < 0&&thumbNav!=='centered' ? - centered:0);
return Math.max(thumbs.bound.right, Math.min(thumbs.bound.left, position) );
};
proto.setCellPosition=function(index){
var cell=this.cells[index];
cell.resetAnimate();
utils.translate(this.slides[index].children[0], 0, 0, 1);
};
proto.setSliderPosition=function(slider, slides){
var RTL=this.options.rightToLeft,
posX=- slides.index * slides.width;
posX=RTL ? - posX:posX;
slider.resetAnimate();
slider.position.x =
slider.attraction.x=posX;
slider.bound={
left:0,
right:-(this.gallery.length - 1) * slides.width
};
if(RTL){
slider.bound.left=- slider.bound.right;
slider.bound.right=0;
}
utils.translate(this.DOM.slider, posX, 0);
};
proto.setAnimation=function(){
var slider=this.DOM.slider,
friction=this.options.friction,
attraction=this.options.attraction;
this.slider=new Animate(
slider,
{ x:0, y:0 },
Math.min(Math.max(friction.slider, 0), 1),
Math.min(Math.max(attraction.slider, 0), 1)
);
this.slider.on('settle.toanimate', this.settleSider.bind(this) );
this.slider.on('render.toanimate', this.renderSlider.bind(this) );
var slides=slider.children,
length=slides.length;
for(var i=0; i < length; i++){
this.cells[i]=new Animate(
slides[i].children[0],
{ x:0, y:0, s:1 },
Math.min(Math.max(friction.slide, 0), 1),
Math.min(Math.max(attraction.slide, 0), 1)
);
this.cells[i].on('settle.toanimate', this.settleCell.bind(this) );
this.cells[i].on('render.toanimate', this.renderCell.bind(this) );
}
this.thumbs=new Animate(
this.DOM.thumbsInner,
{ x:0 },
Math.min(Math.max(friction.thumbs, 0), 1),
Math.min(Math.max(attraction.thumbs, 0), 1)
);
this.thumbs.on('settle.toanimate', this.settleThumbs.bind(this) );
this.thumbs.on('render.toanimate', this.renderThumbs.bind(this) );
};
proto.settleSider=function(slider){
var media;
utils.dispatchEvent(this, 'modulobox', 'sliderSettled', slider.position);
if(this.states.open){
this.setMedia();
this.replaceState();
}
if(this.options.fadeIfSettle){
var slides=this.slides;
for(var i=0; i < slides.length; i++){
var index=slides[i].media;
media=this.gallery[index];
if(media.dom.loaded){
this.showMedia(media, i);
}}
}};
proto.settleCell=function(cell){
var gesture=this.gesture;
if(gesture.closeBy){
utils.dispatchEvent(this, 'modulobox', 'panYSettled', null, cell.position);
}
if(( gesture.closeBy&&gesture.canClose===false)||!gesture.closeBy){
utils.dispatchEvent(this, 'modulobox', 'panZoomSettled', null, cell.position);
}};
proto.settleThumbs=function(thumbs){
utils.dispatchEvent(this, 'modulobox', 'thumbsSettled', null, thumbs.position);
};
proto.renderSlider=function(slider){
this.shiftSlides();
var RTL=this.isRTL(),
length=this.gallery.initialLength,
indexPos=- RTL * slider.position.x / this.slides.width,
moduloPos=utils.modulo(length, indexPos),
progress=(moduloPos > length - 0.5 ? 0:moduloPos) /(length - 1);
utils.dispatchEvent(this, 'modulobox', 'sliderProgress', null, Math.min(1, Math.max(0, progress) ));
};
proto.renderCell=function(cell){
this.willClose(cell);
var progress;
if(this.gesture.type==='panY'||this.gesture.closeBy||(this.gesture.type==='dragSlider'&&cell.position.y!==0) ){
progress=1 - Math.abs(cell.position.y) /(this.slider.height * 0.5);
utils.dispatchEvent(this, 'modulobox', 'panYProgress', null, progress);
}
if(this.gesture.type!=='panY'&&cell.position.s!==1){
progress=cell.position.s;
utils.dispatchEvent(this, 'modulobox', 'panZoomProgress', null, progress);
}};
proto.renderThumbs=function(thumbs){
this.shiftThumbs(thumbs);
var progress=thumbs.bound.left!==thumbs.bound.right ?(thumbs.bound.left - thumbs.position.x) /(thumbs.bound.left - thumbs.bound.right):0;
utils.dispatchEvent(this, 'modulobox', 'thumbsProgress', null, progress);
};
proto.touchStart=function(event){
var element=event.target,
tagName=element.tagName,
className=element.className;
if(event.which!==3&&element!==this.buttons.play){
this.stopSlideShow();
}
if(event.which===3||!this.isEl(event)||['BUTTON', 'VIDEO', 'INPUT', 'A'].indexOf(tagName) > -1){
return;
}
if(tagName==='IMG'&&this.gallery.length > 1){
utils.addClass(this.DOM.holder, this.pre + '-dragging');
}
event.preventDefault();
if(utils.hasClass(this.DOM.holder, this.pre + '-open-tooltip') ){
return;
}
if(!this.pointers.length){
this.gesture.canClose=undefined;
utils.handleEvents(this, window, this.dragEvents.move, 'touchMove');
utils.handleEvents(this, window, this.dragEvents.end, 'touchEnd');
}
this.addPointer(event);
if(className.indexOf('-thumb') < 0){
this.slider.stopAnimate();
var cell=this.getCell();
if(Math.round(cell.position.s * 100) / 100!==1||this.pointers.length===2||this.gesture.closeBy){
cell.stopAnimate();
}}else{
this.thumbs.stopAnimate();
}
this.gestures('start');
};
proto.touchMove=function(event){
this.updatePointer(event);
var gesture=this.gesture;
var pointerNb=this.pointers.length;
var isSettle=this.isSliderSettle();
this.switchPointers();
this.gestures('move');
if(gesture.type){
this[gesture.type](event);
utils.dispatchEvent(this, 'modulobox', gesture.type + 'Move', event, gesture);
gesture.move=true;
}
else if(( pointerNb===2&&isSettle) ||
Math.abs(gesture.dx) > this.options.threshold ||
Math.abs(gesture.dy) > this.options.threshold){
gesture.sx +=gesture.dx;
gesture.sy +=gesture.dy;
gesture.canZoom=this.isZoomable();
gesture.closeBy=false;
gesture.type=Math.abs(gesture.dx) < Math.abs(gesture.dy) / 2 ? false:'dragSlider';
gesture.type=this.options.dragToClose&&!gesture.type&&isSettle ? 'panY':gesture.type;
gesture.type=(this.options.pinchToZoom||this.states.zoom)&&gesture.canZoom&&isSettle&&(pointerNb===2||this.states.zoom) ? 'panZoom':gesture.type;
gesture.type=this.options.pinchToClose&&gesture.scale < 1&&isSettle&&pointerNb===2 ? 'panZoom':gesture.type;
gesture.type=event.target.className.indexOf('-thumb') > -1 ? 'dragThumbs':gesture.type;
if(gesture.type==='dragSlider'){
this.setMedia();
}
if(['dragSlider', 'dragThumbs'].indexOf(gesture.type) > -1){
var cell=this.getCell();
cell.startAnimate();
cell.releaseDrag();
cell.animateTo({
x:0,
y:0,
s:1
});
}
if(gesture.type!=='dragSlider'){
var slider=this.slider,
slides=this.slides;
var RTL=this.isRTL();
if(- RTL * slider.position.x!==slides.index * slides.width){
slider.startAnimate();
slider.releaseDrag();
}}
if(gesture.type){
this.pauseVideo();
utils.dispatchEvent(this, 'modulobox', gesture.type + 'Start', event, gesture);
if(this.gallery.length > 1||gesture.type!=='dragSlider'){
utils.addClass(this.DOM.holder, this.pre + '-dragging');
}}
}};
proto.touchEnd=function(event){
this.deletePointer(event);
if(!this.pointers.length){
utils.removeClass(this.DOM.holder, this.pre + '-dragging');
utils.handleEvents(this, window, this.dragEvents.move, 'touchMove', false);
utils.handleEvents(this, window, this.dragEvents.end, 'touchEnd', false);
if(this.isSliderSettle()){
var className=event.target.className;
if(utils.hasClass(event.target, this.pre + '-video') ){
this.appendVideo();
}else if(this.options.tapToClose&&!this.states.zoom&&(className===this.pre + '-item-inner'||className===this.pre + '-top-bar')&&Math.abs(this.gesture.dx) < this.options.threshold){
this.close();
return;
}
if(event.target.tagName==='IMG'){
this.doubleTap(event);
}}
if(this.options.thumbnails&&!this.gesture.move){
this.thumbClick(event);
}
var gestureEnd=this.gesture.type + 'End';
if(this.gesture.type&&typeof this[gestureEnd]==='function'){
this[gestureEnd](event);
utils.dispatchEvent(this, 'modulobox', gestureEnd, event, this.gesture);
}
this.gesture.type =
this.gesture.move=false;
if(!this.states.open){
return;
}
var cell=this.getCell();
if(!cell.settle){
cell.startAnimate();
cell.releaseDrag();
}
var slider=this.slider;
if(!slider.settle){
slider.startAnimate();
slider.releaseDrag();
}}
};
proto.switchPointers=function(){
if(this.gesture.type==='panZoom'&&this.pointers.length===1&&this.gesture.distance!==0){
var moving=this.getCell();
moving.stopAnimate();
moving.startAnimate();
this.gesture.move=false;
this.gestures('start');
this.gestures('move');
}};
proto.doubleTap=function(event){
event.preventDefault();
var touches=this.mapPointer(event),
clientX=touches[0].clientX,
clientY=touches[0].clientY;
if(typeof this.tap!=='undefined' &&
+new Date() - this.tap.delay < 350 &&
Math.abs(this.tap.deltaX - clientX) < 30 &&
Math.abs(this.tap.deltaY - clientY) < 30 
){
if(this.states.tapIdle){
clearTimeout(this.states.tapIdle);
}
if(this.options.doubleTapToZoom){
this.zoomTo(clientX, clientY);
}
this.tap=undefined;
}else{
if(this.browser.touchDevice&&this.options.timeToIdle&&!this.states.idle){
this.states.tapIdle=setTimeout(function(){
var method = !utils.hasClass(this.DOM.holder, this.pre + '-idle') ? 'add':'remove';
utils[method + 'Class'](this.DOM.holder, this.pre + '-idle');
}.bind(this), 350);
}
this.tap={
delay:+new Date(),
deltaX:touches[0].clientX,
deltaY:touches[0].clientY
};}};
proto.isSliderSettle=function(){
if(this.gesture.type){
return false;
}
var RTL=this.isRTL(),
slides=this.slides,
width=slides.width,
toSettle=Math.abs(RTL * this.slider.position.x + slides.index * width) / width * 100;
return toSettle <=3 ? true:false;
};
proto.mapPointer=function(event){
return event.touches ? event.changedTouches:[event];
};
proto.addPointer=function(event){
var pointers=this.mapPointer(event);
for(var i=0; i < pointers.length; i++){
if(this.pointers.length < 2&&['dragSlider', 'panY', 'dragThumbs'].indexOf(this.gesture.type)===-1){
var ev=pointers[i],
id=ev.pointerId!==undefined ? ev.pointerId:ev.identifier;
if(!this.getPointer(id) ){
this.pointers[this.pointers.length]={
id:id,
x:Math.round(ev.clientX),
y:Math.round(ev.clientY)
};}}
}};
proto.updatePointer=function(event){
var pointers=this.mapPointer(event);
for(var i=0; i < pointers.length; i++){
var ev=pointers[i],
id=ev.pointerId!==undefined ? ev.pointerId:ev.identifier,
pt=this.getPointer(id);
if(pt){
pt.x=Math.round(ev.clientX);
pt.y=Math.round(ev.clientY);
}}
};
proto.deletePointer=function(event){
var pointers=this.mapPointer(event);
for(var i=0; i < pointers.length; i++){
var ev=pointers[i],
id=ev.pointerId!==undefined ? ev.pointerId:ev.identifier;
for(var p=0; p < this.pointers.length; p++){
if(this.pointers[p].id===id){
this.pointers.splice(p, 1);
}}
}};
proto.getPointer=function(id){
for(var k in this.pointers){
if(this.pointers[k].id===id){
return this.pointers[k];
}}
return null;
};
proto.gestures=function(type){
var g=this.gesture,
pointers=this.pointers,
distance;
if(!pointers.length){
return;
}
g.direction=g.x ? pointers[0].x > g.x ? 1:-1:0;
g.x=pointers[0].x;
g.y=pointers[0].y;
if(pointers.length===2){
var x2=pointers[1].x,
y2=pointers[1].y;
distance=this.getDistance([g.x, g.y], [x2, y2]);
g.x=g.x -(g.x - x2) / 2;
g.y=g.y -(g.y - y2) / 2;
}
if(type==='start'){
g.dx=0;
g.dy=0;
g.sx=g.x;
g.sy=g.y;
g.distance=distance ? distance:0;
}else{
g.dx=g.x - g.sx;
g.dy=g.y - g.sy;
g.scale=distance&&g.distance ? distance / g.distance:1;
}};
proto.getDistance=function(p1, p2){
var x=p2[0] - p1[0],
y=p2[1] - p1[1];
return Math.sqrt(( x * x) +(y * y) );
};
proto.panY=function(){
var moving=this.getCell();
moving.startAnimate();
moving.updateDrag({
x:moving.position.x,
y:moving.start.y + this.gesture.dy,
s:moving.position.s
});
};
proto.panYEnd=function(){
var posY=0,
moving=this.getCell(),
height=this.slider.height,
resting=moving.resting.y;
if(1 - Math.abs(resting) /(height * 0.5) < 0.8){
posY=Math.abs(resting) < height * 0.5 ? Math.abs(resting) / resting * height * 0.5:resting;
this.close();
moving.animateTo({
x:0,
y:posY,
s:posY ? moving.resting.s:1
});
moving.startAnimate();
moving.releaseDrag();
}};
proto.panZoom=function(){
var moving=this.getCell(),
gesture=this.gesture,
bound=this.mediaViewport(moving.position.s),
minZoom=this.options.pinchToClose&&gesture.canClose ? 0.1:0.6,
scale=Math.min(this.options.maxZoom * 1.5, Math.max(minZoom, moving.start.s * gesture.scale) ),
posX=moving.start.x + gesture.dx,
posY=moving.start.y + gesture.dy,
centerX=gesture.sx - this.slider.width * 0.5,
centerY=gesture.sy - this.slider.height * 0.5;
if(!gesture.canZoom||(!this.options.pinchToZoom&&!this.states.zoom) ){
scale=Math.min(1, scale);
}
if(!this.options.pinchToZoom&&this.states.zoom){
scale=moving.position.s;
}
if(!gesture.move&&this.pointers.length===1){
moving.start.x +=posX > bound.left ? posX - bound.left:posX < bound.right ? posX - bound.right:0;
moving.start.y +=posY > bound.bottom ? posY - bound.bottom:posY < bound.top ? posY - bound.top:0;
}
posX=gesture.dx + centerX +(moving.start.x - centerX) *(scale / moving.start.s);
posY=gesture.dy + centerY +(moving.start.y - centerY) *(scale / moving.start.s);
if(this.pointers.length===1){
posX=posX > bound.left ?(posX + bound.left) * 0.5:posX < bound.right ?(posX + bound.right) * 0.5:posX;
posY=posY > bound.bottom ?(posY + bound.bottom) * 0.5:posY < bound.top ?(posY + bound.top) * 0.5:posY;
}
moving.startAnimate();
moving.updateDrag({
x:posX,
y:posY,
s:scale
});
this.updateZoom(scale);
};
proto.panZoomEnd=function(){
var moving=this.getCell(),
gesture=this.gesture,
scale=moving.resting.s > this.options.maxZoom ? this.options.maxZoom:moving.resting.s < 1 ? 1:moving.resting.s,
bound=this.mediaViewport(scale),
posX, posY;
if(Math.round(moving.resting.s * 10) / 10 > this.options.maxZoom){
var centerX=gesture.distance ? gesture.sx - this.slider.width * 0.5:0;
var centerY=gesture.distance ? gesture.sy - this.slider.height * 0.5:0;
posX=gesture.dx + centerX +(moving.start.x - centerX) *(scale / moving.start.s);
posY=gesture.dy + centerY +(moving.start.y - centerY) *(scale / moving.start.s);
posX=posX > bound.left ? bound.left:posX < bound.right ? bound.right:posX;
posY=posY > bound.bottom ? bound.bottom:posY < bound.top ? bound.top:posY;
}else{
posX=moving.resting.x > bound.left ? bound.left:moving.resting.x < bound.right ? bound.right:undefined;
posY=moving.resting.y > bound.bottom ? bound.bottom:moving.resting.y < bound.top ? bound.top:undefined;
}
if(this.options.pinchToClose&&moving.resting.s < 0.8&&gesture.canClose){
scale=moving.resting.s < 0.3 ? moving.resting.s:0.15;
posX=moving.resting.x;
posY=moving.resting.y;
this.close();
}
moving.animateTo({
x:posX,
y:posY,
s:scale!==moving.resting.s ? scale:undefined
});
moving.startAnimate();
moving.releaseDrag();
this.updateZoom(moving.resting.s);
};
proto.dragThumbs=function(){
var moving=this.thumbs,
bound=moving.bound,
posX=moving.start.x + this.gesture.dx;
if(!this.gesture.move){
moving.start.x +=posX > bound.left ? posX - bound.left:posX < bound.right ? posX - bound.right:0;
posX=moving.start.x + this.gesture.dx;
}
posX=posX > bound.left ?(posX + bound.left) * 0.5:posX < bound.right ?(posX + bound.right) * 0.5:posX;
moving.startAnimate();
moving.attraction.x=undefined;
moving.updateDrag({
x:posX
});
};
proto.dragThumbsEnd=function(){
var moving=this.thumbs,
bound=moving.bound,
posX=moving.resting.x;
posX=posX > bound.left ? bound.left:posX < bound.right ? bound.right:posX;
if(posX!==moving.resting.x){
moving.animateTo({
x: posX
});
}
moving.startAnimate();
moving.releaseDrag();
};
proto.dragSlider=function(){
if(this.gallery.length===1){
return;
}
var moving=this.slider,
posX=moving.start.x + this.gesture.dx;
if(!this.states.loop){
var bound=moving.bound;
if(!this.gesture.move){
moving.start.x +=posX > bound.left ? posX - bound.left:posX < bound.right ? posX - bound.right:0;
posX=moving.start.x + this.gesture.dx;
}
posX=posX > bound.left ?(posX + bound.left) * 0.5:posX < bound.right ?(posX + bound.right) * 0.5:posX;
}
moving.startAnimate();
moving.updateDrag({
x:posX
});
};
proto.dragSliderEnd=function(){
if(this.gallery.length===1){
return;
}
var moving=this.slider,
slides=this.slides,
oldIndex=slides.index,
RTL=this.isRTL(),
restingX=moving.resting.x,
positionX=moving.position.x;
this.getRestingIndex(positionX, restingX);
if(oldIndex!==slides.index){
this.updateMediaInfo();
}
this.slider.animateTo({
x:- RTL * slides.index * slides.width,
y:undefined,
s:undefined
});
moving.startAnimate();
moving.releaseDrag();
};
proto.getRestingIndex=function(positionX, restingX){
var direction=this.gesture.direction,
gallery=this.gallery,
slides=this.slides,
deltaX=this.gesture.dx,
RTL=this.isRTL(),
index=Math.round(- RTL * positionX / slides.width),
moved=Math.abs(restingX - positionX);
if(Math.abs(deltaX) < slides.width * 0.5&&moved){
if(deltaX > 0&&direction > 0){
index -=1 * RTL;
}else if(deltaX < 0&&direction < 0){
index +=1 * RTL;
}}
var gap=Math.max(-1, Math.min(1, index - slides.index) );
if(!this.states.loop &&
(( gallery.index + gap < 0) ||
(gallery.index + gap > gallery.length - 1) )){
return;
}
slides.index +=gap;
};
proto.shiftSlides=function(){
var slides=this.slides,
gallery=this.gallery,
loop=this.states.loop,
RTL=this.isRTL(),
from=RTL * Math.round(- this.slider.position.x / slides.width) - 2,
to=from + 5;
if(!loop&&to > gallery.initialLength - 1){
from=gallery.initialLength - 5;
to=from + 5;
}
if(!loop&&from < 0){
from=0;
to=5;
}
for(var i=from; i < to; i++){
var position=RTL * i * slides.width,
slide_index=utils.modulo(slides.length, i),
slide=slides[slide_index];
if(slide.index!==i||slide.position!==position){
slide.index=i;
slide.position=position;
slide.style.left=position + 'px';
}}
if(this.states.open){
this.setMedia(3);
}};
proto.shiftThumbs=function(thumbs){
var child=this.DOM.thumbsInner.children,
slider=this.slider,
gallery=this.gallery,
RTL=this.isRTL(),
length=child.length,
index=utils.modulo(gallery.initialLength, gallery.index),
width=thumbs.size *(length) * 0.5,
center=Math.round(( - RTL * thumbs.position.x + RTL * width * 0.5) / thumbs.size),
from=Math.max(0, center - Math.floor(length / 2) ),
to=from + length;
var tolerance=slider.width * 0.5,
boundLeft=thumbs.position.x + tolerance,
boundRight=thumbs.position.x - slider.width - tolerance;
if(to > gallery.initialLength){
to=gallery.initialLength;
from=to - length;
}
if(to===gallery.initialLength - 1&&from - to < length){
from=gallery.initialLength - length;
}
for(var i=from; i < to; i++){
var thumb=child[utils.modulo(length, i)],
position=RTL * i * thumbs.size + thumbs.gutter * 0.5,
className=this.pre + '-active-thumb',
isActive=utils.hasClass(thumb, className);
if(thumb.index!==i||thumb.position!==position){
thumb.index=i;
thumb.position=position;
thumb.style.left=position + 'px';
}
this.setThumbSize(thumb, thumbs);
if(- thumb.position <=boundLeft&&- thumb.position >=boundRight&&thumb.media!==i){
this.loadThumb(thumb, i);
}
if(isActive&&index!==i){
utils.removeClass(thumb, className);
}else if(!isActive&&index===i){
utils.addClass(thumb, className);
}}
};
proto.setThumbSize=function(thumb, thumbs){
if(thumb.width!==thumbs.width ||
thumb.height!==thumbs.height ||
thumb.gutter!==thumbs.gutter){
thumb.width=thumbs.width;
thumb.height=thumbs.height;
thumb.gutter=thumbs.gutter;
thumb.style.width=thumbs.width + 'px';
thumb.style.height=thumbs.height + 'px';
}};
proto.willClose=function(cell){
var opacity=this.DOM.overlay.style.opacity,
canClose=this.gesture.canClose,
gestureType=this.gesture.type,
gestureClose=this.gesture.closeBy,
pinchToClose=gestureType==='panZoom'||gestureClose==='panZoom',
dragYToClose=gestureType==='panY'||gestureClose==='panY';
if(cell.position.s > 1.1&&typeof canClose==='undefined'){
this.gesture.canClose=false;
}else if(cell.position.s < 1&&typeof canClose==='undefined'){
this.gesture.canClose=true;
}
if(this.options.pinchToClose&&pinchToClose&&this.gesture.canClose){
opacity=cell.position.s;
this.gesture.closeBy='panZoom';
}else if(dragYToClose){
opacity=1 - Math.abs(cell.position.y) /(this.slider.height * 0.5);
this.gesture.closeBy='panY';
}else if(opacity&&opacity < 1){
opacity=1;
this.gesture.closeBy=false;
}
opacity = !opacity ? 1:Math.max(0, Math.min(1, opacity) );
var method=opacity <=0.8||!opacity ? 'add':'remove';
utils[method + 'Class'](this.DOM.holder, this.pre + '-will-close');
this.DOM.overlay.style.opacity=opacity;
};
proto.prev=utils.throttle(function(){
if(!this.gesture.move){
this.slideTo(this.slides.index - 1 * this.isRTL());
}}, 120);
proto.next=utils.throttle(function(){
if(!this.gesture.move){
this.slideTo(this.slides.index + 1 * this.isRTL());
}}, 120);
proto.slideTo=function(to, slideShow){
var slides=this.slides,
gallery=this.gallery,
holder=this.DOM.slider,
RTL=this.isRTL(),
length=gallery.initialLength,
moduloTo=utils.modulo(length, to),
moduloFrom=utils.modulo(length, gallery.index),
slideBy=moduloTo - moduloFrom,
fromEnds=length - Math.abs(slideBy);
if(!this.states.loop&&(to < 0||to > this.gallery.initialLength - 1) ){
return;
}
if(this.states.loop&&fromEnds < 3&&fromEnds * 2 < length){
slideBy=slideBy < 0 ? fromEnds:-fromEnds;
}
if(moduloTo===to){
to=slides.index + slideBy;
}
slideBy=to - slides.index;
if(!slideBy){
return;
}
if(this.states.zoom){
this.zoom();
}
this.pauseVideo();
this.share();
if(!slideShow){
this.stopSlideShow();
}
slides.index=to;
var slider=this.slider;
if(Math.abs(slideBy) > 2){
utils.addClass(holder, this.pre + '-hide');
this.setSliderPosition(slider, slides);
this.setSlidesPositions(slides);
var moveBy=RTL * slides.width * Math.min(2, Math.abs(slideBy) ) * Math.abs(slideBy) / slideBy;
slider.position.x   =
slider.attraction.x=slider.position.x + moveBy;
utils.translate(holder, slider.position.x, 0);
holder.getClientRects();
}
this.updateMediaInfo();
utils.removeClass(holder, this.pre + '-hide');
slider.startAnimate();
slider.releaseDrag();
slider.animateTo({
x:- RTL * to * slides.width,
y:0,
s:undefined
});
};
proto.keyDown=function(event){
var key=event.keyCode,
opt=this.options;
if(opt.prevNextKey){
if(key===37){
this.prev(event);
}else if(key===39){
this.next(event);
}}
if(key===27&&opt.escapeToClose){
this.close();
}
if(!opt.mouseWheel&&[32, 33, 34, 35, 36, 38, 40].indexOf(key) > -1){
event.preventDefault();
return false;
}};
proto.zoom=function(){
this.zoomTo();
};
proto.zoomTo=function(x, y, scale){
if(!this.isSliderSettle()||(!this.isZoomable()&&scale > 1) ){
return;
}
this.gesture.closeBy=false;
var media=this.getMedia();
scale=scale ? scale:this.states.zoom ? 1:media.dom.size.scale;
var cell=this.getCell(),
bound=this.mediaViewport(scale),
centX=x ? x - this.slider.width * 0.5:0,
centY=y ? y - this.slider.height * 0.5:0,
PosX=scale > 1 ? Math.ceil(centX +(cell.position.x - centX) *(scale / cell.position.s) ):0,
PosY=scale > 1 ? Math.ceil(centY +(cell.position.y - centY) *(scale / cell.position.s) ):0;
cell.startAnimate();
cell.releaseDrag();
cell.animateTo({
x:PosX > bound.left ? bound.left:PosX < bound.right ? bound.right:PosX,
y:PosY > bound.bottom ? bound.bottom:PosY < bound.top ? bound.top:PosY,
s:scale
});
this.updateZoom(scale);
};
proto.updateZoom=function(scale){
this.states.zoom=scale > 1 ? true:false;
utils[this.states.zoom ? 'addClass':'removeClass'](this.DOM.holder, this.pre + '-panzoom');
};
proto.destroy=function(){
if(!this.GUID){
return;
}
if(this.states.open){
this.close();
}
var selectors=this.options.mediaSelector,
sources='';
try {
sources=document.querySelectorAll(selectors);
} catch (error){}
for(var i=0, l=sources.length; i < l; i++){
var source=sources[i];
if(source.mobxListener){
source.removeEventListener('click', source.mobxListener, false);
}}
this.bindEvents(false);
this.slider.resetAnimate();
for(i=0; i < this.slides.length; i++){
this.cells[i].resetAnimate();
}
if(this.thumbs){
this.thumbs.resetAnimate();
}
this.DOM.holder.parentNode.removeChild(this.DOM.holder);
this.DOM.comment.parentNode.removeChild(this.DOM.comment);
delete instances[this.GUID];
delete this.DOM.holder.GUID;
delete this.GUID;
};
if(typeof jQuery!=='undefined'){
(function($){
$.ModuloBox=function(options){
return new ModuloBox(options);
};})(jQuery);
}
return ModuloBox;
}));
jQuery.easing['jswing']=jQuery.easing['swing'];
jQuery.extend(jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d){
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d){
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d){
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d){
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d){
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d){
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d){
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d){
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d){
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d){
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d){
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d){
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d){
return (t==0) ? b:c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d){
return (t==d) ? b+c:c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d){
if(t==0) return b;
if(t==d) return b+c;
if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d){
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d){
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d){
if((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b;  if((t/=d)==1) return b+c;  if(!p) p=d*.3;
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
},
easeOutElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b;  if((t/=d)==1) return b+c;  if(!p) p=d*.3;
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p) + c + b;
},
easeInOutElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b;  if((t/=d/2)==2) return b+c;  if(!p) p=d*(.3*1.5);
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d){
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d){
if((t/=d) < (1/2.75)){
return c*(7.5625*t*t) + b;
}else if(t < (2/2.75)){
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
}else if(t < (2.5/2.75)){
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
}else{
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}},
easeInOutBounce: function (x, t, b, c, d){
if(t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}});
(function(){
'use strict'
var keyCounter=0
var allWaypoints={}
function Waypoint(options){
if(!options){
throw new Error('No options passed to Waypoint constructor')
}
if(!options.element){
throw new Error('No element option passed to Waypoint constructor')
}
if(!options.handler){
throw new Error('No handler option passed to Waypoint constructor')
}
this.key='waypoint-' + keyCounter
this.options=Waypoint.Adapter.extend({}, Waypoint.defaults, options)
this.element=this.options.element
this.adapter=new Waypoint.Adapter(this.element)
this.callback=options.handler
this.axis=this.options.horizontal ? 'horizontal':'vertical'
this.enabled=this.options.enabled
this.triggerPoint=null
this.group=Waypoint.Group.findOrCreate({
name: this.options.group,
axis: this.axis
})
this.context=Waypoint.Context.findOrCreateByElement(this.options.context)
if(Waypoint.offsetAliases[this.options.offset]){
this.options.offset=Waypoint.offsetAliases[this.options.offset]
}
this.group.add(this)
this.context.add(this)
allWaypoints[this.key]=this
keyCounter +=1
}
Waypoint.prototype.queueTrigger=function(direction){
this.group.queueTrigger(this, direction)
}
Waypoint.prototype.trigger=function(args){
if(!this.enabled){
return
}
if(this.callback){
this.callback.apply(this, args)
}}
Waypoint.prototype.destroy=function(){
this.context.remove(this)
this.group.remove(this)
delete allWaypoints[this.key]
}
Waypoint.prototype.disable=function(){
this.enabled=false
return this
}
Waypoint.prototype.enable=function(){
this.context.refresh()
this.enabled=true
return this
}
Waypoint.prototype.next=function(){
return this.group.next(this)
}
Waypoint.prototype.previous=function(){
return this.group.previous(this)
}
Waypoint.invokeAll=function(method){
var allWaypointsArray=[]
for (var waypointKey in allWaypoints){
allWaypointsArray.push(allWaypoints[waypointKey])
}
for (var i=0, end=allWaypointsArray.length; i < end; i++){
allWaypointsArray[i][method]()
}}
Waypoint.destroyAll=function(){
Waypoint.invokeAll('destroy')
}
Waypoint.disableAll=function(){
Waypoint.invokeAll('disable')
}
Waypoint.enableAll=function(){
Waypoint.Context.refreshAll()
for (var waypointKey in allWaypoints){
allWaypoints[waypointKey].enabled=true
}
return this
}
Waypoint.refreshAll=function(){
Waypoint.Context.refreshAll()
}
Waypoint.viewportHeight=function(){
return window.innerHeight||document.documentElement.clientHeight
}
Waypoint.viewportWidth=function(){
return document.documentElement.clientWidth
}
Waypoint.adapters=[]
Waypoint.defaults={
context: window,
continuous: true,
enabled: true,
group: 'default',
horizontal: false,
offset: 0
}
Waypoint.offsetAliases={
'bottom-in-view': function(){
return this.context.innerHeight() - this.adapter.outerHeight()
},
'right-in-view': function(){
return this.context.innerWidth() - this.adapter.outerWidth()
}}
window.Waypoint=Waypoint
}())
;(function(){
'use strict'
function requestAnimationFrameShim(callback){
window.setTimeout(callback, 1000 / 60)
}
var keyCounter=0
var contexts={}
var Waypoint=window.Waypoint
var oldWindowLoad=window.onload
function Context(element){
this.element=element
this.Adapter=Waypoint.Adapter
this.adapter=new this.Adapter(element)
this.key='waypoint-context-' + keyCounter
this.didScroll=false
this.didResize=false
this.oldScroll={
x: this.adapter.scrollLeft(),
y: this.adapter.scrollTop()
}
this.waypoints={
vertical: {},
horizontal: {}}
element.waypointContextKey=this.key
contexts[element.waypointContextKey]=this
keyCounter +=1
if(!Waypoint.windowContext){
Waypoint.windowContext=true
Waypoint.windowContext=new Context(window)
}
this.createThrottledScrollHandler()
this.createThrottledResizeHandler()
}
Context.prototype.add=function(waypoint){
var axis=waypoint.options.horizontal ? 'horizontal':'vertical'
this.waypoints[axis][waypoint.key]=waypoint
this.refresh()
}
Context.prototype.checkEmpty=function(){
var horizontalEmpty=this.Adapter.isEmptyObject(this.waypoints.horizontal)
var verticalEmpty=this.Adapter.isEmptyObject(this.waypoints.vertical)
var isWindow=this.element==this.element.window
if(horizontalEmpty&&verticalEmpty&&!isWindow){
this.adapter.off('.waypoints')
delete contexts[this.key]
}}
Context.prototype.createThrottledResizeHandler=function(){
var self=this
function resizeHandler(){
self.handleResize()
self.didResize=false
}
this.adapter.on('resize.waypoints', function(){
if(!self.didResize){
self.didResize=true
Waypoint.requestAnimationFrame(resizeHandler)
}})
}
Context.prototype.createThrottledScrollHandler=function(){
var self=this
function scrollHandler(){
self.handleScroll()
self.didScroll=false
}
this.adapter.on('scroll.waypoints', function(){
if(!self.didScroll||Waypoint.isTouch){
self.didScroll=true
Waypoint.requestAnimationFrame(scrollHandler)
}})
}
Context.prototype.handleResize=function(){
Waypoint.Context.refreshAll()
}
Context.prototype.handleScroll=function(){
var triggeredGroups={}
var axes={
horizontal: {
newScroll: this.adapter.scrollLeft(),
oldScroll: this.oldScroll.x,
forward: 'right',
backward: 'left'
},
vertical: {
newScroll: this.adapter.scrollTop(),
oldScroll: this.oldScroll.y,
forward: 'down',
backward: 'up'
}}
for (var axisKey in axes){
var axis=axes[axisKey]
var isForward=axis.newScroll > axis.oldScroll
var direction=isForward ? axis.forward:axis.backward
for (var waypointKey in this.waypoints[axisKey]){
var waypoint=this.waypoints[axisKey][waypointKey]
if(waypoint.triggerPoint===null){
continue
}
var wasBeforeTriggerPoint=axis.oldScroll < waypoint.triggerPoint
var nowAfterTriggerPoint=axis.newScroll >=waypoint.triggerPoint
var crossedForward=wasBeforeTriggerPoint&&nowAfterTriggerPoint
var crossedBackward = !wasBeforeTriggerPoint&&!nowAfterTriggerPoint
if(crossedForward||crossedBackward){
waypoint.queueTrigger(direction)
triggeredGroups[waypoint.group.id]=waypoint.group
}}
}
for (var groupKey in triggeredGroups){
triggeredGroups[groupKey].flushTriggers()
}
this.oldScroll={
x: axes.horizontal.newScroll,
y: axes.vertical.newScroll
}}
Context.prototype.innerHeight=function(){
if(this.element==this.element.window){
return Waypoint.viewportHeight()
}
return this.adapter.innerHeight()
}
Context.prototype.remove=function(waypoint){
delete this.waypoints[waypoint.axis][waypoint.key]
this.checkEmpty()
}
Context.prototype.innerWidth=function(){
if(this.element==this.element.window){
return Waypoint.viewportWidth()
}
return this.adapter.innerWidth()
}
Context.prototype.destroy=function(){
var allWaypoints=[]
for (var axis in this.waypoints){
for (var waypointKey in this.waypoints[axis]){
allWaypoints.push(this.waypoints[axis][waypointKey])
}}
for (var i=0, end=allWaypoints.length; i < end; i++){
allWaypoints[i].destroy()
}}
Context.prototype.refresh=function(){
var isWindow=this.element==this.element.window
var contextOffset=isWindow ? undefined:this.adapter.offset()
var triggeredGroups={}
var axes
this.handleScroll()
axes={
horizontal: {
contextOffset: isWindow ? 0:contextOffset.left,
contextScroll: isWindow ? 0:this.oldScroll.x,
contextDimension: this.innerWidth(),
oldScroll: this.oldScroll.x,
forward: 'right',
backward: 'left',
offsetProp: 'left'
},
vertical: {
contextOffset: isWindow ? 0:contextOffset.top,
contextScroll: isWindow ? 0:this.oldScroll.y,
contextDimension: this.innerHeight(),
oldScroll: this.oldScroll.y,
forward: 'down',
backward: 'up',
offsetProp: 'top'
}}
for (var axisKey in axes){
var axis=axes[axisKey]
for (var waypointKey in this.waypoints[axisKey]){
var waypoint=this.waypoints[axisKey][waypointKey]
var adjustment=waypoint.options.offset
var oldTriggerPoint=waypoint.triggerPoint
var elementOffset=0
var freshWaypoint=oldTriggerPoint==null
var contextModifier, wasBeforeScroll, nowAfterScroll
var triggeredBackward, triggeredForward
if(waypoint.element!==waypoint.element.window&&waypoint.adapter.length){
elementOffset=waypoint.adapter.offset()[axis.offsetProp]
}
if(typeof adjustment==='function'){
adjustment=adjustment.apply(waypoint)
}
else if(typeof adjustment==='string'){
adjustment=parseFloat(adjustment)
if(waypoint.options.offset.indexOf('%') > - 1){
adjustment=Math.ceil(axis.contextDimension * adjustment / 100)
}}
contextModifier=axis.contextScroll - axis.contextOffset
waypoint.triggerPoint=Math.floor(elementOffset + contextModifier - adjustment)
wasBeforeScroll=oldTriggerPoint < axis.oldScroll
nowAfterScroll=waypoint.triggerPoint >=axis.oldScroll
triggeredBackward=wasBeforeScroll&&nowAfterScroll
triggeredForward = !wasBeforeScroll&&!nowAfterScroll
if(!freshWaypoint&&triggeredBackward){
waypoint.queueTrigger(axis.backward)
triggeredGroups[waypoint.group.id]=waypoint.group
}
else if(!freshWaypoint&&triggeredForward){
waypoint.queueTrigger(axis.forward)
triggeredGroups[waypoint.group.id]=waypoint.group
}
else if(freshWaypoint&&axis.oldScroll >=waypoint.triggerPoint){
waypoint.queueTrigger(axis.forward)
triggeredGroups[waypoint.group.id]=waypoint.group
}}
}
Waypoint.requestAnimationFrame(function(){
for (var groupKey in triggeredGroups){
triggeredGroups[groupKey].flushTriggers()
}})
return this
}
Context.findOrCreateByElement=function(element){
return Context.findByElement(element)||new Context(element)
}
Context.refreshAll=function(){
for (var contextId in contexts){
contexts[contextId].refresh()
}}
Context.findByElement=function(element){
return contexts[element.waypointContextKey]
}
window.onload=function(){
if(oldWindowLoad){
oldWindowLoad()
}
Context.refreshAll()
}
Waypoint.requestAnimationFrame=function(callback){
var requestFn=window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
requestAnimationFrameShim
requestFn.call(window, callback)
}
Waypoint.Context=Context
}())
;(function(){
'use strict'
function byTriggerPoint(a, b){
return a.triggerPoint - b.triggerPoint
}
function byReverseTriggerPoint(a, b){
return b.triggerPoint - a.triggerPoint
}
var groups={
vertical: {},
horizontal: {}}
var Waypoint=window.Waypoint
function Group(options){
this.name=options.name
this.axis=options.axis
this.id=this.name + '-' + this.axis
this.waypoints=[]
this.clearTriggerQueues()
groups[this.axis][this.name]=this
}
Group.prototype.add=function(waypoint){
this.waypoints.push(waypoint)
}
Group.prototype.clearTriggerQueues=function(){
this.triggerQueues={
up: [],
down: [],
left: [],
right: []
}}
Group.prototype.flushTriggers=function(){
for (var direction in this.triggerQueues){
var waypoints=this.triggerQueues[direction]
var reverse=direction==='up'||direction==='left'
waypoints.sort(reverse ? byReverseTriggerPoint:byTriggerPoint)
for (var i=0, end=waypoints.length; i < end; i +=1){
var waypoint=waypoints[i]
if(waypoint.options.continuous||i===waypoints.length - 1){
waypoint.trigger([direction])
}}
}
this.clearTriggerQueues()
}
Group.prototype.next=function(waypoint){
this.waypoints.sort(byTriggerPoint)
var index=Waypoint.Adapter.inArray(waypoint, this.waypoints)
var isLast=index===this.waypoints.length - 1
return isLast ? null:this.waypoints[index + 1]
}
Group.prototype.previous=function(waypoint){
this.waypoints.sort(byTriggerPoint)
var index=Waypoint.Adapter.inArray(waypoint, this.waypoints)
return index ? this.waypoints[index - 1]:null
}
Group.prototype.queueTrigger=function(waypoint, direction){
this.triggerQueues[direction].push(waypoint)
}
Group.prototype.remove=function(waypoint){
var index=Waypoint.Adapter.inArray(waypoint, this.waypoints)
if(index > -1){
this.waypoints.splice(index, 1)
}}
Group.prototype.first=function(){
return this.waypoints[0]
}
Group.prototype.last=function(){
return this.waypoints[this.waypoints.length - 1]
}
Group.findOrCreate=function(options){
return groups[options.axis][options.name]||new Group(options)
}
Waypoint.Group=Group
}())
;(function(){
'use strict'
var $=window.jQuery
var Waypoint=window.Waypoint
function JQueryAdapter(element){
this.$element=$(element)
}
$.each([
'innerHeight',
'innerWidth',
'off',
'offset',
'on',
'outerHeight',
'outerWidth',
'scrollLeft',
'scrollTop'
], function(i, method){
JQueryAdapter.prototype[method]=function(){
var args=Array.prototype.slice.call(arguments)
return this.$element[method].apply(this.$element, args)
}})
$.each([
'extend',
'inArray',
'isEmptyObject'
], function(i, method){
JQueryAdapter[method]=$[method]
})
Waypoint.adapters.push({
name: 'jquery',
Adapter: JQueryAdapter
})
Waypoint.Adapter=JQueryAdapter
}())
;(function(){
'use strict'
var Waypoint=window.Waypoint
function createExtension(framework){
return function(){
var waypoints=[]
var overrides=arguments[0]
if(framework.isFunction(arguments[0])){
overrides=framework.extend({}, arguments[1])
overrides.handler=arguments[0]
}
this.each(function(){
var options=framework.extend({}, overrides, {
element: this
})
if(typeof options.context==='string'){
options.context=framework(this).closest(options.context)[0]
}
waypoints.push(new Waypoint(options))
})
return waypoints
}}
if(window.jQuery){
window.jQuery.fn.waypoint=createExtension(window.jQuery)
}
if(window.Zepto){
window.Zepto.fn.waypoint=createExtension(window.Zepto)
}}())
;
(function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e<h;e++){c=g[e]+a;if(typeof b[c]=="string")return c}},i=h("transform"),j=h("transitionProperty"),k={csstransforms:function(){return!!i},csstransforms3d:function(){var a=!!h("perspective");if(a){var c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d="@media ("+c.join("transform-3d),(")+"modernizr)",e=b("<style>"+d+"{#modernizr{height:3px}}"+"</style>").appendTo("head"),f=b('<div id="modernizr" />').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[j],r=h("transitionDuration"));var s=b.event,t=b.event.handle?"handle":"dispatch",u;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",u&&clearTimeout(u),u=setTimeout(function(){s[t].apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var v=["width","height"],w=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=v.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;f<g;f++)e=d[f],this.originalStyle[e]=c[e]||"";this.element.css(this.options.containerStyle),this._updateAnimationEngine(),this._updateUsingTransforms();var h={"original-order":function(a,b){return b.elemCount++,b.elemCount},random:function(){return Math.random()}};this.options.getSortData=b.extend(this.options.getSortData,h),this.reloadItems(),this.offset={left:parseInt(this.element.css("padding-left")||0,10),top:parseInt(this.element.css("padding-top")||0,10)};var i=this;setTimeout(function(){i.element.addClass(i.options.containerClass)},0),this.options.resizable&&w.bind("smartresize.isotope",function(){i.resize()}),this.element.delegate("."+this.options.hiddenClass,"click",function(){return!1})},_getAtoms:function(a){var b=this.options.itemSelector,c=b?a.filter(b).add(a.find(b)):a,d={position:"absolute"};return c=c.filter(function(a,b){return b.nodeType===1}),this.usingTransforms&&(d.left=0,d.top=0),c.css(d).addClass(this.options.itemClass),this.updateSortData(c,!0),c},_init:function(a){this.$filteredAtoms=this._filter(this.$allAtoms),this._sort(),this.reLayout(a)},option:function(a){if(b.isPlainObject(a)){this.options=b.extend(!0,this.options,a);var c;for(var d in a)c="_update"+f(d),this[c]&&this[c]()}},_updateAnimationEngine:function(){var a=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,""),b;switch(a){case"css":case"none":b=!1;break;case"jquery":b=!0;break;default:b=!e.csstransitions}this.isUsingJQueryAnimation=b,this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){var a=this.usingTransforms=this.options.transformsEnabled&&e.csstransforms&&e.csstransitions&&!this.isUsingJQueryAnimation;a||(delete this.options.hiddenStyle.scale,delete this.options.visibleStyle.scale),this.getPositionStyles=a?this._translate:this._positionAbs},_filter:function(a){var b=this.options.filter===""?"*":this.options.filter;if(!b)return a;var c=this.options.hiddenClass,d="."+c,e=a.filter(d),f=e;if(b!=="*"){f=e.filter(b);var g=a.not(d).not(b).addClass(c);this.styleQueue.push({$el:g,style:this.options.hiddenStyle})}return this.styleQueue.push({$el:f,style:this.options.visibleStyle}),f.removeClass(c),a.filter(b)},updateSortData:function(a,c){var d=this,e=this.options.getSortData,f,g;a.each(function(){f=b(this),g={};for(var a in e)!c&&a==="original-order"?g[a]=b.data(this,"isotope-sort-data")[a]:g[a]=e[a](f,d);b.data(this,"isotope-sort-data",g)})},_sort:function(){var a=this.options.sortBy,b=this._getSorter,c=this.options.sortAscending?1:-1,d=function(d,e){var f=b(d,a),g=b(e,a);return f===g&&a!=="original-order"&&(f=b(d,"original-order"),g=b(e,"original-order")),(f>g?1:f<g?-1:0)*c};this.$filteredAtoms.sort(d)},_getSorter:function(a,c){return b.data(a,"isotope-sort-data")[c]},_translate:function(a,b){return{translate:[a,b]}},_positionAbs:function(a,b){return{left:a,top:b}},_pushPosition:function(a,b,c){b=Math.round(b+this.offset.left),c=Math.round(c+this.offset.top);var d=this.getPositionStyles(b,c);this.styleQueue.push({$el:a,style:d}),this.options.itemPositionDataEnabled&&a.data("isotope-item-position",{x:b,y:c})},layout:function(a,b){var c=this.options.layoutMode;this["_"+c+"Layout"](a);if(this.options.resizesContainer){var d=this["_"+c+"GetContainerSize"]();this.styleQueue.push({$el:this.element,style:d})}this._processStyleQueue(a,b),this.isLaidOut=!0},_processStyleQueue:function(a,c){var d=this.isLaidOut?this.isUsingJQueryAnimation?"animate":"css":"css",f=this.options.animationOptions,g=this.options.onLayout,h,i,j,k;i=function(a,b){b.$el[d](b.style,f)};if(this._isInserting&&this.isUsingJQueryAnimation)i=function(a,b){h=b.$el.hasClass("no-transition")?"css":d,b.$el[h](b.style,f)};else if(c||g||f.complete){var l=!1,m=[c,g,f.complete],n=this;j=!0,k=function(){if(l)return;var b;for(var c=0,d=m.length;c<d;c++)b=m[c],typeof b=="function"&&b.call(n.element,a,n);l=!0};if(this.isUsingJQueryAnimation&&d==="animate")f.complete=k,j=!1;else if(e.csstransitions){var o=0,p=this.styleQueue[0],s=p&&p.$el,t;while(!s||!s.length){t=this.styleQueue[o++];if(!t)return;s=t.$el}var u=parseFloat(getComputedStyle(s[0])[r]);u>0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){this.$allAtoms=this.$allAtoms.not(a),this.$filteredAtoms=this.$filteredAtoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),w.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];return this._getSegments(a),this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.colYs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryPlaceBrick(a,g)}})},_masonryPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=this.masonry.columnWidth*d,h=c;this._pushPosition(a,g,h);var i=c+a.outerHeight(!0),j=this.masonry.cols+1-f;for(e=0;e<j;e++)this.masonry.colYs[d+e]=i},_masonryGetContainerSize:function(){var a=Math.max.apply(Math,this.masonry.colYs);return{height:a}},_masonryResizeChanged:function(){return this._checkIfSegmentsChanged()},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0}},_fitRowsLayout:function(a){var c=this,d=this.element.width(),e=this.fitRows;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.x!==0&&f+e.x>d&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.rowXs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryHorizontalPlaceBrick(a,g)}})},_masonryHorizontalPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=c,h=this.masonryHorizontal.rowHeight*d;this._pushPosition(a,g,h);var i=c+a.outerWidth(!0),j=this.masonryHorizontal.rows+1-f;for(e=0;e<j;e++)this.masonryHorizontal.rowXs[d+e]=i},_masonryHorizontalGetContainerSize:function(){var a=Math.max.apply(Math,this.masonryHorizontal.rowXs);return{width:a}},_masonryHorizontalResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0}},_fitColumnsLayout:function(a){var c=this,d=this.element.height(),e=this.fitColumns;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.y!==0&&g+e.y>d&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var x=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){x("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){x("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery);
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}var f={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},g="undefined"!=typeof window?window:null,h={hasTouchCapability:!(!g||!("ontouchstart"in g||g.DocumentTouch&&g.document instanceof g.DocumentTouch||g.navigator.maxTouchPoints)),hasTransitions:e(),IE:!1,semVer:"4.2.6",window:g},i=function(){this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__instancesLatestArr=[],this.__plugins={},this._env=h};i.prototype={__bridge:function(b,c,d){if(!c[d]){var e=function(){};e.prototype=b;var g=new e;g.__init&&g.__init(c),a.each(b,function(a,b){0!=a.indexOf("__")&&(c[a]?f.debug&&console.log("The "+a+" method of the "+d+" plugin conflicts with another plugin or native methods"):(c[a]=function(){return g[a].apply(g,Array.prototype.slice.apply(arguments))},c[a].bridged=g))}),c[d]=g}return this},__setWindow:function(a){return h.window=a,this},_getRuler:function(a){return new b(a)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(b){var c=this;if("string"==typeof b){var d=b,e=null;return d.indexOf(".")>0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a(h.window.document.body).on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;B<m.length;B++){var C=m[B];"even"==A?(C>y&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=a(h.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.close(function(){b.destroy()})},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else if(d(c._$origin)&&d(c._$tooltip)){var e=null;if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{e=c.__geometry();var f=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var d=a(c),g=d.css("overflow-x"),h=d.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(e.origin.windowOffset.left<i.left||e.origin.windowOffset.right>i.right))return f=!0,!1;if("visible"!=h&&(e.origin.windowOffset.top<i.top||e.origin.windowOffset.bottom>i.bottom))return f=!0,!1}return"fixed"==d.css("position")?!1:void 0}),f)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var g=e.origin.offset.left-c.__Geometry.origin.offset.left,i=e.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+g,top:c.__lastPosition.coord.top+i})}}c._trigger({type:"scroll",event:b,geo:e})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c,d){var e=this,f=!0;if(e._trigger({type:"close",event:b,stop:function(){f=!1}}),f||d){c&&e.__callbacks.close.push(c),e.__callbacks.open=[],e.__timeoutsClear();var g=function(){a.each(e.__callbacks.close,function(a,c){c.call(e,e,{event:b,origin:e._$origin[0]})}),e.__callbacks.close=[]};if("closed"!=e.__state){var i=!0,j=new Date,k=j.getTime(),l=k+e.__options.animationDuration[1];if("disappearing"==e.__state&&l>e.__closingTime&&e.__options.animationDuration[1]>0&&(i=!1),i){e.__closingTime=l,"disappearing"!=e.__state&&e.__stateSet("disappearing");var m=function(){clearInterval(e.__tracker),e._trigger({type:"closing",event:b}),e._$tooltip.off("."+e.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+e.__namespace+"-triggerClose"),e.__$originParents.each(function(b,c){a(c).off("scroll."+e.__namespace+"-triggerClose")}),e.__$originParents=null,a(h.window.document.body).off("."+e.__namespace+"-triggerClose"),e._$origin.off("."+e.__namespace+"-triggerClose"),e._off("dismissable"),e.__stateSet("closed"),e._trigger({type:"after",event:b}),e.__options.functionAfter&&e.__options.functionAfter.call(e,e,{event:b,origin:e._$origin[0]}),g()};h.hasTransitions?(e._$tooltip.css({"-moz-animation-duration":e.__options.animationDuration[1]+"ms","-ms-animation-duration":e.__options.animationDuration[1]+"ms","-o-animation-duration":e.__options.animationDuration[1]+"ms","-webkit-animation-duration":e.__options.animationDuration[1]+"ms","animation-duration":e.__options.animationDuration[1]+"ms","transition-duration":e.__options.animationDuration[1]+"ms"}),e._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),e.__options.animationDuration[1]>0&&e._$tooltip.delay(e.__options.animationDuration[1]),e._$tooltip.queue(m)):e._$tooltip.stop().fadeOut(e.__options.animationDuration[1],m)}}else g()}return e},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="",c=a(h.window.document.body);e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),c.on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&c.on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;if(b.__destroyed)b.__destroyError();else{"closed"!=b.__state?b.option("animationDuration",0)._close(null,null,!0):b.__timeoutsClear(),b._trigger("destroy"),b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a(h.window.document.body).off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("<div></div>").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)}return b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(h.window.document.body)},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]));var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"),
this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d<e.__options.side.length;d++){var m={horizontal:0,vertical:0},n=e.__options.side[d];"top"==n||"bottom"==n?m.vertical=e.__options.distance[n]:m.horizontal=e.__options.distance[n],e.__sideChange(h,n),a.each(["natural","constrained"],function(a,d){if(l=null,e.__instance._trigger({container:k,event:b,helper:c,mode:d,results:g,satisfied:j,side:n,takeTest:function(a){l=a},type:"positionTest"}),1==l||0!=l&&0==j){var h={container:k,distance:m,fits:null,mode:d,outerSize:null,side:n,size:null,target:f[n],whole:null},o="natural"==d?i.free():i.constrain(c.geo.available[k][n].width-m.horizontal,c.geo.available[k][n].height-m.vertical),p=o.measure();if(h.size=p.size,h.outerSize={height:p.size.height+m.vertical,width:p.size.width+m.horizontal},"natural"==d?c.geo.available[k][n].width>=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a});
;(function($){
var ParallaxManager=function(options){
this.options=options;
this.vendor_prefixes=['webkit', 'moz', 'o', 'ms'];
this.num_vendor_prefixes=this.vendor_prefixes.length;
var thisBrowserSupportsStyle=function(style){
var vendors=['Webkit', 'Moz', 'ms', 'O'];
var num_vendors=vendors.length;
var dummy_el=window.document.createElement('parallax');
if(dummy_el.style[style]!==undefined){
return true;
}
style=style.replace(/./, function(first){return first.toUpperCase();});
for (var i=0; i < num_vendors; i++){
var pfx_style=vendors[i] + style;
if(dummy_el.style[pfx_style]!==undefined){
return true;
}}
return false;
};
this.has_3dtransforms=thisBrowserSupportsStyle('perspective');
if(this.has_3dtransforms&&thisBrowserSupportsStyle('WebkitPerspective')){
var $test_el=$('<div><style type="text/css">@media (transform-3d),(-webkit-transform-3d){#parallax-3dtest {position: absolute;left: 9px;height: 5px;margin: 0;padding: 0;border: 0;}</style><div id="parallax-3dtest"></div></div>').appendTo('body');
var $el=$('#parallax-3dtest');
this.has_3dtransforms=$el.height()==5&&$el.offset().left==9;
$test_el.remove();
}
this.has_2dtransforms=thisBrowserSupportsStyle('transform');
};
$.extend(ParallaxManager.prototype, {
init: function(){
this.scroll_factor=this.options.scroll_factor;
var parallax_blocks=this.parallax_blocks=[];
var image_attr=this.options.image_attr
var $body=$('body');
var $origins=this.options.origins;
$origins.each(function(){
var $origin=$(this);
var $parallax_block;
if($origin.data(image_attr)){
$parallax_block=$('<div class="parallax-block"><img class="parallax-image" src="' + $origin.data(image_attr) + '"></div>');
parallax_blocks.push({
origin: $origin,
block: $parallax_block,
bg_ratio: $origin.data('width') / $origin.data('height')
});
$body.prepend($parallax_block);
}
else if($origin.data('tile')){
$parallax_block=$('<div class="parallax-block"><div class="parallax-image" style="background-image: url(' + $origin.data('tile') + ')"></div></div>')
parallax_blocks.push({
origin: $origin,
block: $parallax_block,
bg_ratio: 1
});
$body.prepend($parallax_block);
}});
var manager=this;
var reconfigure=function(){
manager.redrawBlocks();
manager.render();
};
var $window=$(window);
$window.on('load', reconfigure);
$window.on('resize', reconfigure);
$window.on('hwparallax.reconfigure', reconfigure);
$window.on('scroll', function(){manager.render();});
},
redrawBlocks: function(){
var window_width=$(window).width();
var window_height=this.window_height=$(window).height();
var body=document.body;
var html=document.documentElement;
var document_height=Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
this.max_scrolltop=Math.max(0, document_height - window_height);
var num_parallax_blocks=this.parallax_blocks.length;
for (var i=0; i < num_parallax_blocks; i++){
var parallax_block_data=this.parallax_blocks[i];
var $parallax_block=parallax_block_data.block;
var bg_ratio=parallax_block_data.bg_ratio;
var $parallax_image=$parallax_block.children('.parallax-image');
var $origin=parallax_block_data.origin;
var origin_height=$origin.outerHeight();
var min_height=window_height - ((window_height - origin_height) * this.scroll_factor);
var img_width=window_width;
var img_height=Math.ceil(img_width / bg_ratio);
var img_xoff=0;
if(img_height < min_height){
img_height=min_height;
img_width=img_height * bg_ratio;
img_xoff=Math.floor(img_width - window_width) / 2;
}
$parallax_image.width(img_width).height(img_height);
$parallax_block.width(window_width).height(origin_height).css('visibility', 'hidden');
$.extend(parallax_block_data, {
origin_position: $origin.offset().top,
origin_height: origin_height,
image: $parallax_image,
image_xoff: img_xoff,
image_height: img_height
});
}},
render: function(){
if(!this.drawing){
this.drawing=true;
var manager=this;
if(window.requestAnimationFrame){
window.requestAnimationFrame(function(){manager.draw();}, document);
}else{
manager.draw();
}}
},
draw: function(){
var scroll_top=Math.min(Math.max(0, $(window).scrollTop()), this.max_scrolltop);
var num_blocks=this.parallax_blocks.length;
var data;
for (var i=0; i < num_blocks; i++){
data=this.parallax_blocks[i];
if(data.origin_position < scroll_top + this.window_height&&data.origin_position + data.origin_height > scroll_top){
var new_block_position=data.origin_position - scroll_top;
var new_image_position=new_block_position * (this.scroll_factor - 1);
var block_styles={
visibility: 'visible'
};
var image_styles={};
var block_transform, image_transform, prefixed_style;
var j;
if(this.has_3dtransforms){
block_transform=block_styles.transform='translate3d(0px, ' + new_block_position + 'px, 0px)';
image_transform=image_styles.transform='translate3d(-' + data.image_xoff + 'px, ' + new_image_position + 'px, 0px)';
for (j=0; j < this.num_vendor_prefixes; j++){
prefixed_style='-' + this.vendor_prefixes[j] + '-transform';
block_styles[prefixed_style]=block_transform;
image_styles[prefixed_style]=image_transform;
}}
else if(this.has_2dtransforms){
block_transform=block_styles.transform='translate(0px, ' + new_block_position + 'px)';
image_transform=image_styles.transform='translate(-' + data.image_xoff + 'px, ' + new_image_position + 'px)';
for (j=0; j < this.num_vendor_prefixes; j++){
prefixed_style='-' + this.vendor_prefixes[j] + '-transform';
block_styles[prefixed_style]=block_transform;
image_styles[prefixed_style]=image_transform;
}}else{
block_styles.top=new_block_position + 'px';
block_styles.left=0 + 'px';
image_styles.top=new_image_position + 'px';
image_styles.left=-data.image_xoff + 'px';
}
data.block.css(block_styles);
data.image.css(image_styles);
}else{
data.block.css('visibility', 'hidden');
}}
this.drawing=false;
}});
$.extend($.fn, {
parallax: function(options){
var settings=$.extend({
scroll_factor: 0.2,
image_attr: 'image'
},
options,
{
origins: $(this)
}
);
var pm=new ParallaxManager(settings);
pm.init();
}});
})(jQuery);
!function(a,b,c,d){function e(b,c){this.element=b,this.options=a.extend({},g,c),this._defaults=g,this._name=f,this.init()}var f="stellar",g={scrollProperty:"scroll",positionProperty:"position",horizontalScrolling:!0,verticalScrolling:!0,horizontalOffset:0,verticalOffset:0,responsive:!1,parallaxBackgrounds:!0,parallaxElements:!0,hideDistantElements:!0,hideElement:function(a){a.hide()},showElement:function(a){a.show()}},h={scroll:{getLeft:function(a){return a.scrollLeft()},setLeft:function(a,b){a.scrollLeft(b)},getTop:function(a){return a.scrollTop()},setTop:function(a,b){a.scrollTop(b)}},position:{getLeft:function(a){return-1*parseInt(a.css("left"),10)},getTop:function(a){return-1*parseInt(a.css("top"),10)}},margin:{getLeft:function(a){return-1*parseInt(a.css("margin-left"),10)},getTop:function(a){return-1*parseInt(a.css("margin-top"),10)}},transform:{getLeft:function(a){var b=getComputedStyle(a[0])[k];return"none"!==b?-1*parseInt(b.match(/(-?[0-9]+)/g)[4],10):0},getTop:function(a){var b=getComputedStyle(a[0])[k];return"none"!==b?-1*parseInt(b.match(/(-?[0-9]+)/g)[5],10):0}}},i={position:{setLeft:function(a,b){a.css("left",b)},setTop:function(a,b){a.css("top",b)}},transform:{setPosition:function(a,b,c,d,e){a[0].style[k]="translate3d("+(b-c)+"px, "+(d-e)+"px, 0)"}}},j=function(){var b,c=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,d=a("script")[0].style,e="";for(b in d)if(c.test(b)){e=b.match(c)[0];break}return"WebkitOpacity"in d&&(e="Webkit"),"KhtmlOpacity"in d&&(e="Khtml"),function(a){return e+(e.length>0?a.charAt(0).toUpperCase()+a.slice(1):a)}}(),k=j("transform"),l=a("<div />",{style:"background:#fff"}).css("background-position-x")!==d,m=l?function(a,b,c){a.css({"background-position-x":b,"background-position-y":c})}:function(a,b,c){a.css("background-position",b+" "+c)},n=l?function(a){return[a.css("background-position-x"),a.css("background-position-y")]}:function(a){return a.css("background-position").split(" ")},o=b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,1e3/60)};e.prototype={init:function(){this.options.name=f+"_"+Math.floor(1e9*Math.random()),this._defineElements(),this._defineGetters(),this._defineSetters(),this._handleWindowLoadAndResize(),this._detectViewport(),this.refresh({firstLoad:!0}),"scroll"===this.options.scrollProperty?this._handleScrollEvent():this._startAnimationLoop()},_defineElements:function(){this.element===c.body&&(this.element=b),this.$scrollElement=a(this.element),this.$element=this.element===b?a("body"):this.$scrollElement,this.$viewportElement=this.options.viewportElement!==d?a(this.options.viewportElement):this.$scrollElement[0]===b||"scroll"===this.options.scrollProperty?this.$scrollElement:this.$scrollElement.parent()},_defineGetters:function(){var a=this,b=h[a.options.scrollProperty];this._getScrollLeft=function(){return b.getLeft(a.$scrollElement)},this._getScrollTop=function(){return b.getTop(a.$scrollElement)}},_defineSetters:function(){var b=this,c=h[b.options.scrollProperty],d=i[b.options.positionProperty],e=c.setLeft,f=c.setTop;this._setScrollLeft="function"==typeof e?function(a){e(b.$scrollElement,a)}:a.noop,this._setScrollTop="function"==typeof f?function(a){f(b.$scrollElement,a)}:a.noop,this._setPosition=d.setPosition||function(a,c,e,f,g){b.options.horizontalScrolling&&d.setLeft(a,c,e),b.options.verticalScrolling&&d.setTop(a,f,g)}},_handleWindowLoadAndResize:function(){var c=this,d=a(b);c.options.responsive&&d.bind("load."+this.name,function(){c.refresh()}),d.bind("resize."+this.name,function(){c._detectViewport(),c.options.responsive&&c.refresh()})},refresh:function(c){var d=this,e=d._getScrollLeft(),f=d._getScrollTop();c&&c.firstLoad||this._reset(),this._setScrollLeft(0),this._setScrollTop(0),this._setOffsets(),this._findParticles(),this._findBackgrounds(),c&&c.firstLoad&&/WebKit/.test(navigator.userAgent)&&a(b).load(function(){var a=d._getScrollLeft(),b=d._getScrollTop();d._setScrollLeft(a+1),d._setScrollTop(b+1),d._setScrollLeft(a),d._setScrollTop(b)}),this._setScrollLeft(e),this._setScrollTop(f)},_detectViewport:function(){var a=this.$viewportElement.offset(),b=null!==a&&a!==d;this.viewportWidth=this.$viewportElement.width(),this.viewportHeight=this.$viewportElement.height(),this.viewportOffsetTop=b?a.top:0,this.viewportOffsetLeft=b?a.left:0},_findParticles:function(){{var b=this;this._getScrollLeft(),this._getScrollTop()}if(this.particles!==d)for(var c=this.particles.length-1;c>=0;c--)this.particles[c].$element.data("stellar-elementIsActive",d);this.particles=[],this.options.parallaxElements&&this.$element.find("[data-stellar-ratio]").each(function(){var c,e,f,g,h,i,j,k,l,m=a(this),n=0,o=0,p=0,q=0;if(m.data("stellar-elementIsActive")){if(m.data("stellar-elementIsActive")!==this)return}else m.data("stellar-elementIsActive",this);b.options.showElement(m),m.data("stellar-startingLeft")?(m.css("left",m.data("stellar-startingLeft")),m.css("top",m.data("stellar-startingTop"))):(m.data("stellar-startingLeft",m.css("left")),m.data("stellar-startingTop",m.css("top"))),f=m.position().left,g=m.position().top,h="auto"===m.css("margin-left")?0:parseInt(m.css("margin-left"),10),i="auto"===m.css("margin-top")?0:parseInt(m.css("margin-top"),10),k=m.offset().left-h,l=m.offset().top-i,m.parents().each(function(){var b=a(this);return b.data("stellar-offset-parent")===!0?(n=p,o=q,j=b,!1):(p+=b.position().left,void(q+=b.position().top))}),c=m.data("stellar-horizontal-offset")!==d?m.data("stellar-horizontal-offset"):j!==d&&j.data("stellar-horizontal-offset")!==d?j.data("stellar-horizontal-offset"):b.horizontalOffset,e=m.data("stellar-vertical-offset")!==d?m.data("stellar-vertical-offset"):j!==d&&j.data("stellar-vertical-offset")!==d?j.data("stellar-vertical-offset"):b.verticalOffset,b.particles.push({$element:m,$offsetParent:j,isFixed:"fixed"===m.css("position"),horizontalOffset:c,verticalOffset:e,startingPositionLeft:f,startingPositionTop:g,startingOffsetLeft:k,startingOffsetTop:l,parentOffsetLeft:n,parentOffsetTop:o,stellarRatio:m.data("stellar-ratio")!==d?m.data("stellar-ratio"):1,width:m.outerWidth(!0),height:m.outerHeight(!0),isHidden:!1})})},_findBackgrounds:function(){var b,c=this,e=this._getScrollLeft(),f=this._getScrollTop();this.backgrounds=[],this.options.parallaxBackgrounds&&(b=this.$element.find("[data-stellar-background-ratio]"),this.$element.data("stellar-background-ratio")&&(b=b.add(this.$element)),b.each(function(){var b,g,h,i,j,k,l,o=a(this),p=n(o),q=0,r=0,s=0,t=0;if(o.data("stellar-backgroundIsActive")){if(o.data("stellar-backgroundIsActive")!==this)return}else o.data("stellar-backgroundIsActive",this);o.data("stellar-backgroundStartingLeft")?m(o,o.data("stellar-backgroundStartingLeft"),o.data("stellar-backgroundStartingTop")):(o.data("stellar-backgroundStartingLeft",p[0]),o.data("stellar-backgroundStartingTop",p[1])),h="auto"===o.css("margin-left")?0:parseInt(o.css("margin-left"),10),i="auto"===o.css("margin-top")?0:parseInt(o.css("margin-top"),10),j=o.offset().left-h-e,k=o.offset().top-i-f,o.parents().each(function(){var b=a(this);return b.data("stellar-offset-parent")===!0?(q=s,r=t,l=b,!1):(s+=b.position().left,void(t+=b.position().top))}),b=o.data("stellar-horizontal-offset")!==d?o.data("stellar-horizontal-offset"):l!==d&&l.data("stellar-horizontal-offset")!==d?l.data("stellar-horizontal-offset"):c.horizontalOffset,g=o.data("stellar-vertical-offset")!==d?o.data("stellar-vertical-offset"):l!==d&&l.data("stellar-vertical-offset")!==d?l.data("stellar-vertical-offset"):c.verticalOffset,c.backgrounds.push({$element:o,$offsetParent:l,isFixed:"fixed"===o.css("background-attachment"),horizontalOffset:b,verticalOffset:g,startingValueLeft:p[0],startingValueTop:p[1],startingBackgroundPositionLeft:isNaN(parseInt(p[0],10))?0:parseInt(p[0],10),startingBackgroundPositionTop:isNaN(parseInt(p[1],10))?0:parseInt(p[1],10),startingPositionLeft:o.position().left,startingPositionTop:o.position().top,startingOffsetLeft:j,startingOffsetTop:k,parentOffsetLeft:q,parentOffsetTop:r,stellarRatio:o.data("stellar-background-ratio")===d?1:o.data("stellar-background-ratio")})}))},_reset:function(){var a,b,c,d,e;for(e=this.particles.length-1;e>=0;e--)a=this.particles[e],b=a.$element.data("stellar-startingLeft"),c=a.$element.data("stellar-startingTop"),this._setPosition(a.$element,b,b,c,c),this.options.showElement(a.$element),a.$element.data("stellar-startingLeft",null).data("stellar-elementIsActive",null).data("stellar-backgroundIsActive",null);for(e=this.backgrounds.length-1;e>=0;e--)d=this.backgrounds[e],d.$element.data("stellar-backgroundStartingLeft",null).data("stellar-backgroundStartingTop",null),m(d.$element,d.startingValueLeft,d.startingValueTop)},destroy:function(){this._reset(),this.$scrollElement.unbind("resize."+this.name).unbind("scroll."+this.name),this._animationLoop=a.noop,a(b).unbind("load."+this.name).unbind("resize."+this.name)},_setOffsets:function(){var c=this,d=a(b);d.unbind("resize.horizontal-"+this.name).unbind("resize.vertical-"+this.name),"function"==typeof this.options.horizontalOffset?(this.horizontalOffset=this.options.horizontalOffset(),d.bind("resize.horizontal-"+this.name,function(){c.horizontalOffset=c.options.horizontalOffset()})):this.horizontalOffset=this.options.horizontalOffset,"function"==typeof this.options.verticalOffset?(this.verticalOffset=this.options.verticalOffset(),d.bind("resize.vertical-"+this.name,function(){c.verticalOffset=c.options.verticalOffset()})):this.verticalOffset=this.options.verticalOffset},_repositionElements:function(){var a,b,c,d,e,f,g,h,i,j,k=this._getScrollLeft(),l=this._getScrollTop(),n=!0,o=!0;if(this.currentScrollLeft!==k||this.currentScrollTop!==l||this.currentWidth!==this.viewportWidth||this.currentHeight!==this.viewportHeight){for(this.currentScrollLeft=k,this.currentScrollTop=l,this.currentWidth=this.viewportWidth,this.currentHeight=this.viewportHeight,j=this.particles.length-1;j>=0;j--)a=this.particles[j],b=a.isFixed?1:0,this.options.horizontalScrolling?(f=(k+a.horizontalOffset+this.viewportOffsetLeft+a.startingPositionLeft-a.startingOffsetLeft+a.parentOffsetLeft)*-(a.stellarRatio+b-1)+a.startingPositionLeft,h=f-a.startingPositionLeft+a.startingOffsetLeft):(f=a.startingPositionLeft,h=a.startingOffsetLeft),this.options.verticalScrolling?(g=(l+a.verticalOffset+this.viewportOffsetTop+a.startingPositionTop-a.startingOffsetTop+a.parentOffsetTop)*-(a.stellarRatio+b-1)+a.startingPositionTop,i=g-a.startingPositionTop+a.startingOffsetTop):(g=a.startingPositionTop,i=a.startingOffsetTop),this.options.hideDistantElements&&(o=!this.options.horizontalScrolling||h+a.width>(a.isFixed?0:k)&&h<(a.isFixed?0:k)+this.viewportWidth+this.viewportOffsetLeft,n=!this.options.verticalScrolling||i+a.height>(a.isFixed?0:l)&&i<(a.isFixed?0:l)+this.viewportHeight+this.viewportOffsetTop),o&&n?(a.isHidden&&(this.options.showElement(a.$element),a.isHidden=!1),this._setPosition(a.$element,f,a.startingPositionLeft,g,a.startingPositionTop)):a.isHidden||(this.options.hideElement(a.$element),a.isHidden=!0);for(j=this.backgrounds.length-1;j>=0;j--)c=this.backgrounds[j],b=c.isFixed?0:1,d=this.options.horizontalScrolling?(k+c.horizontalOffset-this.viewportOffsetLeft-c.startingOffsetLeft+c.parentOffsetLeft-c.startingBackgroundPositionLeft)*(b-c.stellarRatio)+"px":c.startingValueLeft,e=this.options.verticalScrolling?(l+c.verticalOffset-this.viewportOffsetTop-c.startingOffsetTop+c.parentOffsetTop-c.startingBackgroundPositionTop)*(b-c.stellarRatio)+"px":c.startingValueTop,m(c.$element,d,e)}},_handleScrollEvent:function(){var a=this,b=!1,c=function(){a._repositionElements(),b=!1},d=function(){b||(o(c),b=!0)};this.$scrollElement.bind("scroll."+this.name,d),d()},_startAnimationLoop:function(){var a=this;this._animationLoop=function(){o(a._animationLoop),a._repositionElements()},this._animationLoop()}},a.fn[f]=function(b){var c=arguments;return b===d||"object"==typeof b?this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var d=a.data(this,"plugin_"+f);d instanceof e&&"function"==typeof d[b]&&d[b].apply(d,Array.prototype.slice.call(c,1)),"destroy"===b&&a.data(this,"plugin_"+f,null)}):void 0},a[f]=function(){var c=a(b);return c.stellar.apply(c,Array.prototype.slice.call(arguments,0))},a[f].scrollProperty=h,a[f].positionProperty=i,b.Stellar=e}(jQuery,this,document);
(function(a){a.fn.resizeToParent=function(c){var e={parent:"div",delay:100};var c=a.extend(e,c);function f(n){n.css({width:"",height:"","margin-left":"","margin-top":""});var k=n.parents(c.parent).width();var j=n.parents(c.parent).height();var h=n.width();var g=n.height();var m=h/k;if((g/m)<j){n.css({width:"auto",height:j});h=h/(g/j);g=j}else{n.css({height:"auto",width:k});h=k;g=g/m}var l=(h-k)/-2;var i=(g-j)/-2;n.css({"margin-left":l,"margin-top":i})}var d;var b=this;a(window).on("resize",function(){clearTimeout(d);d=setTimeout(function(){b.each(function(){f(a(this))})},c.delay)});return this.each(function(){var g=a(this);g.attr("src",g.attr("src"));g.load(function(){f(g)});if(this.complete){f(g)}})}})(jQuery);
jQuery.fn.center=function (){
this.css("left", (jQuery(window).width() / 2) - (this.outerWidth() / 2));
return this;
}
jQuery.fn.animateAuto=function(prop, speed, callback){
var elem, height, width;
return this.each(function(i, el){
el=jQuery(el), elem=el.clone().css({"height":"auto"}).appendTo("body");
if(navigator.userAgent.indexOf('Safari')!=-1&&navigator.userAgent.indexOf('Chrome')==-1){
height=elem.height();
height=elem.css("auto"),
width=elem.css("width");
}else{
height=elem.height();
height=height,
width=elem.css("width");
}
elem.remove();
if(prop==="height")
el.animate({"height":height+15}, speed, callback);
else if(prop==="max-height")
el.animate({"max-height":height}, speed, callback);
else if(prop==="width")
el.animate({"width":width}, speed, callback);
else if(prop==="both")
el.animate({"width":width,"height":height}, speed, callback);
});
}
jQuery.fn.setNav=function(){
var calScreenWidth=jQuery(window).width();
var menuLayout=jQuery('#pp_menu_layout').val();
if(calScreenWidth >=960){
jQuery('#main_menu li ul').css({display: 'none', opacity: 1});
if(menuLayout!='leftmenu'){
jQuery('#menu_wrapper div .nav li.megamenu > ul > li').each(function(){
jQuery(this).css('height', jQuery(this).parent('ul').height()+'px');
});
}
jQuery('#main_menu li').each(function(){
var jQuerysublist=jQuery(this).find('ul:first');
jQuery(this).hover(function(){
position=jQuery(this).position();
if(jQuery(this).parents().attr('class')=='sub-menu'){
jQuerysublist.stop().fadeIn(500);
}else{
jQuerysublist.stop().css({overflow: 'visible'}).fadeIn(500);
}},
function(){
jQuerysublist.stop().css({height:'auto'}).fadeOut(500);
});
});
jQuery('#menu_wrapper .nav ul li ul').css({display: 'none', opacity: 1});
jQuery('#menu_wrapper .nav ul li').each(function(){
var jQuerysublist=jQuery(this).find('ul:first');
jQuery(this).hover(function(){
jQuerysublist.stop().fadeIn(500);
},
function(){
jQuerysublist.stop().fadeOut(500);
});
});
}
jQuery('body').on('click', '.mobile_main_nav > li a', function(event){
var jQuerysublist=jQuery(this).parent('li').find('ul.sub-menu:first');
var menuContainerClass=jQuery(this).parent('li').parent('#mobile_main_menu.mobile_main_nav').parent('div');
if(jQuerysublist.length>0){
event.preventDefault();
}
var menuLevel='top_level';
var parentMenu='';
var menuClickedId=jQuery(this).attr('id');
if(jQuery(this).parent('li').parent('ul').attr('id')=='mobile_main_menu'){
menuLevel='parent_level';
}else{
parentMenu=jQuery(this).parent('li').attr('id');
}
if(jQuerysublist.length>0){
jQuery('#mobile_main_menu.mobile_main_nav').addClass('mainnav_out');
jQuery('.mobile_menu_wrapper div #sub_menu').removeClass('subnav_in');
jQuery('.mobile_menu_wrapper div #sub_menu').addClass('mainnav_out');
setTimeout(function(){
jQuery('#mobile_main_menu.mobile_main_nav').css('display', 'none');
jQuery('.mobile_menu_wrapper div #sub_menu').remove();
var subMenuHTML='<li><a href="#" id="menu_back" class="'+menuLevel+'" data-parent="'+parentMenu+'">'+jQuery('#pp_back').val()+'</a></li>';
subMenuHTML +=jQuerysublist.html();
menuContainerClass.append('<ul id="sub_menu" class="nav '+menuLevel+'"></ul>');
menuContainerClass.find('#sub_menu').html(subMenuHTML);
menuContainerClass.find('#sub_menu').addClass('subnav_in');
}, 200);
}});
jQuery('body').on('click', '#menu_back.parent_level', function(){
jQuery('.mobile_menu_wrapper div #sub_menu').removeClass('subnav_in');
jQuery('.mobile_menu_wrapper div #sub_menu').addClass('subnav_out');
jQuery('#mobile_main_menu.mobile_main_nav').removeClass('mainnav_out');
setTimeout(function(){
jQuery('.mobile_menu_wrapper div #sub_menu').remove();
jQuery('#mobile_main_menu.mobile_main_nav').css('display', 'block');
jQuery('#mobile_main_menu.mobile_main_nav').addClass('mainnav_in');
}, 200);
});
jQuery('body').on('click', '#menu_back.top_level', function(){
event.preventDefault();
jQuery('.mobile_menu_wrapper div #sub_menu').addClass('subnav_out');
var parentMenuId=jQuery(this).data('parent');
setTimeout(function(){
jQuery('.mobile_menu_wrapper div #sub_menu').remove();
var menuLevel='top_level';
var parentMenu='';
if(jQuery('#mobile_main_menu.mobile_main_nav li#'+parentMenuId).parent('ul.sub-menu:first').parent('li').parent('ul#main_menu').length==1){
menuLevel='parent_level';
}else{
parentMenu=jQuery('#mobile_main_menu.mobile_main_nav li#'+parentMenuId).parent('ul.sub-menu:first').parent('li').attr('id');
}
var subMenuHTML='<li><a href="#" id="menu_back" class="'+menuLevel+'" data-parent="'+parentMenu+'">'+jQuery('#pp_back').val()+'</a></li>';
subMenuHTML+=jQuery('#mobile_main_menu.mobile_main_nav li#'+parentMenuId).parent('ul.sub-menu:first').html();
jQuery('.mobile_menu_wrapper div').append('<ul id="sub_menu" class="nav '+menuLevel+'"></ul>');
jQuery('.mobile_menu_wrapper div #sub_menu').html(subMenuHTML);
jQuery('.mobile_menu_wrapper div #sub_menu').addClass('mainnav_in');
}, 200);
});
}
function adjustIframes(){
jQuery('iframe').each(function(){
var
$this=jQuery(this),
proportion=$this.data('proportion'),
w=$this.attr('width'),
actual_w=$this.width();
if(! proportion){
proportion=$this.attr('height') / w;
$this.data('proportion', proportion);
}
if(actual_w!=w){
$this.css('height', Math.round(actual_w * proportion) + 'px !important');
}});
}
function is_touch_device(){
return 'ontouchstart' in window
|| 'onmsgesturechange' in window;
};
if(jQuery('#pp_page_title_img_blur').val()!=''){
(function(){
jQuery(window).scroll(function(){
var oVal;
oVal=jQuery(window).scrollTop() / 300;
if(oVal>1){
oVal=1;
}
if(oVal==1){
jQuery('body.single.single-post .post_share_bubble a.post_share, body.single.single-projects .post_share_bubble a.post_share, body.single.single-attachment .post_share_bubble a.post_share').css('display', 'block');
}
if(oVal==0){
jQuery('body.single.single-post .post_share_bubble a.post_share, body.single.single-projects .post_share_bubble a.post_share, body.single.single-attachment .post_share_bubble a.post_share').css('display', 'none');
}
return jQuery("#bg_blurred").css("opacity", oVal);
});
}).call(this);
}
if(jQuery('#pp_page_title_img_blur').val()!=''){
(function(){
jQuery(window).scroll(function(){
var oVal;
oVal=jQuery(window).scrollTop() / 300;
if(oVal>1){
oVal=1;
}
oVal=parseFloat(1-oVal);
return jQuery("#page_caption.hasbg .page_title_wrapper .page_title_inner").css("opacity", oVal);
});
}).call(this);
}
jQuery(document).ready(function(){
"use strict";
jQuery(document).setNav();
jQuery(window).resize(function(){
jQuery(document).setNav();
});
if(jQuery('body').hasClass('single-product')){
jQuery('.woocommerce-product-gallery__wrapper').children('div').each(function(){
jQuery(this).find('a').attr('data-rel', 'woo-product-gallery');
});
}
var moduloLightboxLoad=false;
if(jQuery('#tg_enable_theme_lightbox').val()==1){
moduloLightboxLoad=true;
}
var moduloThumbnail=false;
if(jQuery('#tg_lightbox_thumbnails').val()=='thumbnail'){
moduloThumbnail=true;
}
if(moduloLightboxLoad){
var mobx=new ModuloBox({
mediaSelector:'.fancy-gallery, .grandrestaurant_gallery_lightbox, .pp_gallery a, .img_frame, .lightbox_vimeo, .lightbox_youtube, .woocommerce-product-gallery__image a',
scrollToZoom:true,
controls:['zoom', 'play', 'fullScreen', 'close'],
countTimer: true,
thumbnails: moduloThumbnail,
caption: jQuery('#tg_lightbox_enable_title').val(),
videoAutoPlay: true,
thumbnailSizes:{
1920:{
width:110,
height:80,
gutter:10 
},
1280:{
width:90,
height:65,
gutter:10
},
680:{
width:70,
height:50,
gutter:8
},
480:{
width:60,
height:44,
gutter:5
}}
});
mobx.init();
}
jQuery('#menu_expand_wrapper a').on('click', function(){
jQuery('#menu_wrapper').fadeIn();
jQuery('#custom_logo').animate({'left': '15px', 'opacity': 1}, 400);
jQuery('#menu_close').animate({'left': '-10px', 'opacity': 1}, 400);
jQuery(this).animate({'left': '-60px', 'opacity': 0}, 400);
jQuery('#menu_border_wrapper select').animate({'left': '0', 'opacity': 1}, 400).fadeIn();
});
jQuery('#menu_close').on('click', function(){
jQuery('#custom_logo').animate({'left': '-200px', 'opacity': 0}, 400);
jQuery(this).stop().animate({'left': '-200px', 'opacity': 0}, 400);
jQuery('#menu_expand_wrapper a').animate({'left': '20px', 'opacity': 1}, 400);
jQuery('#menu_border_wrapper select').animate({'left': '-200px', 'opacity': 0}, 400).fadeOut();
jQuery('#menu_wrapper').fadeOut();
});
jQuery.Isotope.prototype._getMasonryGutterColumns=function(){
var gutter=this.options.masonry&&this.options.masonry.gutterWidth||0;
var containerWidth=this.element.width();
this.masonry.columnWidth=this.options.masonry&&this.options.masonry.columnWidth ||
this.$filteredAtoms.outerWidth(true) ||
containerWidth;
this.masonry.columnWidth +=gutter;
this.masonry.cols=Math.floor(( containerWidth + gutter) / this.masonry.columnWidth);
this.masonry.cols=Math.max(this.masonry.cols, 1);
};
jQuery.Isotope.prototype._masonryReset=function(){
this.masonry={};
this._getMasonryGutterColumns();
var i=this.masonry.cols;
this.masonry.colYs=[];
while (i--){
this.masonry.colYs.push(0);
}};
jQuery.Isotope.prototype._masonryResizeChanged=function(){
var prevSegments=this.masonry.cols;
this._getMasonryGutterColumns();
return(this.masonry.cols!==prevSegments);
};
var $window=jQuery(window);
var dropdowns=jQuery(".portfolio_filter_dropdown");
dropdowns.find(".portfolio_filter_dropdown_title").on('click', function(){
dropdowns.find(".portfolio_filter_dropdown_select ul.portfolio_select").hide();
jQuery(this).next().children().toggle();
});
dropdowns.find(".portfolio_filter_dropdown_select ul.portfolio_select li a").on('click', function(){
var leSpan=jQuery(this).parents(".portfolio_filter_dropdown").find(".portfolio_filter_dropdown_title a span");
jQuery(this).parents(".portfolio_filter_dropdown").find('.portfolio_filter_dropdown_select a').each(function(){
jQuery(this).removeClass('selected');
});
leSpan.html(jQuery(this).html());
if(jQuery(this).hasClass('default')){
leSpan.removeClass('selected')
}else{
leSpan.addClass('selected');
jQuery(this).addClass('selected');
}
jQuery(this).parents("ul").hide();
});
jQuery(document).bind('click', function(e){
if(! jQuery(e.target).parents().hasClass("portfolio_filter_dropdown")) jQuery(".portfolio_filter_dropdown .portfolio_filter_dropdown_select ul.portfolio_select").hide();
});
function reLayout(){
var jQuerycontainer=jQuery('#photo_wall_wrapper, .photo_wall_wrapper');
var windowWidth=parseInt(jQuerycontainer.width());
var jQueryportfolioColumn=4;
var columnValue;
var masonryOpts;
if(windowWidth < 480){
jQueryportfolioColumn=1;
}
else if(windowWidth >=480&&windowWidth < 960){
jQueryportfolioColumn=2;
}
else if(windowWidth >=960){
jQueryportfolioColumn=4;
}
$container.addClass('visible');
$container.isotope({
resizable: false,
itemSelector:'.wall_entry',
}).isotope();
}
var $container=jQuery('#photo_wall_wrapper, .photo_wall_wrapper');
$container.imagesLoaded(function(){
reLayout();
$window.smartresize(reLayout);
$container.children('.wall_entry').children('.gallery_type').each(function(){
jQuery(this).addClass('fade-in');
});
$container.children('.wall_entry').mouseenter(function(){
jQuery(this).addClass('hover');
});
$container.children('.wall_entry').mouseleave(function(){
$container.children('.wall_entry').removeClass('hover');
});
jQuery(window).trigger('hwparallax.reconfigure');
});
jQuery(window).resize(function(){
if(jQuery(this).width() < 768){
jQuery('#menu_expand_wrapper a').trigger('click');
}});
var isDisableRightClick=jQuery('#pp_enable_right_click').val();
if(isDisableRightClick!=''){
jQuery(this).bind("contextmenu", function(e){
e.preventDefault();
});
}
function rePortfolioLayout(){
var jQuerycontainer=jQuery('#portfolio_filter_wrapper, .portfolio_filter_wrapper');
var windowWidth=jQuerycontainer.width();
if(jQuery('#pp_menu_layout').val()=='leftmenu'&&jQuery(window).width() > 768){
windowWidth=parseInt(windowWidth + 265);
}
var jQueryportfolioColumn=jQuery('#pp_portfolio_columns').attr('value');
var columnValue;
var masonryOpts;
if(jQuery('#pp_menu_layout').val()=='leftmenu'){
var windowWidth=jQuerycontainer.width();
}
if(jQuery.type(jQueryportfolioColumn)==="undefined"){
if(windowWidth < 481){
jQueryportfolioColumn=1;
}
else if(windowWidth >=480&&windowWidth < 960){
jQueryportfolioColumn=2;
}
else if(windowWidth >=960){
jQueryportfolioColumn=4;
}}else{
if(windowWidth <=768){
jQueryportfolioColumn=2;
}}
masonryOpts={
columnWidth: columnValue
};
jQuerycontainer.isotope({
resizable: false,
itemSelector:'.element',
masonry: masonryOpts
}).isotope();
}
var $window=jQuery(window);
var jQuerycontainer=jQuery('#portfolio_filter_wrapper, .portfolio_filter_wrapper');
jQuerycontainer.imagesLoaded(function(){
rePortfolioLayout();
$window.smartresize(rePortfolioLayout);
jQuerycontainer.children('.element').children('.gallery_type').each(function(){
jQuery(this).addClass('fadeIn');
});
jQuerycontainer.children('.element').children('.portfolio_type').each(function(){
jQuery(this).addClass('fadeIn');
});
jQuerycontainer.children('.element').mouseenter(function(){
jQuery(this).addClass('hover');
});
jQuerycontainer.children('.element').mouseleave(function(){
jQuerycontainer.children('.element').removeClass('hover');
});
jQuery(this).addClass('visible');
jQuery(window).trigger('hwparallax.reconfigure');
});
if(jQuery('#tg_project_filterable_link').val()!=1){
jQuery('#project_services_filters li a').on('click', function(){
var selector=jQuery(this).attr('data-filter');
var selector_combine=jQuery('#project_sectors_filters').find('li').find('a.active').attr('data-filter');
if(selector_combine!='*'){
selector+=selector_combine;
}
jQuerycontainer.isotope({ filter: selector });
jQuery('#project_services_filters li a').removeClass('active');
jQuery(this).addClass('active');
return false;
});
jQuery('#project_sectors_filters li a').on('click', function(){
var selector=jQuery(this).attr('data-filter');
var selector_combine=jQuery('#project_services_filters').find('li').find('a.active').attr('data-filter');
if(selector_combine!='*'){
selector+=selector_combine;
}
jQuerycontainer.isotope({ filter: selector });
jQuery('#project_sectors_filters li a').removeClass('active');
jQuery(this).addClass('active');
return false;
});
}
function reBlogLayout(){
var windowWidth=jQuery(window).width();
var jQueryblogcontainer=jQuery('#blog_grid_wrapper, .blog_grid_wrapper');
var containerWidth=jQuery('#blog_grid_wrapper, .blog_grid_wrapper').width();
var $blogGridColumn=3;
var columnValue=0;
var masonryOpts;
if(containerWidth >=960){
columnValue=containerWidth / $blogGridColumn;
}
else if(containerWidth < 960&&containerWidth >=660){
columnValue=containerWidth / 2;
}else{
columnValue=containerWidth/1;
}
masonryOpts={
columnWidth: columnValue
};
jQueryblogcontainer.isotope({
resizable: false,
itemSelector:'.status-publish',
masonry: masonryOpts
}).isotope();
}
var jQueryblogcontainer=jQuery('#blog_grid_wrapper, .blog_grid_wrapper');
jQueryblogcontainer.imagesLoaded(function(){
reBlogLayout();
$window.smartresize(reBlogLayout);
jQuery(window).trigger('hwparallax.reconfigure');
});
jQuery(window).scroll(function(){
var calScreenWidth=jQuery(window).width();
if(jQuery(this).scrollTop() > 200){
jQuery('#toTop').stop().css({opacity: 0.5, "visibility": "visible"}).animate({"visibility": "visible"}, {duration:1000,easing:"easeOutExpo"});
}else if(jQuery(this).scrollTop()==0){
jQuery('#toTop').stop().css({opacity: 0, "visibility": "hidden"}).animate({"visibility": "hidden"}, {duration:1500,easing:"easeOutExpo"});
}});
jQuery('#toTop, .hr_totop').on('click', function(){
jQuery('body,html').animate({scrollTop:0},800);
});
var isDisableDragging=jQuery('#pp_enable_dragging').val();
if(isDisableDragging!=''){
jQuery("img").mousedown(function(){
return false;
});
}
if(jQuery('#pp_topbar').val()==0){
var topBarHeight=jQuery('.header_style_wrapper').height();
}else{
var topBarHeight=parseInt(jQuery('.header_style_wrapper').height()-jQuery('.header_style_wrapper .above_top_bar').height());
}
var logoHeight=jQuery('#custom_logo img').height();
var logoTransHeight=jQuery('#custom_logo_transparent img').height();
var logoMargin=parseInt(jQuery('#custom_logo').css('marginTop'));
var logoTransMargin=parseInt(jQuery('#custom_logo_transparent').css('marginTop'));
var menuPaddingTop=parseInt(jQuery('#menu_wrapper div .nav li > a').css('paddingTop'));
var menuPaddingBottom=parseInt(jQuery('#menu_wrapper div .nav li > a').css('paddingBottom'));
var SearchPaddingTop=parseInt(jQuery('.top_bar #searchform button').css('paddingTop'));
var menuLayout=jQuery('#pp_menu_layout').val();
var headercontent=jQuery('#grandrestaurant_header_content').val();
var fixedMenu=jQuery('#pp_fixed_menu').val();
if(menuLayout!='leftmenu'||jQuery(window).width()<=768){
if(headercontent=='menu'){
jQuery('#wrapper').css('paddingTop', parseInt(jQuery('.header_style_wrapper').height())+'px');
}else{
jQuery('#wrapper').css('paddingTop', parseInt(jQuery('#elementor-header').height())+'px');
setTimeout(function (){ jQuery('#wrapper').css('paddingTop', parseInt(jQuery('#elementor-header').height())+'px'); }, 200);
setTimeout(function (){ jQuery('#wrapper').css('paddingTop', parseInt(jQuery('#elementor-header').height())+'px'); }, 1000);
}}
jQuery(window).resize(function(){
if(jQuery(this).width()>960){
if(menuLayout!='leftmenu'){
var resizedTopBarHeight=jQuery('.header_style_wrapper').height();
jQuery('#wrapper').css('paddingTop', resizedTopBarHeight+'px');
jQuery('.logo_wrapper').css('marginTop', '');
jQuery('.top_bar #searchform button').css('paddingTop', '');
}else{
jQuery('#wrapper').css('paddingTop', 0);
}}else{
jQuery('#wrapper').css('paddingTop', parseInt(jQuery('.header_style_wrapper').height())+'px');
}});
if(menuLayout!='leftmenu'||jQuery(window).width()<=960){
if(jQuery(window).width()>960){
jQuery('#wrapper').css('paddingTop', parseInt(topBarHeight+jQuery('.header_style_wrapper .above_top_bar').height())+'px');
jQuery('.top_bar').css('height', topBarHeight+'px');
}else{
jQuery('#wrapper').css('paddingTop', parseInt(jQuery('.header_style_wrapper').height())+'px');
}
jQuery(window).scroll(function(){
if(jQuery('#pp_fixed_menu').val()==1){
if(jQuery(this).scrollTop() >=200){
jQuery('.header_style_wrapper .above_top_bar').hide();
jQuery('.extend_top_contact_info').hide();
if(jQuery(window).width()>=1024){
jQuery('.top_bar').addClass('scroll');
jQuery('.top_bar').css('height', parseInt(topBarHeight/1.5)+'px');
jQuery('.top_bar').css('height', parseInt(topBarHeight/1.5)+'px');
jQuery('#custom_logo img').addClass('zoom');
jQuery('#custom_logo img').css('width', 'auto');
jQuery('#custom_logo img').css('maxHeight', parseInt(topBarHeight/3)+'px');
jQuery('#custom_logo_transparent img').addClass('zoom');
jQuery('#custom_logo').css('marginTop', parseInt(logoMargin/1.5)+'px');
jQuery('#custom_logo_transparent').css('marginTop', parseInt(logoTransMargin/1.5)+'px');
jQuery('#menu_wrapper div .nav > li > a').css('paddingTop', parseInt(menuPaddingTop/1.7)+'px');
jQuery('#menu_wrapper div .nav > li > a').css('paddingBottom', parseInt(menuPaddingBottom/1.7)+'px');
if(menuLayout=='centermenu'){
jQuery('.logo_container').addClass('hidden');
}}
if(jQuery('.top_bar').hasClass('hasbg')){
jQuery('.top_bar').removeClass('hasbg');
jQuery('.top_bar').data('hasbg', 1);
jQuery('#custom_logo').removeClass('hidden');
jQuery('#custom_logo_transparent').addClass('hidden');
}}
else if(jQuery(this).scrollTop() < 200){
jQuery('.header_style_wrapper .above_top_bar').show();
jQuery('.extend_top_contact_info').show();
jQuery('.top_bar').removeClass('scroll');
jQuery('.top_bar').css('height', topBarHeight+'px');
jQuery('#custom_logo img').removeClass('zoom');
jQuery('#custom_logo img').css('maxHeight', '');
jQuery('#custom_logo_transparent img').removeClass('zoom');
jQuery('#custom_logo').css('marginTop', parseInt(logoMargin)+'px');
jQuery('#custom_logo_transparent').css('marginTop', parseInt(logoTransMargin)+'px');
jQuery('#menu_wrapper div .nav > li > a').css('paddingTop', menuPaddingTop+'px');
jQuery('#menu_wrapper div .nav > li > a').css('paddingBottom', menuPaddingBottom+'px');
if(menuLayout=='centermenu'){
if(jQuery('.top_bar').data('hasbg')==1){
jQuery('#logo_transparent.logo_container').removeClass('hidden');
}else{
jQuery('#logo_normal.logo_container').removeClass('hidden');
}}
if(jQuery('.top_bar').data('hasbg')==1){
jQuery('.top_bar').addClass('hasbg');
jQuery('#custom_logo').addClass('hidden');
jQuery('#custom_logo_transparent').removeClass('hidden');
}}
}else{
if(jQuery(this).scrollTop() >=200){
jQuery('.header_style_wrapper').addClass('nofixed');
}else{
jQuery('.header_style_wrapper').removeClass('nofixed');
}}
});
}
jQuery('.post_img img').imagesLoaded(function(){
jQuery(this).parent('.post_img').addClass('fadeIn');
});
jQuery(document).mouseenter(function(){
jQuery('body').addClass('hover');
});
jQuery(document).mouseleave(function(){
jQuery('body').removeClass('hover');
});
jQuery('#slidecaption').center();
jQuery(window).resize(function(){
jQuery('#slidecaption').center();
});
var siteBaseURL=jQuery('#pp_homepage_url').val();
if(jQuery('#pp_ajax_search').val()!=''){
jQuery('#s').on('input', function(){
jQuery.ajax({
url:siteBaseURL+"/wp-admin/admin-ajax.php",
type:'POST',
data:'action=pp_ajax_search&s='+jQuery('#s').val(),
success:function(results){
jQuery("#autocomplete").html(results);
if(results!=''){
jQuery("#autocomplete").addClass('visible');
jQuery("#autocomplete").show();
jQuery("body.js_nav .mobile_menu_wrapper").css('overflow', 'visible');
}else{
jQuery("#autocomplete").hide();
jQuery("body.js_nav .mobile_menu_wrapper").css('overflow', 'scroll');
}}
})
});
jQuery("#s").keypress(function(event){
if(event.which==13){
event.preventDefault();
jQuery("form#searchform").submit();
}});
jQuery('#s').focus(function(){
if(jQuery('#autocomplete').html()!=''){
jQuery("#autocomplete").addClass('visible');
jQuery("#autocomplete").fadeIn();
}});
jQuery('#s').blur(function(){
jQuery("#autocomplete").fadeOut();
});
}
jQuery('.animated').imagesLoaded(function(){
var windowWidth=jQuery(window).width();
var animatedElement=jQuery(this);
if(windowWidth >=960){
animatedElement.waypoint(function(direction){
var animationClass=animatedElement.data('animation');
animatedElement.addClass(animationClass, direction==='down');
} , { offset: '100%' });
}});
jQuery('#post_more_close').on('click', function(){
jQuery('#post_more_wrapper').animate({ right: '-380px' }, 300);
return false;
});
jQuery('.parallax').each(function(){
var parallaxHeight=jQuery(this).data('content-height');
parallaxHeight=parseInt((parallaxHeight/100)*jQuery(window).height());
jQuery(this).css('height', parallaxHeight+'px');
});
if(jQuery(window).width() >=960){
jQuery('.parallax').parallax();
}else{
jQuery('.parallax').each(function(){
var dataImgURL=jQuery(this).data('image');
if(jQuery.type(dataImgURL)!="undefined"){
jQuery(this).css('background-image', 'url('+dataImgURL+')');
jQuery(this).css('background-size', 'cover');
jQuery(this).css('background-position', 'center center');
}});
}
jQuery(window).resize(function(){
if(jQuery(window).width() >=960){
jQuery('.parallax').each(function(){
var parallaxHeight=jQuery(this).data('content-height');
parallaxHeight=parseInt((parallaxHeight/100)*jQuery(window).height());
jQuery(this).css('height', parallaxHeight+'px');
});
jQuery(window).trigger('hwparallax.reconfigure');
}else{
jQuery('.parallax').each(function(){
var dataImgURL=jQuery(this).data('image');
if(jQuery.type(dataImgURL)!="undefined"){
jQuery(this).css('background-image', 'url('+dataImgURL+')');
jQuery(this).css('background-size', 'cover');
jQuery(this).css('background-position', 'center center');
}});
}});
var stellarActivated=false;
if(jQuery(window).width() >=1024){
stellarActivated=true;
jQuery(window).stellar({ positionProperty: 'transform', parallaxBackgrounds: false, responsive: true, horizontalScrolling: false, hideDistantElements: true });
}
if(jQuery(window).width() <=1024){
if(stellarActivated==true){
stellarActivated=false;
}}else{
if(stellarActivated==false){
jQuery(window).stellar({ positionProperty: 'transform', parallaxBackgrounds: false, responsive: true, horizontalScrolling: false, hideDistantElements: true });
stellarActivated=true;
}}
jQuery(window).resize(function(){
if(jQuery(window).width() >=1024){
stellarActivated=true;
jQuery(window).stellar({ positionProperty: 'transform', parallaxBackgrounds: false, responsive: true, horizontalScrolling: false, hideDistantElements: true });
}
if(jQuery(window).width() <=1024){
if(stellarActivated==true){
stellarActivated=false;
}}else{
if(stellarActivated==false){
jQuery(window).stellar({ positionProperty: 'transform', parallaxBackgrounds: false, responsive: true, horizontalScrolling: false, hideDistantElements: true });
stellarActivated=true;
}}
});
jQuery('#mobile_nav_icon').on('click', function(){
jQuery('body,html').animate({scrollTop:0},100);
jQuery('body').toggleClass('js_nav');
});
jQuery('#close_mobile_menu, #overlay_background').on('click', function(){
jQuery('body').removeClass('js_nav');
setTimeout(function(){
jQuery('.rev_slider_wrapper').css('left', '0px');
}, 500);
});
jQuery('.mobile_menu_close a').on('click', function(){
jQuery('body').removeClass('js_nav');
setTimeout(function(){
jQuery('.rev_slider_wrapper').css('left', '0px');
}, 500);
});
jQuery('.close_alert').on('click', function(){
var target=jQuery(this).data('target');
jQuery('#'+target).fadeOut();
});
jQuery('.progress_bar').waypoint(function(direction){
jQuery(this).addClass('fadeIn');
var progressContent=jQuery(this).children('.progress_bar_holder').children('.progress_bar_content');
var progressWidth=progressContent.data('score');
progressContent.css({'width': progressWidth+'%'});
} , { offset: '100%' });
jQuery('.tooltip').tooltipster();
jQuery('.demotip').tooltipster({
position: 'left',
theme: 'tooltipster-themegoods-demo',
});
jQuery('.portfolio_prev_next_link').each(function(){
jQuery(this).tooltipster({
content: jQuery('<img src="'+jQuery(this).attr('data-img')+'" /><br/><div style="text-align:center;margin:7px 0 5px 0;"><strong>'+jQuery(this).attr('data-title')+'</strong></div>')
});
});
jQuery('.post_prev_next_link').each(function(){
jQuery(this).tooltipster({
content: jQuery('<img src="'+jQuery(this).attr('data-img')+'" />')
});
});
jQuery('.rev_slider_wrapper.fullscreen-container').each(function(){
jQuery(this).append('<div class="icon-scroll"></div>');
});
jQuery('.post_share').on('click', function(){
var targetShareID=jQuery(this).attr('data-share');
var targetParentID=jQuery(this).attr('data-parent');
jQuery(this).toggleClass('visible');
jQuery('#'+targetShareID).toggleClass('slideUp');
jQuery('#'+targetParentID).toggleClass('sharing');
return false;
});
if(jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper').length > 0){
var sliderHeight=jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper').height();
var topBarHeight=jQuery('.top_bar').height();
if(jQuery('.above_top_bar').length > 0){
topBarHeight+=jQuery('.above_top_bar').height();
}
if(jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper.fullscreen-container').length > 0){
var topBarHeight=55;
}
jQuery('.ppb_wrapper').css('marginTop', sliderHeight-topBarHeight+'px');
jQuery('#page_content_wrapper').css('marginTop', sliderHeight-topBarHeight+'px');
}
jQuery(window).resize(function(){
if(jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper').length > 0){
var sliderHeight=jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper').height();
var topBarHeight=jQuery('.top_bar').height();
if(jQuery('.above_top_bar').length > 0){
topBarHeight+=jQuery('.above_top_bar').height();
}
if(jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper.fullscreen-container').length > 0){
var topBarHeight=55;
}
jQuery('.ppb_wrapper').css('marginTop', sliderHeight-topBarHeight+'px');
jQuery('#page_content_wrapper').css('marginTop', sliderHeight-topBarHeight+'px');
}});
jQuery('.skin_box').on('click', function(){
jQuery('.skin_box').removeClass('selected');
jQuery(this).addClass('selected');
jQuery('#skin').val(jQuery(this).attr('data-color'));
});
jQuery('#demo_apply').on('click', function(){
jQuery('#ajax_loading').addClass('visible');
jQuery('body').addClass('loading');
jQuery("form#form_option").submit();
});
jQuery('#option_wrapper').mouseenter(function(){
jQuery('body').addClass('overflow_hidden');
});
jQuery('#option_wrapper').mouseleave(function(){
jQuery('body').removeClass('overflow_hidden');
});
jQuery('.animate').waypoint(function(direction){
var windowWidth=jQuery(window).width();
jQuery(this).addClass('visible', direction==='down');
} , { offset: '80%' });
var calScreenHeight=jQuery(window).height()-108;
var miniRightPos=800;
var cols=3
var masonry=jQuery('.gallery_mansory_wrapper');
masonry.imagesLoaded(function(){
masonry.masonry({
itemSelector: '.mansory_thumbnail',
isResizable: true,
isAnimated: true,
isFitWidth: true,
columnWidth:Math.floor((masonry.width()/ cols))
});
masonry.children('.mansory_thumbnail').children('.gallery_type').each(function(){
jQuery(this).addClass('fade-in');
});
jQuery(window).trigger('hwparallax.reconfigure');
});
jQuery(window).resize(function(){
var masonry=jQuery('.gallery_mansory_wrapper');
masonry.imagesLoaded(function(){
masonry.masonry({
itemSelector: '.mansory_thumbnail',
isResizable: true,
isAnimated: true,
isFitWidth: true,
columnWidth:Math.floor((masonry.width()/ cols))
});
masonry.children('.mansory_thumbnail').children('.gallery_type').each(function(){
jQuery(this).addClass('fade-in');
});
});
});
jQuery('#tg_reservation:not(.custom_link), .tg_reservation').on('click', function(e){
e.preventDefault();
jQuery('#reservation_wrapper').fadeIn();
jQuery('body').removeClass('js_nav');
jQuery('body').addClass('overflow_hidden');
jQuery('html').addClass('overflow_hidden');
});
jQuery('#tg_sidemenu_reservation:not(.custom_link)').on('click', function(e){
e.preventDefault();
jQuery('#reservation_wrapper').fadeIn();
jQuery('body').removeClass('js_nav');
jQuery('body').addClass('overflow_hidden');
jQuery('html').addClass('overflow_hidden');
});
jQuery('#reservation_cancel_btn').on('click', function(){
jQuery('#reservation_wrapper').fadeOut();
jQuery('body').removeClass('overflow_hidden');
jQuery('html').removeClass('overflow_hidden');
});
jQuery('.mobile_main_nav li a, #sub_menu li a').on('click', function(){
if(!jQuery(this).parent('li').hasClass('menu-item-has-children')){
jQuery('body').removeClass('js_nav');
}});
jQuery('body').on('adding_to_cart', function(event, param1, param2){
var currentCartCount=parseInt(jQuery('.header_cart_wrapper .cart_count').html());
currentCartCount=currentCartCount + 1;
jQuery('.header_cart_wrapper .cart_count').html(currentCartCount);
});
if(jQuery('.one.fullwidth.slideronly').length > 0){
jQuery('body').addClass('overflow_hidden');
}
var menuLayout=jQuery('#pp_menu_layout').val();
if(jQuery(window).width()<960&&menuLayout=='leftmenu'){
document.getElementById("leftmenu.css-css").disabled=true;
jQuery('.mobile_menu_wrapper .logo_container').hide();
}
jQuery(window).resize(function(){
if(jQuery(window).width()>=960&&menuLayout=='leftmenu'){
document.getElementById("leftmenu.css-css").disabled=false;
jQuery('.mobile_menu_wrapper .logo_container').show();
}
else if(jQuery(window).width()<960&&menuLayout=='leftmenu'){
document.getElementById("leftmenu.css-css").disabled=true;
jQuery('.mobile_menu_wrapper .logo_container').hide();
}});
jQuery(window).scroll(function(){
if(fixedMenu==1){
if(jQuery(this).scrollTop() >=100){
jQuery('#elementor-header').removeClass('visible');
jQuery('#elementor-sticky-header').addClass('visible');
jQuery('#elementor-header').addClass('scrolling');
jQuery('#elementor-sticky-header').addClass('scrolling');
}
else if(jQuery(this).scrollTop() < 100){
jQuery('#elementor-header').addClass('visible');
jQuery('#elementor-sticky-header').removeClass('visible');
jQuery('#elementor-header').removeClass('scrolling');
jQuery('#elementor-sticky-header').removeClass('scrolling');
}}else{
if(jQuery(this).scrollTop() >=100){
jQuery('#elementor-header').removeClass('visible');
jQuery('#elementor-header').addClass('scrolling');
}
else if(jQuery(this).scrollTop() < 100){
jQuery('#elementor-header').addClass('visible');
jQuery('#elementor-header').removeClass('scrolling');
}}
});
if(jQuery(window).scrollTop() < 100){
setTimeout(function (){ jQuery('#elementor-header').addClass('visible'); }, 200);
}else{
setTimeout(function (){ jQuery('#elementor-sticky-header').addClass('visible'); }, 200);
}
jQuery('.smoove').each(function(){
var minWidth=1;
if(typeof jQuery(this).attr('data-minwidth')!='undefined'){
minWidth=jQuery(this).attr('data-minwidth');
}
var offset='20%';
if(typeof jQuery(this).attr('data-offset')!='undefined'){
offset=jQuery(this).attr('data-offset');
}
jQuery(this).smoove({
min_width:parseInt(minWidth),
offset:offset
});
});
});
jQuery(window).on('resize load',adjustIframes);
(()=>{"use strict";var e,r,_,t,a,n={},i={};function __webpack_require__(e){var r=i[e];if(void 0!==r)return r.exports;var _=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(_.exports,_,_.exports,__webpack_require__),_.loaded=!0,_.exports}__webpack_require__.m=n,e=[],__webpack_require__.O=(r,_,t,a)=>{if(!_){var n=1/0;for(b=0;b<e.length;b++){for(var[_,t,a]=e[b],i=!0,c=0;c<_.length;c++)(!1&a||n>=a)&&Object.keys(__webpack_require__.O).every(e=>__webpack_require__.O[e](_[c]))?_.splice(c--,1):(i=!1,a<n&&(n=a));if(i){e.splice(b--,1);var o=t();void 0!==o&&(r=o)}}return r}a=a||0;for(var b=e.length;b>0&&e[b-1][2]>a;b--)e[b]=e[b-1];e[b]=[_,t,a]},_=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var a=Object.create(null);__webpack_require__.r(a);var n={};r=r||[null,_({}),_([]),_(_)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~r.indexOf(i);i=_(i))Object.getOwnPropertyNames(i).forEach(r=>n[r]=()=>e[r]);return n.default=()=>e,__webpack_require__.d(a,n),a},__webpack_require__.d=(e,r)=>{for(var _ in r)__webpack_require__.o(r,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:r[_]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((r,_)=>(__webpack_require__.f[_](e,r),r),[])),__webpack_require__.u=e=>786===e?"397f2d183c19202777d6.bundle.min.js":216===e?"lightbox.3f9b3a051b2336dd5372.bundle.min.js":30===e?"text-path.a67c1f3a78d208bc7e1b.bundle.min.js":131===e?"accordion.8b0db5058afeb74622f5.bundle.min.js":707===e?"alert.b4336601ffdb6086d1b5.bundle.min.js":457===e?"counter.12335f45aaa79d244f24.bundle.min.js":234===e?"progress.0ea083b809812c0e3aa1.bundle.min.js":575===e?"tabs.18344b05d8d1ea0702bc.bundle.min.js":775===e?"toggle.2a177a3ef4785d3dfbc5.bundle.min.js":180===e?"video.86d44e46e43d0807e708.bundle.min.js":177===e?"image-carousel.6167d20b95b33386757b.bundle.min.js":212===e?"text-editor.45609661e409413f1cef.bundle.min.js":211===e?"wp-audio.c9624cb6e5dc9de86abd.bundle.min.js":215===e?"nested-tabs.a2401356d329f179475e.bundle.min.js":915===e?"nested-accordion.294d40984397351fd0f5.bundle.min.js":1===e?"contact-buttons.e98d0220ce8c38404e7e.bundle.min.js":336===e?"floating-bars.740d06d17cea5cebdb61.bundle.min.js":557===e?"shared-frontend-handlers.03caa53373b56d3bab67.bundle.min.js":396===e?"shared-editor-handlers.cacdcbed391abf4b48b0.bundle.min.js":768===e?"container-editor-handlers.49d65af3a7e15d2d67e8.bundle.min.js":77===e?"section-frontend-handlers.d85ab872da118940910d.bundle.min.js":220===e?"section-editor-handlers.53ffedef32043348b99b.bundle.min.js":304===e?"nested-title-keyboard-handler.2a67d3cc630e11815acc.bundle.min.js":void 0,__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a="elementorFrontend:",__webpack_require__.l=(e,r,_,n)=>{if(t[e])t[e].push(r);else{var i,c;if(void 0!==_)for(var o=document.getElementsByTagName("script"),b=0;b<o.length;b++){var d=o[b];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==a+_){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",__webpack_require__.nc&&i.setAttribute("nonce",__webpack_require__.nc),i.setAttribute("data-webpack",a+_),i.src=e),t[e]=[r];var onScriptComplete=(r,_)=>{i.onerror=i.onload=null,clearTimeout(u);var a=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(e=>e(_)),r)return r(_)},u=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=onScriptComplete.bind(null,i.onerror),i.onload=onScriptComplete.bind(null,i.onload),c&&document.head.appendChild(i)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var r=__webpack_require__.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var _=r.getElementsByTagName("script");if(_.length)for(var t=_.length-1;t>-1&&(!e||!/^http(s?):/.test(e));)e=_[t--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={76:0};__webpack_require__.f.j=(r,_)=>{var t=__webpack_require__.o(e,r)?e[r]:void 0;if(0!==t)if(t)_.push(t[2]);else if(76!=r){var a=new Promise((_,a)=>t=e[r]=[_,a]);_.push(t[2]=a);var n=__webpack_require__.p+__webpack_require__.u(r),i=new Error;__webpack_require__.l(n,_=>{if(__webpack_require__.o(e,r)&&(0!==(t=e[r])&&(e[r]=void 0),t)){var a=_&&("load"===_.type?"missing":_.type),n=_&&_.target&&_.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+n+")",i.name="ChunkLoadError",i.type=a,i.request=n,t[1](i)}},"chunk-"+r,r)}else e[r]=0},__webpack_require__.O.j=r=>0===e[r];var webpackJsonpCallback=(r,_)=>{var t,a,[n,i,c]=_,o=0;if(n.some(r=>0!==e[r])){for(t in i)__webpack_require__.o(i,t)&&(__webpack_require__.m[t]=i[t]);if(c)var b=c(__webpack_require__)}for(r&&r(_);o<n.length;o++)a=n[o],__webpack_require__.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return __webpack_require__.O(b)},r=self.webpackChunkelementorFrontend=self.webpackChunkelementorFrontend||[];r.forEach(webpackJsonpCallback.bind(null,0)),r.push=webpackJsonpCallback.bind(null,r.push.bind(r))})()})();
(self.webpackChunkelementorFrontend=self.webpackChunkelementorFrontend||[]).push([[941],{1:(e,t,r)=>{"use strict";var n=r(5578),i=r(7255),s=r(5755),o=r(1866),a=r(6029),c=r(5022),l=n.Symbol,u=i("wks"),p=c?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return s(u,e)||(u[e]=a&&s(l,e)?l[e]:p("Symbol."+e)),u[e]}},41:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},169:(e,t,r)=>{"use strict";var n=r(4762),i=r(8473),s=r(1483),o=r(5755),a=r(382),c=r(2048).CONFIGURABLE,l=r(7268),u=r(4483),p=u.enforce,d=u.get,h=String,f=Object.defineProperty,g=n("".slice),m=n("".replace),v=n([].join),y=a&&!i(function(){return 8!==f(function(){},"length",{value:8}).length}),w=String(String).split("String"),b=e.exports=function(e,t,r){"Symbol("===g(h(t),0,7)&&(t="["+m(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!o(e,"name")||c&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&o(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=p(e);return o(n,"source")||(n.source=v(w,"string"==typeof t?t:"")),e};Function.prototype.toString=b(function toString(){return s(this)&&d(this).source||l(this)},"toString")},274:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},348:(e,t,r)=>{"use strict";var n=r(1807),i=r(1483),s=r(1704),o=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!s(a=n(r,e)))return a;if(i(r=e.valueOf)&&!s(a=n(r,e)))return a;if("string"!==t&&i(r=e.toString)&&!s(a=n(r,e)))return a;throw new o("Can't convert object to primitive value")}},382:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},641:(e,t,r)=>{"use strict";r(5724),r(4846),r(7458),r(9655);const Module=function(){const e=jQuery,t=arguments,r=this,n={};let i;this.getItems=function(e,t){if(t){const r=t.split("."),n=r.splice(0,1);if(!r.length)return e[n];if(!e[n])return;return this.getItems(e[n],r.join("."))}return e},this.getSettings=function(e){return this.getItems(i,e)},this.setSettings=function(t,n,s){if(s||(s=i),"object"==typeof t)return e.extend(s,t),r;const o=t.split("."),a=o.splice(0,1);return o.length?(s[a]||(s[a]={}),r.setSettings(o.join("."),n,s[a])):(s[a]=n,r)},this.getErrorMessage=function(e,t){let r;if("forceMethodImplementation"===e)r=`The method '${t}' must to be implemented in the inheritor child.`;else r="An error occurs";return r},this.forceMethodImplementation=function(e){throw new Error(this.getErrorMessage("forceMethodImplementation",e))},this.on=function(t,i){if("object"==typeof t)return e.each(t,function(e){r.on(e,this)}),r;return t.split(" ").forEach(function(e){n[e]||(n[e]=[]),n[e].push(i)}),r},this.off=function(e,t){if(!n[e])return r;if(!t)return delete n[e],r;const i=n[e].indexOf(t);return-1!==i&&(delete n[e][i],n[e]=n[e].filter(e=>e)),r},this.trigger=function(t){const i="on"+t[0].toUpperCase()+t.slice(1),s=Array.prototype.slice.call(arguments,1);r[i]&&r[i].apply(r,s);const o=n[t];return o?(e.each(o,function(e,t){t.apply(r,s)}),r):r},r.__construct.apply(r,t),e.each(r,function(e){const t=r[e];"function"==typeof t&&(r[e]=function(){return t.apply(r,arguments)})}),function(){i=r.getDefaultSettings();const n=t[0];n&&e.extend(!0,i,n)}(),r.trigger("init")};Module.prototype.__construct=function(){},Module.prototype.getDefaultSettings=function(){return{}},Module.prototype.getConstructorID=function(){return this.constructor.name},Module.extend=function(e){const t=jQuery,r=this,child=function(){return r.apply(this,arguments)};return t.extend(child,r),(child.prototype=Object.create(t.extend({},r.prototype,e))).constructor=child,child.__super__=r.prototype,child},e.exports=Module},670:(e,t,r)=>{"use strict";var n=r(382),i=r(5835),s=r(7738);e.exports=function(e,t,r){n?i.f(e,t,s(0,r)):e[t]=r}},751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724),r(4846),r(9655);class InstanceType{static[Symbol.hasInstance](e){let t=super[Symbol.hasInstance](e);if(e&&!e.constructor.getInstanceType)return t;if(e&&(e.instanceTypes||(e.instanceTypes=[]),t||this.getInstanceType()===e.constructor.getInstanceType()&&(t=!0),t)){const t=this.getInstanceType===InstanceType.getInstanceType?"BaseInstanceType":this.getInstanceType();-1===e.instanceTypes.indexOf(t)&&e.instanceTypes.push(t)}return!t&&e&&(t=e.instanceTypes&&Array.isArray(e.instanceTypes)&&-1!==e.instanceTypes.indexOf(this.getInstanceType())),t}static getInstanceType(){elementorModules.ForceMethodImplementation()}constructor(){let e=new.target;const t=[];for(;e.__proto__&&e.__proto__.name;)t.push(e.__proto__),e=e.__proto__;t.reverse().forEach(e=>this instanceof e)}}t.default=InstanceType},1091:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},1265:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(641)),s=n(r(2425)),o=n(r(2946)),a=n(r(3980)),c=n(r(2970)),l=n(r(8685)),u=r(9031),p=r(1462);const d={Module:i.default,ViewModule:s.default,ArgsObject:o.default,ForceMethodImplementation:l.default,utils:{Masonry:a.default,Scroll:c.default},importExport:{createGetInitialState:u.createGetInitialState,customizationDialogsRegistry:p.customizationDialogsRegistry}};window.elementorModules?Object.assign(window.elementorModules,d):window.elementorModules=d;t.default=window.elementorModules},1278:(e,t,r)=>{"use strict";var n=r(4762),i=n({}.toString),s=n("".slice);e.exports=function(e){return s(i(e),8,-1)}},1409:(e,t,r)=>{"use strict";var n=r(5578),i=r(1483);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},1423:(e,t,r)=>{"use strict";var n=r(1409),i=r(1483),s=r(4815),o=r(5022),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&s(t.prototype,a(e))}},1462:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.customizationDialogsRegistry=void 0;var n=r(7958);t.customizationDialogsRegistry=new n.BaseRegistry},1483:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},1506:(e,t,r)=>{"use strict";var n=r(2914),i=r(1807),s=r(2293),o=r(8761),a=r(5299),c=r(6960),l=r(4815),u=r(4887),p=r(6665),d=r(6721),h=TypeError,Result=function(e,t){this.stopped=e,this.result=t},f=Result.prototype;e.exports=function(e,t,r){var g,m,v,y,w,b,S,x=r&&r.that,E=!(!r||!r.AS_ENTRIES),I=!(!r||!r.IS_RECORD),_=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),O=n(t,x),stop=function(e){return g&&d(g,"normal"),new Result(!0,e)},callFn=function(e){return E?(s(e),C?O(e[0],e[1],stop):O(e[0],e[1])):C?O(e,stop):O(e)};if(I)g=e.iterator;else if(_)g=e;else{if(!(m=p(e)))throw new h(o(e)+" is not iterable");if(a(m)){for(v=0,y=c(e);y>v;v++)if((w=callFn(e[v]))&&l(f,w))return w;return new Result(!1)}g=u(e,m)}for(b=I?e.next:g.next;!(S=i(b,g)).done;){try{w=callFn(S.value)}catch(e){d(g,"throw",e)}if("object"==typeof w&&w&&l(f,w))return w}return new Result(!1)}},1507:e=>{"use strict";e.exports={}},1703:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function trunc(e){var n=+e;return(n>0?r:t)(n)}},1704:(e,t,r)=>{"use strict";var n=r(1483);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},1799:(e,t,r)=>{"use strict";var n=r(382),i=r(8473),s=r(3145);e.exports=!n&&!i(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},1807:(e,t,r)=>{"use strict";var n=r(274),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},1831:(e,t,r)=>{"use strict";var n=r(9557),i=r(5578),s=r(2095),o="__core-js_shared__",a=e.exports=i[o]||s(o,{});(a.versions||(a.versions=[])).push({version:"3.46.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"})},1851:(e,t,r)=>{"use strict";var n,i,s,o=r(8473),a=r(1483),c=r(1704),l=r(5290),u=r(3181),p=r(7914),d=r(1),h=r(9557),f=d("iterator"),g=!1;[].keys&&("next"in(s=[].keys())?(i=u(u(s)))!==Object.prototype&&(n=i):g=!0),!c(n)||o(function(){var e={};return n[f].call(e)!==e})?n={}:h&&(n=l(n)),a(n[f])||p(n,f,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},1866:(e,t,r)=>{"use strict";var n=r(4762),i=0,s=Math.random(),o=n(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+s,36)}},1975:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(8120),o=r(2293),a=r(41),c=r(8660),l=r(8901),u=r(9557),p=r(6721),d=r(7486),h=r(5267),f=!u&&!d("filter",function(){}),g=!u&&!f&&h("filter",TypeError),m=u||f||g,v=c(function(){for(var e,t,r=this.iterator,n=this.predicate,s=this.next;;){if(e=o(i(s,r)),this.done=!!e.done)return;if(t=e.value,l(r,n,[t,this.counter++],!0))return t}});n({target:"Iterator",proto:!0,real:!0,forced:m},{filter:function filter(e){o(this);try{s(e)}catch(e){p(this,"throw",e)}return g?i(g,this,e):new v(a(this),{predicate:e})}})},1983:(e,t,r)=>{"use strict";var n=r(6721);e.exports=function(e,t,r){for(var i=e.length-1;i>=0;i--)if(void 0!==e[i])try{r=n(e[i].iterator,t,r)}catch(e){t="throw",r=e}if("throw"===t)throw r;return r}},2048:(e,t,r)=>{"use strict";var n=r(382),i=r(5755),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=i(s,"name"),c=a&&"something"===function something(){}.name,l=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:l}},2095:(e,t,r)=>{"use strict";var n=r(5578),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},2121:(e,t,r)=>{"use strict";var n=r(4762),i=r(8473),s=r(1278),o=Object,a=n("".split);e.exports=i(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"===s(e)?a(e,""):o(e)}:o},2278:(e,t,r)=>{"use strict";var n=r(6742),i=r(4741).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,i)}},2293:(e,t,r)=>{"use strict";var n=r(1704),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not an object")}},2313:(e,t,r)=>{"use strict";var n=r(7914);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},2347:(e,t,r)=>{"use strict";var n=r(3312),i=Object;e.exports=function(e){return i(n(e))}},2355:(e,t,r)=>{"use strict";var n=r(1807),i=r(1704),s=r(1423),o=r(2564),a=r(348),c=r(1),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!i(e)||s(e))return e;var r,c=o(e,u);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!i(r)||s(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},2425:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(641));t.default=i.default.extend({elements:null,getDefaultElements:()=>({}),bindEvents(){},onInit(){this.initElements(),this.bindEvents()},initElements(){this.elements=this.getDefaultElements()}})},2564:(e,t,r)=>{"use strict";var n=r(8120),i=r(5983);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},2811:(e,t,r)=>{"use strict";var n=r(1409);e.exports=n("document","documentElement")},2890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211);class _default extends elementorModules.ViewModule{getDefaultSettings(){return{selectors:{elements:".elementor-element",nestedDocumentElements:".elementor .elementor-element"},classes:{editMode:"elementor-edit-mode"}}}getDefaultElements(){const e=this.getSettings("selectors");return{$elements:this.$element.find(e.elements).not(this.$element.find(e.nestedDocumentElements))}}getDocumentSettings(e){let t;if(this.isEdit){t={};const e=elementor.settings.page.model;jQuery.each(e.getActiveControls(),r=>{t[r]=e.attributes[r]})}else t=this.$element.data("elementor-settings")||{};return this.getItems(t,e)}runElementsHandlers(){this.elements.$elements.each((e,t)=>setTimeout(()=>elementorFrontend.elementsHandler.runReadyTrigger(t)))}onInit(){this.$element=this.getSettings("$element"),super.onInit(),this.isEdit=this.$element.hasClass(this.getSettings("classes.editMode")),this.isEdit?elementor.on("document:loaded",()=>{elementor.settings.page.model.on("change",this.onSettingsChange.bind(this))}):this.runElementsHandlers()}onSettingsChange(){}}t.default=_default},2914:(e,t,r)=>{"use strict";var n=r(3786),i=r(8120),s=r(274),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},2946:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(751)),s=n(r(5213));class ArgsObject extends i.default{static getInstanceType(){return"ArgsObject"}constructor(e){super(),this.args=e}requireArgument(e,t=this.args){if(!Object.prototype.hasOwnProperty.call(t,e))throw Error(`${e} is required.`)}requireArgumentType(e,t,r=this.args){if(this.requireArgument(e,r),typeof r[e]!==t)throw Error(`${e} invalid type: ${t}.`)}requireArgumentInstance(e,t,r=this.args){if(this.requireArgument(e,r),!(r[e]instanceof t||(0,s.default)(r[e],t)))throw Error(`${e} invalid instance.`)}requireArgumentConstructor(e,t,r=this.args){if(this.requireArgument(e,r),r[e].constructor.toString()!==t.prototype.constructor.toString())throw Error(`${e} invalid constructor type.`)}}t.default=ArgsObject},2970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724);t.default=class Scroll{static scrollObserver(e){let t=0;const r={root:e.root||null,rootMargin:e.offset||"0px",threshold:((e=0)=>{const t=[];if(e>0&&e<=100){const r=100/e;for(let e=0;e<=100;e+=r)t.push(e/100)}else t.push(0);return t})(e.sensitivity)};return new IntersectionObserver(function handleIntersect(r){const n=r[0].boundingClientRect.y,i=r[0].isIntersecting,s=n<t?"down":"up",o=Math.abs(parseFloat((100*r[0].intersectionRatio).toFixed(2)));e.callback({sensitivity:e.sensitivity,isInViewport:i,scrollPercentage:o,intersectionScrollDirection:s}),t=n},r)}static getElementViewportPercentage(e,t={}){const r=e[0].getBoundingClientRect(),n=t.start||0,i=t.end||0,s=window.innerHeight*n/100,o=window.innerHeight*i/100,a=r.top-window.innerHeight,c=0-a+s,l=r.top+s+e.height()-a+o,u=Math.max(0,Math.min(c/l,1));return parseFloat((100*u).toFixed(2))}static getPageScrollPercentage(e={},t){const r=e.start||0,n=e.end||0,i=t||document.documentElement.scrollHeight-document.documentElement.clientHeight,s=i*r/100,o=i+s+i*n/100;return(document.documentElement.scrollTop+document.body.scrollTop+s)/o*100}}},3005:(e,t,r)=>{"use strict";var n=r(1703);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},3145:(e,t,r)=>{"use strict";var n=r(5578),i=r(1704),s=n.document,o=i(s)&&i(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},3181:(e,t,r)=>{"use strict";var n=r(5755),i=r(1483),s=r(2347),o=r(5409),a=r(9441),c=o("IE_PROTO"),l=Object,u=l.prototype;e.exports=a?l.getPrototypeOf:function(e){var t=s(e);if(n(t,c))return t[c];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof l?u:null}},3242:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(1506),o=r(8120),a=r(2293),c=r(41),l=r(6721),u=r(5267)("find",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{find:function find(e){a(this);try{o(e)}catch(e){l(this,"throw",e)}if(u)return i(u,this,e);var t=c(this),r=0;return s(t,function(t,n){if(e(t,r++))return n(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},3312:(e,t,r)=>{"use strict";var n=r(5983),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},3392:(e,t,r)=>{"use strict";var n=r(3005),i=Math.max,s=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):s(r,t)}},3617:(e,t,r)=>{"use strict";var n=r(8612),i=r(5578),s=r(6021),o=r(2293),a=r(1483),c=r(3181),l=r(3864),u=r(670),p=r(8473),d=r(5755),h=r(1),f=r(1851).IteratorPrototype,g=r(382),m=r(9557),v="constructor",y="Iterator",w=h("toStringTag"),b=TypeError,S=i[y],x=m||!a(S)||S.prototype!==f||!p(function(){S({})}),E=function Iterator(){if(s(this,f),c(this)===f)throw new b("Abstract class Iterator not directly constructable")},defineIteratorPrototypeAccessor=function(e,t){g?l(f,e,{configurable:!0,get:function(){return t},set:function(t){if(o(this),this===f)throw new b("You can't redefine this property");d(this,e)?this[e]=t:u(this,e,t)}}):f[e]=t};d(f,w)||defineIteratorPrototypeAccessor(w,y),!x&&d(f,v)&&f[v]!==Object||defineIteratorPrototypeAccessor(v,E),E.prototype=f,n({global:!0,constructor:!0,forced:x},{Iterator:E})},3658:(e,t,r)=>{"use strict";var n=r(6742),i=r(4741);e.exports=Object.keys||function keys(e){return n(e,i)}},3786:(e,t,r)=>{"use strict";var n=r(1278),i=r(4762);e.exports=function(e){if("Function"===n(e))return i(e)}},3815:(e,t,r)=>{"use strict";var n=r(2355),i=r(1423);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},3864:(e,t,r)=>{"use strict";var n=r(169),i=r(5835);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},3896:(e,t,r)=>{"use strict";var n=r(382),i=r(8473);e.exports=n&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},3980:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724);var i=n(r(2425));t.default=i.default.extend({getDefaultSettings:()=>({container:null,items:null,columnsCount:3,verticalSpaceBetween:30}),getDefaultElements(){return{$container:jQuery(this.getSettings("container")),$items:jQuery(this.getSettings("items"))}},run(){var e=[],t=this.elements.$container.position().top,r=this.getSettings(),n=r.columnsCount;t+=parseInt(this.elements.$container.css("margin-top"),10),this.elements.$items.each(function(i){var s=Math.floor(i/n),o=jQuery(this),a=o[0].getBoundingClientRect().height+r.verticalSpaceBetween;if(s){var c=o.position(),l=i%n,u=c.top-t-e[l];u-=parseInt(o.css("margin-top"),10),u*=-1,o.css("margin-top",u+"px"),e[l]+=a}else e.push(a)})}})},3991:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(8120),o=r(2293),a=r(41),c=r(8660),l=r(8901),u=r(6721),p=r(7486),d=r(5267),h=r(9557),f=!h&&!p("map",function(){}),g=!h&&!f&&d("map",TypeError),m=h||f||g,v=c(function(){var e=this.iterator,t=o(i(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});n({target:"Iterator",proto:!0,real:!0,forced:m},{map:function map(e){o(this);try{s(e)}catch(e){u(this,"throw",e)}return g?i(g,this,e):new v(a(this),{mapper:e})}})},4338:(e,t,r)=>{"use strict";var n={};n[r(1)("toStringTag")]="z",e.exports="[object z]"===String(n)},4347:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},4364:(e,t,r)=>{"use strict";r(3991)},4483:(e,t,r)=>{"use strict";var n,i,s,o=r(4644),a=r(5578),c=r(1704),l=r(9037),u=r(5755),p=r(1831),d=r(5409),h=r(1507),f="Object already initialized",g=a.TypeError,m=a.WeakMap;if(o||p.state){var v=p.state||(p.state=new m);v.get=v.get,v.has=v.has,v.set=v.set,n=function(e,t){if(v.has(e))throw new g(f);return t.facade=e,v.set(e,t),t},i=function(e){return v.get(e)||{}},s=function(e){return v.has(e)}}else{var y=d("state");h[y]=!0,n=function(e,t){if(u(e,y))throw new g(f);return t.facade=e,l(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},s=function(e){return u(e,y)}}e.exports={set:n,get:i,has:s,enforce:function(e){return s(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=i(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return r}}}},4644:(e,t,r)=>{"use strict";var n=r(5578),i=r(1483),s=n.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},4741:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},4762:(e,t,r)=>{"use strict";var n=r(274),i=Function.prototype,s=i.call,o=n&&i.bind.bind(s,s);e.exports=n?o:function(e){return function(){return s.apply(e,arguments)}}},4815:(e,t,r)=>{"use strict";var n=r(4762);e.exports=n({}.isPrototypeOf)},4846:(e,t,r)=>{"use strict";r(3617)},4887:(e,t,r)=>{"use strict";var n=r(1807),i=r(8120),s=r(2293),o=r(8761),a=r(6665),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(i(r))return s(n(r,e));throw new c(o(e)+" is not iterable")}},4914:(e,t,r)=>{"use strict";var n=r(1278);e.exports=Array.isArray||function isArray(e){return"Array"===n(e)}},4946:(e,t,r)=>{"use strict";var n=r(6784),i=n(r(1265)),s=n(r(2890)),o=n(r(7955)),a=n(r(8140)),c=n(r(7224)),l=n(r(5633)),u=n(r(9603));i.default.frontend={Document:s.default,tools:{StretchElement:o.default},handlers:{Base:c.default,StretchedElement:a.default,SwiperBase:l.default,CarouselBase:u.default}}},4961:(e,t,r)=>{"use strict";var n=r(382),i=r(1807),s=r(7611),o=r(7738),a=r(5599),c=r(3815),l=r(5755),u=r(1799),p=Object.getOwnPropertyDescriptor;t.f=n?p:function getOwnPropertyDescriptor(e,t){if(e=a(e),t=c(t),u)try{return p(e,t)}catch(e){}if(l(e,t))return o(!i(s.f,e,t),e[t])}},5022:(e,t,r)=>{"use strict";var n=r(6029);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=(e,t)=>{t=Array.isArray(t)?t:[t];for(const r of t)if(e.constructor.name===r.prototype[Symbol.toStringTag])return!0;return!1}},5247:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},5267:(e,t,r)=>{"use strict";var n=r(5578);e.exports=function(e,t){var r=n.Iterator,i=r&&r.prototype,s=i&&i[e],o=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){o=!0}},-1)}catch(e){e instanceof t||(o=!1)}if(!o)return s}},5290:(e,t,r)=>{"use strict";var n,i=r(2293),s=r(5799),o=r(4741),a=r(1507),c=r(2811),l=r(3145),u=r(5409),p="prototype",d="script",h=u("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<"+d+">"+e+"</"+d+">"},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObject=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;NullProtoObject="undefined"!=typeof document?document.domain&&n?NullProtoObjectViaActiveX(n):(t=l("iframe"),r="java"+d+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F):NullProtoObjectViaActiveX(n);for(var i=o.length;i--;)delete NullProtoObject[p][o[i]];return NullProtoObject()};a[h]=!0,e.exports=Object.create||function create(e,t){var r;return null!==e?(EmptyConstructor[p]=i(e),r=new EmptyConstructor,EmptyConstructor[p]=null,r[h]=e):r=NullProtoObject(),void 0===t?r:s.f(r,t)}},5299:(e,t,r)=>{"use strict";var n=r(1),i=r(6775),s=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[s]===e)}},5409:(e,t,r)=>{"use strict";var n=r(7255),i=r(1866),s=n("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},5578:function(e,t,r){"use strict";var check=function(e){return e&&e.Math===Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof r.g&&r.g)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()},5599:(e,t,r)=>{"use strict";var n=r(2121),i=r(3312);e.exports=function(e){return n(i(e))}},5633:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(7224));class SwiperHandlerBase extends i.default{getInitialSlide(){const e=this.getEditSettings();return e.activeItemIndex?e.activeItemIndex-1:0}getSlidesCount(){return this.elements.$slides.length}togglePauseOnHover(e){e?this.elements.$swiperContainer.on({mouseenter:()=>{this.swiper.autoplay.stop()},mouseleave:()=>{this.swiper.autoplay.start()}}):this.elements.$swiperContainer.off("mouseenter mouseleave")}handleKenBurns(){const e=this.getSettings();this.$activeImageBg&&this.$activeImageBg.removeClass(e.classes.kenBurnsActive),this.activeItemIndex=this.swiper?this.swiper.activeIndex:this.getInitialSlide(),this.swiper?this.$activeImageBg=jQuery(this.swiper.slides[this.activeItemIndex]).children("."+e.classes.slideBackground):this.$activeImageBg=jQuery(this.elements.$slides[0]).children("."+e.classes.slideBackground),this.$activeImageBg.addClass(e.classes.kenBurnsActive)}}t.default=SwiperHandlerBase},5724:(e,t,r)=>{"use strict";var n=r(8612),i=r(2347),s=r(6960),o=r(9273),a=r(1091);n({target:"Array",proto:!0,arity:1,forced:r(8473)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function push(e){var t=i(this),r=s(t),n=arguments.length;a(r+n);for(var c=0;c<n;c++)t[r]=arguments[c],r++;return o(t,r),r}})},5755:(e,t,r)=>{"use strict";var n=r(4762),i=r(2347),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return s(i(e),t)}},5799:(e,t,r)=>{"use strict";var n=r(382),i=r(3896),s=r(5835),o=r(2293),a=r(5599),c=r(3658);t.f=n&&!i?Object.defineProperties:function defineProperties(e,t){o(e);for(var r,n=a(t),i=c(t),l=i.length,u=0;l>u;)s.f(e,r=i[u++],n[r]);return e}},5835:(e,t,r)=>{"use strict";var n=r(382),i=r(1799),s=r(3896),o=r(2293),a=r(3815),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p="enumerable",d="configurable",h="writable";t.f=n?s?function defineProperty(e,t,r){if(o(e),t=a(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=u(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:p in r?r[p]:n[p],writable:!1})}return l(e,t,r)}:l:function defineProperty(e,t,r){if(o(e),t=a(t),o(r),i)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},5983:e=>{"use strict";e.exports=function(e){return null==e}},6021:(e,t,r)=>{"use strict";var n=r(4815),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},6029:(e,t,r)=>{"use strict";var n=r(6477),i=r(8473),s=r(5578).String;e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},6145:(e,t,r)=>{"use strict";var n=r(4338),i=r(1483),s=r(1278),o=r(1)("toStringTag"),a=Object,c="Arguments"===s(function(){return arguments}());e.exports=n?s:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?r:c?s(t):"Object"===(n=s(t))&&i(t.callee)?"Arguments":n}},6211:(e,t,r)=>{"use strict";r(3242)},6477:(e,t,r)=>{"use strict";var n,i,s=r(5578),o=r(9461),a=s.process,c=s.Deno,l=a&&a.versions||c&&c.version,u=l&&l.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},6651:(e,t,r)=>{"use strict";var n=r(5599),i=r(3392),s=r(6960),createMethod=function(e){return function(t,r,o){var a=n(t),c=s(a);if(0===c)return!e&&-1;var l,u=i(o,c);if(e&&r!=r){for(;c>u;)if((l=a[u++])!=l)return!0}else for(;c>u;u++)if((e||u in a)&&a[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},6665:(e,t,r)=>{"use strict";var n=r(6145),i=r(2564),s=r(5983),o=r(6775),a=r(1)("iterator");e.exports=function(e){if(!s(e))return i(e,a)||i(e,"@@iterator")||o[n(e)]}},6721:(e,t,r)=>{"use strict";var n=r(1807),i=r(2293),s=r(2564);e.exports=function(e,t,r){var o,a;i(e);try{if(!(o=s(e,"return"))){if("throw"===t)throw r;return r}o=n(o,e)}catch(e){a=!0,o=e}if("throw"===t)throw r;if(a)throw o;return i(o),r}},6726:(e,t,r)=>{"use strict";var n=r(5755),i=r(9497),s=r(4961),o=r(5835);e.exports=function(e,t,r){for(var a=i(t),c=o.f,l=s.f,u=0;u<a.length;u++){var p=a[u];n(e,p)||r&&n(r,p)||c(e,p,l(t,p))}}},6742:(e,t,r)=>{"use strict";var n=r(4762),i=r(5755),s=r(5599),o=r(6651).indexOf,a=r(1507),c=n([].push);e.exports=function(e,t){var r,n=s(e),l=0,u=[];for(r in n)!i(a,r)&&i(n,r)&&c(u,r);for(;t.length>l;)i(n,r=t[l++])&&(~o(u,r)||c(u,r));return u}},6775:e=>{"use strict";e.exports={}},6784:e=>{e.exports=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},6960:(e,t,r)=>{"use strict";var n=r(8324);e.exports=function(e){return n(e.length)}},7224:(e,t,r)=>{"use strict";r(5724),r(4846),r(7458),r(6211),r(9655),e.exports=elementorModules.ViewModule.extend({$element:null,editorListeners:null,onElementChange:null,onEditSettingsChange:null,onPageSettingsChange:null,isEdit:null,__construct(e){this.isActive(e)&&(this.$element=e.$element,this.isEdit=this.$element.hasClass("elementor-element-edit-mode"),this.isEdit&&this.addEditorListeners())},isActive:()=>!0,isElementInTheCurrentDocument(){return!!elementorFrontend.isEditMode()&&elementor.documents.currentDocument.id.toString()===this.$element[0].closest(".elementor").dataset.elementorId},findElement(e){var t=this.$element;return t.find(e).filter(function(){return jQuery(this).parent().closest(".elementor-element").is(t)})},getUniqueHandlerID(e,t){return e||(e=this.getModelCID()),t||(t=this.$element),e+t.attr("data-element_type")+this.getConstructorID()},initEditorListeners(){var e=this;if(e.editorListeners=[{event:"element:destroy",to:elementor.channels.data,callback(t){t.cid===e.getModelCID()&&e.onDestroy()}}],e.onElementChange){const t=e.getWidgetType()||e.getElementType();let r="change";"global"!==t&&(r+=":"+t),e.editorListeners.push({event:r,to:elementor.channels.editor,callback(t,r){e.getUniqueHandlerID(r.model.cid,r.$el)===e.getUniqueHandlerID()&&e.onElementChange(t.model.get("name"),t,r)}})}e.onEditSettingsChange&&e.editorListeners.push({event:"change:editSettings",to:elementor.channels.editor,callback(t,r){if(r.model.cid!==e.getModelCID())return;const n=Object.keys(t.changed)[0];e.onEditSettingsChange(n,t.changed[n])}}),["page"].forEach(function(t){var r="on"+t[0].toUpperCase()+t.slice(1)+"SettingsChange";e[r]&&e.editorListeners.push({event:"change",to:elementor.settings[t].model,callback(t){e[r](t.changed)}})})},getEditorListeners(){return this.editorListeners||this.initEditorListeners(),this.editorListeners},addEditorListeners(){var e=this.getUniqueHandlerID();this.getEditorListeners().forEach(function(t){elementorFrontend.addListenerOnce(e,t.event,t.callback,t.to)})},removeEditorListeners(){var e=this.getUniqueHandlerID();this.getEditorListeners().forEach(function(t){elementorFrontend.removeListeners(e,t.event,null,t.to)})},getElementType(){return this.$element.data("element_type")},getWidgetType(){const e=this.$element.data("widget_type");if(e)return e.split(".")[0]},getID(){return this.$element.data("id")},getModelCID(){return this.$element.data("model-cid")},getElementSettings(e){let t={};const r=this.getModelCID();if(this.isEdit&&r){const e=elementorFrontend.config.elements.data[r],n=e.attributes;let i=n.widgetType||n.elType;n.isInner&&(i="inner-"+i);let s=elementorFrontend.config.elements.keys[i];s||(s=elementorFrontend.config.elements.keys[i]=[],jQuery.each(e.controls,(e,t)=>{(t.frontend_available||t.editor_available)&&s.push(e)})),jQuery.each(e.getActiveControls(),function(e){if(-1!==s.indexOf(e)){let r=n[e];r.toJSON&&(r=r.toJSON()),t[e]=r}})}else t=this.$element.data("settings")||{};return this.getItems(t,e)},getEditSettings(e){var t={};return this.isEdit&&(t=elementorFrontend.config.elements.editSettings[this.getModelCID()].attributes),this.getItems(t,e)},getCurrentDeviceSetting(e){return elementorFrontend.getCurrentDeviceSetting(this.getElementSettings(),e)},onInit(){this.isActive(this.getSettings())&&elementorModules.ViewModule.prototype.onInit.apply(this,arguments)},onDestroy(){this.isEdit&&this.removeEditorListeners(),this.unbindEvents&&this.unbindEvents()}})},7255:(e,t,r)=>{"use strict";var n=r(1831);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},7268:(e,t,r)=>{"use strict";var n=r(4762),i=r(1483),s=r(1831),o=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(e){return o(e)}),e.exports=s.inspectSource},7458:(e,t,r)=>{"use strict";r(1975)},7486:e=>{"use strict";e.exports=function(e,t){var r="function"==typeof Iterator&&Iterator.prototype[e];if(r)try{r.call({next:null},t).next()}catch(e){return!0}}},7611:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:r},7738:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7914:(e,t,r)=>{"use strict";var n=r(1483),i=r(5835),s=r(169),o=r(2095);e.exports=function(e,t,r,a){a||(a={});var c=a.enumerable,l=void 0!==a.name?a.name:t;if(n(r)&&s(r,l,a),a.global)c?e[t]=r:o(t,r);else{try{a.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},7955:e=>{"use strict";e.exports=elementorModules.ViewModule.extend({getDefaultSettings:()=>({element:null,direction:elementorFrontend.config.is_rtl?"right":"left",selectors:{container:window},considerScrollbar:!1,cssOutput:"inline"}),getDefaultElements(){return{$element:jQuery(this.getSettings("element"))}},stretch(){const e=this.getSettings();let t;try{t=jQuery(e.selectors.container)}catch(e){}t&&t.length||(t=jQuery(this.getDefaultSettings().selectors.container)),this.reset();var r=this.elements.$element,n=t.innerWidth(),i=r.offset().left,s="fixed"===r.css("position"),o=s?0:i,a=window===t[0];if(!a){var c=t.offset().left;s&&(o=c),i>c&&(o=i-c)}if(e.considerScrollbar&&a){o-=window.innerWidth-n}s||(elementorFrontend.config.is_rtl&&(o=n-(r.outerWidth()+o)),o=-o),e.margin&&(o+=e.margin);var l={};let u=n;e.margin&&(u-=2*e.margin),l.width=u+"px",l[e.direction]=o+"px","variables"!==e.cssOutput?r.css(l):this.applyCssVariables(r,l)},reset(){const e={},t=this.getSettings(),r=this.elements.$element;"variables"!==t.cssOutput?(e.width="",e[t.direction]="",r.css(e)):this.resetCssVariables(r)},applyCssVariables(e,t){e.css("--stretch-width",t.width),t.left?e.css("--stretch-left",t.left):e.css("--stretch-right",t.right)},resetCssVariables(e){e.css({"--stretch-width":"","--stretch-left":"","--stretch-right":""})}})},7958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRegistry=void 0,r(4846),r(7458),r(9655),r(4364);t.BaseRegistry=class BaseRegistry{constructor(){this.sections=new Map}register(e){if(!e.key||!e.title)throw new Error("Template type must have key and title");const t=this.get(e.key)||this.formatSection(e);if(e.children)if(t.children){const r=new Map(t.children.map(e=>[e.key,e]));e.children.forEach(e=>{const t=this.formatSection(e);r.set(e.key,t)}),t.children=Array.from(r.values())}else t.children=e.children.map(e=>this.formatSection(e));this.sections.set(e.key,t)}formatSection({children:e,...t}){return{key:t.key,title:t.title,description:t.description||"",useParentDefault:!1!==t.useParentDefault,getInitialState:t.getInitialState||null,component:t.component||null,order:t.order||10,isAvailable:t.isAvailable||(()=>!0),...t}}getAll(){return Array.from(this.sections.values()).filter(e=>e.isAvailable()).map(e=>e.children?{...e,children:[...e.children].sort((e,t)=>e.order-t.order)}:e).sort((e,t)=>e.order-t.order)}get(e){return this.sections.get(e)}}},8120:(e,t,r)=>{"use strict";var n=r(1483),i=r(8761),s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not a function")}},8140:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211);var i=n(r(7224));class StretchedElement extends i.default{getStretchedClass(){return"e-stretched"}getStretchSettingName(){return"stretch_element"}getStretchActiveValue(){return"yes"}bindEvents(){const e=this.getUniqueHandlerID();elementorFrontend.addListenerOnce(e,"resize",this.stretch),elementorFrontend.addListenerOnce(e,"sticky:stick",this.stretch,this.$element),elementorFrontend.addListenerOnce(e,"sticky:unstick",this.stretch,this.$element),elementorFrontend.isEditMode()&&(this.onKitChangeStretchContainerChange=this.onKitChangeStretchContainerChange.bind(this),elementor.channels.editor.on("kit:change:stretchContainer",this.onKitChangeStretchContainerChange))}unbindEvents(){elementorFrontend.removeListeners(this.getUniqueHandlerID(),"resize",this.stretch),elementorFrontend.isEditMode()&&elementor.channels.editor.off("kit:change:stretchContainer",this.onKitChangeStretchContainerChange)}isActive(e){return elementorFrontend.isEditMode()||e.$element.hasClass(this.getStretchedClass())}getStretchElementForConfig(e=null){return e?this.$element.find(e):this.$element}getStretchElementConfig(){return{element:this.getStretchElementForConfig(),selectors:{container:this.getStretchContainer()},considerScrollbar:elementorFrontend.isEditMode()&&elementorFrontend.config.is_rtl}}initStretch(){this.stretch=this.stretch.bind(this),this.stretchElement=new elementorModules.frontend.tools.StretchElement(this.getStretchElementConfig())}getStretchContainer(){return elementorFrontend.getKitSettings("stretched_section_container")||window}isStretchSettingEnabled(){return this.getElementSettings(this.getStretchSettingName())===this.getStretchActiveValue()}stretch(){this.isStretchSettingEnabled()&&this.stretchElement.stretch()}onInit(...e){this.isActive(this.getSettings())&&(this.initStretch(),super.onInit(...e),this.stretch())}onElementChange(e){this.getStretchSettingName()===e&&(this.isStretchSettingEnabled()?this.stretch():this.stretchElement.reset())}onKitChangeStretchContainerChange(){this.stretchElement.setSettings("selectors.container",this.getStretchContainer()),this.stretch()}}t.default=StretchedElement},8324:(e,t,r)=>{"use strict";var n=r(3005),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},8473:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},8612:(e,t,r)=>{"use strict";var n=r(5578),i=r(4961).f,s=r(9037),o=r(7914),a=r(2095),c=r(6726),l=r(8730);e.exports=function(e,t){var r,u,p,d,h,f=e.target,g=e.global,m=e.stat;if(r=g?n:m?n[f]||a(f,{}):n[f]&&n[f].prototype)for(u in t){if(d=t[u],p=e.dontCallGetSet?(h=i(r,u))&&h.value:r[u],!l(g?u:f+(m?".":"#")+u,e.forced)&&void 0!==p){if(typeof d==typeof p)continue;c(d,p)}(e.sham||p&&p.sham)&&s(d,"sham",!0),o(r,u,d,e)}}},8660:(e,t,r)=>{"use strict";var n=r(1807),i=r(5290),s=r(9037),o=r(2313),a=r(1),c=r(4483),l=r(2564),u=r(1851).IteratorPrototype,p=r(5247),d=r(6721),h=r(1983),f=a("toStringTag"),g="IteratorHelper",m="WrapForValidIterator",v="normal",y="throw",w=c.set,createIteratorProxyPrototype=function(e){var t=c.getterFor(e?m:g);return o(i(u),{next:function next(){var r=t(this);if(e)return r.nextHandler();if(r.done)return p(void 0,!0);try{var n=r.nextHandler();return r.returnHandlerResult?n:p(n,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),i=r.iterator;if(r.done=!0,e){var s=l(i,"return");return s?n(s,i):p(void 0,!0)}if(r.inner)try{d(r.inner.iterator,v)}catch(e){return d(i,y,e)}if(r.openIters)try{h(r.openIters,v)}catch(e){return d(i,y,e)}return i&&d(i,v),p(void 0,!0)}})},b=createIteratorProxyPrototype(!0),S=createIteratorProxyPrototype(!1);s(S,f,"Iterator Helper"),e.exports=function(e,t,r){var n=function Iterator(n,i){i?(i.iterator=n.iterator,i.next=n.next):i=n,i.type=t?m:g,i.returnHandlerResult=!!r,i.nextHandler=e,i.counter=0,i.done=!1,w(this,i)};return n.prototype=t?b:S,n}},8685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ForceMethodImplementation=void 0;class ForceMethodImplementation extends Error{constructor(e={},t={}){super(`${e.isStatic?"static ":""}${e.fullName}() should be implemented, please provide '${e.functionName||e.fullName}' functionality.`,t),Object.keys(t).length&&console.error(t),Error.captureStackTrace(this,ForceMethodImplementation)}}t.ForceMethodImplementation=ForceMethodImplementation;t.default=e=>{const t=Error().stack.split("\n")[2].trim(),r=t.startsWith("at new")?"constructor":t.split(" ")[1],n={};if(n.functionName=r,n.fullName=r,n.functionName.includes(".")){const e=n.functionName.split(".");n.className=e[0],n.functionName=e[1]}else n.isStatic=!0;throw new ForceMethodImplementation(n,e)}},8730:(e,t,r)=>{"use strict";var n=r(8473),i=r(1483),s=/#|\.prototype\./,isForced=function(e,t){var r=a[o(e)];return r===l||r!==c&&(i(t)?n(t):!!t)},o=isForced.normalize=function(e){return String(e).replace(s,".").toLowerCase()},a=isForced.data={},c=isForced.NATIVE="N",l=isForced.POLYFILL="P";e.exports=isForced},8761:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},8901:(e,t,r)=>{"use strict";var n=r(2293),i=r(6721);e.exports=function(e,t,r,s){try{return s?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},9031:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGetInitialState=function createGetInitialState(e,t={}){return(r,n)=>{let i=n;if(r.hasOwnProperty("uploadedData")){i=!1;const t=r.uploadedData.manifest.templates,n=elementorAppConfig?.["import-export-customization"]?.exportGroups||{};for(const r in t){if(n[t[r].doc_type]===e){i=!0;break}}}return{enabled:i,...t}}}},9037:(e,t,r)=>{"use strict";var n=r(382),i=r(5835),s=r(7738);e.exports=n?function(e,t,r){return i.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},9273:(e,t,r)=>{"use strict";var n=r(382),i=r(4914),s=TypeError,o=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!o(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},9441:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})},9461:(e,t,r)=>{"use strict";var n=r(5578).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},9497:(e,t,r)=>{"use strict";var n=r(1409),i=r(4762),s=r(2278),o=r(4347),a=r(2293),c=i([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=s.f(a(e)),r=o.f;return r?c(t,r(e)):t}},9557:e=>{"use strict";e.exports=!1},9603:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211),r(9655);var i=n(r(5633));class CarouselHandlerBase extends i.default{getDefaultSettings(){return{selectors:{carousel:".swiper",swiperWrapper:".swiper-wrapper",slideContent:".swiper-slide",swiperArrow:".elementor-swiper-button",paginationWrapper:".swiper-pagination",paginationBullet:".swiper-pagination-bullet",paginationBulletWrapper:".swiper-pagination-bullets"}}}getDefaultElements(){const e=this.getSettings("selectors"),t={$swiperContainer:this.$element.find(e.carousel),$swiperWrapper:this.$element.find(e.swiperWrapper),$swiperArrows:this.$element.find(e.swiperArrow),$paginationWrapper:this.$element.find(e.paginationWrapper),$paginationBullets:this.$element.find(e.paginationBullet),$paginationBulletWrapper:this.$element.find(e.paginationBulletWrapper)};return t.$slides=t.$swiperContainer.find(e.slideContent),t}getSwiperSettings(){const e=this.getElementSettings(),t=+e.slides_to_show||3,r=1===t,n=elementorFrontend.config.responsive.activeBreakpoints,i={mobile:1,tablet:r?1:2},s={slidesPerView:t,loop:"yes"===e.infinite,speed:e.speed,handleElementorBreakpoints:!0,breakpoints:{}};let o=t;Object.keys(n).reverse().forEach(t=>{const r=i[t]?i[t]:o;s.breakpoints[n[t].value]={slidesPerView:+e["slides_to_show_"+t]||r,slidesPerGroup:+e["slides_to_scroll_"+t]||1},e.image_spacing_custom&&(s.breakpoints[n[t].value].spaceBetween=this.getSpaceBetween(t)),o=+e["slides_to_show_"+t]||r}),"yes"===e.autoplay&&(s.autoplay={delay:e.autoplay_speed,disableOnInteraction:"yes"===e.pause_on_interaction}),r?(s.effect=e.effect,"fade"===e.effect&&(s.fadeEffect={crossFade:!0})):s.slidesPerGroup=+e.slides_to_scroll||1,e.image_spacing_custom&&(s.spaceBetween=this.getSpaceBetween());const a="arrows"===e.navigation||"both"===e.navigation,c="dots"===e.navigation||"both"===e.navigation||e.pagination;return a&&(s.navigation={prevEl:".elementor-swiper-button-prev",nextEl:".elementor-swiper-button-next"}),c&&(s.pagination={el:`.elementor-element-${this.getID()} .swiper-pagination`,type:e.pagination?e.pagination:"bullets",clickable:!0,renderBullet:(e,t)=>`<span class="${t}" role="button" tabindex="0" data-bullet-index="${e}" aria-label="${elementorFrontend.config.i18n.a11yCarouselPaginationBulletMessage} ${e+1}"></span>`}),"yes"===e.lazyload&&(s.lazy={loadPrevNext:!0,loadPrevNextAmount:1}),s.a11y={enabled:!0,prevSlideMessage:elementorFrontend.config.i18n.a11yCarouselPrevSlideMessage,nextSlideMessage:elementorFrontend.config.i18n.a11yCarouselNextSlideMessage,firstSlideMessage:elementorFrontend.config.i18n.a11yCarouselFirstSlideMessage,lastSlideMessage:elementorFrontend.config.i18n.a11yCarouselLastSlideMessage},s.on={slideChange:()=>{this.a11ySetPaginationTabindex(),this.handleElementHandlers(),this.a11ySetSlideAriaHidden()},init:()=>{this.a11ySetPaginationTabindex(),this.a11ySetSlideAriaHidden("initialisation")}},this.applyOffsetSettings(e,s,t),s}getOffsetWidth(){const e=elementorFrontend.getCurrentDeviceMode();return elementorFrontend.utils.controls.getResponsiveControlValue(this.getElementSettings(),"offset_width","size",e)||0}applyOffsetSettings(e,t,r){const n=e.offset_sides;if(!(elementorFrontend.isEditMode()&&"NestedCarousel"===this.constructor.name)&&n&&"none"!==n)switch(n){case"right":this.forceSliderToShowNextSlideWhenOnLast(t,r),this.addClassToSwiperContainer("offset-right");break;case"left":this.addClassToSwiperContainer("offset-left");break;case"both":this.forceSliderToShowNextSlideWhenOnLast(t,r),this.addClassToSwiperContainer("offset-both")}}forceSliderToShowNextSlideWhenOnLast(e,t){e.slidesPerView=t+.001}addClassToSwiperContainer(e){this.getDefaultElements().$swiperContainer[0].classList.add(e)}async onInit(...e){if(super.onInit(...e),!this.elements.$swiperContainer.length||2>this.elements.$slides.length)return;await this.initSwiper();"yes"===this.getElementSettings().pause_on_hover&&this.togglePauseOnHover(!0)}async initSwiper(){const e=elementorFrontend.utils.swiper;this.swiper=await new e(this.elements.$swiperContainer,this.getSwiperSettings()),this.elements.$swiperContainer.data("swiper",this.swiper)}bindEvents(){this.elements.$swiperArrows.on("keydown",this.onDirectionArrowKeydown.bind(this)),this.elements.$paginationWrapper.on("keydown",".swiper-pagination-bullet",this.onDirectionArrowKeydown.bind(this)),this.elements.$swiperContainer.on("keydown",".swiper-slide",this.onDirectionArrowKeydown.bind(this)),this.$element.find(":focusable").on("focus",this.onFocusDisableAutoplay.bind(this)),elementorFrontend.elements.$window.on("resize",this.getSwiperSettings.bind(this))}unbindEvents(){this.elements.$swiperArrows.off(),this.elements.$paginationWrapper.off(),this.elements.$swiperContainer.off(),this.$element.find(":focusable").off(),elementorFrontend.elements.$window.off("resize")}onDirectionArrowKeydown(e){const t=elementorFrontend.config.is_rtl,r=e.originalEvent.code,n=t?"ArrowLeft":"ArrowRight";if(!(-1!==["ArrowLeft","ArrowRight"].indexOf(r)))return!0;(t?"ArrowRight":"ArrowLeft")===r?this.swiper.slidePrev():n===r&&this.swiper.slideNext()}onFocusDisableAutoplay(){this.swiper.autoplay.stop()}updateSwiperOption(e){const t=this.getElementSettings()[e],r=this.swiper.params;switch(e){case"autoplay_speed":r.autoplay.delay=t;break;case"speed":r.speed=t}this.swiper.update()}getChangeableProperties(){return{pause_on_hover:"pauseOnHover",autoplay_speed:"delay",speed:"speed",arrows_position:"arrows_position"}}onElementChange(e){if(0===e.indexOf("image_spacing_custom"))return void this.updateSpaceBetween(e);if(this.getChangeableProperties()[e])if("pause_on_hover"===e){const e=this.getElementSettings("pause_on_hover");this.togglePauseOnHover("yes"===e)}else this.updateSwiperOption(e)}onEditSettingsChange(e){"activeItemIndex"===e&&this.swiper.slideToLoop(this.getEditSettings("activeItemIndex")-1)}getSpaceBetween(e=null){const t=elementorFrontend.utils.controls.getResponsiveControlValue(this.getElementSettings(),"image_spacing_custom","size",e);return Number(t)||0}updateSpaceBetween(e){const t=e.match("image_spacing_custom_(.*)"),r=t?t[1]:"desktop",n=this.getSpaceBetween(r);"desktop"!==r&&(this.swiper.params.breakpoints[elementorFrontend.config.responsive.activeBreakpoints[r].value].spaceBetween=n),this.swiper.params.spaceBetween=n,this.swiper.update()}getPaginationBullets(e="array"){const t=this.$element.find(this.getSettings("selectors").paginationBullet);return"array"===e?Array.from(t):t}a11ySetPaginationTabindex(){const e=this.swiper?.params?.pagination.bulletClass,t=this.swiper?.params?.pagination.bulletActiveClass;this.getPaginationBullets().forEach(e=>{e.classList?.contains(t)||e.removeAttribute("tabindex")});const r="ArrowLeft"===event?.code||"ArrowRight"===event?.code;event?.target?.classList?.contains(e)&&r&&this.$element.find(`.${t}`).trigger("focus")}getSwiperWrapperTranformXValue(){let e=this.elements.$swiperWrapper[0]?.style.transform;return e=e.replace("translate3d(",""),e=e.split(","),e=parseInt(e[0].replace("px","")),e||0}a11ySetSlideAriaHidden(e=""){if("number"!=typeof("initialisation"===e?0:this.swiper?.activeIndex))return;const t=this.getSwiperWrapperTranformXValue(),r=this.elements.$swiperWrapper[0].clientWidth;this.elements.$swiperContainer.find(this.getSettings("selectors").slideContent).each((e,n)=>{0<=n.offsetLeft+t&&r>n.offsetLeft+t?(n.removeAttribute("aria-hidden"),n.removeAttribute("inert")):(n.setAttribute("aria-hidden",!0),n.setAttribute("inert",""))})}handleElementHandlers(){}}t.default=CarouselHandlerBase},9655:(e,t,r)=>{"use strict";r(9930)},9930:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(1506),o=r(8120),a=r(2293),c=r(41),l=r(6721),u=r(5267)("forEach",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function forEach(e){a(this);try{o(e)}catch(e){l(this,"throw",e)}if(u)return i(u,this,e);var t=c(this),r=0;s(t,function(t){e(t,r++)},{IS_RECORD:!0})}})}},e=>{var t;t=4946,e(e.s=t)}]);
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){"use strict";var t,e,i,n,W,C,o,s,r,l,a,h,u;function E(t,e,i){return[parseFloat(t[0])*(a.test(t[0])?e/100:1),parseFloat(t[1])*(a.test(t[1])?i/100:1)]}function L(t,e){return parseInt(x.css(t,e),10)||0}function N(t){return null!=t&&t===t.window}x.ui=x.ui||{},x.ui.version="1.13.3",
x.extend(x.expr.pseudos,{data:x.expr.createPseudo?x.expr.createPseudo(function(e){return function(t){return!!x.data(t,e)}}):function(t,e,i){return!!x.data(t,i[3])}}),
x.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}),
x.ui.focusable=function(t,e){var i,n,o,s=t.nodeName.toLowerCase();return"area"===s?(o=(i=t.parentNode).name,!(!t.href||!o||"map"!==i.nodeName.toLowerCase())&&0<(i=x("img[usemap='#"+o+"']")).length&&i.is(":visible")):(/^(input|select|textarea|button|object)$/.test(s)?(n=!t.disabled)&&(o=x(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===s&&t.href||e,n&&x(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(x(t)))},x.extend(x.expr.pseudos,{focusable:function(t){return x.ui.focusable(t,null!=x.attr(t,"tabindex"))}}),x.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):x(this[0].form)},
x.ui.formResetMixin={_formResetHandler:function(){var e=x(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");x.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(x.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},x.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),
x.expr.pseudos||(x.expr.pseudos=x.expr[":"]),x.uniqueSort||(x.uniqueSort=x.unique),x.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,i=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},x.escapeSelector=function(t){return(t+"").replace(e,i)}),x.fn.even&&x.fn.odd||x.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}}),
x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},
x.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+x.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},x.ui.plugin={add:function(t,e,i){var n,o=x.ui[t].prototype;for(n in i)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([e,i[n]])},call:function(t,e,i,n){var o,s=t.plugins[e];if(s&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<s.length;o++)t.options[s[o][0]]&&s[o][1].apply(t.element,i)}},
W=Math.max,C=Math.abs,o=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,a=/%$/,h=x.fn.position,x.position={scrollbarWidth:function(){var t,e,i;return void 0!==n?n:(i=(e=x("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>")).children()[0],x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),n=t-i)},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?x.position.scrollbarWidth():0,height:e?x.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=x(t||window),i=N(e[0]),n=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:n,offset:!i&&!n?x(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},x.fn.position=function(f){var c,d,p,g,m,v,y,w,b,_,t,e;return f&&f.of?(v="string"==typeof(f=x.extend({},f)).of?x(document).find(f.of):x(f.of),y=x.position.getWithinInfo(f.within),w=x.position.getScrollInfo(y),b=(f.collision||"flip").split(" "),_={},e=9===(e=(t=v)[0]).nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:N(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()},v[0].preventDefault&&(f.at="left top"),d=e.width,p=e.height,m=x.extend({},g=e.offset),x.each(["my","at"],function(){var t,e,i=(f[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):s.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=s.test(i[1])?i[1]:"center",t=r.exec(i[0]),e=r.exec(i[1]),_[this]=[t?t[0]:0,e?e[0]:0],f[this]=[l.exec(i[0])[0],l.exec(i[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===f.at[0]?m.left+=d:"center"===f.at[0]&&(m.left+=d/2),"bottom"===f.at[1]?m.top+=p:"center"===f.at[1]&&(m.top+=p/2),c=E(_.at,d,p),m.left+=c[0],m.top+=c[1],this.each(function(){var i,t,r=x(this),l=r.outerWidth(),a=r.outerHeight(),e=L(this,"marginLeft"),n=L(this,"marginTop"),o=l+e+L(this,"marginRight")+w.width,s=a+n+L(this,"marginBottom")+w.height,h=x.extend({},m),u=E(_.my,r.outerWidth(),r.outerHeight());"right"===f.my[0]?h.left-=l:"center"===f.my[0]&&(h.left-=l/2),"bottom"===f.my[1]?h.top-=a:"center"===f.my[1]&&(h.top-=a/2),h.left+=u[0],h.top+=u[1],i={marginLeft:e,marginTop:n},x.each(["left","top"],function(t,e){x.ui.position[b[t]]&&x.ui.position[b[t]][e](h,{targetWidth:d,targetHeight:p,elemWidth:l,elemHeight:a,collisionPosition:i,collisionWidth:o,collisionHeight:s,offset:[c[0]+u[0],c[1]+u[1]],my:f.my,at:f.at,within:y,elem:r})}),f.using&&(t=function(t){var e=g.left-h.left,i=e+d-l,n=g.top-h.top,o=n+p-a,s={target:{element:v,left:g.left,top:g.top,width:d,height:p},element:{element:r,left:h.left,top:h.top,width:l,height:a},horizontal:i<0?"left":0<e?"right":"center",vertical:o<0?"top":0<n?"bottom":"middle"};d<l&&C(e+i)<d&&(s.horizontal="center"),p<a&&C(n+o)<p&&(s.vertical="middle"),W(C(e),C(i))>W(C(n),C(o))?s.important="horizontal":s.important="vertical",f.using.call(this,t,s)}),r.offset(x.extend(h,{using:t}))})):h.apply(this,arguments)},x.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,n=n.width,s=t.left-e.collisionPosition.marginLeft,r=o-s,l=s+e.collisionWidth-n-o;n<e.collisionWidth?0<r&&l<=0?(i=t.left+r+e.collisionWidth-n-o,t.left+=r-i):t.left=!(0<l&&r<=0)&&l<r?o+n-e.collisionWidth:o:0<r?t.left+=r:0<l?t.left-=l:t.left=W(t.left-s,t.left)},top:function(t,e){var i,n=e.within,n=n.isWindow?n.scrollTop:n.offset.top,o=e.within.height,s=t.top-e.collisionPosition.marginTop,r=n-s,l=s+e.collisionHeight-o-n;o<e.collisionHeight?0<r&&l<=0?(i=t.top+r+e.collisionHeight-o-n,t.top+=r-i):t.top=!(0<l&&r<=0)&&l<r?n+o-e.collisionHeight:n:0<r?t.top+=r:0<l?t.top-=l:t.top=W(t.top-s,t.top)}},flip:{left:function(t,e){var i=e.within,n=i.offset.left+i.scrollLeft,o=i.width,i=i.isWindow?i.scrollLeft:i.offset.left,s=t.left-e.collisionPosition.marginLeft,r=s-i,s=s+e.collisionWidth-o-i,l="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,a="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0];r<0?((o=t.left+l+a+h+e.collisionWidth-o-n)<0||o<C(r))&&(t.left+=l+a+h):0<s&&(0<(n=t.left-e.collisionPosition.marginLeft+l+a+h-i)||C(n)<s)&&(t.left+=l+a+h)},top:function(t,e){var i=e.within,n=i.offset.top+i.scrollTop,o=i.height,i=i.isWindow?i.scrollTop:i.offset.top,s=t.top-e.collisionPosition.marginTop,r=s-i,s=s+e.collisionHeight-o-i,l="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,a="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,h=-2*e.offset[1];r<0?((o=t.top+l+a+h+e.collisionHeight-o-n)<0||o<C(r))&&(t.top+=l+a+h):0<s&&(0<(n=t.top-e.collisionPosition.marginTop+l+a+h-i)||C(n)<s)&&(t.top+=l+a+h)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}},x.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=(i=i||e.body).nodeName?i:e.body},x.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&x(t).trigger("blur")},
x.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=x(this);return(!i||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:x(this[0].ownerDocument||document)},
x.extend(x.expr.pseudos,{tabbable:function(t){var e=x.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&x.ui.focusable(t,i)}}),
x.fn.extend({uniqueId:(u=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++u)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&x(this).removeAttr("id")})}});
var f,c=0,d=Array.prototype.hasOwnProperty,p=Array.prototype.slice;x.cleanData=(f=x.cleanData,function(t){for(var e,i,n=0;null!=(i=t[n]);n++)(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove");f(t)}),x.widget=function(t,i,e){var n,o,s,r={},l=t.split(".")[0],a=l+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),Array.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr.pseudos[a.toLowerCase()]=function(t){return!!x.data(t,a)},x[l]=x[l]||{},n=x[l][t],o=x[l][t]=function(t,e){if(!this||!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},x.extend(o,n,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(s=new i).options=x.widget.extend({},s.options),x.each(e,function(e,n){function o(){return i.prototype[e].apply(this,arguments)}function s(t){return i.prototype[e].apply(this,t)}r[e]="function"!=typeof n?n:function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=s,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}}),o.prototype=x.widget.extend(s,{widgetEventPrefix:n&&s.widgetEventPrefix||t},r,{constructor:o,namespace:l,widgetName:t,widgetFullName:a}),n?(x.each(n._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete n._childConstructors):i._childConstructors.push(o),x.widget.bridge(t,o),o},x.widget.extend=function(t){for(var e,i,n=p.call(arguments,1),o=0,s=n.length;o<s;o++)for(e in n[o])i=n[o][e],d.call(n[o],e)&&void 0!==i&&(x.isPlainObject(i)?t[e]=x.isPlainObject(t[e])?x.widget.extend({},t[e],i):x.widget.extend({},i):t[e]=i);return t},x.widget.bridge=function(s,e){var r=e.prototype.widgetFullName||s;x.fn[s]=function(i){var t="string"==typeof i,n=p.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=x.data(this,r);return"instance"===i?(o=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?x.error("no such method '"+i+"' for "+s+" widget instance"):(t=e[i].apply(e,n))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:x.error("cannot call methods on "+s+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(n.length&&(i=x.widget.extend.apply(null,[i].concat(n))),this.each(function(){var t=x.data(this,r);t?(t.option(i||{}),t._init&&t._init()):x.data(this,r,new e(i,this))})),o}},x.Widget=function(){},x.Widget._childConstructors=[],x.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,n,o,s=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(s={},t=(i=t.split(".")).shift(),i.length){for(n=s[t]=x.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)n[i[o]]=n[i[o]]||{},n=n[i[o]];if(t=i.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=e}return this._setOptions(s),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,n;for(e in t)n=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&n&&n.length&&(i=x(n.get()),this._removeClass(n,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var s=[],r=this;function t(t,e){for(var i,n=0;n<t.length;n++)i=r.classesElementLookup[t[n]]||x(),i=o.add?(function(){var i=[];o.element.each(function(t,e){x.map(r.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),r._on(x(i),{remove:"_untrackClassesElement"})}(),x(x.uniqueSort(i.get().concat(o.element.get())))):x(i.not(o.element).get()),r.classesElementLookup[t[n]]=i,s.push(t[n]),e&&o.classes[t[n]]&&s.push(o.classes[t[n]])}return(o=x.extend({element:this.element,classes:this.options.classes||{}},o)).keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(i){var n=this;x.each(n.classesElementLookup,function(t,e){-1!==x.inArray(i.target,e)&&(n.classesElementLookup[t]=x(e.not(i.target).get()))}),this._off(x(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){var o="string"==typeof t||null===t,e={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:n="boolean"==typeof n?n:i};return e.element.toggleClass(this._classes(e),n),this},_on:function(o,s,t){var r,l=this;"boolean"!=typeof o&&(t=s,s=o,o=!1),t?(s=r=x(s),this.bindings=this.bindings.add(s)):(t=s,s=this.element,r=this.widget()),x.each(t,function(t,e){function i(){if(o||!0!==l.options.disabled&&!x(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||x.guid++);var t=t.match(/^([\w:-]*)\s*(.*)$/),n=t[1]+l.eventNamespace,t=t[2];t?r.on(n,t,i):s.on(n,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=x(this.bindings.not(t).get()),this.focusable=x(this.focusable.not(t).get()),this.hoverable=x(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(x(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(x(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var n,o,s=this.options[t];if(i=i||{},(e=x.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(n in o)n in e||(e[n]=o[n]);return this.element.trigger(e,i),!("function"==typeof s&&!1===s.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},x.each({show:"fadeIn",hide:"fadeOut"},function(s,r){x.Widget.prototype["_"+s]=function(e,t,i){var n,o=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||r:s;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),n=!x.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),n&&x.effects&&x.effects.effect[o]?e[s](t):o!==s&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){x(this)[s](),i&&i.call(e[0]),t()})}})});