!function($,e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,n={exports:{}};n.exports;var o,a=(i||(i=1,n.exports=function(){function e(e){for(var t=1;t11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},w={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},x=function(e,t,i){for(t+=e.firstDay;t>=7;)t-=7;return i?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},k=function(e){var t=[],i="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'';t.push("is-outside-current-month"),e.enableSelectionDaysInNextAndPreviousMonths||t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),i="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"},D=function(e,t){e.setHours(0,0,0,0);var i=e.getDate(),n=e.getDay(),o=t,a=o-1,s=7,r=function(e){return(e+s-1)%s};e.setDate(i+a-r(n));var c=new Date(e.getFullYear(),0,o),l=864e5,d=(e.getTime()-c.getTime())/l;return 1+Math.round((d-a+r(c.getDay()))/s)},M=function(i,n,o,a){var s=new Date(o,n,i);return''+(t?e(s).isoWeek():D(s,a))+""},F=function(e,t,i,n){return''+(t?e.reverse():e).join("")+""},O=function(e){return""+e.join("")+""},C=function(e){var t,i=[];for(e.showWeekNumber&&i.push(""),t=0;t<7;t++)i.push(''+x(e,t,!0)+"");return""+(e.isRTL?i.reverse():i).join("")+""},E=function(e,t,i,n,o,a){var s,r,c,l,d,u=e._o,p=i===u.minYear,f=i===u.maxYear,m='
',h=!0,g=!0;for(c=[],s=0;s<12;s++)c.push('");for(l='
'+u.i18n.months[n]+'
",_(u.yearRange)?(s=u.yearRange[0],r=u.yearRange[1]+1):(s=i-u.yearRange,r=1+i+u.yearRange),c=[];s=u.minYear&&c.push('");return d='
'+i+u.yearSuffix+'
",u.showMonthAfterYear?m+=d+l:m+=l+d,p&&(0===n||u.minMonth>=n)&&(h=!1),f&&(11===n||u.maxMonth<=n)&&(g=!1),0===t&&(m+='"),t===e._o.numberOfMonths-1&&(m+='"),m+"
"},S=function(e,t,i){return''+C(e)+O(t)+"
"},T=function(s){var r=this,l=r.config(s);r._onMouseDown=function(e){if(r._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(c(t,"is-disabled")||(!c(t,"pika-button")||c(t,"is-empty")||c(t.parentNode,"is-disabled")?c(t,"pika-prev")?r.prevMonth():c(t,"pika-next")&&r.nextMonth():(r.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),l.bound&&o((function(){r.hide(),l.blurFieldOnSelect&&l.field&&l.field.blur()}),100))),c(t,"pika-select"))r._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},r._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(c(t,"pika-select-month")?r.gotoMonth(t.value):c(t,"pika-select-year")&&r.gotoYear(t.value))},r._onKeyChange=function(e){if(e=e||window.event,r.isVisible())switch(e.keyCode){case 13:case 27:l.field&&l.field.blur();break;case 37:r.adjustDate("subtract",1);break;case 38:r.adjustDate("subtract",7);break;case 39:r.adjustDate("add",1);break;case 40:r.adjustDate("add",7);break;case 8:case 46:r.setDate(null)}},r._parseFieldValue=function(){if(l.parse)return l.parse(l.field.value,l.format);if(t){var i=e(l.field.value,l.format,l.formatStrict);return i&&i.isValid()?i.toDate():null}return new Date(Date.parse(l.field.value))},r._onInputChange=function(e){var t;e.firedBy!==r&&(t=r._parseFieldValue(),u(t)&&r.setDate(t),r._v||r.show())},r._onInputFocus=function(){r.show()},r._onInputClick=function(){r.show()},r._onInputBlur=function(){var e=n.activeElement;do{if(c(e,"pika-single"))return}while(e=e.parentNode);r._c||(r._b=o((function(){r.hide()}),50)),r._c=!1},r._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,n=t;if(t){!i&&c(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),a(t,"change",r._onChange)));do{if(c(n,"pika-single")||n===l.trigger)return}while(n=n.parentNode);r._v&&t!==l.trigger&&n!==l.trigger&&r.hide()}},r.el=n.createElement("div"),r.el.className="pika-single"+(l.isRTL?" is-rtl":"")+(l.theme?" "+l.theme:""),a(r.el,"mousedown",r._onMouseDown,!0),a(r.el,"touchend",r._onMouseDown,!0),a(r.el,"change",r._onChange),l.keyboardInput&&a(n,"keydown",r._onKeyChange),l.field&&(l.container?l.container.appendChild(r.el):l.bound?n.body.appendChild(r.el):l.field.parentNode.insertBefore(r.el,l.field.nextSibling),a(l.field,"change",r._onInputChange),l.defaultDate||(l.defaultDate=r._parseFieldValue(),l.setDefaultDate=!0));var d=l.defaultDate;u(d)?l.setDefaultDate?r.setDate(d,!0):r.gotoDate(d):r.gotoDate(new Date),l.bound?(this.hide(),r.el.className+=" is-bound",a(l.trigger,"click",r._onInputClick),a(l.trigger,"focus",r._onInputFocus),a(l.trigger,"blur",r._onInputBlur)):this.show()};return T.prototype={config:function(e){this._o||(this._o=v({},w,!0));var t=v(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var i=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=i>4?4:i,u(t.minDate)||(t.minDate=!1),u(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(i){return i=i||this._o.format,u(this._d)?this._o.toString?this._o.toString(this._d,i):t?e(this._d).format(i):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(i,n){t&&e.isMoment(i)&&this.setDate(i.toDate(),n)},getDate:function(){return u(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",b(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),u(e)){var i=this._o.minDate,n=this._o.maxDate;u(i)&&en&&(e=n),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),b(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},clear:function(){this.setDate(null)},gotoDate:function(e){var t=!0;if(u(e)){if(this.calendars){var i=new Date(this.calendars[0].year,this.calendars[0].month,1),n=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=e.getTime();n.setMonth(n.getMonth()+1),n.setDate(n.getDate()-1),t=o=a&&(this._y=a,!isNaN(r)&&this._m>r&&(this._m=r));for(var l=0;l";this.el.innerHTML=c,i.bound&&"hidden"!==i.field.type&&o((function(){i.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),i.bound&&i.field.setAttribute("aria-label",i.ariaLabel)}},adjustPosition:function(){var e,t,i,o,a,s,r,c,_,u,p,f;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,i=this.el.offsetWidth,o=this.el.offsetHeight,a=window.innerWidth||n.documentElement.clientWidth,s=window.innerHeight||n.documentElement.clientHeight,r=window.pageYOffset||n.body.scrollTop||n.documentElement.scrollTop,p=!0,f=!0,"function"==typeof e.getBoundingClientRect)c=(u=e.getBoundingClientRect()).left+window.pageXOffset,_=u.bottom+window.pageYOffset;else for(c=t.offsetLeft,_=t.offsetTop+t.offsetHeight;t=t.offsetParent;)c+=t.offsetLeft,_+=t.offsetTop;(this._o.reposition&&c+i>a||this._o.position.indexOf("right")>-1&&c-i+e.offsetWidth>0)&&(c=c-i+e.offsetWidth,p=!1),(this._o.reposition&&_+o>s+r||this._o.position.indexOf("top")>-1&&_-o-e.offsetHeight>0)&&(_=_-o-e.offsetHeight,f=!1),this.el.style.left=c+"px",this.el.style.top=_+"px",l(this.el,p?"left-aligned":"right-aligned"),l(this.el,f?"bottom-aligned":"top-aligned"),d(this.el,p?"right-aligned":"left-aligned"),d(this.el,f?"top-aligned":"bottom-aligned")}},render:function(e,t,i){var n=this._o,o=new Date,a=m(e,t),s=new Date(e,t,1).getDay(),r=[],c=[];h(o),n.firstDay>0&&(s-=n.firstDay)<0&&(s+=7);for(var l=0===t?11:t-1,d=11===t?0:t+1,_=0===t?e-1:e,f=11===t?e+1:e,v=m(_,l),b=a+s,y=b;y>7;)y-=7;b+=7-y;for(var w=!1,x=0,D=0;x=a+s,R=x-s+1,I=t,B=e,j=n.startRange&&g(n.startRange,O),N=n.endRange&&g(n.endRange,O),z=n.startRange&&n.endRange&&n.startRangen.maxDate||n.disableWeekends&&p(O)||n.disableDayFn&&n.disableDayFn(O),isEmpty:A,isStartRange:j,isEndRange:N,isInRange:z,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:n.enableSelectionDaysInNextAndPreviousMonths};n.pickWholeWeek&&C&&(w=!0),c.push(k(Y)),7==++D&&(n.showWeekNumber&&c.unshift(M(x-s,t,e,n.firstWeekOfYearMinDays)),r.push(F(c,n.isRTL,n.pickWholeWeek,w)),c=[],D=0,w=!1)}return S(n,r,i)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),d(this.el,"is-hidden"),this._o.bound&&(a(n,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;!1!==e&&(this._o.bound&&s(n,"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),l(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){var e=this._o;this.hide(),s(this.el,"mousedown",this._onMouseDown,!0),s(this.el,"touchend",this._onMouseDown,!0),s(this.el,"change",this._onChange),e.keyboardInput&&s(n,"keydown",this._onKeyChange),e.field&&(s(e.field,"change",this._onInputChange),e.bound&&(s(e.trigger,"click",this._onInputClick),s(e.trigger,"focus",this._onInputFocus),s(e.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},T}(e)}()),r.exports),d=t(l);$.MailOptin={is_adblock_script_loaded:!1,is_customize_preview:"true"===e.is_customize_preview,track_impression:function(t){if(!0!==$.MailOptin.is_customize_preview&&"true"!==e.disable_impression_tracking){var i={optin_uuid:t,conversion_page:window.location.href,referrer:document.referrer||""};$.post(e.mailoptin_ajaxurl.toString().replace("%%endpoint%%","track_optin_impression"),{stat_data:i})}}};var _={content_locker_storage:[],mailoptin_jq_plugin:function(){var e=this;$.fn.mailoptin=function(t){var i,n,o,a,s,r;if(t=void 0!==t&&t,n=this.attr("id"),o=this.attr("data-optin-type"),a=n+"_"+o,void 0!==(s=e.optin_js_config(a))){if(r=!0===$.MailOptin.is_customize_preview||s.test_mode,!1===this.hasClass("mo-optin-form-lightbox")&&$(document).on("click.moOptin",'a[rel~="moOptin:close"], .mo-close-optin',{optin_uuid:n,optin_type:o,optin_js_config:s,self:e},e.close_optin),!0===$.MailOptin.is_customize_preview&&($(document).off("submit.moOptinSubmit","form.mo-optin-form"),$(document).off("click.moOptinSubmit",".mo-optin-form-submit-button"),$(document).off("click.moOptin",'a[rel~="moOptin:close"]'),$(document).off("click.moOptin",".mo-close-optin")),this.hasClass("mo-optin-form-lightbox")&&(i={optin_uuid:n,bodyClose:s.body_close,keyClose:s.body_close,test_mode:r,iconClose:s.icon_close,onOpen:function(){e.animate_optin_display.call(this,s.effects)},onClose:function(){e.set_cookie("exit",n,s)}},!0===$.MailOptin.is_customize_preview&&(i.keyClose=!1,i.bodyClose=!1,i.test_mode=!0),s=$.extend({},i,s),e.process_optin_form_display.call(this,s,"lightbox",t)),this.hasClass("mo-optin-form-bar")){if(e.is_flag_optin_type_active(s,"bar"))return;e.process_optin_form_display.call(this,s,"bar",t)}if(this.hasClass("mo-optin-form-slidein")){if(e.is_flag_optin_type_active(s,"slidein"))return;e.process_optin_form_display.call(this,s,"slidein",t)}this.hasClass("mo-optin-form-sidebar")&&e.process_optin_form_display.call(this,s,"sidebar",t),this.hasClass("mo-optin-form-inpost")&&e.process_optin_form_display.call(this,s,"inpost",t),$(document).on("click",".mo-trigger-conversion",(function(){e.set_cookie("success",n,s),s.mo_email="CTA",e.ga_event_tracking("conversion",s)})),e.is_var_defined(s,"cta_display")&&!0===s.cta_display&&e.is_var_defined(s,"cta_action")&&$(document).on("click","#"+a+"_cta_button",(function(t){t.preventDefault();var i=$(this).parents(".moOptinForm");if("navigate_to_url"===s.cta_action&&e.is_var_defined(s,"cta_navigate_url")){if(!0===$.MailOptin.is_customize_preview)return;e.set_cookie("success",n,s),s.mo_email="CTA",e.ga_event_tracking("conversion",s),window.location.assign(s.cta_navigate_url)}else if("reveal_optin_form"===s.cta_action){var o=$("#"+a);o.find(".mo-optin-form-cta-button, .mo-optin-form-cta-wrapper").hide(),o.find(".mo-optin-fields-wrapper").show(),o.find(".mo-optin-form-submit-button").show(),$("#"+n).removeClass("mo-cta-button-flag")}else-1!==$.inArray(s.cta_action,["close_optin","close_optin_reload_page"])?($.MoModalBox.close(),_._close_optin(i),"close_optin_reload_page"===s.cta_action&&window.location.reload()):console.warn("something went wrong.");return!1})),$.MailOptin.is_customize_preview||!0!==e.is_adblock_rule_active(s)||!1!==$.MailOptin.is_adblock_script_loaded||(e.load_adblock_detect_script(),$.MailOptin.is_adblock_script_loaded=!0)}},$.fn.extend({animateOptin:function(e){this.addClass("MOanimate__animated "+e).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",(function(){$(this).removeClass("MOanimate__animated "+e)}))}})},is_after_x_seconds_active:function(e){return void 0!==e.x_seconds_status&&!0===e.x_seconds_status&&void 0!==e.x_seconds_value},is_after_x_scroll_active:function(e){return!0===e.x_scroll_status&&void 0!==e.x_scroll_value},is_after_x_page_views_active:function(e){return!0===e.x_page_views_status&&void 0!==e.x_page_views_condition&&void 0!==e.x_page_views_value},is_exit_intent_active:function(e){return!0===e.exit_intent_status},load_adblock_detect_script:function(){var t=document.createElement("script");t.src=e.public_js+"/ad-m.js",t.async=!0,(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(t)},is_newvsreturn_rule_active:function(e){return!0===e.newvsreturn_status},is_referrer_detection_rule_active:function(e){return!0===e.referrer_detection_status},is_cookie_targeting_rule_active:function(e){return!0===e.cookie_targeting_status},is_adblock_rule_active:function(e){return!0===e.adblock_status},is_optin_visible:function(e){if("optin_form_shown"!==e.state_after_conversion){var t=e.optin_uuid;if(e.global_success_cookie>0&&s.get("mo_global_success_cookie"))return!1;if(e.global_cookie>0&&s.get("mo_global_cookie"))return!1;if(s.get("mo_success_"+t))return!1;if(s.get("mo_"+t))return!1}return!0},split_test_cookie_test:function(e){if(!0===e.is_split_test){var t=!0,i=_;if(e.optin_campaign_id in e.split_test_variants)return $.each(e.split_test_variants,(function(e,n){if(i.is_var_defined(n,"state_after_conversion")&&"optin_form_shown"!==n.state_after_conversion&&!1===i.is_optin_visible(n))return t=!1,!1})),t}return!0},process_optin_form_display:function(e,t,i){var n=_,o=this;!0===n.is_adblock_rule_active(e)?$(window).on("load",(function(){n.rule_base_show_optin_form.call(o,e,t,i)})):n.rule_base_show_optin_form.call(o,e,t,i)},rule_base_show_optin_form:function(t,i,n){var o=_,a=this;if(!0===$.MailOptin.is_customize_preview||!0===t.test_mode||!0===n)return o.display_optin_form.call(a,t,i,n);if((!o.is_var_defined(t,"click_launch_status")||!0!==t.click_launch_status||!1!==n)&&!1!==o.is_optin_visible(t)&&!1!==o.split_test_cookie_test(t)){if(o.is_after_x_page_views_active(t)){var r=t.x_page_views_condition,c=t.x_page_views_value;switch(r){case"equals":if(o.get_page_views()!==c)return;break;case"more_than":if(o.get_page_views()<=c)return;break;case"less_than":if(o.get_page_views()>=c)return;break;case"at_least":if(o.get_page_views()c)return}}if(!0===o.is_cookie_targeting_rule_active(t)){var l,d=t.cookie_targeting_settings,u=t.cookie_targeting_name,p=t.cookie_targeting_value;if("show"===d&&(l=!1,_.is_defined_not_empty(u)&&_.is_defined_not_empty(p)?s.get(u)===p&&(l=!0):_.is_defined_not_empty(u)&&void 0!==s.get(u)&&(l=!0)),"hide"===d&&(l=!0,_.is_defined_not_empty(u)&&_.is_defined_not_empty(p)?s.get(u)===p&&(l=!1):_.is_defined_not_empty(u)&&void 0!==s.get(u)&&(l=!1)),!l)return}if(!0===o.is_referrer_detection_rule_active(t)){var f=function(e){return e.replace(/\/+$/,"")},m=document.referrer.toLowerCase()||!1;if(!m)return;var h=t.referrer_detection_settings,g=t.referrer_detection_values;if("show_to"===h){var v=!1;$.each(g,(function(e,t){if(t=f(t).toLowerCase(),-1!==m.indexOf(t))return v=!0,!1}))}if("hide_from"===h){v=!0;$.each(g,(function(e,t){if(t=f(t),-1!==m.indexOf(t))return v=!1,!1}))}if(!v)return}if(!0===o.is_newvsreturn_rule_active(t)){if("is_new"===t.newvsreturn_settings&&o.visitor_is_returning())return;if("is_returning"===t.newvsreturn_settings&&o.visitor_is_new())return}if(!0===o.is_adblock_rule_active(t)){if("adblock_enabled"===t.adblock_settings&&o.isAdblockDisabled())return;if("adblock_disabled"===t.adblock_settings&&o.isAdblockEnabled())return}if(void 0!==window.MobileDetect){var b=new MobileDetect(window.navigator.userAgent);if(!0===t.device_targeting_hide_mobile&&b.phone())return;if(!0===t.device_targeting_hide_tablet&&b.tablet())return;if(!0===t.device_targeting_hide_desktop&&!b.mobile())return}if(o.is_var_defined(t,"wc_atc_activate_rule")&&!0===t.wc_atc_activate_rule){if($(document.body).on("added_to_cart",(function(e,n,s,r){var c=r.data("product_id");return(!o.is_var_defined(t,"wc_atc_products")||-1!==$.inArray(c,t.wc_atc_products))&&o.display_optin_form.call(a,t,i)})),o.is_var_defined(e,"wc_atc_products")){if(o.is_var_defined(t,"wc_atc_products"))if(0===t.wc_atc_products.filter((function(t){return-1!==e.wc_atc_products.indexOf(t)})).length)return!1;return o.display_optin_form.call(a,t,i)}}else{var y=1e3*t.x_seconds_value,w=t.x_scroll_value;if(!0!==o.is_after_x_seconds_active(t)||!0!==o.is_after_x_scroll_active(t)||!0!==o.is_exit_intent_active(t)){if(!0===o.is_after_x_scroll_active(t)&&!0===o.is_exit_intent_active(t))return $.moScrollTrigger("enable"),void $(document).on("moScrollTrigger",(function(e,n){n>=w&&($.moExitIntent("enable"),$(document).on("moExitIntent",(function(){return o.display_optin_form.call(a,t,i)})))}));if(!0!==o.is_after_x_seconds_active(t)||!0!==o.is_after_x_scroll_active(t))if(!0!==o.is_after_x_seconds_active(t)||!0!==o.is_exit_intent_active(t)){if(!0!==o.is_after_x_seconds_active(t))return o.is_after_x_scroll_active(t)?($.moScrollTrigger("enable"),void $(document).on("moScrollTrigger",(function(e,n){if(!1===a.hasClass("si-open")&&n>=w)return a.addClass("si-open"),o.display_optin_form.call(a,t,i)}))):o.is_exit_intent_active(t)?($.moExitIntent("enable"),void $(document).on("moExitIntent",(function(){return o.display_optin_form.call(a,t,i)}))):o.display_optin_form.call(a,t,i);setTimeout((function(){return o.display_optin_form.call(a,t,i)}),y)}else setTimeout((function(){$.moExitIntent("enable"),$(document).on("moExitIntent",(function(){return o.display_optin_form.call(a,t,i)}))}),y);else setTimeout((function(){$.moScrollTrigger("enable"),$(document).on("moScrollTrigger",(function(e,n){if(!1===a.hasClass("si-open")&&n>=w)return a.addClass("si-open"),o.display_optin_form.call(a,t,i)}))}),y)}else setTimeout((function(){$.moScrollTrigger("enable"),$(document).on("moScrollTrigger",(function(e,n){n>=w&&($.moExitIntent("enable"),$(document).on("moExitIntent",(function(){return o.display_optin_form.call(a,t,i)})))}))}),y)}}},display_optin_form:function(e,t,i){if(void 0!==t&&void 0!==t){var n=_;if(!1===$.MailOptin.is_customize_preview&&!1===e.test_mode&&!0!==i){if(!1===n.is_optin_visible(e))return;if(!1===n.split_test_cookie_test(e))return}if(void 0!==t&&"lightbox"===t)return $(document.body).on($.MoModalBox.OPEN,(function(e,i,n){$(this).trigger("moOptin:show",[n.optin_uuid,n,t])})),void this.MoModalBox(e);if(n.animate_optin_display.call(this,e.effects),n.flag_optin_type_displayed(e,t),"bar"===t&&"top"===e.bar_position){var o=parseFloat($(document.body).css("margin-top")),a=e.optin_uuid;$(window).on("resize.MoBarTop",(function(){setTimeout((function(){var e=$("#"+a+"_bar"),t=$("#wpadminbar"),i=e.outerHeight();$(window).width()<=600&&t.length>0&&($("#"+a+".mo-optin-form-bar-sticky").length>0?i-=t.outerHeight():i+=t.outerHeight()),i=$.MailOptin.activeBarHeight=o+i,$(document.body).css("margin-top",o+i+"px")}),500)})),$(window).trigger("resize")}this.show(),$(this).trigger("moOptin:show",[e.optin_uuid,e,t])}},optin_sound_selected:function(t,i){if(!0!==$.MailOptin.is_customize_preview&&("bar"===i||"lightbox"===i||"slidein"===i)){var n=void 0!==t.optin_sound?t.optin_sound:"";if("none"!==n&&""!==n){var o="custom"!==n?e.public_sound+n:t.optin_custom_sound,a=new Audio(o);a.addEventListener("canplaythrough",(function(){this.play().catch((function(e){console.warn("Sound was not able to play when selected. Reason: "+e)}))})),a.addEventListener("error",(function(){console.error("Error occurred when trying to load popup opening sound.")}))}}},flag_optin_type_displayed:function(e,t){if("bar"===t){var i=e.bar_position;$.MailOptin["isActiveMOBar_"+i]=!0}if("slidein"===t){var n=e.slidein_position;$.MailOptin["isActiveMOSlidein_"+n]=!0}},flag_optin_type_close:function(e,t){if("bar"===t){var i=e.bar_position;$.MailOptin["isActiveMOBar_"+i]=!1}if("slidein"===t){var n=e.slidein_position;$.MailOptin["isActiveMOSlidein_"+n]=!1}},is_flag_optin_type_active:function(e,t){if("bar"===t){var i=e.bar_position;return!0===$.MailOptin["isActiveMOBar_"+i]}if("slidein"===t){var n=e.slidein_position;return!0===$.MailOptin["isActiveMOSlidein_"+n]}},close_optin:function(e){e.preventDefault();var t=$(this).parents(".moOptinForm"),i=t.attr("id"),n=t.attr("data-optin-type"),o=_.optin_js_config(i);_._close_optin(t),t.removeClass("si-open"),_.set_cookie("exit",i,o),_.flag_optin_type_close(o,n)},_close_optin:function(e){e.fadeOut(400,(function(){$(this).trigger("moOptin:close",[this]);var t=e.attr("id"),i=_.optin_js_config(t);if("bar"===i.optin_type&&"top"===i.bar_position){var n=parseFloat($(document.body).css("margin-top"));$(document.body).css("margin-top",n-$.MailOptin.activeBarHeight+"px"),delete $.MailOptin.activeBarHeight,$(window).off("resize.MoBarTop")}}))},track_page_views:function(){if("true"===e.is_new_returning_visitors_cookies){var t=s.get("mo_page_views_counter"),i=void 0===t?0:t;s.set("mo_page_views_counter",++i)}},set_visitor_cookies:function(){"true"===e.is_new_returning_visitors_cookies&&(s.get("mo_has_visited")||(s.set("mo_is_new","true"),s.set("mo_has_visited","true",{expires:3999})))},isAdblockEnabled:function(){return"undefined"==typeof mailoptin_no_adblock_detected},isAdblockDisabled:function(){return"undefined"!=typeof mailoptin_no_adblock_detected},visitor_is_new:function(){return"true"===s.get("mo_has_visited")&&"true"===s.get("mo_is_new")},visitor_is_returning:function(){return"true"===s.get("mo_has_visited")&&!s.get("mo_is_new")},get_page_views:function(){return Number(s.get("mo_page_views_counter"))},animate_optin_display:function(e){void 0!==e&&""!==e&&(e=e.replace(/\bMOshake\b/,"MOheadShake").replace(/\bMOlightSpeedIn\b/,"MOlightSpeedInRight").replace("MO","MOanimate__"),this.find(".mo-optin-form-wrapper").animateOptin(e))},optin_js_config:function(e){return window[e]},optin_conversion:function(){var e,t,i,n,o,a,s;if(s=this,!0!==$.MailOptin.is_customize_preview){var r=function(r){if(r.preventDefault(),r.stopImmediatePropagation(),t=$(this).parents(".moOptinForm"),i=t.attr("id"),n=t.attr("data-optin-type"),o=i+"_"+n,a=s.optin_js_config(o),s.hide_optin_error(i,t),s.validate_optin_form_fields(o,a,t)){var c=$("form#"+o+"_form").serializeArray().reduce((function(e,t){if(-1!==t.name.indexOf("[]")){var i=t.name.replace("[]","");void 0===e[i]?(e[i]=[],e[i].push(t.value)):e[i].push(t.value)}else e[t.name]=t.value;return e}),{});e=$.extend({},c,{optin_uuid:i,optin_campaign_id:a.optin_campaign_id,email:$("input#"+o+"_email_field",t).val(),name:$("input#"+o+"_name_field",t).val(),_mo_timestamp:$("input#"+o+"_honeypot_timestamp").val(),user_agent:navigator.userAgent,conversion_page:window.location.href,referrer:document.referrer||""}),s.addProcessingOverlay.call(t),s.subscribe_to_email_list(e,t,a,n)}} ;$(document).on("submit.moOptinSubmit","form.mo-optin-form",r),$(document).on("click.moOptinSubmit",".mo-optin-form-submit-button",r)}},addProcessingOverlay:function(){this.find(".mo-optin-spinner").show()},removeProcessingOverlay:function(){this.find(".mo-optin-spinner").hide()},addSuccessCloseIcon:function(){this.find(".mo-optin-spinner").after('×')},removeSuccessCloseIcon:function(){this.find(".mo-optin-success-close").remove()},displaySuccessContent:function(){this.find(".mo-optin-success-msg").show(),this.addClass("mo-optin-success-state")},removeSpinner:function(){this.find(".mo-optin-spinner").css("background-image","none")},displayErrorMessage:function(e){this.find(".mo-optin-error").html(e).show()},set_cookie:function(e,t,i){var n=i.test_mode||!1,o=i.cookie;"success"==e&&(o=i.success_cookie),e="exit"===e?"":e+"_",n||(s.set("mo_"+e+t,!0,{expires:o}),s.set("mo_global_"+e+"cookie",!0,{expires:i["global_"+e+"cookie"]}))},subscribe_to_email_list:function(t,i,n,o){var a=this;$.post(e.mailoptin_ajaxurl.toString().replace("%%endpoint%%","subscribe_to_email_list"),{optin_data:t},(function(e){!$.isEmptyObject(e)&&"success"in e?!0===e.success?($(document.body).trigger("moOptinConversion",[i,n,t]),a.set_cookie("success",t.optin_uuid,n),-1!==$.inArray(o,["lightbox","bar","slidein"])&&!0!==n.icon_close&&a.addSuccessCloseIcon.call(i),a.displaySuccessContent.call(i),a.removeSpinner.call(i)):(a.removeProcessingOverlay.call(i),a.removeSuccessCloseIcon.call(i),a.displayErrorMessage.call(i,e.message)):(a.displayErrorMessage.call(i,n.unexpected_error),a.removeProcessingOverlay.call(i),a.removeSuccessCloseIcon.call(i))}),"json")},validate_optin_form_fields:function(e,t,i){var n=t.name_missing_error,o=t.email_missing_error,a=t.honeypot_error,s=t.note_acceptance_error,r=t.custom_field_required_error,c=this,l=$("#"+e+"_name_field:visible",i),d=$("#"+e+"_email_field:visible",i),_=$("#"+e+" .mo-acceptance-checkbox",i),u=$("#"+e+"_honeypot_email_field",i).val(),p=$("#"+e+"_honeypot_website_field",i).val(),f=!0;return(u.length>0||p.length>0)&&(c.display_optin_error.call(void 0,e,a,i),f=!1),$("#"+e+" .mo-optin-form-custom-field",i).each((function(){var n=$(this),o=$(this).data("field-id"),a=t.required_custom_fields,s=n.val();n.find("input[type=radio]").length>0&&(s=0===n.find("input[type=radio]:checked").length?"":n.find("input[type=radio]:checked").val()),n.find("input[type=checkbox]").length>0&&(s=0===n.find("input[type=checkbox]:checked").length?"":n.find("input[type=checkbox]:checked").val()),-1!==$.inArray(o,a)&&""===s&&(c.display_optin_error.call(n,e,r,i),f=!1)})),d.length>0&&!1===c.isValidEmail(d.val())&&(c.display_optin_error.call(d,e,o,i),f=!1),!0===t.name_field_required&&l.length>0&&""===l.val()&&(c.display_optin_error.call(l,e,n,i),f=!1),!1===f?f:_.length>0&&!1===_[0].checked?(c.display_optin_error.call(void 0,e,s,i),!1):(!1===$(document.body).triggerHandler("mo_validate_optin_form_fields",[c,e,t])&&(f=!1),f)},display_optin_error:function(e,t,i){void 0!==this&&(this.css("-webkit-box-shadow","inset 0px 0px 0px 2px #f45a4a"),this.css("-moz-box-shadow","inset 0px 0px 0px 2px #f45a4a"),this.css("box-shadow","inset 0px 0px 0px 2px #f45a4a"));var n=$("div#"+e+" .mo-optin-error",i);void 0!==t&&void 0!==n&&n.length>0&&"string"==typeof t&&n.text(t).show()},hide_optin_error:function(e,t){var i=$(".mo-optin-field",t);$(".mo-optin-error",t).hide(),i.css("-webkit-box-shadow",""),i.css("-moz-box-shadow",""),i.css("box-shadow","")},isValidEmail:function(e){return new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i).test(e)},ga_event_tracking:function(e,t){if(e=e||"impression",!1!==_.is_var_defined(t,"ga_active")&&("function"==typeof ga&&ga((function(){var i=ga.getAll()[0].get("trackingId");!1!==_.is_defined_not_empty(i)&&(ga("create",i,"auto","moTracker"),ga("moTracker.send","event",t.optin_campaign_name,e,t.optin_uuid,{nonInteraction:!0}))})),"function"==typeof gtag)){var i="mailoptin_"+e,n={optin_campaign:t.optin_campaign_name,optin_uuid:t.optin_uuid};void 0!==t.mo_email&&(n.lead_email=t.mo_email),gtag("event",i,n)}},success_action_after_conversion:function(e,t,i,n){var o=i.success_action,a=i.redirect_url_value,s=i.success_js_script,r=void 0!==s&&""!==s,c={};c.mo_name=c.mo_email="",_.is_defined_not_empty(n.name)&&(c.mo_name=n.name),_.is_defined_not_empty(n.email)&&(c.mo_email=n.email,i.mo_email=n.email),_.ga_event_tracking("conversion",i),_.content_locker_removal(i),!0===r&&(-1===s.indexOf("'+s+"<\/script>"),s=s.replace(/\[EMAIL\]/gi,c.mo_email).replace(/\[NAME\]/gi,c.mo_name),$(t).append(s)),void 0!==o&&-1!==$.inArray(o,["close_optin","redirect_url","close_optin_reload_page"])&&setTimeout((function(){if($.MoModalBox.close(),_._close_optin(t),"close_optin_reload_page"===o)return window.location.reload();"redirect_url"===o&&void 0!==a&&""!==a&&(void 0!==i.pass_lead_data&&!0===i.pass_lead_data&&(a=_.add_query_args(a,c)),window.location.assign(a))}),1e3)},eventSubscription:function(){$(document.body).on("moOptin:show",(function(e,t,i,n){_.content_locker_init(i),$.MailOptin.track_impression(t),_.ga_event_tracking("impression",i),_.optin_sound_selected(i,n)})),$(document.body).on("moOptinConversion",this.success_action_after_conversion)},is_content_locker_enabled:function(e){return _.is_var_defined(e,"content_lock_status")&&!0===e.content_lock_status&&_.is_var_defined(e,"content_lock_style")},content_locker_init:function(e){if(_.is_content_locker_enabled(e)){var t=!1,i=e.content_lock_selector.toString(),n=$("#"+e.optin_uuid).nextAll();i.length>0&&$(i).length>0&&(t=$(i)),"removal"===e.content_lock_style?(!1!==t&&t.hide(),n.each((function(e,t){_.content_locker_storage.push($(t).clone(!0)),$(t).remove()}))):(!1!==t&&t.addClass("mailoptin-content-lock"),n.each((function(e,t){$(t).addClass("mailoptin-content-lock")})))}},content_locker_removal:function(e){if(_.is_content_locker_enabled(e)){var t=$("#"+e.optin_uuid),i=!1,n=t.nextAll(),o=e.content_lock_selector.toString();o.length>0&&$(o).length>0&&(i=$(o)),"removal"===e.content_lock_style?(_.content_locker_storage.reverse(),!1!==i&&i.show(),$.each(_.content_locker_storage,(function(e,i){t.after(i)}))):(n.removeClass("mailoptin-content-lock"),!1!==i&&i.removeClass("mailoptin-content-lock"))}},add_query_args:function(e,t){var i=-1!==e.indexOf("?")?"&":"?";for(var n in t)t.hasOwnProperty(n)&&(e+=i+n+"="+t[n],i="&");return e},initOptinForms:function(){$(".moOptinForm").each((function(e,t){$(t).mailoptin()}));var e=function(e){void 0!==e&&$(["#"+e+".mo-optin-form-lightbox","#"+e+".mo-optin-form-bar","#"+e+".mo-optin-form-slidein"].join(",")).mailoptin(!0)};$(document).on("click",".mailoptin-click-trigger",(function(t){t.preventDefault();var i=$(this).data("optin-uuid")||$(this).attr("id");e(i)})),$(document).on("click",'[class*="mailoptin-click-trigger-"]',(function(t){t.preventDefault();var i,n=this.className.match(/mailoptin-click-trigger-([a-z0-1]+)\s?/i);null!==n&&(i=n[1],e(i))}))},is_scheduled_for_display:function(){!0!==$.MailOptin.is_customize_preview&&$(".moOptinForm").each((function(){var e=$(this).attr("id"),t=_.optin_js_config(e),i=t.schedule_status,n=t.schedule_start,o=t.schedule_end,a=t.schedule_timezone;if(_.is_defined_not_empty(i)&&_.is_defined_not_empty(n)&&_.is_defined_not_empty(o)&&_.is_defined_not_empty(a)){var s,r,c,l,d=new Date;s="visitors_local_time"===a?60*d.getTimezoneOffset()*1e3:1e3*a,r=d.getTime(),c=Date.parse(n+" GMT")-s,l=Date.parse(o+" GMT")-s,!1===(r>=c&&r<=l)?$(this).remove():$(this).mailoptin()}}))},is_var_defined:function(e,t){return void 0!==e[t]},is_defined_not_empty:function(e){return void 0!==e&&""!==e},init_date_picker:function(){$(".mo-optin-form-custom-field.date-field").each((function(){var e=(new Date).getFullYear(),t=150;new d({field:this,minDate:new Date(e-t,0),maxDate:new Date(e+t,0),yearRange:300,toString:function(e,t){var i=("0"+e.getDate()).slice(-2),n=("0"+(e.getMonth()+1)).slice(-2);return e.getFullYear()+"-"+n+"-"+i}})}))},init:function(){var e=this;e.track_page_views(),e.set_visitor_cookies(),$((function(){e.eventSubscription(),e.mailoptin_jq_plugin(),e.is_scheduled_for_display(),e.initOptinForms(),e.optin_conversion(),e.init_date_picker(),$(document.body).trigger("mo-mailoptinjs-loaded")}))}};!function(){var e={open:function(e){e=$.extend({},$.MoModalBox.defaults,e);var i=this,n=this.attr("id"),o=n+"_lightbox";i.trigger($.MoModalBox.BEFORE_OPEN,[i,e]),i.addClass("moModal"),i.show();var a=$(window).height(),s=$("#"+o+"_container"),r=s.outerHeight(!0);if("iconClose"in e&&!0===e.iconClose&&(r+=15),r>=a)s.css({top:10});else{var c=(a-r)/2;s.css({top:c})}if($(window).on("resize",(function(){var e=$(window).height(),t=$("#"+o+"_container"),i=t.outerHeight(!0);if(i>=e)t.css({top:10});else{var n=(e-i)/2;t.css({top:n})}})),"iconClose"in e&&!0===e.iconClose){var l=$(''+e.closeText+"");i.find(".mo-optin-form-wrapper").append(l)}if(e.keyClose&&$(document).on("keyup.moModal",t),e.bodyClose){var d=$("#"+n+".mo-optin-form-lightbox");d.on("click",(function(e){e.target==d.get(0)&&$.MoModalBox.close()}))}$.MoModalBox.isActive=!0,e.onOpen.call(this),i.data("closeFun",e.onClose),i.trigger($.MoModalBox.OPEN,[i,e])},close:function(){var e=this;e.hasClass("moModal")&&(e.trigger($.MoModalBox.BEFORE_CLOSE,[e]),e.fadeOut(400,(function(){void 0!==(e=$(this)).data&&void 0!==e.data("closeFun")&&void 0!==e.data("closeFun").call&&e.data("closeFun").call(this),e.removeData("closeFun").removeClass("moModal"),e.trigger($.MoModalBox.CLOSE,[e]),0===$(".moModal").length&&($(".mo-optin-form-lightbox").hide(),$(document).off("keyup.moModal")),$.MoModalBox.isActive=!1,e.trigger($.MoModalBox.AFTER_CLOSE,[e])})))}};$.fn.MoModalBox=function(t,i){return $.MoModalBox.isActive||(e[t]?e[t].call(this,i):"object"!=typeof t&&t||e.open.call(this,t)),this},$.MoModalBox={},$.MoModalBox.defaults={overlay:!0,iconClose:!0,closeClass:"",closeText:"Close",keyClose:!0,bodyClose:!0,onOpen:function(){},onClose:function(){}},$.MoModalBox.close=function(){e.close.call($(".moModal"))};var t=function(e){27==e.keyCode&&$.MoModalBox.close()},i=function(e){e.preventDefault(),$.MoModalBox.close()};$.MoModalBox.BEFORE_OPEN="moOptin:before-open",$.MoModalBox.OPEN="moOptin:open",$.MoModalBox.BEFORE_CLOSE="moOptin:before-close",$.MoModalBox.CLOSE="moOptin:close",$.MoModalBox.AFTER_CLOSE="moOptin:after-close",$(document).on("click.moOptin",'a[rel~="moOptin:close"]',i),$(document).on("click.moOptin",".mo-close-optin",i)}(),function(){var e;function t(t){t.clientY>20||(e&&clearTimeout(e),e=setTimeout((function(){e=null,$.event.trigger("moExitIntent")}),300))}function i(){e&&(clearTimeout(e),e=null)}$.moExitIntent=function(e){"enable"===e?($(window).on("mouseleave.moOptin",t),$(window).on("mouseenter.moOptin",i)):"disable"===e&&(i(),$(window).off("mouseleave.moOptin",t),$(window).off("mouseenter.moOptin",i))}}(),function(){var e,t,i,n;function o(){e=$(window).height(),t=$(document).height(),i=t-e}$(window).on("resize",(function(){o()})),$.moScrollTrigger=function(e){"enable"===e&&(o(),$(window).on("scroll",(function(){clearTimeout(n),n=setTimeout((function(){var e,t;e=$(window).scrollTop(),t=Math.floor(e/i*100),$.event.trigger("moScrollTrigger",[t])}),50)})))}}(),$(document.body).on("mo_validate_optin_form_fields",(function(e,t,i,n){var o=$("#"+i).find(".mo-mailchimp-interest-choice");if(0!==o.length&&!1!==n.mailchimp_segment_required){var a=!1;return o.each((function(){this.checked&&(a=!0)})),!1===a?(t.display_optin_error.call(void 0,i,n.mailchimp_segment_required_error),!1):void 0}})),window.moFormRecaptchaLoadCallback=function(){$(".mo-g-recaptcha").each((function(e,t){var i=$(t).attr("data-sitekey");if("v3"===$(t).attr("data-type")){var n=$(this).parents("form.mo-optin-form");n.find("input.mo-optin-form-submit-button").on("click",(function(e){e.preventDefault(),grecaptcha.ready((function(){grecaptcha.execute(i,{action:"form"}).then((function(e){n.find('[name="g-recaptcha-response"]').remove(),n.append($("",{type:"hidden",value:e,name:"g-recaptcha-response"})),n.submit()}))}))}))}else grecaptcha.render(t,{sitekey:i,theme:$(t).attr("data-theme"),size:$(t).attr("data-size")})}))},_.init()}(jQuery,mailoptin_globals);; /*! * @fileOverview TouchSwipe - jQuery Plugin * @version 1.6.18 * * @author Matt Bryson http://www.github.com/mattbryson * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin * @see http://labs.rampinteractive.co.uk/touchSwipe/ * @see http://plugins.jquery.com/project/touchSwipe * @license * Copyright (c) 2010-2015 Matt Bryson * Dual licensed under the MIT or GPL Version 2 licenses. * */ !function(factory){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],factory):factory("undefined"!=typeof module&&module.exports?require("jquery"):jQuery)}(function($){"use strict";function init(options){return!options||void 0!==options.allowPageScroll||void 0===options.swipe&&void 0===options.swipeStatus||(options.allowPageScroll=NONE),void 0!==options.click&&void 0===options.tap&&(options.tap=options.click),options||(options={}),options=$.extend({},$.fn.swipe.defaults,options),this.each(function(){var $this=$(this),plugin=$this.data(PLUGIN_NS);plugin||(plugin=new TouchSwipe(this,options),$this.data(PLUGIN_NS,plugin))})}function TouchSwipe(element,options){function touchStart(jqEvent){if(!(getTouchInProgress()||$(jqEvent.target).closest(options.excludedElements,$element).length>0)){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(!event.pointerType||"mouse"!=event.pointerType||0!=options.fallbackToMouseEvents){var ret,touches=event.touches,evt=touches?touches[0]:event;return phase=PHASE_START,touches?fingerCount=touches.length:options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),distance=0,direction=null,currentDirection=null,pinchDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,maximumsMap=createMaximumsData(),cancelMultiFingerRelease(),createFingerData(0,evt),!touches||fingerCount===options.fingers||options.fingers===ALL_FINGERS||hasPinches()?(startTime=getTimeStamp(),2==fingerCount&&(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)),(options.swipeStatus||options.pinchStatus)&&(ret=triggerHandler(event,phase))):ret=!1,ret===!1?(phase=PHASE_CANCEL,triggerHandler(event,phase),ret):(options.hold&&(holdTimeout=setTimeout($.proxy(function(){$element.trigger("hold",[event.target]),options.hold&&(ret=options.hold.call($element,event,event.target))},this),options.longTapThreshold)),setTouchInProgress(!0),null)}}}function touchMove(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(phase!==PHASE_END&&phase!==PHASE_CANCEL&&!inMultiFingerRelease()){var ret,touches=event.touches,evt=touches?touches[0]:event,currentFinger=updateFingerData(evt);if(endTime=getTimeStamp(),touches&&(fingerCount=touches.length),options.hold&&clearTimeout(holdTimeout),phase=PHASE_MOVE,2==fingerCount&&(0==startTouchesDistance?(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)):(updateFingerData(touches[1]),endTouchesDistance=calculateTouchesDistance(fingerData[0].end,fingerData[1].end),pinchDirection=calculatePinchDirection(fingerData[0].end,fingerData[1].end)),pinchZoom=calculatePinchZoom(startTouchesDistance,endTouchesDistance),pinchDistance=Math.abs(startTouchesDistance-endTouchesDistance)),fingerCount===options.fingers||options.fingers===ALL_FINGERS||!touches||hasPinches()){if(direction=calculateDirection(currentFinger.start,currentFinger.end),currentDirection=calculateDirection(currentFinger.last,currentFinger.end),validateDefaultEvent(jqEvent,currentDirection),distance=calculateDistance(currentFinger.start,currentFinger.end),duration=calculateDuration(),setMaxDistance(direction,distance),ret=triggerHandler(event,phase),!options.triggerOnTouchEnd||options.triggerOnTouchLeave){var inBounds=!0;if(options.triggerOnTouchLeave){var bounds=getbounds(this);inBounds=isInBounds(currentFinger.end,bounds)}!options.triggerOnTouchEnd&&inBounds?phase=getNextPhase(PHASE_MOVE):options.triggerOnTouchLeave&&!inBounds&&(phase=getNextPhase(PHASE_END)),phase!=PHASE_CANCEL&&phase!=PHASE_END||triggerHandler(event,phase)}}else phase=PHASE_CANCEL,triggerHandler(event,phase);ret===!1&&(phase=PHASE_CANCEL,triggerHandler(event,phase))}}function touchEnd(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent,touches=event.touches;if(touches){if(touches.length&&!inMultiFingerRelease())return startMultiFingerRelease(event),!0;if(touches.length&&inMultiFingerRelease())return!0}return inMultiFingerRelease()&&(fingerCount=fingerCountAtRelease),endTime=getTimeStamp(),duration=calculateDuration(),didSwipeBackToCancel()||!validateSwipeDistance()?(phase=PHASE_CANCEL,triggerHandler(event,phase)):options.triggerOnTouchEnd||options.triggerOnTouchEnd===!1&&phase===PHASE_MOVE?(options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),phase=PHASE_END,triggerHandler(event,phase)):!options.triggerOnTouchEnd&&hasTap()?(phase=PHASE_END,triggerHandlerForGesture(event,phase,TAP)):phase===PHASE_MOVE&&(phase=PHASE_CANCEL,triggerHandler(event,phase)),setTouchInProgress(!1),null}function touchCancel(){fingerCount=0,endTime=0,startTime=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,cancelMultiFingerRelease(),setTouchInProgress(!1)}function touchLeave(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;options.triggerOnTouchLeave&&(phase=getNextPhase(PHASE_END),triggerHandler(event,phase))}function removeListeners(){$element.unbind(START_EV,touchStart),$element.unbind(CANCEL_EV,touchCancel),$element.unbind(MOVE_EV,touchMove),$element.unbind(END_EV,touchEnd),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave),setTouchInProgress(!1)}function getNextPhase(currentPhase){var nextPhase=currentPhase,validTime=validateSwipeTime(),validDistance=validateSwipeDistance(),didCancel=didSwipeBackToCancel();return!validTime||didCancel?nextPhase=PHASE_CANCEL:!validDistance||currentPhase!=PHASE_MOVE||options.triggerOnTouchEnd&&!options.triggerOnTouchLeave?!validDistance&¤tPhase==PHASE_END&&options.triggerOnTouchLeave&&(nextPhase=PHASE_CANCEL):nextPhase=PHASE_END,nextPhase}function triggerHandler(event,phase){var ret,touches=event.touches;return(didSwipe()||hasSwipes())&&(ret=triggerHandlerForGesture(event,phase,SWIPE)),(didPinch()||hasPinches())&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,PINCH)),didDoubleTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,DOUBLE_TAP):didLongTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,LONG_TAP):didTap()&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,TAP)),phase===PHASE_CANCEL&&touchCancel(event),phase===PHASE_END&&(touches?touches.length||touchCancel(event):touchCancel(event)),ret}function triggerHandlerForGesture(event,phase,gesture){var ret;if(gesture==SWIPE){if($element.trigger("swipeStatus",[phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection]),options.swipeStatus&&(ret=options.swipeStatus.call($element,event,phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection),ret===!1))return!1;if(phase==PHASE_END&&validateSwipe()){if(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),$element.trigger("swipe",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipe&&(ret=options.swipe.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection),ret===!1))return!1;switch(direction){case LEFT:$element.trigger("swipeLeft",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeLeft&&(ret=options.swipeLeft.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case RIGHT:$element.trigger("swipeRight",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeRight&&(ret=options.swipeRight.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case UP:$element.trigger("swipeUp",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeUp&&(ret=options.swipeUp.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case DOWN:$element.trigger("swipeDown",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeDown&&(ret=options.swipeDown.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection))}}}if(gesture==PINCH){if($element.trigger("pinchStatus",[phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchStatus&&(ret=options.pinchStatus.call($element,event,phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData),ret===!1))return!1;if(phase==PHASE_END&&validatePinch())switch(pinchDirection){case IN:$element.trigger("pinchIn",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchIn&&(ret=options.pinchIn.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData));break;case OUT:$element.trigger("pinchOut",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchOut&&(ret=options.pinchOut.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData))}}return gesture==TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),hasDoubleTap()&&!inDoubleTap()?(doubleTapStartTime=getTimeStamp(),singleTapTimeout=setTimeout($.proxy(function(){doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target))},this),options.doubleTapThreshold)):(doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target)))):gesture==DOUBLE_TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),doubleTapStartTime=null,$element.trigger("doubletap",[event.target]),options.doubleTap&&(ret=options.doubleTap.call($element,event,event.target))):gesture==LONG_TAP&&(phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),doubleTapStartTime=null,$element.trigger("longtap",[event.target]),options.longTap&&(ret=options.longTap.call($element,event,event.target)))),ret}function validateSwipeDistance(){var valid=!0;return null!==options.threshold&&(valid=distance>=options.threshold),valid}function didSwipeBackToCancel(){var cancelled=!1;return null!==options.cancelThreshold&&null!==direction&&(cancelled=getMaxDistance(direction)-distance>=options.cancelThreshold),cancelled}function validatePinchDistance(){return null!==options.pinchThreshold?pinchDistance>=options.pinchThreshold:!0}function validateSwipeTime(){var result;return result=options.maxTimeThreshold?!(duration>=options.maxTimeThreshold):!0}function validateDefaultEvent(jqEvent,direction){if(options.preventDefaultEvents!==!1)if(options.allowPageScroll===NONE)jqEvent.preventDefault();else{var auto=options.allowPageScroll===AUTO;switch(direction){case LEFT:(options.swipeLeft&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case RIGHT:(options.swipeRight&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case UP:(options.swipeUp&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case DOWN:(options.swipeDown&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case NONE:}}}function validatePinch(){var hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),hasCorrectDistance=validatePinchDistance();return hasCorrectFingerCount&&hasEndPoint&&hasCorrectDistance}function hasPinches(){return!!(options.pinchStatus||options.pinchIn||options.pinchOut)}function didPinch(){return!(!validatePinch()||!hasPinches())}function validateSwipe(){var hasValidTime=validateSwipeTime(),hasValidDistance=validateSwipeDistance(),hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),didCancel=didSwipeBackToCancel(),valid=!didCancel&&hasEndPoint&&hasCorrectFingerCount&&hasValidDistance&&hasValidTime;return valid}function hasSwipes(){return!!(options.swipe||options.swipeStatus||options.swipeLeft||options.swipeRight||options.swipeUp||options.swipeDown)}function didSwipe(){return!(!validateSwipe()||!hasSwipes())}function validateFingers(){return fingerCount===options.fingers||options.fingers===ALL_FINGERS||!SUPPORTS_TOUCH}function validateEndPoint(){return 0!==fingerData[0].end.x}function hasTap(){return!!options.tap}function hasDoubleTap(){return!!options.doubleTap}function hasLongTap(){return!!options.longTap}function validateDoubleTap(){if(null==doubleTapStartTime)return!1;var now=getTimeStamp();return hasDoubleTap()&&now-doubleTapStartTime<=options.doubleTapThreshold}function inDoubleTap(){return validateDoubleTap()}function validateTap(){return(1===fingerCount||!SUPPORTS_TOUCH)&&(isNaN(distance)||distanceoptions.longTapThreshold&&DOUBLE_TAP_THRESHOLD>distance}function didTap(){return!(!validateTap()||!hasTap())}function didDoubleTap(){return!(!validateDoubleTap()||!hasDoubleTap())}function didLongTap(){return!(!validateLongTap()||!hasLongTap())}function startMultiFingerRelease(event){previousTouchEndTime=getTimeStamp(),fingerCountAtRelease=event.touches.length+1}function cancelMultiFingerRelease(){previousTouchEndTime=0,fingerCountAtRelease=0}function inMultiFingerRelease(){var withinThreshold=!1;if(previousTouchEndTime){var diff=getTimeStamp()-previousTouchEndTime;diff<=options.fingerReleaseThreshold&&(withinThreshold=!0)}return withinThreshold}function getTouchInProgress(){return!($element.data(PLUGIN_NS+"_intouch")!==!0)}function setTouchInProgress(val){$element&&(val===!0?($element.bind(MOVE_EV,touchMove),$element.bind(END_EV,touchEnd),LEAVE_EV&&$element.bind(LEAVE_EV,touchLeave)):($element.unbind(MOVE_EV,touchMove,!1),$element.unbind(END_EV,touchEnd,!1),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave,!1)),$element.data(PLUGIN_NS+"_intouch",val===!0))}function createFingerData(id,evt){var f={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return f.start.x=f.last.x=f.end.x=evt.pageX||evt.clientX,f.start.y=f.last.y=f.end.y=evt.pageY||evt.clientY,fingerData[id]=f,f}function updateFingerData(evt){var id=void 0!==evt.identifier?evt.identifier:0,f=getFingerData(id);return null===f&&(f=createFingerData(id,evt)),f.last.x=f.end.x,f.last.y=f.end.y,f.end.x=evt.pageX||evt.clientX,f.end.y=evt.pageY||evt.clientY,f}function getFingerData(id){return fingerData[id]||null}function setMaxDistance(direction,distance){direction!=NONE&&(distance=Math.max(distance,getMaxDistance(direction)),maximumsMap[direction].distance=distance)}function getMaxDistance(direction){return maximumsMap[direction]?maximumsMap[direction].distance:void 0}function createMaximumsData(){var maxData={};return maxData[LEFT]=createMaximumVO(LEFT),maxData[RIGHT]=createMaximumVO(RIGHT),maxData[UP]=createMaximumVO(UP),maxData[DOWN]=createMaximumVO(DOWN),maxData}function createMaximumVO(dir){return{direction:dir,distance:0}}function calculateDuration(){return endTime-startTime}function calculateTouchesDistance(startPoint,endPoint){var diffX=Math.abs(startPoint.x-endPoint.x),diffY=Math.abs(startPoint.y-endPoint.y);return Math.round(Math.sqrt(diffX*diffX+diffY*diffY))}function calculatePinchZoom(startDistance,endDistance){var percent=endDistance/startDistance*1;return percent.toFixed(2)}function calculatePinchDirection(){return 1>pinchZoom?OUT:IN}function calculateDistance(startPoint,endPoint){return Math.round(Math.sqrt(Math.pow(endPoint.x-startPoint.x,2)+Math.pow(endPoint.y-startPoint.y,2)))}function calculateAngle(startPoint,endPoint){var x=startPoint.x-endPoint.x,y=endPoint.y-startPoint.y,r=Math.atan2(y,x),angle=Math.round(180*r/Math.PI);return 0>angle&&(angle=360-Math.abs(angle)),angle}function calculateDirection(startPoint,endPoint){if(comparePoints(startPoint,endPoint))return NONE;var angle=calculateAngle(startPoint,endPoint);return 45>=angle&&angle>=0?LEFT:360>=angle&&angle>=315?LEFT:angle>=135&&225>=angle?RIGHT:angle>45&&135>angle?DOWN:UP}function getTimeStamp(){var now=new Date;return now.getTime()}function getbounds(el){el=$(el);var offset=el.offset(),bounds={left:offset.left,right:offset.left+el.outerWidth(),top:offset.top,bottom:offset.top+el.outerHeight()};return bounds}function isInBounds(point,bounds){return point.x>bounds.left&&point.xbounds.top&&point.y breakpoint)) { sWidth = (100 / ItemLength) + '%'; liItem.width(sWidth); } }); } // responsive tabs function PNtabsResponsive() { var widget = $('.pe-panels.tabs'); if (!widget.length) return; widget.each(function (i, e) { var breakpoint = $(e).attr('data-responsive'); if ($(window).width() < breakpoint) { var windowWidth; var head = $(e).find('.pn-headings'); var headUl = $(e).find('.pn-list'); var headLi = headUl.find('li'); var headLink = headLi.find('a'); var headWidth; var responsiveEnabled; var itemsWidth; var maxScroll; var fullwidth; var scrollAllowed; var breakpoint = $(e).attr('data-responsive'); // swipe event widget.swipe({ allowPageScroll: 'vertical', swipe: function (event, direction, distance, duration) { var itemActive = $(this).find('.pn-list li.active'); var nextItem = itemActive.next().find('a'); var prevItem = itemActive.prev().find('a'); if (direction == 'left') { nextItem.trigger('click'); } else if (direction == 'right') { prevItem.trigger('click'); } } }); // remove responsive mode function unResponsive() { //remove responsive $(e).removeClass('responsive'); if (!$(e).hasClass('desktop')) { $(e).addClass('desktop'); } //remove unnecessary styles headUl.removeAttr('style'); headLi.each(function () { $(this).removeAttr('style'); }); $(e).find('pn-navi').remove(); //restore full width if needed if (fullwidth) { $(e).addClass('full'); PNtabsFull(); } } // navigation function addNavi() { var naviAdded = $(e).find('.pn-navi'); if (!naviAdded.length) { $(e).prepend('
'); var prevBtn = $(e).find('.pn-prev'); var nextBtn = $(e).find('.pn-next'); var itemActive; var nextItem; var prevItem; prevBtn.bind('click', function (event) { event.preventDefault(); itemActive = head.find('.pn-list li.active'); prevItem = itemActive.prev().find('a'); if (prevItem.length) { prevItem.trigger('click'); } }); nextBtn.bind('click', function (event) { event.preventDefault(); itemActive = head.find('.pn-list li.active'); nextItem = itemActive.next().find('a'); if (nextItem.length) { nextItem.trigger('click'); } }); } } // set widths function setSizes() { itemsWidth = 0; windowWidth = $(window).width(); //if window size smaller than break point if (windowWidth <= breakpoint) { // remove full width if ($(e).hasClass('full')) { $(e).removeClass('full'); headLi.removeAttr('style'); fullwidth = true; } $(e).removeClass('desktop'); $(e).addClass('responsive'); headWidth = Math.ceil(head.outerWidth()); headLi.each(function () { var itemWidth = Math.ceil($(this).outerWidth()); if (itemWidth > headWidth) { itemWidth = headWidth; $(this).addClass('long'); } itemsWidth += itemWidth; $(this).css('width', itemWidth); }); if (itemsWidth <= headWidth) { //not need responsive if (!$(e).hasClass('left') && !$(e).hasClass('right')) { scrollAllowed = false; unResponsive(); return false; } else { scrollAllowed = false; return false; } } scrollAllowed = true; maxScroll = itemsWidth - headWidth; headUl.css('width', itemsWidth); addNavi(); //scroll to active item var item = head.find('.pn-list li.active').attr('data-number'); scrollToitem(item); return true; } else { //not need responsive scrollAllowed = false; unResponsive(); return false; } } setSizes(); var widthTimer; $(window).resize(function () { clearTimeout(widthTimer); widthTimer = setTimeout(setSizes, 400); }); // scroll to item function scrollToitem(item) { var $this = head.find('li[data-number=' + item + ']'); var position = $this.position(); var leftCorner = Math.ceil(position.left); var rightCorner = Math.ceil(position.left + $this.outerWidth()); var scrollTo; var scrollTmp; var overSize; var toCenter = (headWidth - $this.outerWidth()) / 2; scrollTmp = -Math.abs(leftCorner) + toCenter; //center position if (scrollTmp <= -Math.abs(maxScroll)) { // if left larger than max scroll (last tab) overSize = Math.abs(scrollTmp) - maxScroll; scrollTo = scrollTmp + overSize; } else if (scrollTmp >= 0) { // if left larger than 0 (first tab) scrollTo = 0; } else { scrollTo = scrollTmp; } if ($.isNumeric(scrollTo)) { headUl.css('left', scrollTo); } //arrows active class var prevBtn = $(e).find('.pn-prev'); var nextBtn = $(e).find('.pn-next'); var prevItem = $this.prev(); var nextItem = $this.next(); if (nextItem.length) { nextBtn.removeClass('inactive'); } else { nextBtn.addClass('inactive'); } if (prevItem.length) { prevBtn.removeClass('inactive'); } else { prevBtn.addClass('inactive'); } } // click event headLink.bind('click', function () { if (scrollAllowed) { var item = $(this).parent().attr('data-number'); scrollToitem(item); } }); } }); } // PANELS // --------------------------- function PNhandleAccordion() { var widget = $('.pe-panels.acco'); if (!widget.length) return; widget.each(function () { //check multiselect if ($(this).attr('aria-multiselectable')) { var multiSelect = true; } else { var multiSelect = false; } var panels = $(this).find('.pn-panel'); var panelsHeading = panels.find('.pn-heading'); var panelsContent = panels.find('.pn-content'); var panelsButton = panels.find('.pn-heading-button'); //hide all inactive content panels.each(function () { if (!$(this).hasClass('active')) { $(this).find('.pn-content').hide(); } }); //on click panelsHeading.find('a').click(function (e) { e.preventDefault(); var thisPanel = $(this).closest('.pn-panel'); var thisButton = $(this).closest('.pn-heading-button'); var thisContent = $(this).parent().next(); //if inactive panel was clicked if (!thisPanel.hasClass('active')) { //hide all panels except this (if not multiselect) if (!multiSelect) { panelsContent.slideUp(400); panelsContent.attr('aria-expanded', 'false'); setTimeout(function () { panels.removeClass('active'); thisPanel.addClass('active'); }, 400); } //make current panel active thisPanel.addClass('active'); thisButton.attr('aria-expanded', 'true'); thisContent.slideDown(400); //if active panel was clicked } else { //hide current panel thisContent.slideUp(400); thisButton.attr('aria-expanded', 'false'); setTimeout(function () { thisPanel.removeClass('active'); }, 400); } }); }); } function PNaccordionResponsive() { var widget = $('.pe-panels.acco'); if (!widget.length) return; widget.each(function (i, e) { var breakpoint = $(e).attr('data-responsive'); if ($(window).width() < breakpoint) { // swipe event widget.swipe({ allowPageScroll: 'vertical', swipe: function (event, direction, distance, duration) { var itemActive = $(this).find('.pn-panel.active'); var nextItem = itemActive.next().find('a'); var prevItem = itemActive.prev().find('a'); if (direction == 'left') { nextItem.trigger('click'); } else if (direction == 'right') { prevItem.trigger('click'); } } }); } }); } $(document).ready(function () { PNhandleTabs(); PNhandleAccordion(); PNkeyboardTabs(); PNkeyboardAccordion(); }); $(window).on('load', function () { PNtabsFull(); PNtabsResponsive(); PNaccordionResponsive(); }); })(jQuery); ; /*-------------------------------------------------------------- Copyright (C) pixelemu.com License: http://www.pixelemu.com/license.html PixelEmu Proprietary Use License Website: http://www.pixelemu.com Support: info@pixelemu.com ---------------------------------------------------------------*/ // Google Maps (function($) { "use strict"; /* -------------------------------------------------------- */ /* FUNCTIONS */ /* -------------------------------------------------------- */ $(document).ready(function(){ if( $('.pe_map_canvas').length ) { //load only if needed //console.log('Map needed'); if (window.google && google.maps) { // Map script is already loaded initializeMap(); } else { //Lazy loading Google Map API lazyLoadGoogleMap(); } } }); function lazyLoadGoogleMap() { var script = '//maps.google.com/maps/api/js?sensor=true&callback=initializeMap'; if( typeof pemaps !== 'undefined' ) { script = '//maps.google.com/maps/api/js?key=' + pemaps.key + '&sensor=true&callback=initializeMap'; } else { window.pemaps = {}; } $.getScript(script) .done(function (script, textStatus) { //console.log("Google map script loaded successfully"); }) .fail(function (jqxhr, settings, ex) { //console.log("Could not load Google Map script: " + jqxhr); }); } function initializeMap() { $('.pe_map_canvas').each(function() { var mapID = $(this).attr('id'); var zoom = parseInt( $(this).attr('data-zoom') ); var latitude = $(this).attr('data-lat'); var longitude = $(this).attr('data-lng'); var scroll = $(this).attr('data-scroll'); var control = $(this).attr('data-control'); var tooltip = $(this).attr('data-tooltip'); var options = { zoom: zoom, center: new google.maps.LatLng(latitude, longitude), scrollwheel: scroll, disableDefaultUI: control, mapTypeId: google.maps.MapTypeId.ROADMAP } var location = new google.maps.LatLng(latitude, longitude); var bounds = new google.maps.LatLngBounds(); var map = new google.maps.Map(document.getElementById(mapID), options); var marker = new google.maps.Marker({ position: location, map: map, }); if( tooltip && tooltip != 'disable' ) { // add tootltip var infoWindow = new google.maps.InfoWindow({ content: tooltip, }); infoWindow.open(mapID, marker); google.maps.event.addListener(marker, 'click', function () { infoWindow.open(mapID, marker); }); } //create object window.pemaps[mapID] = { map: map, marker: marker, infoWindow: infoWindow, tooltip: tooltip, } }); } window.initializeMap = initializeMap; })(jQuery); ;