!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(a){var e,t,n,i;function r(e,t){var n,i,r=e.nodeName.toLowerCase();return"area"===r?(i=(n=e.parentNode).name,!(!e.href||!i||"map"!==n.nodeName.toLowerCase())&&(!!(i=a("img[usemap='#"+i+"']")[0])&&o(i))):(/^(input|select|textarea|button|object)$/.test(r)?!e.disabled:"a"===r&&e.href||t)&&o(e)}function o(e){return a.expr.filters.visible(e)&&!a(e).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.4",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}}),a.fn.extend({scrollParent:function(e){var t=this.css("position"),n="absolute"===t,i=e?/(auto|scroll|hidden)/:/(auto|scroll)/,e=this.parents().filter(function(){var e=a(this);return(!n||"static"!==e.css("position"))&&i.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==t&&e.length?e:a(this[0].ownerDocument||document)},uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(t){return function(e){return!!a.data(e,t)}}):function(e,t,n){return!!a.data(e,n[3])},focusable:function(e){return r(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(e){var t=a.attr(e,"tabindex"),n=isNaN(t);return(n||0<=t)&&r(e,!n)}}),a("").outerWidth(1).jquery||a.each(["Width","Height"],function(e,n){var r="Width"===n?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),o={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function s(e,t,n,i){return a.each(r,function(){t-=parseFloat(a.css(e,"padding"+this))||0,n&&(t-=parseFloat(a.css(e,"border"+this+"Width"))||0),i&&(t-=parseFloat(a.css(e,"margin"+this))||0)}),t}a.fn["inner"+n]=function(e){return void 0===e?o["inner"+n].call(this):this.each(function(){a(this).css(i,s(this,e)+"px")})},a.fn["outer"+n]=function(e,t){return"number"!=typeof e?o["outer"+n].call(this,e):this.each(function(){a(this).css(i,s(this,e,!0,t)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),a("").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=(t=a.fn.removeData,function(e){return arguments.length?t.call(this,a.camelCase(e)):t.call(this)})),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:(i=a.fn.focus,function(t,n){return"number"==typeof t?this.each(function(){var e=this;setTimeout(function(){a(e).focus(),n&&n.call(e)},t)}):i.apply(this,arguments)}),disableSelection:(n="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.bind(n+".ui-disableSelection",function(e){e.preventDefault()})}),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var t,n,i=a(this[0]);i.length&&i[0]!==document;){if(t=i.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(n=parseInt(i.css("zIndex"),10),!isNaN(n)&&0!==n))return n;i=i.parent()}return 0}}),a.ui.plugin={add:function(e,t,n){var i,r=a.ui[e].prototype;for(i in n)r.plugins[i]=r.plugins[i]||[],r.plugins[i].push([t,n[i]])},call:function(e,t,n,i){var r,o=e.plugins[t];if(o&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(r=0;r"))}function a(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(t,"mouseout",function(){M(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&M(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&M(this).removeClass("ui-datepicker-next-hover")}).delegate(t,"mouseover",r)}function r(){M.datepicker._isDisabledDatepicker((n.inline?n.dpDiv.parent():n.input)[0])||(M(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),M(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&M(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&M(this).addClass("ui-datepicker-next-hover"))}function c(e,t){for(var a in M.extend(e,t),t)null==t[a]&&(e[a]=t[a]);return e}return M.extend(M.ui,{datepicker:{version:"1.11.4"}}),M.extend(e.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return c(this._defaults,e||{}),this},_attachDatepicker:function(e,t){var a,i=e.nodeName.toLowerCase(),s="div"===i||"span"===i;e.id||(this.uuid+=1,e.id="dp"+this.uuid),(a=this._newInst(M(e),s)).settings=M.extend({},t||{}),"input"===i?this._connectDatepicker(e,a):s&&this._inlineDatepicker(e,a)},_newInst:function(e,t){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?a(M("
")):this.dpDiv}},_connectDatepicker:function(e,t){var a=M(e);t.append=M([]),t.trigger=M([]),a.hasClass(this.markerClassName)||(this._attachments(a,t),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(t),M.data(e,"datepicker",t),t.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,t){var a,i=this._get(t,"appendText"),s=this._get(t,"isRTL");t.append&&t.append.remove(),i&&(t.append=M(""+i+""),e[s?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove(),"focus"!==(a=this._get(t,"showOn"))&&"both"!==a||e.focus(this._showDatepicker),"button"!==a&&"both"!==a||(i=this._get(t,"buttonText"),a=this._get(t,"buttonImage"),t.trigger=M(this._get(t,"buttonImageOnly")?M("").addClass(this._triggerClass).attr({src:a,alt:i,title:i}):M("").addClass(this._triggerClass).html(a?M("").attr({src:a,alt:i,title:i}):i)),e[s?"before":"after"](t.trigger),t.trigger.click(function(){return M.datepicker._datepickerShowing&&M.datepicker._lastInput===e[0]?M.datepicker._hideDatepicker():(M.datepicker._datepickerShowing&&M.datepicker._lastInput!==e[0]&&M.datepicker._hideDatepicker(),M.datepicker._showDatepicker(e[0])),!1}))},_autoSize:function(e){var t,a,i,s,n,r;this._get(e,"autoSize")&&!e.inline&&(n=new Date(2009,11,20),(r=this._get(e,"dateFormat")).match(/[DM]/)&&(n.setMonth((t=function(e){for(s=i=a=0;sa&&(a=e[s].length,i=s);return i})(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length))},_inlineDatepicker:function(e,t){var a=M(e);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(t.dpDiv),M.data(e,"datepicker",t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block"))},_dialogDatepicker:function(e,t,a,i,s){var n,r=this._dialogInst;return r||(this.uuid+=1,n="dp"+this.uuid,this._dialogInput=M(""),this._dialogInput.keydown(this._doKeyDown),M("body").append(this._dialogInput),(r=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},M.data(this._dialogInput[0],"datepicker",r)),c(r.settings,i||{}),t=t&&t.constructor===Date?this._formatDate(r,t):t,this._dialogInput.val(t),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(n=document.documentElement.clientWidth,i=document.documentElement.clientHeight,t=document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[n/2-100+t,i/2-150+s]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),r.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),M.blockUI&&M.blockUI(this.dpDiv),M.data(this._dialogInput[0],"datepicker",r),this},_destroyDatepicker:function(e){var t,a=M(e),i=M.data(e,"datepicker");a.hasClass(this.markerClassName)&&(t=e.nodeName.toLowerCase(),M.removeData(e,"datepicker"),"input"===t?(i.append.remove(),i.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!==t&&"span"!==t||a.removeClass(this.markerClassName).empty(),n===i&&(n=null))},_enableDatepicker:function(t){var e,a=M(t),i=M.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==e&&"span"!==e||((a=a.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=M.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var e,a=M(t),i=M.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==e&&"span"!==e||((a=a.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=M.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;td&&ic&&st;)--B<0&&(B=11,J--);for(e.drawMonth=B,e.drawYear=J,E=this._get(e,"prevText"),E=L?this.formatDate(E,this._daylightSavingAdjust(new Date(J,B-A,1)),this._getFormatConfig(e)):E,a=this._canAdjustMonth(e,-1,J,B)?"
"+E+"":R?"":""+E+"",E=this._get(e,"nextText"),E=L?this.formatDate(E,this._daylightSavingAdjust(new Date(J,B+A,1)),this._getFormatConfig(e)):E,i=this._canAdjustMonth(e,1,J,B)?""+E+"":R?"":""+E+"",R=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?P:K,R=L?this.formatDate(R,E,this._getFormatConfig(e)):R,L=e.inline?"":"",L=O?"
"+(j?L:"")+(this._isInRange(e,E)?"":"")+(j?"":L)+"
":"",s=parseInt(this._get(e,"firstDay"),10),s=isNaN(s)?0:s,n=this._get(e,"showWeek"),r=this._get(e,"dayNames"),d=this._get(e,"dayNamesMin"),c=this._get(e,"monthNames"),o=this._get(e,"monthNamesShort"),l=this._get(e,"beforeShowDay"),h=this._get(e,"showOtherMonths"),u=this._get(e,"selectOtherMonths"),p=this._getDefaultDate(e),g="",f=0;f"+(/all|left/.test(y)&&0===f?j?i:a:"")+(/all|right/.test(y)&&0===f?j?a:i:"")+this._generateMonthYearHeader(e,B,J,U,z,0",M=n?"":"",_=0;_<7;_++)M+="";for(v+=M+"",C=this._getDaysInMonth(J,B),J===e.selectedYear&&B===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,C)),w=(this._getFirstDayOfMonth(J,B)-s+7)%7,C=Math.ceil((w+C)/7),I=H&&this.maxRows>C?this.maxRows:C,this.maxRows=I,x=this._daylightSavingAdjust(new Date(J,B,1-w)),Y=0;Y",S=n?"":"",_=0;_<7;_++)N=l?l.apply(e.input?e.input[0]:null,[x]):[!0,""],T=(F=x.getMonth()!==B)&&!u||!N[0]||U&&x"+(F&&!h?" ":T?""+x.getDate()+"":""+x.getDate()+"")+"",x.setDate(x.getDate()+1),x=this._daylightSavingAdjust(x);v+=S+""}11<++B&&(B=0,J++),k+=v+="
"+this._get(e,"weekHeader")+""+d[b]+"
"+this._get(e,"calculateWeek")(x)+"
"+(H?""+(0":""):"")}g+=k}return g+=L,e._keyEvent=!1,g},_generateMonthYearHeader:function(e,t,a,i,s,n,r,d){var c,o,l,h,u,p,g,_=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),k=this._get(e,"showMonthAfterYear"),D="
",m="";if(n||!_)m+=""+r[t]+"";else{for(c=i&&i.getFullYear()===a,o=s&&s.getFullYear()===a,m+=""}if(k||(D+=m+(!n&&_&&f?"":" ")),!e.yearshtml)if(e.yearshtml="",n||!f)D+=""+a+"";else{for(h=this._get(e,"yearRange").split(":"),u=(new Date).getFullYear(),p=(r=function(e){e=e.match(/c[+\-].*/)?a+parseInt(e.substring(1),10):e.match(/[+\-].*/)?u+parseInt(e,10):parseInt(e,10);return isNaN(e)?u:e})(h[0]),g=Math.max(p,r(h[1]||"")),p=i?Math.max(p,i.getFullYear()):p,g=s?Math.min(g,s.getFullYear()):g,e.yearshtml+="",D+=e.yearshtml,e.yearshtml=null}return D+=this._get(e,"yearSuffix"),k&&(D+=(!n&&_&&f?"":" ")+m),D+="
"},_adjustInstDate:function(e,t,a){var i=e.drawYear+("Y"===a?t:0),s=e.drawMonth+("M"===a?t:0),t=Math.min(e.selectedDay,this._getDaysInMonth(i,s))+("D"===a?t:0),t=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,s,t)));e.selectedDay=t.getDate(),e.drawMonth=e.selectedMonth=t.getMonth(),e.drawYear=e.selectedYear=t.getFullYear(),"M"!==a&&"Y"!==a||this._notifyChange(e)},_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),e=this._getMinMaxDate(e,"max"),t=a&&t=a.getTime())&&(!i||t.getTime()<=i.getTime())&&(!s||t.getFullYear()>=s)&&(!n||t.getFullYear()<=n)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);t=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),t,this._getFormatConfig(e))}}),M.fn.datepicker=function(e){if(!this.length)return this;M.datepicker.initialized||(M(document).mousedown(M.datepicker._checkExternalClick),M.datepicker.initialized=!0),0===M("#"+M.datepicker._mainDivId).length&&M("body").append(M.datepicker.dpDiv);var t=Array.prototype.slice.call(arguments,1);return"string"==typeof e&&("isDisabled"===e||"getDate"===e||"widget"===e)||"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?M.datepicker["_"+e+"Datepicker"].apply(M.datepicker,[this[0]].concat(t)):this.each(function(){"string"==typeof e?M.datepicker["_"+e+"Datepicker"].apply(M.datepicker,[this].concat(t)):M.datepicker._attachDatepicker(this,e)})},M.datepicker=new e,M.datepicker.initialized=!1,M.datepicker.uuid=(new Date).getTime(),M.datepicker.version="1.11.4",M.datepicker}); !function(a,b){"object"==typeof module&&module.exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return m[e]||(k.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",k.cssRules.length),m[e]=1),e}function d(a,b){var c,d,e=a.style;if(b=b.charAt(0).toUpperCase()+b.slice(1),void 0!==e[b])return b;for(d=0;d',c)}k.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.scale*d.width,left:d.scale*d.radius,top:-d.scale*d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.scale*(d.length+d.width),k=2*d.scale*j,l=-(d.width+d.length)*d.scale*2+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=true;t._show()}}).on("mouseleave."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(u&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t._showNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!f()||t.options.touchDevices){t._show()}})}}},_show:function(){var e=this;if(e.Status!="shown"&&e.Status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e._showNow()}},e.options.delay)}else e._showNow()}},_showNow:function(n){var r=this;r.options.functionBefore.call(r.$el,r.$el,function(){if(r.enabled&&r.Content!==null){if(n)r.callbacks.show.push(n);r.callbacks.hide=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;if(r.options.onlyOne){e(".tooltipstered").not(r.$el).each(function(t,n){var r=e(n),i=r.data("tooltipster-ns");e.each(i,function(e,t){var n=r.data(t),i=n.status(),s=n.option("autoClose");if(i!=="hidden"&&i!=="disappearing"&&s){n.hide()}})})}var i=function(){r.Status="shown";e.each(r.callbacks.show,function(e,t){t.call(r.$el)});r.callbacks.show=[]};if(r.Status!=="hidden"){var s=0;if(r.Status==="disappearing"){r.Status="appearing";if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+r.options.animation+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.stop().fadeIn(i)}}else if(r.Status==="shown"){i()}}else{r.Status="appearing";var s=r.options.speed;r.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var o="tooltipster-"+r.options.animation,a="-webkit-transition-duration: "+r.options.speed+"ms; -webkit-animation-duration: "+r.options.speed+"ms; -moz-transition-duration: "+r.options.speed+"ms; -moz-animation-duration: "+r.options.speed+"ms; -o-transition-duration: "+r.options.speed+"ms; -o-animation-duration: "+r.options.speed+"ms; -ms-transition-duration: "+r.options.speed+"ms; -ms-animation-duration: "+r.options.speed+"ms; transition-duration: "+r.options.speed+"ms; animation-duration: "+r.options.speed+"ms;",f=r.options.minWidth?"min-width:"+Math.round(r.options.minWidth)+"px;":"",c=r.options.maxWidth?"max-width:"+Math.round(r.options.maxWidth)+"px;":"",h=r.options.interactive?"pointer-events: auto;":"";r.$tooltip=e('
');if(l())r.$tooltip.addClass(o);r._content_insert();r.$tooltip.appendTo("body");r.reposition();r.options.functionReady.call(r.$el,r.$el,r.$tooltip);if(l()){r.$tooltip.addClass(o+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.css("display","none").fadeIn(r.options.speed,i)}r._interval_set();e(t).on("scroll."+r.namespace+" resize."+r.namespace,function(){r.reposition()});if(r.options.autoClose){e("body").off("."+r.namespace);if(r.options.trigger=="hover"){if(u){setTimeout(function(){e("body").on("touchstart."+r.namespace,function(){r.hide()})},0)}if(r.options.interactive){if(u){r.$tooltip.on("touchstart."+r.namespace,function(e){e.stopPropagation()})}var p=null;r.$elProxy.add(r.$tooltip).on("mouseleave."+r.namespace+"-autoClose",function(){clearTimeout(p);p=setTimeout(function(){r.hide()},r.options.interactiveTolerance)}).on("mouseenter."+r.namespace+"-autoClose",function(){clearTimeout(p)})}else{r.$elProxy.on("mouseleave."+r.namespace+"-autoClose",function(){r.hide()})}if(r.options.hideOnClick){r.$elProxy.on("click."+r.namespace+"-autoClose",function(){r.hide()})}}else if(r.options.trigger=="click"){setTimeout(function(){e("body").on("click."+r.namespace+" touchstart."+r.namespace,function(){r.hide()})},0);if(r.options.interactive){r.$tooltip.on("click."+r.namespace+" touchstart."+r.namespace,function(e){e.stopPropagation()})}}}}if(r.options.timer>0){r.timerHide=setTimeout(function(){r.timerHide=null;r.hide()},r.options.timer+s)}}})},_interval_set:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.Status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.Status=="shown"||t.Status=="appearing")t.hide();t._interval_cancel()}else{if(t.options.positionTracker){var n=t._repositionInfo(t.$elProxy),r=false;if(o(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(o(n.position,t.elProxyPosition.position))r=true}else{if(o(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.reposition();t.options.positionTrackerCallback.call(t,t.$el)}}}},200)},_interval_cancel:function(){clearInterval(this.checkInterval);this.checkInterval=null},_content_set:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.Content=e},_content_insert:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.Content==="string"&&!e.options.contentAsHTML){t.text(e.Content)}else{t.empty().append(e.Content)}},_update:function(e){var t=this;t._content_set(e);if(t.Content!==null){if(t.Status!=="hidden"){t._content_insert();t.reposition();if(t.options.updateAnimation){if(l()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.Status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hide()}},_repositionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},hide:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.Status=="shown"||r.Status=="appearing"){r.Status="disappearing";var s=function(){r.Status="hidden";if(typeof r.Content=="object"&&r.Content!==null){r.Content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace).css("overflow-x",r.bodyOverflowX);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.Status=="hidden"){i()}return r},show:function(e){this._showNow(e);return this},update:function(e){return this.content(e)},content:function(e){if(typeof e==="undefined"){return this.Content}else{this._update(e);return this}},reposition:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n._repositionInfo(n.$elProxy);var r=null,i=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var f=n.$elProxy.attr("shape"),l=n.$elProxy.parent().attr("name"),c=e('img[usemap="#'+l+'"]'),h=c.offset().left,p=c.offset().top,d=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(f=="circle"){var v=parseInt(d[0]),m=parseInt(d[1]),g=parseInt(d[2]);s.dimension.height=g*2;s.dimension.width=g*2;s.offset.top=p+m-g;s.offset.left=h+v-g}else if(f=="rect"){var v=parseInt(d[0]),m=parseInt(d[1]),y=parseInt(d[2]),b=parseInt(d[3]);s.dimension.height=b-m;s.dimension.width=y-v;s.offset.top=p+m;s.offset.left=h+v}else if(f=="poly"){var w=[],E=[],S=0,x=0,T=0,N=0,C="even";for(var k=0;kT){T=L;if(k===0){S=T}}if(LN){N=L;if(k==1){x=N}}if(Li){r=A-(i+n-o);A=i+n-o}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A<0&&O+o>i){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;r="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A+o>i&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=i-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A+o>i){A=s.offset.left-D-o-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X=''}n.$tooltip.find(".tooltipster-arrow").remove();var K='
'+X+'
';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}return n},enable:function(){this.enabled=true;return this},disable:function(){this.hide();this.enabled=false;return this},destroy:function(){var t=this;t.hide();if(t.$el[0]!==t.$elProxy[0]){t.$elProxy.remove()}t.$el.removeData(t.namespace).off("."+t.namespace);var n=t.$el.data("tooltipster-ns");if(n.length===1){var r=null;if(t.options.restoration==="previous"){r=t.$el.data("tooltipster-initialTitle")}else if(t.options.restoration==="current"){r=typeof t.Content==="string"?t.Content:e("
").append(t.Content).html()}if(r){t.$el.attr("title",r)}t.$el.removeClass("tooltipstered").removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else{n=e.grep(n,function(e,n){return e!==t.namespace});t.$el.data("tooltipster-ns",n)}return t},elementIcon:function(){return this.$el[0]!==this.$elProxy[0]?this.$elProxy[0]:undefined},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:undefined},option:function(e,t){if(typeof t=="undefined")return this.options[e];else{this.options[e]=t;return this}},status:function(){return this.Status}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(i,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster-ns"),i=n?e(this).data(n[0]):null;if(i){if(typeof i[t[0]]==="function"){var s=i[t[0]](t[1],t[2])}else{throw new Error('Unknown method .tooltipster("'+t[0]+'")')}if(s!==i){r=s;return false}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{var o=[],u=t[0]&&typeof t[0].multiple!=="undefined",a=u&&t[0].multiple||!u&&i.multiple,f=t[0]&&typeof t[0].debug!=="undefined",l=f&&t[0].debug||!f&&i.debug;this.each(function(){var n=false,r=e(this).data("tooltipster-ns"),i=null;if(!r){n=true}else if(a){n=true}else if(l){console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')}if(n){i=new s(this,t[0]);if(!r)r=[];r.push(i.namespace);e(this).data("tooltipster-ns",r);e(this).data(i.namespace,i)}o.push(i)});if(a)return o;else return this}}};var u=!!("ontouchstart"in t);var a=false;e("body").one("mousemove",function(){a=true})})(jQuery,window,document); var booked_load_calendar_date_booking_options, booked_appt_form_options, bookedNewAppointment; ;(function($, window, document, undefined){ var $win=$(window); $.fn.spin.presets.booked={ lines: 10, length: 7, width: 5, radius: 11, corners: 1, rotate: 0, direction: 1, color: '#555', speed: 1, trail: 60, shadow: false, hwaccel: false, className: 'booked-spinner', zIndex: 2e9, top: '50%', left: '50%' } $.fn.spin.presets.booked_top={ lines: 11, length: 10, width: 6, radius: 15, corners: 1, rotate: 0, scale: 0.5, direction: 1, color: '#aaaaaa', speed: 1, trail: 60, shadow: false, hwaccel: false, className: 'booked-spinner booked-spinner-top', zIndex: 2e9, top: '15px', left: '50%' } $.fn.spin.presets.booked_white={ lines: 13, length: 11, width: 5, radius: 18, scale: 1, corners: 1, rotate: 0, direction: 1, color: '#fff', speed: 1, trail: 60, shadow: false, hwaccel: false, className: 'booked-spinner booked-white', zIndex: 2e9, top: '50%', left: '50%' } $win.on('resize', function(){ adjust_calendar_boxes(); resize_booked_modal(); }); $win.on('load', function(){ BookedTabs.Init(); var ajaxRequests=[]; adjust_calendar_boxes(); $('.booked-calendar-wrap').each(function(){ var thisCalendar=$(this); var calendar_month=thisCalendar.find('table.booked-calendar').attr('data-calendar-date'); thisCalendar.attr('data-default',calendar_month); init_tooltips(thisCalendar); }); $('.booked-list-view').each(function(){ var thisList=$(this); var list_date=thisList.find('.booked-appt-list').attr('data-list-date'); thisList.attr('data-default',list_date); }); bookedRemoveEmptyTRs(); init_appt_list_date_picker(); $('.booked_calendar_chooser').change(function(e){ e.preventDefault(); var $selector=$(this), thisIsCalendar=$selector.parents('.booked-calendarSwitcher').hasClass('calendar'); if(!thisIsCalendar){ var thisCalendarWrap=$selector.parents('.booked-calendar-shortcode-wrap').find('.booked-list-view'), thisDefaultDate=thisCalendarWrap.attr('data-default'), thisIsCalendar=$selector.parents('.booked-calendarSwitcher').hasClass('calendar'); if(typeof thisDefaultDate=='undefined'){ thisDefaultDate=false; } thisCalendarWrap.addClass('booked-loading'); var args={ 'action':'booked_appointment_list_date', 'date':thisDefaultDate, 'calendar_id':$selector.val() }; $(document).trigger("booked-before-loading-appointment-list-booking-options"); thisCalendarWrap.spin('booked_top'); $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: args, success: function(html){ thisCalendarWrap.html(html); init_appt_list_date_picker(); setTimeout(function(){ thisCalendarWrap.removeClass('booked-loading'); },1); }}); }else{ var thisCalendarWrap=$selector.parents('.booked-calendar-shortcode-wrap').find('.booked-calendar-wrap'), thisDefaultDate=thisCalendarWrap.attr('data-default'); if(typeof thisDefaultDate=='undefined'){ thisDefaultDate=false; } var args={ 'action':'booked_calendar_month', 'gotoMonth':thisDefaultDate, 'calendar_id':$selector.val() }; savingState(true,thisCalendarWrap); $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: args, success: function(html){ thisCalendarWrap.html(html); adjust_calendar_boxes(); bookedRemoveEmptyTRs(); init_tooltips(thisCalendarWrap); $(window).trigger('booked-load-calendar', args, $selector); }}); } return false; }); $('body').on('click', '.booked-calendar-wrap .page-right, .booked-calendar-wrap .page-left, .booked-calendar-wrap .monthName a', function(e){ e.preventDefault(); var $button=$(this), gotoMonth=$button.attr('data-goto'), thisCalendarWrap=$button.parents('.booked-calendar-wrap'), thisCalendarDefault=thisCalendarWrap.attr('data-default'), calendar_id=$button.parents('table.booked-calendar').attr('data-calendar-id'); if(typeof thisCalendarDefault=='undefined'){ thisCalendarDefault=false; } var args={ 'action':'booked_calendar_month', 'gotoMonth':gotoMonth, 'calendar_id':calendar_id, 'force_default':thisCalendarDefault }; savingState(true,thisCalendarWrap); $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: args, success: function(html){ thisCalendarWrap.html(html); adjust_calendar_boxes(); bookedRemoveEmptyTRs(); init_tooltips(thisCalendarWrap); $(window).trigger('booked-load-calendar', args, $button); }}); return false; }); $('body').on('click', '.booked-calendar-wrap tr.week td', function(e){ e.preventDefault(); var $thisDate=$(this), booked_calendar_table=$thisDate.parents('table.booked-calendar'), $thisRow=$thisDate.parent(), date=$thisDate.attr('data-date'), calendar_id=booked_calendar_table.attr('data-calendar-id'), colspanSetting=$thisRow.find('td').length; if(!calendar_id){ calendar_id=0; } if($thisDate.hasClass('blur')||$thisDate.hasClass('booked')&&!booked_js_vars.publicAppointments||$thisDate.hasClass('prev-date')){ }else if($thisDate.hasClass('active')){ $thisDate.removeClass('active'); $('tr.entryBlock').remove(); var calendarHeight=booked_calendar_table.height(); booked_calendar_table.parent().height(calendarHeight); }else{ $('tr.week td').removeClass('active'); $thisDate.addClass('active'); $('tr.entryBlock').remove(); $thisRow.after(''); $('tr.entryBlock').find('td').spin('booked'); booked_load_calendar_date_booking_options={'action':'booked_calendar_date','date':date,'calendar_id':calendar_id}; $(document).trigger("booked-before-loading-calendar-booking-options"); var calendarHeight=booked_calendar_table.height(); booked_calendar_table.parent().height(calendarHeight); $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: booked_load_calendar_date_booking_options, success: function(html){ $('tr.entryBlock').find('td').html(html); $('tr.entryBlock').removeClass('booked-loading'); $('tr.entryBlock').find('.booked-appt-list').fadeIn(300); $('tr.entryBlock').find('.booked-appt-list').addClass('shown'); adjust_calendar_boxes(); }}); } return; }); $('body').on('click', '.booked-list-view .booked-list-view-date-prev, .booked-list-view .booked-list-view-date-next', function(e){ e.preventDefault(); var $thisLink=$(this), date=$thisLink.attr('data-date'), thisList=$thisLink.parents('.booked-list-view'), defaultDate=thisList.attr('data-default'), calendar_id=$thisLink.parents('.booked-list-view-nav').attr('data-calendar-id'); if(typeof defaultDate=='undefined'){ defaultDate=false; } if(!calendar_id){ calendar_id=0; } thisList.addClass('booked-loading'); var booked_load_list_view_date_booking_options={ 'action':'booked_appointment_list_date', 'date':date, 'calendar_id':calendar_id, 'force_default':defaultDate }; $(document).trigger("booked-before-loading-appointment-list-booking-options"); thisList.spin('booked_top'); $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: booked_load_list_view_date_booking_options, success: function(html){ thisList.html(html); init_appt_list_date_picker(); setTimeout(function(){ thisList.removeClass('booked-loading'); },1); }}); return false; }); bookedNewAppointment=function(e){ e.preventDefault(); var $button=$(this), title=$button.attr('data-title'), timeslot=$button.attr('data-timeslot'), date=$button.attr('data-date'), calendar_id=$button.attr('data-calendar-id'), $thisTimeslot=$button.parents('.timeslot'), is_list_view=$button.parents('.booked-calendar-wrap').hasClass('booked-list-view'); if(typeof is_list_view!='undefined'&&is_list_view){ var new_calendar_id=$button.parents('.booked-list-view').find('.booked-list-view-nav').attr('data-calendar-id'); }else{ var new_calendar_id=$button.parents('table.booked-calendar').attr('data-calendar-id'); } calendar_id=new_calendar_id ? new_calendar_id:calendar_id; booked_appt_form_options={'action':'booked_new_appointment_form','date':date,'timeslot':timeslot,'calendar_id':calendar_id,'title':title}; $(document).trigger("booked-before-loading-booking-form"); create_booked_modal(); setTimeout(function(){ $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: booked_appt_form_options, success: function(html){ $('.bm-window').html(html); var bookedModal=$('.booked-modal'); var bmWindow=bookedModal.find('.bm-window'); bmWindow.css({'visibility':'hidden'}); bookedModal.removeClass('bm-loading'); $(document).trigger("booked-on-new-app"); resize_booked_modal(); bmWindow.hide(); $('.booked-modal .bm-overlay').find('.booked-spinner').remove(); setTimeout(function(){ bmWindow.css({'visibility':'visible'}); bmWindow.show(); },50); }}); },100); return false; } $('body').on('click', '.booked-calendar-wrap button.new-appt', bookedNewAppointment); var profileTabs=$('.booked-tabs'); if(!profileTabs.find('li.active').length){ profileTabs.find('li:first-child').addClass("active"); } if(profileTabs.length){ $('.booked-tab-content').hide(); var activeTab=profileTabs.find('.active > a').attr('href'); activeTab=activeTab.split('#'); activeTab=activeTab[1]; $('#profile-'+activeTab).show(); profileTabs.find('li > a').on('click', function(e){ e.preventDefault(); $('.booked-tab-content').hide(); profileTabs.find('li').removeClass('active'); $(this).parent().addClass('active'); var activeTab=$(this).attr('href'); activeTab=activeTab.split('#'); activeTab=activeTab[1]; $('#profile-'+activeTab).show(); return false; }); } $('body').on('click', '.booked-profile-appt-list .booked-show-cf', function(e){ e.preventDefault(); var hiddenBlock=$(this).parent().find('.cf-meta-values-hidden'); if(hiddenBlock.is(':visible')){ hiddenBlock.hide(); $(this).removeClass('booked-cf-active'); }else{ hiddenBlock.show(); $(this).addClass('booked-cf-active'); } return false; }); if($('#loginform').length){ $('#loginform input[type="submit"]').on('click',function(e){ if($('#loginform input[name="log"]').val()&&$('#loginform input[name="pwd"]').val()){ $('#loginform .booked-custom-error').hide(); }else{ if($('#loginform').parents('.booked-form-wrap').length){ e.preventDefault(); $('#loginform').parents('.booked-form-wrap').find('.booked-custom-error').fadeOut(200).fadeIn(200); }} }); } if($('#profile-forgot').length){ $('#profile-forgot input[type="submit"]').on('click',function(e){ if($('#profile-forgot input[name="user_login"]').val()){ $('#profile-forgot .booked-custom-error').hide(); }else{ e.preventDefault(); $('#profile-forgot').find('.booked-custom-error').fadeOut(200).fadeIn(200); }}); } if($('.booked-upload-wrap').length){ $('.booked-upload-wrap input[type=file]').on('change',function(){ var fileName=$(this).val(); $(this).parent().find('span').html(fileName); $(this).parent().addClass('hasFile'); }); } $('body').on('click', '.booked-profile-appt-list .appt-block .cancel', function(e){ e.preventDefault(); var $button=$(this), $thisParent=$button.parents('.appt-block'), appt_id=$thisParent.attr('data-appt-id'); confirm_delete=confirm(booked_js_vars.i18n_confirm_appt_delete); if(confirm_delete==true){ var currentApptCount=parseInt($('.booked-profile-appt-list').find('h4').find('span.count').html()); currentApptCount=parseInt(currentApptCount - 1); if(currentApptCount < 1){ $('.booked-profile-appt-list').find('h4').find('span.count').html('0'); $('.no-appts-message').slideDown('fast'); }else{ $('.booked-profile-appt-list').find('h4').find('span.count').html(currentApptCount); } $('.appt-block').animate({'opacity':0.4},0); $thisParent.slideUp('fast',function(){ $(this).remove(); }); $.ajax({ 'url':booked_js_vars.ajax_url, 'method':'post', 'data':{ 'action':'booked_cancel_appt', 'appt_id':appt_id }, success: function(data){ $('.appt-block').animate({'opacity':1},150); }}); } return false; }); $('body').on('touchstart click','.bm-overlay, .bm-window .close, .booked-form .cancel',function(e){ e.preventDefault(); close_booked_modal(); return false; }); $('body') .on('focusin', '.booked-form input', function(){ if(this.title==this.value){ $(this).addClass('hasContent'); this.value=''; }}).on('focusout', '.booked-form input', function(){ if(this.value===''){ $(this).removeClass('hasContent'); this.value=this.title; }}); $('body').on('change','.booked-form input',function(){ var condition=$(this).attr('data-condition'), thisVal=$(this).val(); if(condition&&$('.condition-block').length){ $('.condition-block.'+condition).hide(); $('#condition-'+thisVal).fadeIn(200); resize_booked_modal(); }}); $('body').on('submit','form#ajaxlogin', function(e){ e.preventDefault(); $('form#ajaxlogin p.status').show().html('   ' + booked_js_vars.i18n_please_wait); resize_booked_modal(); var $this=$(this), date=$this.data('date'), title=$this.data('title'), timeslot=$this.data('timeslot'), calendar_id=$this.data('calendar-id'); $.ajax({ type:'post', url:booked_js_vars.ajax_url, data:$('form#ajaxlogin').serialize(), success:function(data){ if(data=='success'){ close_booked_modal(); var $button=$(''); $button.on('click', window.bookedNewAppointment); $button.triggerHandler('click'); $button.unbind('click', window.bookedNewAppointment); $button.detach(); }else{ $('form#ajaxlogin p.status').show().html('   ' + booked_js_vars.i18n_wrong_username_pass); resize_booked_modal(); }} }); e.preventDefault(); }); $('body').on('click','.booked-forgot-password',function(e){ e.preventDefault(); $('#ajaxlogin').hide(); $('#ajaxforgot').show(); resize_booked_modal(); }); $('body').on('click','.booked-forgot-goback',function(e){ e.preventDefault(); $('#ajaxlogin').show(); $('#ajaxforgot').hide(); resize_booked_modal(); }); $('body').on('submit','form#ajaxforgot', function(e){ e.preventDefault(); $('form#ajaxforgot p.status').show().html('   ' + booked_js_vars.i18n_please_wait); resize_booked_modal(); var $this=$(this); $.ajax({ type:'post', url:booked_js_vars.ajax_url, data:$('form#ajaxforgot').serialize(), success:function(data){ if(data=='success'){ e.preventDefault(); $('#ajaxlogin').show(); $('#ajaxforgot').hide(); $('form#ajaxlogin p.status').show().html('   ' + booked_js_vars.i18n_password_reset); resize_booked_modal(); }else{ $('form#ajaxforgot p.status').show().html('   ' + booked_js_vars.i18n_password_reset_error); resize_booked_modal(); }} }); e.preventDefault(); }); $('body').on('click','.booked-form input#submit-request-appointment',function(e){ $('form#newAppointmentForm p.status').show().html('   ' + booked_js_vars.i18n_please_wait); resize_booked_modal(); e.preventDefault(); var customerType=$('#newAppointmentForm input[name=customer_type]').val(), customerID=$('#newAppointmentForm input[name=user_id]').val(), name=$('#newAppointmentForm input[name=booked_appt_name]').val(), surname=$('#newAppointmentForm input[name=booked_appt_surname]').val(), surnameActive=$('#newAppointmentForm input[name=booked_appt_surname]').length, guest_name=$('#newAppointmentForm input[name=guest_name]').val(), guest_surname=$('#newAppointmentForm input[name=guest_surname]').val(), guest_surnameActive=$('#newAppointmentForm input[name=guest_surname]').length, guest_email=$('#newAppointmentForm input[name=guest_email]').val(), guest_emailActive=$('#newAppointmentForm input[name=guest_email]').length, email=$('#newAppointmentForm input[name=booked_appt_email]').val(), password=$('#newAppointmentForm input[name=booked_appt_password]').val(), showRequiredError=false, ajaxRequests=[]; $(this).parents('.booked-form').find('input,textarea,select').each(function(i,field){ var required=$(this).attr('required'); if(required&&$(field).attr('type')=='hidden'){ var fieldParts=$(field).attr('name'); fieldParts=fieldParts.split('---'); fieldName=fieldParts[0]; fieldNumber=fieldParts[1].split('___'); fieldNumber=fieldNumber[0]; if(fieldName=='radio-buttons-label'){ var radioValue=false; $('input:radio[name="single-radio-button---'+fieldNumber+'[]"]:checked').each(function(){ if($(this).val()){ radioValue=$(this).val(); }}); if(!radioValue){ showRequiredError=true; }}else if(fieldName=='checkboxes-label'){ var checkboxValue=false; $('input:checkbox[name="single-checkbox---'+fieldNumber+'[]"]:checked').each(function(){ if($(this).val()){ checkboxValue=$(this).val(); }}); if(!checkboxValue){ showRequiredError=true; }} }else if(required&&$(field).attr('type')!='hidden'&&$(field).val()==''){ showRequiredError=true; }}); if(showRequiredError){ $('form#newAppointmentForm p.status').show().html('   ' + booked_js_vars.i18n_fill_out_required_fields); resize_booked_modal(); return false; } if(customerType=='new'&&!name||customerType=='new'&&surnameActive&&!surname||customerType=='new'&&!email||customerType=='new'&&!password){ $('form#newAppointmentForm p.status').show().html('   ' + booked_js_vars.i18n_appt_required_fields); resize_booked_modal(); return false; } if(customerType=='guest'&&!guest_name||customerType=='guest'&&guest_emailActive&&!guest_email||customerType=='guest'&&guest_surnameActive&&!guest_surname){ $('form#newAppointmentForm p.status').show().html('   ' + booked_js_vars.i18n_appt_required_fields_guest); resize_booked_modal(); return false; } if(customerType=='current'&&customerID || customerType=='guest'&&guest_name&&!guest_surnameActive&&!guest_emailActive || customerType=='guest'&&guest_name&&guest_surnameActive&&guest_surname&&!guest_emailActive || customerType=='guest'&&guest_name&&guest_emailActive&&guest_email&&!guest_surnameActive || customerType=='guest'&&guest_name&&guest_emailActive&&guest_email&&guest_surnameActive&&guest_surname){ SubmitRequestAppointment.currentUserOrGuest(); } if(customerType=='new'&&name&&email&&password){ if(!surnameActive||surnameActive&&surname){ SubmitRequestAppointment.newUser(); }} }); var SubmitRequestAppointment={ formSelector: '#newAppointmentForm', formBtnRequestSelector: '.booked-form input#submit-request-appointment', formStatusSelector: 'p.status', formSubmitBtnSelector: '#submit-request-appointment', apptContainerSelector: '.booked-appointment-details', baseFields: [ 'guest_name','guest_surname','guest_email','action', 'customer_type', 'user_id' ], apptFields: [ 'appoinment', 'calendar_id', 'title', 'date', 'timestamp', 'timeslot' ], userFields: [ 'booked_appt_name','booked_appt_surname','booked_appt_email', 'booked_appt_password' ], captchaFields: [ 'captcha_word', 'captcha_code' ], currentApptIndex: false, currentApptCounter: false, hasAnyErrors: false, currentUserOrGuest: function(){ var total_appts=SubmitRequestAppointment._totalAppts(); if(! total_appts){ return; } SubmitRequestAppointment._showLoadingMessage(); SubmitRequestAppointment._resetDefaultValues(); var data=SubmitRequestAppointment._getBaseData(); SubmitRequestAppointment.currentApptIndex=0; SubmitRequestAppointment.currentApptCounter=1; SubmitRequestAppointment._doRequestAppointment(data, total_appts); }, newUser: function(){ var total_appts=SubmitRequestAppointment._totalAppts(); if(! total_appts){ return; } SubmitRequestAppointment._showLoadingMessage(); SubmitRequestAppointment._resetDefaultValues(); var data=SubmitRequestAppointment._getBaseData(); if(total_appts > 1){ var data_obj_with_no_reference=null; data_obj_with_no_reference=$.extend(true, {}, data); data_obj_with_no_reference=SubmitRequestAppointment._addUserRegistrationData(data_obj_with_no_reference); SubmitRequestAppointment._requestUserRegistration(data_obj_with_no_reference); data.customer_type='current'; }else{ data=SubmitRequestAppointment._addUserRegistrationData(data); } SubmitRequestAppointment.currentApptIndex=0; SubmitRequestAppointment._doRequestAppointment(data, total_appts); }, _doRequestAppointment: function(data, total_appts){ var appt_fields=SubmitRequestAppointment.apptFields; if(SubmitRequestAppointment.currentApptIndex===0){ SubmitRequestAppointment._hideCancelBtn(); SubmitRequestAppointment._disableSubmitBtn(); SubmitRequestAppointment.hasAnyErrors=false; } var data_obj_with_no_reference=$.extend(true, {}, data); for (var i=0; i < appt_fields.length; i++){ data_obj_with_no_reference[ appt_fields[i] ]=SubmitRequestAppointment._getFieldVal(appt_fields[i], SubmitRequestAppointment.currentApptIndex); } var calendar_id=SubmitRequestAppointment._getFieldVal('calendar_id', SubmitRequestAppointment.currentApptIndex); data_obj_with_no_reference=SubmitRequestAppointment._addCustomFieldsData(data_obj_with_no_reference, calendar_id); var $appt=SubmitRequestAppointment._getApptElement(SubmitRequestAppointment.currentApptIndex); if(! $appt.hasClass('skip')){ $.ajax({ type:'post', url:booked_js_vars.ajax_url, data:data_obj_with_no_reference, success:function(response){ SubmitRequestAppointment._requestAppointmentResponseHandler(response); SubmitRequestAppointment.currentApptIndex++; setTimeout(function(){ if(SubmitRequestAppointment.currentApptCounter===total_appts){ if(! SubmitRequestAppointment.hasAnyErrors){ SubmitRequestAppointment._onAfterRequestAppointment(); }else{ SubmitRequestAppointment._enableSubmitBtn(); SubmitRequestAppointment._showCancelBtn(); }}else{ SubmitRequestAppointment.currentApptCounter++; SubmitRequestAppointment._doRequestAppointment(data, total_appts); }}, 100); }}); }else{ SubmitRequestAppointment.currentApptIndex++; SubmitRequestAppointment.currentApptCounter++; SubmitRequestAppointment._doRequestAppointment(data, total_appts, SubmitRequestAppointment.currentApptIndex); }}, _totalAppts: function(){ return $(SubmitRequestAppointment.formSelector + ' input[name="appoinment[]"]').length; }, _getBaseData: function(){ var data={}, fields=SubmitRequestAppointment.baseFields; for(var i=0; i < fields.length; i++){ data[ fields[i] ]=SubmitRequestAppointment._getFieldVal(fields[i]); } data['is_fe_form']=true; data['total_appts']=SubmitRequestAppointment._totalAppts(); return data; }, _getFieldVal: function(field_name, field_index){ var field_name=typeof field_name==='undefined' ? '':field_name, field_index=typeof field_index==='undefined' ? false:field_index, selector=SubmitRequestAppointment.formSelector + ' '; if(field_index===false){ selector +=' [name=' + field_name + ']'; return $(selector).val(); } selector +=' [name="' + field_name + '[]"]'; return $(selector).eq(field_index).val(); }, _resetDefaultValues: function(){ $('.booked-form input').each(function(){ var thisVal=$(this).val(), thisDefault=$(this).attr('title'); if(thisDefault==thisVal){ $(this).val(''); }}); }, _resetToDefaultValues: function(){ $('.booked-form input').each(function(){ var thisVal=$(this).val(), thisDefault=$(this).attr('title'); if(! thisVal){ $(this).val(thisDefault); }}); }, _addUserRegistrationData: function(data){ $.each(SubmitRequestAppointment.userFields, function(index, field_name){ data[ field_name ]=SubmitRequestAppointment._getFieldVal(field_name); }); $.each(SubmitRequestAppointment.captchaFields, function(index, field_name){ var field_value=SubmitRequestAppointment._getFieldVal(field_name); if(! field_value){ return; } data[ field_name ]=field_value; }); return data; }, _addCustomFieldsData: function(data, calendar_id){ var custom_fields_data=$('.cf-block [name]') .filter(function(index){ var $this=$(this); return parseInt($this.data('calendar-id'))===parseInt(calendar_id)&&$this.attr('name').match(/---\d+/g); }) .each(function(index){ var $this=$(this), name=$this.attr('name'), value=$this.val(), type=$this.attr('type'); if(! value){ return; } if(! name.match(/checkbox|radio+/g)){ data[ name ]=value; return; } if(name.match(/radio+/g)&&$this.is(':checked')){ data[ name ]=value; return; } if(! name.match(/radio+/g)&&typeof data[ name ]==='undefined'||! name.match(/radio+/g)&&data[ name ].constructor!==Array){ data[ name ]=[]; } if(! $this.is(':checked')){ return; } data[ name ].push(value); }); return data; }, _requestUserRegistration: function(base_data, appt_index){ $.ajax({ type:'post', url:booked_js_vars.ajax_url, data:base_data, async:false, success:function(response){ SubmitRequestAppointment._requestUserRegistrationResponseHandler(response); }}); }, _requestUserRegistrationResponseHandler: function(response){ var response_parts=response.split('###'), data_result=response_parts[0].substr(response_parts[0].length - 5); if(data_result==='error'){ return; }}, _requestAppointment: function(response){ SubmitRequestAppointment._requestAppointmentResponseHandler(response); }, _requestAppointmentResponseHandler: function(response){ var response_parts=response.split('###'), data_result=response_parts[0].substr(response_parts[0].length - 5); if(data_result==='error'){ SubmitRequestAppointment._requestAppointmentOnError(response_parts); return; } SubmitRequestAppointment._requestAppointmentOnSuccess(response_parts); }, _requestAppointmentOnError: function(response_parts){ var $apptEl=SubmitRequestAppointment._getApptElement(); $(document).trigger("booked-on-requested-appt-error",[$apptEl]); SubmitRequestAppointment._highlightAppt(); SubmitRequestAppointment._setStatusMsg(response_parts[1]); SubmitRequestAppointment.hasAnyErrors=true; resize_booked_modal(); }, _requestAppointmentOnSuccess: function(response_parts){ var $apptEl=SubmitRequestAppointment._getApptElement(); $(document).trigger("booked-on-requested-appt-success",[$apptEl]); SubmitRequestAppointment._unhighlightAppt(); }, _onAfterRequestAppointment: function(){ var redirectObj={ redirect:false }; var redirect=$(document).trigger("booked-on-requested-appointment",[redirectObj]); if(redirectObj.redirect){ return; } if(booked_js_vars.profilePage){ window.location=booked_js_vars.profilePage; return; } SubmitRequestAppointment._reloadApptsList(); SubmitRequestAppointment._reloadCalendarTable(); }, _setStatusMsg: function(msg){ var form_status_selector=SubmitRequestAppointment.formSelector + ' ' + SubmitRequestAppointment.formStatusSelector; $(form_status_selector).show().html('   ' + msg); }, _getApptElement: function(appt_index){ var appt_index=typeof appt_index==='undefined' ? SubmitRequestAppointment.currentApptIndex:appt_index, appt_cnt_selector=SubmitRequestAppointment.formSelector + ' ' + SubmitRequestAppointment.apptContainerSelector; return $(appt_cnt_selector).eq(appt_index); }, _highlightAppt: function(msg){ var $apptEl=SubmitRequestAppointment._getApptElement(); if(! $apptEl.length){ return; } $apptEl.addClass('has-error'); }, _unhighlightAppt: function(msg){ var $apptEl=SubmitRequestAppointment._getApptElement(); if(! $apptEl.length){ return; } $apptEl.removeClass('has-error').addClass('skip'); }, _enableSubmitBtn: function(){ var btn_selector=SubmitRequestAppointment.formSelector + ' ' + SubmitRequestAppointment.formSubmitBtnSelector; $(btn_selector).attr('disabled', false); }, _disableSubmitBtn: function(){ var btn_selector=SubmitRequestAppointment.formSelector + ' ' + SubmitRequestAppointment.formSubmitBtnSelector; $(btn_selector).attr('disabled', true); }, _showCancelBtn: function(){ $(SubmitRequestAppointment.formSelector).find('button.cancel').show(); }, _hideCancelBtn: function(){ $(SubmitRequestAppointment.formSelector).find('button.cancel').hide(); }, _showLoadingMessage: function(){ $('form#newAppointmentForm p.status').show().html('   ' + booked_js_vars.i18n_please_wait); }, _reloadApptsList: function(){ if(! $('.booked-appt-list').length){ return; } $('.booked-appt-list').each(function(){ var $thisApptList=$(this), date=$thisApptList.attr('data-list-date'), thisList=$thisApptList.parents('.booked-list-view'), defaultDate=thisList.attr('data-default'), calendar_id=parseInt($thisApptList.find('.booked-list-view-nav').attr('data-calendar-id'))||0; defaultDate=typeof defaultDate==='undefined' ? false:defaultDate; calendar_id=calendar_id ? calendar_id:0; thisList.addClass('booked-loading'); var booked_load_list_view_date_booking_options={ 'action':'booked_appointment_list_date', 'date':date, 'calendar_id':calendar_id, 'force_default':defaultDate }; $(document).trigger("booked-before-loading-appointment-list-booking-options"); thisList.spin('booked_top'); $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: booked_load_list_view_date_booking_options, success: function(html){ thisList.html(html); close_booked_modal(); init_appt_list_date_picker(); setTimeout(function(){ thisList.removeClass('booked-loading'); },1); }}); }); }, _reloadCalendarTable: function(){ if(! $('td.active').length){ return; } var $activeTD=$('td.active'), activeDate=$activeTD.attr('data-date'), calendar_id=parseInt($activeTD.parents('table').data('calendar-id'))||0; booked_load_calendar_date_booking_options={ 'action':'booked_calendar_date', 'date':activeDate, 'calendar_id':calendar_id }; $(document).trigger("booked-before-loading-calendar-booking-options"); $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: booked_load_calendar_date_booking_options, success: function(html){ $('tr.entryBlock').find('td').html(html); close_booked_modal(); $('tr.entryBlock').removeClass('booked-loading'); $('tr.entryBlock').find('.booked-appt-list').hide().fadeIn(300); $('tr.entryBlock').find('.booked-appt-list').addClass('shown'); adjust_calendar_boxes(); }}); }} }); function bookedRemoveEmptyTRs(){ $('table.booked-calendar').find('tr.week').each(function(){ if($(this).children().length==0){ $(this).remove(); }}); } function savingState(show,limit_to){ show=typeof show!=='undefined' ? show:true; limit_to=typeof limit_to!=='undefined' ? limit_to:false; if(limit_to){ var $savingStateDIV=limit_to.find('li.active .savingState, .topSavingState.savingState, .calendarSavingState'); var $stuffToHide=limit_to.find('.monthName'); var $stuffToTransparent=limit_to.find('table.booked-calendar tbody'); }else{ var $savingStateDIV=$('li.active .savingState, .topSavingState.savingState, .calendarSavingState'); var $stuffToHide=$('.monthName'); var $stuffToTransparent=$('table.booked-calendar tbody'); } if(show){ $savingStateDIV.fadeIn(200); $stuffToHide.hide(); $stuffToTransparent.animate({'opacity':0.2},100); }else{ $savingStateDIV.hide(); $stuffToHide.show(); $stuffToTransparent.animate({'opacity':1},0); }} $(document).ajaxStop(function(){ savingState(false); }); function init_appt_list_date_picker(){ $('.booked_list_date_picker').each(function(){ var thisDatePicker=$(this); var minDateVal=thisDatePicker.parents('.booked-appt-list').attr('data-min-date'); var maxDateVal=thisDatePicker.parents('.booked-appt-list').attr('data-max-date'); if(typeof minDateVal=='undefined'){ var minDateVal=thisDatePicker.attr('data-min-date'); } thisDatePicker.datepicker({ dateFormat: 'yy-mm-dd', minDate: minDateVal, maxDate: maxDateVal, showAnim: false, beforeShow: function(input, inst){ $('#ui-datepicker-div').removeClass(); $('#ui-datepicker-div').addClass('booked_custom_date_picker'); }, onClose: function(dateText){ $('.booked_list_date_picker_trigger').removeClass('booked-dp-active'); }, onSelect: function(dateText){ var thisInput=$(this), date=dateText, thisList=thisInput.parents('.booked-list-view'), defaultDate=thisList.attr('data-default'), calendar_id=thisInput.parents('.booked-list-view-nav').attr('data-calendar-id'); if(typeof defaultDate=='undefined'){ defaultDate=false; } if(!calendar_id){ calendar_id=0; } thisList.addClass('booked-loading'); var booked_load_list_view_date_booking_options={ 'action':'booked_appointment_list_date', 'date':date, 'calendar_id':calendar_id, 'force_default':defaultDate }; $(document).trigger("booked-before-loading-appointment-list-booking-options"); thisList.spin('booked_top'); $.ajax({ url: booked_js_vars.ajax_url, type: 'post', data: booked_load_list_view_date_booking_options, success: function(html){ thisList.html(html); init_appt_list_date_picker(); setTimeout(function(){ thisList.removeClass('booked-loading'); },1); }}); return false; }}); }); $('body').on('click','.booked_list_date_picker_trigger',function(e){ e.preventDefault(); if(!$(this).hasClass('booked-dp-active')){ $(this).addClass('booked-dp-active'); $(this).parents('.booked-appt-list').find('.booked_list_date_picker').datepicker('show'); }}); } var BookedTabs={ bookingModalSelector: '.booked-modal', tabSelector: '.booked-tabs', tabNavSelector: '.booked-tabs-nav span', tabCntSelector: '.booked-tabs-cnt', Init: function(){ $(document).on('click', this.tabNavSelector, this.tabsNav); }, tabsNav: function(event){ event.preventDefault(); BookedTabs.switchToTab($(this)); BookedTabs.maybeResizeBookingModal(); }, switchToTab: function(tab_nav_item){ var $nav_item=tab_nav_item, tab_cnt_class='.' + $nav_item.data('tab-cnt'), $tabs_container=$nav_item.parents(BookedTabs.tabSelector); $nav_item .addClass('active') .siblings() .removeClass('active') $tabs_container .find(BookedTabs.tabCntSelector + ' ' + tab_cnt_class) .addClass('active') .siblings() .removeClass('active'); }, maybeResizeBookingModal: function(){ if(! $(BookedTabs.bookingModalSelector).length){ return; } resize_booked_modal(); }} })(jQuery, window, document); function create_booked_modal(){ var windowHeight=jQuery(window).height(); var windowWidth=jQuery(window).width(); if(windowWidth > 720){ var maxModalHeight=windowHeight - 295; }else{ var maxModalHeight=windowHeight; } jQuery('body input, body textarea, body select').blur(); jQuery('body').addClass('booked-noScroll'); jQuery('
').appendTo('body'); jQuery('.booked-modal .bm-overlay').spin('booked_white'); jQuery('.booked-modal .bm-window').css({'max-height':maxModalHeight+'px'}); } var previousRealModalHeight=100; function resize_booked_modal(){ var windowHeight=jQuery(window).height(); var windowWidth=jQuery(window).width(); var common43=43; if(jQuery('.booked-modal .bm-window .booked-scrollable').length){ var realModalHeight=jQuery('.booked-modal .bm-window .booked-scrollable')[0].scrollHeight; if(realModalHeight < 100){ realModalHeight=previousRealModalHeight; }else{ previousRealModalHeight=realModalHeight; }}else{ var realModalHeight=0; } var minimumWindowHeight=realModalHeight + common43 + common43; var modalScrollableHeight=realModalHeight - common43; var maxModalHeight; var maxFormHeight; if(windowHeight < minimumWindowHeight){ modalScrollableHeight=windowHeight - common43 - common43; }else{ modalScrollableHeight=realModalHeight; } if(windowWidth > 720){ maxModalHeight=modalScrollableHeight - 25; maxFormHeight=maxModalHeight - 15; var modalNegMargin=(maxModalHeight + 78) / 2; }else{ maxModalHeight=windowHeight - common43; maxFormHeight=maxModalHeight - 60; var modalNegMargin=(maxModalHeight) / 2; } jQuery('.booked-modal').css({'margin-top':'-'+modalNegMargin+'px'}); jQuery('.booked-modal .bm-window').css({'max-height':maxModalHeight+'px'}); jQuery('.booked-modal .bm-window .booked-scrollable').css({'max-height':maxFormHeight+'px'}); } function close_booked_modal(){ var modal=jQuery('.booked-modal'); modal.fadeOut(200); modal.addClass('bm-closing'); jQuery('body').removeClass('booked-noScroll'); setTimeout(function(){ modal.remove(); },300); } function init_tooltips(container){ jQuery('.tooltipster').tooltipster({ theme: 'tooltipster-light', animation: 'grow', speed: 200, delay: 50, offsetY: -15 }); } function adjust_calendar_boxes(){ jQuery('.booked-calendar').each(function(){ var windowWidth=jQuery(window).width(); var smallCalendar=jQuery(this).parents('.booked-calendar-wrap').hasClass('small'); var boxesWidth=jQuery(this).find('tbody tr.week td').width(); var calendarHeight=jQuery(this).height(); boxesHeight=boxesWidth * 1; jQuery(this).find('tbody tr.week td').height(boxesHeight); jQuery(this).find('tbody tr.week td .date').css('line-height',boxesHeight+'px'); jQuery(this).find('tbody tr.week td .date .number').css('line-height',boxesHeight+'px'); if(smallCalendar||windowWidth < 720){ jQuery(this).find('tbody tr.week td .date .number').css('line-height',boxesHeight+'px'); }else{ jQuery(this).find('tbody tr.week td .date .number').css('line-height',''); } var calendarHeight=jQuery(this).height(); jQuery(this).parent().height(calendarHeight); }); }; var wpAjaxUrl='https://www.o2residence.fr/wp-admin/admin-ajax.php';var flBuilderUrl='https://www.o2residence.fr/wp-content/plugins/beaver-builder-lite-version/';var FLBuilderLayoutConfig={anchorLinkAnimations:{duration:1000,easing:'swing',offset:100},paths:{pluginUrl:'https://www.o2residence.fr/wp-content/plugins/beaver-builder-lite-version/',wpAjaxUrl:'https://www.o2residence.fr/wp-admin/admin-ajax.php'},breakpoints:{small:768,medium:992},waypoint:{offset:80}};(function($){if(typeof FLBuilderLayout!='undefined'){return;} FLBuilderLayout={init:function(){FLBuilderLayout._destroy();FLBuilderLayout._initClasses();FLBuilderLayout._initBackgrounds();if(0===$('.fl-builder-edit').length){FLBuilderLayout._initModuleAnimations();FLBuilderLayout._initAnchorLinks();FLBuilderLayout._initHash();FLBuilderLayout._initForms();}},refreshGalleries:function(element){var $element='undefined'==typeof element?$('body'):$(element),mfContent=$element.find('.fl-mosaicflow-content'),wmContent=$element.find('.fl-gallery'),mfObject=null;if(mfContent){mfObject=mfContent.data('mosaicflow');if(mfObject){mfObject.columns=$([]);mfObject.columnsHeights=[];mfContent.data('mosaicflow',mfObject);mfContent.mosaicflow('refill');}} if(wmContent){wmContent.trigger('refreshWookmark');}},refreshGridLayout:function(element){var $element='undefined'==typeof element?$('body'):$(element),msnryContent=$element.find('.masonry');if(msnryContent.length){msnryContent.masonry('layout');}},reloadSlider:function(element){var $element='undefined'==typeof element?$('body'):$(element),bxContent=$element.find('.bx-viewport > div').eq(0),bxObject=null;if(bxContent.length){bxObject=bxContent.data('bxSlider');if(bxObject){bxObject.reloadSlider();}}},resizeAudio:function(element){var $element='undefined'==typeof element?$('body'):$(element),audioPlayers=$element.find('.wp-audio-shortcode.mejs-audio'),player=null,mejsPlayer=null,rail=null,railWidth=400;if(audioPlayers.length&&typeof mejs!=='undefined'){audioPlayers.each(function(){player=$(this);mejsPlayer=mejs.players[player.attr('id')];rail=player.find('.mejs-controls .mejs-time-rail');var innerMejs=player.find('.mejs-inner'),total=player.find('.mejs-controls .mejs-time-total');if(typeof mejsPlayer!=='undefined'){railWidth=Math.ceil(player.width()*0.8);if(innerMejs.length){rail.css('width',railWidth+'px!important');mejsPlayer.options.autosizeProgress=true;setTimeout(function(){mejsPlayer.setControlsSize();},50);player.find('.mejs-inner').css({visibility:'visible',height:'inherit'});}}});}},preloadAudio:function(element){var $element='undefined'==typeof element?$('body'):$(element),contentWrap=$element.closest('.fl-accordion-item'),audioPlayers=$element.find('.wp-audio-shortcode.mejs-audio');if(!contentWrap.hasClass('fl-accordion-item-active')&&audioPlayers.find('.mejs-inner').length){audioPlayers.find('.mejs-inner').css({visibility:'hidden',height:0});}},resizeSlideshow:function(){if(typeof YUI!=='undefined'){YUI().use('node-event-simulate',function(Y){Y.one(window).simulate("resize");});}},reloadGoogleMap:function(element){var $element='undefined'==typeof element?$('body'):$(element),googleMap=$element.find('iframe[src*="google.com/maps"]');if(googleMap.length){googleMap.attr('src',function(i,val){return val;});}},_destroy:function(){var win=$(window);win.off('scroll.fl-bg-parallax');win.off('resize.fl-bg-video');},_isTouch:function(){if(('ontouchstart'in window)||(window.DocumentTouch&&document instanceof DocumentTouch)){return true;} return false;},_isMobile:function(){return/Mobile|Android|Silk\/|Kindle|BlackBerry|Opera Mini|Opera Mobi|webOS/i.test(navigator.userAgent);},_initClasses:function(){var body=$('body'),ua=navigator.userAgent;if(!body.hasClass('archive')&&$('.fl-builder-content-primary').length>0){body.addClass('fl-builder');} if(FLBuilderLayout._isTouch()){body.addClass('fl-builder-touch');} if(FLBuilderLayout._isMobile()){body.addClass('fl-builder-mobile');} if($(window).width()FLBuilderLayoutConfig.breakpoints.small&&$(window).width()FLBuilderLayoutConfig.breakpoints.medium){body.addClass('fl-builder-breakpoint-large');} if(ua.indexOf('Trident/7.0')>-1&&ua.indexOf('rv:11.0')>-1){body.addClass('fl-builder-ie-11');}},_initBackgrounds:function(){var win=$(window);if($('.fl-row-bg-parallax').length>0&&!FLBuilderLayout._isMobile()){FLBuilderLayout._scrollParallaxBackgrounds();FLBuilderLayout._initParallaxBackgrounds();win.on('scroll.fl-bg-parallax',FLBuilderLayout._scrollParallaxBackgrounds);} if($('.fl-bg-video').length>0){FLBuilderLayout._initBgVideos();FLBuilderLayout._resizeBgVideos();win.on('resize.fl-bg-video',FLBuilderLayout._resizeBgVideos);}},_initParallaxBackgrounds:function(){$('.fl-row-bg-parallax').each(FLBuilderLayout._initParallaxBackground);},_initParallaxBackground:function(){var row=$(this),content=row.find('> .fl-row-content-wrap'),src=row.data('parallax-image'),loaded=row.data('parallax-loaded'),img=new Image();if(loaded){return;} else if(typeof src!='undefined'){$(img).on('load',function(){content.css('background-image','url('+src+')');row.data('parallax-loaded',true);});img.src=src;}},_scrollParallaxBackgrounds:function(){$('.fl-row-bg-parallax').each(FLBuilderLayout._scrollParallaxBackground);},_scrollParallaxBackground:function(){var win=$(window),row=$(this),content=row.find('> .fl-row-content-wrap'),speed=row.data('parallax-speed'),offset=content.offset(),yPos=-((win.scrollTop()-offset.top)/speed);content.css('background-position','center '+yPos+'px');},_initBgVideos:function(){$('.fl-bg-video').each(FLBuilderLayout._initBgVideo);},_initBgVideo:function(){var wrap=$(this),width=wrap.data('width'),height=wrap.data('height'),mp4=wrap.data('mp4'),youtube=wrap.data('youtube'),vimeo=wrap.data('vimeo'),mp4Type=wrap.data('mp4-type'),webm=wrap.data('webm'),webmType=wrap.data('webm-type'),fallback=wrap.data('fallback'),loaded=wrap.data('loaded'),videoMobile=wrap.data('video-mobile'),fallbackTag='',videoTag=null,mp4Tag=null,webmTag=null;if(loaded){return;} videoTag=$('');if('undefined'!=typeof fallback&&''!=fallback){videoTag.attr('poster','data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7') videoTag.css('background','transparent url("'+fallback+'") no-repeat center center') videoTag.css('background-size','cover') videoTag.css('height','100%')} if('undefined'!=typeof mp4&&''!=mp4){mp4Tag=$('');mp4Tag.attr('src',mp4);mp4Tag.attr('type',mp4Type);videoTag.append(mp4Tag);} if('undefined'!=typeof webm&&''!=webm){webmTag=$('');webmTag.attr('src',webm);webmTag.attr('type',webmType);videoTag.append(webmTag);} if(!FLBuilderLayout._isMobile()||(FLBuilderLayout._isMobile()&&"yes"==videoMobile)){if('undefined'!=typeof youtube){FLBuilderLayout._initYoutubeBgVideo.apply(this);} else if('undefined'!=typeof vimeo){FLBuilderLayout._initVimeoBgVideo.apply(this);}else{wrap.append(videoTag);}}else{videoTag.attr('src','') wrap.append(videoTag);} wrap.data('loaded',true);},_initYoutubeBgVideo:function(){var playerWrap=$(this),videoId=playerWrap.data('video-id'),videoPlayer=playerWrap.find('.fl-bg-video-player'),enableAudio=playerWrap.data('enable-audio'),audioButton=playerWrap.find('.fl-bg-video-audio'),startTime='undefined'!==typeof playerWrap.data('start')?playerWrap.data('start'):0,endTime='undefined'!==typeof playerWrap.data('end')?playerWrap.data('end'):0,loop='undefined'!==typeof playerWrap.data('loop')?playerWrap.data('loop'):1,stateCount=0,player,fallback_showing;if(videoId){fallback=playerWrap.data('fallback')||false if(fallback){playerWrap.find('iframe').remove() fallbackTag=$('
');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+playerWrap.data('fallback')+')');fallbackTag.css('background-size','cover');fallbackTag.css('transition','background-image 1s') playerWrap.append(fallbackTag);fallback_showing=true;} FLBuilderLayout._onYoutubeApiReady(function(YT){setTimeout(function(){player=new YT.Player(videoPlayer[0],{videoId:videoId,events:{onReady:function(event){if("no"===enableAudio||FLBuilderLayout._isMobile()){event.target.mute();} else if("yes"===enableAudio&&event.target.isMuted){event.target.unMute();} playerWrap.data('YTPlayer',player);FLBuilderLayout._resizeYoutubeBgVideo.apply(playerWrap);event.target.playVideo();if(audioButton.length>0&&!FLBuilderLayout._isMobile()){audioButton.on('click',{button:audioButton,player:player},FLBuilderLayout._toggleBgVideoAudio);}},onStateChange:function(event){if(event.data===1){if(fallback_showing){$('.fl-bg-video-fallback').css('background-image','url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)')}} if(stateCount<4){stateCount++;} if(stateCount>1&&(-1===event.data||2===event.data)&&"yes"===enableAudio){player.mute();player.playVideo();audioButton.show();} if(event.data===YT.PlayerState.ENDED&&1===loop){if(startTime>0){player.seekTo(startTime);}else{player.playVideo();}}},onError:function(event){console.info('YT Error: '+event.data) FLBuilderLayout._onErrorYoutubeVimeo(playerWrap)}},playerVars:{playsinline:FLBuilderLayout._isMobile()?1:0,controls:0,showinfo:0,rel:0,start:startTime,end:endTime,}});},1);});}},_onErrorYoutubeVimeo:function(playerWrap){fallback=playerWrap.data('fallback')||false if(!fallback){return false;} playerWrap.find('iframe').remove() fallbackTag=$('
');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+playerWrap.data('fallback')+')');playerWrap.append(fallbackTag);},_onYoutubeApiReady:function(callback){if(window.YT&&YT.loaded){callback(YT);}else{setTimeout(function(){FLBuilderLayout._onYoutubeApiReady(callback);},350);}},_initVimeoBgVideo:function(){var playerWrap=$(this),videoId=playerWrap.data('video-id'),videoPlayer=playerWrap.find('.fl-bg-video-player'),enableAudio=playerWrap.data('enable-audio'),audioButton=playerWrap.find('.fl-bg-video-audio'),player,width=playerWrap.outerWidth();if(typeof Vimeo!=='undefined'&&videoId){player=new Vimeo.Player(videoPlayer[0],{id:videoId,loop:true,title:false,portrait:false,background:true,autopause:false,muted:true});playerWrap.data('VMPlayer',player);if("no"===enableAudio){player.setVolume(0);} else if("yes"===enableAudio){if($.browser.safari||$.browser.chrome){player.setVolume(0);audioButton.show();}else{player.setVolume(1);}} player.play().catch(function(error){FLBuilderLayout._onErrorYoutubeVimeo(playerWrap)});if(audioButton.length>0){audioButton.on('click',{button:audioButton,player:player},FLBuilderLayout._toggleBgVideoAudio);}}},_toggleBgVideoAudio:function(e){var player=e.data.player,control=e.data.button.find('.fl-audio-control');if(control.hasClass('fa-volume-off')){control.removeClass('fa-volume-off').addClass('fa-volume-up');e.data.button.find('.fa-times').hide();if('function'===typeof player.unMute){player.unMute();}else{player.setVolume(1);}}else{control.removeClass('fa-volume-up').addClass('fa-volume-off');e.data.button.find('.fa-times').show();if('function'===typeof player.unMute){player.mute();}else{player.setVolume(0);}}},_videoBgSourceError:function(e){var source=$(e.target),wrap=source.closest('.fl-bg-video'),vid=wrap.find('video'),fallback=wrap.data('fallback'),fallbackTag='';source.remove();if(vid.find('source').length){return;}else if(''!==fallback){fallbackTag=$('
');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+fallback+')');wrap.append(fallbackTag);vid.remove();}},_resizeBgVideos:function(){$('.fl-bg-video').each(function(){FLBuilderLayout._resizeBgVideo.apply(this);if($(this).parent().find('img').length>0){$(this).parent().imagesLoaded($.proxy(FLBuilderLayout._resizeBgVideo,this));}});},_resizeBgVideo:function(){if(0===$(this).find('video').length&&0===$(this).find('iframe').length){return;} var wrap=$(this),wrapHeight=wrap.outerHeight(),wrapWidth=wrap.outerWidth(),vid=wrap.find('video'),vidHeight=wrap.data('height'),vidWidth=wrap.data('width'),newWidth=wrapWidth,newHeight=Math.round(vidHeight*wrapWidth/vidWidth),newLeft=0,newTop=0,iframe=wrap.find('iframe');if(vid.length){if(vidHeight===''||typeof vidHeight==='undefined'||vidWidth===''||typeof vidWidth==='undefined'){vid.css({'left':'0px','top':'0px','width':newWidth+'px'});vid.on('loadedmetadata',FLBuilderLayout._resizeOnLoadedMeta);}else{if(newHeightaspectRatio,width=isWidthFixed?wrapWidth:ratioHeight,height=isWidthFixed?ratioWidth:wrapHeight;if(video){$(video).width(width).height(height);}},_initModuleAnimations:function(){if(typeof jQuery.fn.waypoint!=='undefined'){$('.fl-animation').each(function(){var node=$(this),nodeTop=node.offset().top,winHeight=$(window).height(),bodyHeight=$('body').height(),waypoint=FLBuilderLayoutConfig.waypoint,offset='80%';if(typeof waypoint.offset!==undefined){offset=FLBuilderLayoutConfig.waypoint.offset+'%';} if(bodyHeight-nodeTop0){setTimeout(function(){module.addClass('fl-animated');},delay*1000);}else{setTimeout(function(){module.addClass('fl-animated');},1);}},_initHash:function(){var hash=window.location.hash.replace('#','').split('/').shift(),element=null,tabs=null,responsiveLabel=null,tabIndex=null,label=null;if(''!==hash){try{element=$('#'+hash);if(element.length>0){if(element.hasClass('fl-accordion-item')){setTimeout(function(){element.find('.fl-accordion-button').trigger('click');},100);} if(element.hasClass('fl-tabs-panel')){setTimeout(function(){tabs=element.closest('.fl-tabs');responsiveLabel=element.find('.fl-tabs-panel-label');tabIndex=responsiveLabel.data('index');label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index='+tabIndex+']');if(responsiveLabel.is(':visible')){responsiveLabel.trigger('click');}else{label[0].click();FLBuilderLayout._scrollToElement(element);}},100);}}} catch(e){}}},_initAnchorLinks:function(){$('a').each(FLBuilderLayout._initAnchorLink);},_initAnchorLink:function(){var link=$(this),href=link.attr('href'),loc=window.location,id=null,element=null;if('undefined'!=typeof href&&href.indexOf('#')>-1&&link.closest('svg').length<1){if(loc.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&loc.hostname==this.hostname){try{id=href.split('#').pop();if(!id){return;} element=$('#'+id);if(element.length>0){if(link.hasClass('fl-scroll-link')||element.hasClass('fl-row')||element.hasClass('fl-col')||element.hasClass('fl-module')){$(link).on('click',FLBuilderLayout._scrollToElementOnLinkClick);} if(element.hasClass('fl-accordion-item')){$(link).on('click',FLBuilderLayout._scrollToAccordionOnLinkClick);} if(element.hasClass('fl-tabs-panel')){$(link).on('click',FLBuilderLayout._scrollToTabOnLinkClick);}}} catch(e){}}}},_scrollToElementOnLinkClick:function(e,callback){var element=$('#'+$(this).attr('href').split('#').pop());FLBuilderLayout._scrollToElement(element,callback);e.preventDefault();},_scrollToElement:function(element,callback){var config=FLBuilderLayoutConfig.anchorLinkAnimations,dest=0,win=$(window),doc=$(document);if(element.length>0){if(element.offset().top>doc.height()-win.height()){dest=doc.height()-win.height();}else{dest=element.offset().top-config.offset;} $('html, body').animate({scrollTop:dest},config.duration,config.easing,function(){if('undefined'!=typeof callback){callback();} if(undefined!=element.attr('id')){if(history.pushState){history.pushState(null,null,'#'+element.attr('id'));}else{window.location.hash=element.attr('id');}}});}},_scrollToAccordionOnLinkClick:function(e){var element=$('#'+$(this).attr('href').split('#').pop());if(element.length>0){var callback=function(){if(element){element.find('.fl-accordion-button').trigger('click');element=false;}};FLBuilderLayout._scrollToElementOnLinkClick.call(this,e,callback);}},_scrollToTabOnLinkClick:function(e){var element=$('#'+$(this).attr('href').split('#').pop()),tabs=null,label=null,responsiveLabel=null;if(element.length>0){tabs=element.closest('.fl-tabs');responsiveLabel=element.find('.fl-tabs-panel-label');tabIndex=responsiveLabel.data('index');label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index='+tabIndex+']');if(responsiveLabel.is(':visible')){var callback=function(){if(element){responsiveLabel.trigger('click');element=false;}};FLBuilderLayout._scrollToElementOnLinkClick.call(this,e,callback);}else{label[0].click();FLBuilderLayout._scrollToElement(element);} e.preventDefault();}},_initForms:function(){if(!FLBuilderLayout._hasPlaceholderSupport){$('.fl-form-field input').each(FLBuilderLayout._initFormFieldPlaceholderFallback);} $('.fl-form-field input').on('focus',FLBuilderLayout._clearFormFieldError);},_hasPlaceholderSupport:function(){var input=document.createElement('input');return'undefined'!=input.placeholder;},_initFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if('undefined'!=placeholder&&''===val){field.val(placeholder);field.on('focus',FLBuilderLayout._hideFormFieldPlaceholderFallback);field.on('blur',FLBuilderLayout._showFormFieldPlaceholderFallback);}},_hideFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if(val==placeholder){field.val('');}},_showFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if(''===val){field.val(placeholder);}},_clearFormFieldError:function(){var field=$(this);field.removeClass('fl-form-error');field.siblings('.fl-form-error-message').hide();}};$(function(){FLBuilderLayout.init();});})(jQuery); !function(){"use strict";function e(e){function t(t,n){var s,h,k=t==window,y=n&&n.message!==undefined?n.message:undefined;if(!(n=e.extend({},e.blockUI.defaults,n||{})).ignoreIfBlocked||!e(t).data("blockUI.isBlocked")){if(n.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,n.overlayCSS||{}),s=e.extend({},e.blockUI.defaults.css,n.css||{}),n.onOverlayClick&&(n.overlayCSS.cursor="pointer"),h=e.extend({},e.blockUI.defaults.themedCSS,n.themedCSS||{}),y=y===undefined?n.message:y,k&&p&&o(window,{fadeOut:0}),y&&"string"!=typeof y&&(y.parentNode||y.jquery)){var m=y.jquery?y[0]:y,g={};e(t).data("blockUI.history",g),g.el=m,g.parent=m.parentNode,g.display=m.style.display,g.position=m.style.position,g.parent&&g.parent.removeChild(m)}e(t).data("blockUI.onUnblock",n.onUnblock);var v,I,w,U,x=n.baseZ;v=e(r||n.forceIframe?'':''),I=e(n.theme?'':''),n.theme&&k?(U='"):n.theme?(U='"):U=k?'':'',w=e(U),y&&(n.theme?(w.css(h),w.addClass("ui-widget-content")):w.css(s)),n.theme||I.css(n.overlayCSS),I.css("position",k?"fixed":"absolute"),(r||n.forceIframe)&&v.css("opacity",0);var C=[v,I,w],S=e(k?"body":t);e.each(C,function(){this.appendTo(S)}),n.theme&&n.draggable&&e.fn.draggable&&w.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var O=f&&(!e.support.boxModel||e("object,embed",k?null:t).length>0);if(u||O){if(k&&n.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(u||!e.support.boxModel)&&!k)var E=a(t,"borderTopWidth"),T=a(t,"borderLeftWidth"),M=E?"(0 - "+E+")":0,B=T?"(0 - "+T+")":0;e.each(C,function(e,t){var o=t[0].style;if(o.position="absolute",e<2)k?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+n.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),k?o.setExpression("width",'jQuery.support.boxModel&&document.documentElement.clientWidth||document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),B&&o.setExpression("left",B),M&&o.setExpression("top",M);else if(n.centerY)k&&o.setExpression("top",'(document.documentElement.clientHeight||document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah=document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop) + "px"'),o.marginTop=0;else if(!n.centerY&&k){var i="((document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop) + "+(n.css&&n.css.top?parseInt(n.css.top,10):0)+') + "px"';o.setExpression("top",i)}})}if(y&&(n.theme?w.find(".ui-widget-content").append(y):w.append(y),(y.jquery||y.nodeType)&&e(y).show()),(r||n.forceIframe)&&n.showOverlay&&v.show(),n.fadeIn){var j=n.onBlock?n.onBlock:c,H=n.showOverlay&&!y?j:c,z=y?j:c;n.showOverlay&&I._fadeIn(n.fadeIn,H),y&&w._fadeIn(n.fadeIn,z)}else n.showOverlay&&I.show(),y&&w.show(),n.onBlock&&n.onBlock.bind(w)();if(i(1,t,n),k?(p=w[0],b=e(n.focusableElements,p),n.focusInput&&setTimeout(l,20)):d(w[0],n.centerX,n.centerY),n.timeout){var W=setTimeout(function(){k?e.unblockUI(n):e(t).unblock(n)},n.timeout);e(t).data("blockUI.timeout",W)}}}function o(t,o){var s,l=t==window,d=e(t),a=d.data("blockUI.history"),c=d.data("blockUI.timeout");c&&(clearTimeout(c),d.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),i(0,t,o),null===o.onUnblock&&(o.onUnblock=d.data("blockUI.onUnblock"),d.removeData("blockUI.onUnblock"));var r;r=l?e(document.body).children().filter(".blockUI").add("body > .blockUI"):d.find(">.blockUI"),o.cursorReset&&(r.length>1&&(r[1].style.cursor=o.cursorReset),r.length>2&&(r[2].style.cursor=o.cursorReset)),l&&(p=b=null),o.fadeOut?(s=r.length,r.stop().fadeOut(o.fadeOut,function(){0==--s&&n(r,a,o,t)})):n(r,a,o,t)}function n(t,o,n,i){var s=e(i);if(!s.data("blockUI.isBlocked")){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.el.style.cursor="default",o.parent&&o.parent.appendChild(o.el),s.removeData("blockUI.history")),s.data("blockUI.static")&&s.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var l=e(document.body),d=l.width(),a=l[0].style.width;l.width(d-1).width(d),l[0].style.width=a}}function i(t,o,n){var i=o==window,l=e(o);if((t||(!i||p)&&(i||l.data("blockUI.isBlocked")))&&(l.data("blockUI.isBlocked",t),i&&n.bindEvents&&(!t||n.showOverlay))){var d="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(d,n,s):e(document).unbind(d,s)}}function s(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&p&&t.data.constrainTabKey){var o=b,n=!t.shiftKey&&t.target===o[o.length-1],i=t.shiftKey&&t.target===o[0];if(n||i)return setTimeout(function(){l(i)},10),!1}var s=t.data,d=e(t.target);return d.hasClass("blockOverlay")&&s.onOverlayClick&&s.onOverlayClick(t),d.parents("div."+s.blockMsgClass).length>0||0===d.parents().children().filter("div.blockUI").length}function l(e){if(b){var t=b[!0===e?b.length-1:0];t&&t.focus()}}function d(e,t,o){var n=e.parentNode,i=e.style,s=(n.offsetWidth-e.offsetWidth)/2-a(n,"borderLeftWidth"),l=(n.offsetHeight-e.offsetHeight)/2-a(n,"borderTopWidth");t&&(i.left=s>0?s+"px":"0"),o&&(i.top=l>0?l+"px":"0")}function a(t,o){return parseInt(e.css(t,o),10)||0}e.fn._fadeIn=e.fn.fadeIn;var c=e.noop||function(){},r=/MSIE/.test(navigator.userAgent),u=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),f=(document.documentMode,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){t(window,e)},e.unblockUI=function(e){o(window,e)},e.growlUI=function(t,o,n,i){var s=e('
');t&&s.append("

"+t+"

"),o&&s.append("

"+o+"

"),n===undefined&&(n=3e3);var l=function(t){t=t||{},e.blockUI({message:s,fadeIn:"undefined"!=typeof t.fadeIn?t.fadeIn:700,fadeOut:"undefined"!=typeof t.fadeOut?t.fadeOut:1e3,timeout:"undefined"!=typeof t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})};l();s.css("opacity");s.mouseover(function(){l({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(o){if(this[0]===window)return e.blockUI(o),this;var n=e.extend({},e.blockUI.defaults,o||{});return this.each(function(){var t=e(this);n.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,t(this,o)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){o(this,t)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"

Please wait...

",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var p=null,b=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}(); jQuery(function(d){if("undefined"==typeof wc_add_to_cart_params)return!1;function t(){this.requests=[],this.addRequest=this.addRequest.bind(this),this.run=this.run.bind(this),d(document.body).on("click",".add_to_cart_button",{addToCartHandler:this},this.onAddToCart).on("click",".remove_from_cart_button",{addToCartHandler:this},this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("ajax_request_not_sent.adding_to_cart",this.updateButton).on("added_to_cart removed_from_cart",{addToCartHandler:this},this.updateFragments)}t.prototype.addRequest=function(t){this.requests.push(t),1===this.requests.length&&this.run()},t.prototype.run=function(){var t=this,a=t.requests[0].complete;t.requests[0].complete=function(){"function"==typeof a&&a(),t.requests.shift(),0'+wc_add_to_cart_params.i18n_view_cart+""),d(document.body).trigger("wc_cart_button_updated",[r]))},t.prototype.updateFragments=function(t,a){a&&(d.each(a,function(t){d(t).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),d.each(a,function(t,a){d(t).replaceWith(a),d(t).stop(!0).css("opacity","1").unblock()}),d(document.body).trigger("wc_fragments_loaded"))},new t}); !function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(m){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var f="";for(var s in i)i[s]&&(f+="; "+s,!0!==i[s]&&(f+="="+i[s]));return document.cookie=n+"="+r+f}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u'),t(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),t(".password-input").append(''),t(".show-password-input").click(function(){t(this).toggleClass("display-password"),t(this).hasClass("display-password")?t(this).siblings(['input[type="password"]']).prop("type","text"):t(this).siblings('input[type="text"]').prop("type","password")})}); !function(e){"use strict";var t=window.VAMTAM=window.VAMTAM||{};t.debounce=function(e,t,i){var a;return function(){var n=this,o=arguments,s=i&&!a;clearTimeout(a),a=setTimeout(function(){a=null,i||e.apply(n,o)},t),s&&e.apply(n,o)}},t.offset=function(e){var t=e.getBoundingClientRect(),i=window.pageXOffset||document.documentElement.scrollLeft,a=window.pageYOffset||document.documentElement.scrollTop;return{top:t.top+a,left:t.left+i}},t.scroll_handlers=[],t.latestKnownScrollY=0;var i=!1;t.addScrollHandler=function(e){requestAnimationFrame(function(){e.init(),t.scroll_handlers.push(e),e.measure(t.latestKnownScrollY),e.mutate(t.latestKnownScrollY)})},t.onScroll=function(){t.latestKnownScrollY=window.pageYOffset,i||(i=!0,requestAnimationFrame(function(){var e;for(e=0;e=t.length&&(window.GreenSockGlobals=window._gsQueue=window._gsDefine=null,window.vamtam_greensock_loaded=!0,function(){for(var e=0;e0)for(var o=0;o .mega-menu-wrap > .mega-menu-toggle"),l=document.querySelector("#main-menu");s&&s.addEventListener("click",function(e){e.preventDefault(),requestAnimationFrame(function(){var e=(r||s).classList.contains("mega-menu-open");s.classList.toggle("mega-menu-open",!e),(r||l).classList.toggle("mega-menu-open",!e)})});var m,c=document.getElementById("vamtam-overlay-menu"),d=document.querySelector(".vamtam-overlay-menu-toggle"),u=!1;document.body.addEventListener("click",function(e){var t=e.target.closest("button");t&&t.classList.contains("vamtam-overlay-menu-toggle")&&function(e){e.preventDefault(),requestAnimationFrame(function(){if(u=!u){m=d.cloneNode(!0);var e=d.getBoundingClientRect();document.body.appendChild(m),Object.assign(m.style,{position:"fixed",top:e.top+"px",left:e.left+"px"}),requestAnimationFrame(function(){c.classList.add("open"),m.classList.add("is-active")})}else m.classList.remove("is-active"),c.classList.remove("open"),setTimeout(function(){requestAnimationFrame(function(){m.remove()})},650)})}(e)});var p,h,f=e("#main-menu .sub-menu");if(f.length){var w=window.VAMTAM.debounce(function(){requestAnimationFrame(function(){var t=window.innerWidth;f.show().removeClass("invert-position").each(function(){e(this).offset().left+e(this).width()>t-50&&e(this).addClass("invert-position")}),f.css("display","")})},100);w(),window.addEventListener("resize",w,!1)}if(l&&l.classList.contains("vamtam-basic-menu")){var g=e(l).find(".sub-menu"),v=e(l).find(".menu-item > a");v.on("click",function(t){if(l.classList.contains("mega-menu-open")){var i=this.parentElement;if(!this.classList.contains("menu-item-on")&&i.classList.contains("menu-item-has-children")){t.preventDefault();var a=e(i).find(".sub-menu");g.attr("style",""),a.attr("style","display: block !important;"),v.not(this).removeClass("menu-item-on"),this.classList.add("menu-item-on")}}})}var y=function(){clearTimeout(p),p=setTimeout(b,200)},b=function(){window.removeEventListener("scroll",y,{passive:!0}),t.blockStickyHeaderAnimation=!1,setTimeout(function(){requestAnimationFrame(function(){document.body.classList.remove("no-sticky-header-animation-tmp")})},50),h&&h()},A=function(e,l,m){requestAnimationFrame(function(){var l=e.offset().top;t.blockStickyHeaderAnimation=!0;var c=0;i.hasClass("layout-standard")||i.hasClass("logo-text-menu")?c=l>=a.offset().top?i.find(".second-row-columns").height():i.height():n.hasClass("no-sticky-header-animation")?c=i.height():(c=o.height(),"stickyHeader"in t&&t.stickyHeader.singleRowStick(),document.body.classList.add("no-sticky-header-animation-tmp"));var d=l-t.admin_bar_fix-c;h=m,window.addEventListener("scroll",y,{passive:!0}),window.scroll({left:0,top:d,behavior:"smooth"}),e.attr("id")&&(history.pushState?history.pushState(null,null,"#"+e.attr("id")):window.location.hash=e.attr("id")),s&&s.classList.remove("mega-menu-open"),r&&r.classList.remove("mega-menu-open")})};if(window.FLBuilderLayout&&Object.assign(window.FLBuilderLayout,{_scrollToElement:function(e,t){var i=window.FLBuilderLayoutConfig.anchorLinkAnimations;e.length&&(s.classList.remove("mega-menu-open"),r.classList.remove("mega-menu-open"),A(e,i.duration,t))}}),e(document.body).on("click",".vamtam-animated-page-scroll[href], .vamtam-animated-page-scroll [href], .vamtam-animated-page-scroll [data-href], .mega-vamtam-animated-page-scroll[href], .mega-vamtam-animated-page-scroll [href], .mega-vamtam-animated-page-scroll [data-href]",function(t){var i=e(this).prop("href")||e(this).data("href"),a=e("#"+i.split("#")[1]),n=document.createElement("a");n.href=i,a.length&&n.pathname===window.location.pathname&&(s.classList.remove("mega-menu-open"),r.classList.remove("mega-menu-open"),A(a),t.preventDefault())}),""!==window.location.hash&&(e('.vamtam-animated-page-scroll[href*="'+window.location.hash+'"]').length||e('.vamtam-animated-page-scroll [href*="'+window.location.hash+'"]').length||e('.vamtam-animated-page-scroll [data-href*="'+window.location.hash+'"]').length||e('.mega-vamtam-animated-page-scroll[href*="'+window.location.hash+'"]').length||e('.mega-vamtam-animated-page-scroll [href*="'+window.location.hash+'"]').length||e('.mega-vamtam-animated-page-scroll [data-href*="'+window.location.hash+'"]').length)){var T=e(window.location.hash);T.length>0&&e(window).add("html, body, #page").scrollTop(0),setTimeout(function(){A(T)},400)}var L=[];if(e("#main-menu").find(".mega-menu, .menu").find(".maybe-current-menu-item, .mega-current-menu-item, .current-menu-item").each(function(){var t=e("> a",this);if(t.prop("href").indexOf("#")>-1){var i=t.prop("href").split("#")[1];"#"+i!==window.location.hash&&e(this).removeClass("mega-current-menu-item current-menu-item"),L.push([i,e(this),e("#"+i)])}}),L.length){var M=0,x=0,_=null;t.addScrollHandler({init:function(){},add_current_menu_item:function(e){for(var t=0;te&&a a",this.upmost_data[1]).text(),0!==t?"#"+this.upmost_data[0]:location.href.replace(location.hash,"")),_=e.extend({},this.upmost_data))):null===this.upmost_data&&null!==_&&this.add_current_menu_item(_[0])}})}})}(jQuery,window.VAMTAM),function(e,t){"use strict";window.addEventListener("load",function(){var t=document.querySelectorAll("[data-progressive-animation]");!t.length||document.body.classList.contains("fl-builder-active")||window.matchMedia("(prefers-reduced-motion: reduce)").matches||vamtam_greensock_wait(function(){e.addScrollHandler({defaultOptions:{origin:"center center",type:"progressive",exit:!0,delay:0,mobile:!1,pin:!1,pinTrigger:"center"},blockAnimations:!1,canActivate:function(t){return t||!e.MEDIA.layout["layout-below-max"]},buildTimeline:function(e,t){var i=new vamtamgs.TimelineLite({paused:!0}),a=e.getAttribute("data-progressive-animation");if("dummy"===a)i.fromTo(e,1,{opacity:1},{opacity:1},"0"),t&&i.to(e,1,{opacity:1},"1");else if("rotate"===a)i.fromTo(e,1,{rotation:-180},{rotation:0},"0"),t&&i.to(e,1,{rotation:180},"1");else if("fade"===a)i.fromTo(e,1,{opacity:0},{opacity:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{y:-100},"1.6");else if("move-from-top"===a)i.fromTo(e,1,{y:-160,opacity:0},{y:0,opacity:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{y:-100},"1.6");else if("move-from-bottom"===a)i.fromTo(e,1,{y:100,opacity:0},{y:0,opacity:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{y:-50},"1.6");else if("move-from-left"===a)i.fromTo(e,1,{x:-160,opacity:0},{x:0,opacity:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{x:-100},"1.6");else if("move-from-right"===a)i.fromTo(e,1,{x:160,opacity:0},{x:0,opacity:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{x:100},"1.6");else if("scale-in"===a)i.fromTo(e,1,{opacity:0,scaleX:0,scaleY:0},{opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6");else if("scale-out"===a)i.fromTo(e,1,{opacity:0,scaleX:2,scaleY:2},{opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6");else if("move-scale-in-from-top"===a)i.fromTo(e,1,{y:-160,opacity:0,scaleX:.6,scaleY:.6},{y:0,opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{y:-100},"1.6");else if("move-scale-in-from-bottom"===a)i.fromTo(e,1,{y:160,opacity:0,scaleX:.6,scaleY:.6},{y:0,opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{y:-100},"1.6");else if("move-scale-in-from-left"===a)i.fromTo(e,1,{x:-160,opacity:0,scaleX:.6,scaleY:.6},{x:0,opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{x:-100},"1.6");else if("move-scale-in-from-right"===a)i.fromTo(e,1,{x:160,opacity:0,scaleX:.6,scaleY:.6},{x:0,opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{x:100},"1.6");else if("move-scale-out-from-top"===a)i.fromTo(e,1,{y:-160,opacity:0,scaleX:1.6,scaleY:1.6},{y:0,opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{y:-100},"1.6");else if("move-scale-out-from-bottom"===a)i.fromTo(e,1,{y:160,opacity:0,scaleX:1.6,scaleY:1.6},{y:0,opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{y:-100},"1.6");else if("move-scale-out-from-left"===a)i.fromTo(e,1,{x:-160,opacity:0,scaleX:1.6,scaleY:1.6},{x:0,opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{x:-100},"1.6");else if("move-scale-out-from-right"===a)i.fromTo(e,1,{x:160,opacity:0,scaleX:1.6,scaleY:1.6},{x:0,opacity:1,scaleX:1,scaleY:1},"0"),t&&i.to(e,.4,{opacity:0},"1.6"),t&&i.to(e,1,{x:100},"1.6");else if("rotate-from-top-right"===a)i.fromTo(e,1,{y:-200,x:120,rotation:-10,opacity:0},{y:0,x:0,rotation:0,opacity:1},"0"),t&&i.fromTo(e,1,{immediateRender:!1,y:0},{y:-70},"1.6");else if("page-title"===a){var n=e.querySelector(".page-header-line"),o=e.querySelector(".desc"),s=document.getElementById("sub-header").querySelector(".text-shadow");i.fromTo(e.querySelector("h1"),.9,{y:0,opacity:1},{y:-10,opacity:0,ease:vamtamgs.Quad.easeIn},"0.1"),o&&i.fromTo(o,1,{y:0,opacity:1},{y:30,opacity:0,ease:vamtamgs.Quad.easeIn},"0"),s&&i.to(s,1,{className:"text-shadow shadow-darkened",ease:vamtamgs.Quad.easeIn},"0"),n&&i.to(n,1,{scaleX:0,y:30,opacity:0,ease:vamtamgs.Quad.easeIn},"0")}else"custom"===a&&i.to(e,1,{className:e.getAttribute("data-progressive-animation-custom")},"1");return i},getPinTrigger:function(e){return"center"===e.options.pinTrigger?this.winHeight/2-e.height/2:"bottom"===e.options.pinTrigger?this.winHeight-e.height:"top"===e.options.pinTrigger?0:void 0},calculatePinDuration:function(t){if(e.MEDIA.layout["layout-below-max"])t.vamtamProgressiveTimeline.pinDuration=0;else if("parent"===t.vamtamProgressiveTimeline.options.pin){var i=t.closest(".fl-row-content");t.vamtamProgressiveTimeline.pinDuration=i.offsetHeight-(t.vamtamProgressiveTimeline.top-e.offset(i).top)}else t.vamtamProgressiveTimeline.pinDuration=+t.vamtamProgressiveTimeline.options.pin},onresize:function(){var i=this;this.winWidth!==window.innerWidth&&(this.winWidth=window.innerWidth,this.winHeight=window.innerHeight,this.blockAnimations=!0,requestAnimationFrame(function(){for(var a=0;a1||!l.options.exit?l.timeline.seek(1):l.timeline.seek(0):l.timeline.seek(1),l.timeline=null,l.pusher&&(l.pusher.parentElement.minHeight="",l.wrapper.classList.remove("vamtam-pin-active"),l.wrapper.style.display="block",s.push(l.wrapper)))}n=s,requestAnimationFrame(function(){n.forEach(function(e){e.style.display=""})}),i.blockAnimations=!1,i.measure(o),i.mutate(o)})}))},init:function(){var i,a;for(this.winHeight=window.innerHeight,this.winWidth=window.innerWidth,i=0;ia.top){var n,o,s=a.top+a.height/2;if(!1!==a.options.pin)"center"===a.options.pinTrigger?o=e+this.winHeight/2:"bottom"===a.options.pinTrigger?o=e+this.winHeight-a.height/2:"top"===a.options.pinTrigger&&(o=e+a.height/2),n=2*(o-s)/(s+a.pinDuration-a.height-s)-1;else n=1-(s-e)/Math.min(this.winHeight/2,s);n-=a.options.delay,"progressive"===a.options.type?(a.timeline.totalDuration()>1||!t[i].vamtamProgressiveTimeline.options.exit?(n=Math.min(1,Math.max(-1,n)),n+=1):n=Math.min(1,Math.max(0,n)),a.timeline.seek(n)):!a.used&&n>=0?(a.used=!0,a.timeline.timeScale(2).play()):a.used&&!a.timeline.isActive()&&a.timeline.progress()<1&&a.timeline.seek(1)}}}})})},{passive:!0})}(window.VAMTAM),function(e,t){"use strict";var i=!1;e.parallaxBackground={init:function(){this.rows=document.querySelectorAll(".fl-row-bg-parallax");for(var e=0;e .vamtam-video-frame").find("iframe, object, embed, video").each(function(){setTimeout(function(){requestAnimationFrame(function(){var t=this.offsetWidth;this.style.width="100%","0"===this.width&&"0"===this.height?this.style.height=9*t/16+"px":this.style.height=this.height*t/this.width+"px",e(this).trigger("vamtam-video-resized")}.bind(this))}.bind(this),50)}),setTimeout(function(){requestAnimationFrame(function(){e(".mejs-time-rail").css("width","-=1px")})},100)},window.addEventListener("resize",window.VAMTAM.debounce(window.VAMTAM.resizeElements,100),!1),window.VAMTAM.resizeElements()}),document.addEventListener("DOMContentLoaded",function(){if(window.VAMTAM.load_script(VAMTAM_FRONT.jspath+"build/low-priority.min.js"),!(window.CSS&&window.CSS.supports&&window.CSS.supports("(--foo: red)"))){window.VAMTAM.load_script(VAMTAM_FRONT.jspath+"plugins/thirdparty/css-variables-polyfill.js");var e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=VAMTAM_FRONT.jspath+"../css/dist/ie11.css",document.body.appendChild(e)}},{passive:!0})}(jQuery),function(e,t){"use strict";var i,a=window.CSS&&window.CSS.supports&&window.CSS.supports("(--foo: red)");function n(){this.removeEventListener("load",n),requestAnimationFrame(function(){!this.classList.contains("vamtam-lazyload-noparent")&&this.parentElement?this.parentElement.classList.add("image-loaded"):this.classList.add("image-loaded")}.bind(this))}function o(e){var t=e.dataset.srcset;t?(requestAnimationFrame(function(){e.addEventListener("load",n),e.srcset=t}),delete e.dataset.srcset):n.call(e)}function s(){var e,t=document.querySelectorAll("img[data-srcset]");if(!a){var n=document.querySelectorAll(".vamtam-responsive-wrapper:not(.image-loaded), .vamtam-lazyload-noparent:not(.image-loaded)");for(e=0;e0||e.isIntersecting)&&(o(e.target),i.unobserve(e.target))})},{rootMargin:"200px"})),document.addEventListener("DOMContentLoaded",function(){new MutationObserver(s).observe(document.body,{childList:!0,subtree:!0}),s()})}(window.VAMTAM),function(e,t){"use strict";e(function(){var t="cubeportfolio"in e.fn,i=!1,a=e(window),n=function(e){requestAnimationFrame(function(){var t=e.find(".cbp-wrapper"),i=e.find(".cbp-wrapper-outer");t.width()<=i.width()?e.addClass("vamtam-cube-narrow"):e.removeClass("vamtam-cube-narrow")})},o=function(){e(".vamtam-cubeportfolio[data-options]:not(.vamtam-cube-loaded)").filter(":visible").each(function(){var t=e(this),i=t.data("options");"singlePageCallback"in i||(i.singlePageDelegate=null),i.singlePageCallback=r[i.singlePageCallback]||null,t.on("initComplete.cbp",function(){"slider"===i.layoutMode&&(n(t),a.on("resize.vamtamcube",function(){n(t)}))}),t.addClass("vamtam-cube-loaded").cubeportfolio(i),t.on("vamtam-video-resized","iframe, object, embed, video",function(){t.data("cubeportfolio").layoutAndAdjustment()}),this.addEventListener("vamtamlazyloaded",function(){t.data("cubeportfolio").layoutAndAdjustment()})})},s=function(){if(document.getElementsByClassName("vamtam-cubeportfolio").length)if(t)o();else if(!i){i=!0;var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=VAMTAM_FRONT.cube_path,a.onload=function(){t="cubeportfolio"in e.fn,o()},document.getElementsByTagName("script")[0].before(a)}},r={portfolio:function(t){var i=this;e.ajax({url:t,type:"GET",dataType:"html"}).done(function(t){i.updateSinglePage(t),s(),e(document).trigger("vamtam-single-page-project-loaded")}).fail(function(){i.updateSinglePage("AJAX Error! Please refresh the page!")})}};e(document).on("vamtam-attempt-cube-load",s),s(),window.addEventListener("resize",window.VAMTAM.debounce(s,100),!1),window.addEventListener("load",function(){e(".cbp").each(function(){try{this.data("cubeportfolio").layoutAndAdjustment()}catch(e){}})},!1)})}(jQuery),function(e,t){"use strict";e(function(){var t=e(".fixed-header-box .cart-dropdown"),i=e(".vamtam-cart-dropdown-link"),a=e(".products",i),n=e(".widget",t),o=!1;e(document.body).on("added_to_cart removed_from_cart wc_fragments_refreshed wc_fragments_loaded",function(){if(parseInt(Cookies.get("woocommerce_items_in_cart")||0,10)>0){for(var e=0,i=document.querySelector(".widget_shopping_cart").querySelectorAll("li .quantity"),n=0;n=0?e:"",a.text(e),a.removeClass("cart-empty"),t.removeClass("hidden")}else{var o=t.hasClass("show-if-empty");a.addClass("cart-empty"),a.text("0"),t.toggleClass("hidden",!o)}});var s=0,r=function(){s=+new Date,t.addClass("state-hover"),n.stop(!0,!0).fadeIn(300,function(){o=!0})},l=function(){var e=new Date-s;e>1e3?(t.removeClass("state-hover"),n.stop(!0,!0).fadeOut(300,function(){o=!1})):setTimeout(function(){t.is(":hover")||l()},1e3-e)};t.on("mouseenter",function(){r()}).on("mouseleave",function(){l()}),i.not(".no-dropdown").on("click",function(e){o?l():r(),e.preventDefault()})})}(jQuery); jQuery(function(r){if("undefined"==typeof wc_cart_fragments_params)return!1;var t=!0,o=wc_cart_fragments_params.cart_hash_key;try{t="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(f){t=!1}function a(){t&&sessionStorage.setItem("wc_cart_created",(new Date).getTime())}function s(e){t&&(localStorage.setItem(o,e),sessionStorage.setItem(o,e))}var e={url:wc_cart_fragments_params.wc_ajax_url.toString().replace("%%endpoint%%","get_refreshed_fragments"),type:"POST",data:{time:(new Date).getTime()},timeout:wc_cart_fragments_params.request_timeout,success:function(e){e&&e.fragments&&(r.each(e.fragments,function(e,t){r(e).replaceWith(t)}),t&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e.fragments)),s(e.cart_hash),e.cart_hash&&a()),r(document.body).trigger("wc_fragments_refreshed"))},error:function(){r(document.body).trigger("wc_fragments_ajax_error")}};function n(){r.ajax(e)}if(t){var i=null;r(document.body).on("wc_fragment_refresh updated_wc_div",function(){n()}),r(document.body).on("added_to_cart removed_from_cart",function(e,t,r){var n=sessionStorage.getItem(o);null!==n&&n!==undefined&&""!==n||a(),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(t)),s(r)}),r(document.body).on("wc_fragments_refreshed",function(){clearTimeout(i),i=setTimeout(n,864e5)}),r(window).on("storage onstorage",function(e){o===e.originalEvent.key&&localStorage.getItem(o)!==sessionStorage.getItem(o)&&n()}),r(window).on("pageshow",function(e){e.originalEvent.persisted&&(r(".widget_shopping_cart_content").empty(),r(document.body).trigger("wc_fragment_refresh"))});try{var c=r.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),_=sessionStorage.getItem(o),g=Cookies.get("woocommerce_cart_hash"),m=sessionStorage.getItem("wc_cart_created");if(null!==_&&_!==undefined&&""!==_||(_=""),null!==g&&g!==undefined&&""!==g||(g=""),_&&(null===m||m===undefined||""===m))throw"No cart_created";if(m){var d=1*m+864e5,w=(new Date).getTime();if(d