!function(t){"use strict";window.awb_oc_timeouts={},window.awbOffCanvas={timeouts:{},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},set:function(t,n,e){t=t?"_"+t:"_data";let a=localStorage.getItem("off_canvas"+t);a=a?JSON.parse(a):{},a[n]=e,localStorage.setItem("off_canvas"+t,JSON.stringify(a))},get:function(t,n){t=t?"_"+t:"_data";let e=localStorage.getItem("off_canvas"+t);return e=e?JSON.parse(e):{},e[n]||""},animationsWithoutDirection:["flash","rubberBand","shake","flipinx","flipiny","lightspeedin","flipOutX","flipOutY","lightSpeedOut"],open_off_canvas:function(n,e=!0,a=!1){const o=t('.awb-off-canvas-wrap[data-id="'+n+'"]'),s=o.find(".awb-off-canvas"),i=window["off_canvas_"+n],c=this;if(!o.length)return;if(o.hasClass("awb-show")&&a)return void this.close_off_canvas(n);if(this.set(n,"last_open_date",new Date),o.hasClass("awb-show")&&!a)return;let f=i.enter_animation;const r=i.enter_animation_direction&&"static"!==i.enter_animation_direction?this.capitalize(i.enter_animation_direction):"",l=i.enter_animation_speed||1,d=i.enter_animation_timing||"ease";if(("off"===i.status_css_animations||"desktop"===i.status_css_animations&&window.cssua.ua.mobile)&&(f=!1),f){if(this.animationsWithoutDirection.includes(f)||(f=f+"In"+r),s.addClass("fusion-animated "+f),s.attr("data-animation-type",f),s.css({visibility:"visible","animation-duration":l+"s","animation-timing-function":d}),"sliding-bar"===i.type&&"push"===i.transition&&"top"===i.position){const n={transition:"margin-top "+i.enter_animation_speed+"s"};n.marginTop=s.outerHeight()+"px";let e="#wrapper";o.hasClass("init-for-studio")&&(e=".post-preview"),t(e).css(n);const a=t(".fusion-tb-header").find(".fusion-sticky-container.fusion-container-stuck");a.length&&a.each((function(){t(this).attr("data-top",t(this).css("top")),t(this).css({top:"calc("+n.marginTop+" + "+t(this).attr("data-top")+")",transition:"top "+i.enter_animation_speed+"s"})}))}if("sliding-bar"===i.type&&"push"===i.transition&&("left"===i.position||"right"===i.position)){const n={transition:"margin-inline-start "+i.enter_animation_speed+"s"};t("body").hasClass("rtl")?(n.marginInlineStart="-"+s.outerWidth()+"px","right"===i.position&&(n.marginInlineStart=s.outerWidth()+"px")):(n.marginInlineStart=s.outerWidth()+"px","right"===i.position&&(n.marginInlineStart="-"+s.outerWidth()+"px"));let e="#wrapper";o.hasClass("init-for-studio")&&(e=".post-preview"),t(e).css(n),t('#sliders-container .tfs-slider[data-parallax="1"]').length&&t('#sliders-container .tfs-slider[data-parallax="1"]').css(n)}}else this.enableTrapFocus(o);if("yes"===i.overlay&&"no"===i.overlay_page_scrollbar&&t("html").css("overflow","hidden"),o.addClass("awb-show"),t('a[href^="#awb-oc__'+n+'"]').addClass("awb-oc-active"),e){const t=this.get(n,"open_count")||0;this.set(n,"open_count",t+1)}const _=parseInt(i.auto_close_after_time);_&&(window.awb_oc_timeouts["close_after_time_"+n]=setTimeout(()=>{c.close_off_canvas(n)},1e3*_));const w=parseInt(i.show_close_button_after_time);w&&(window.awb_oc_timeouts["show_close_button_"+n]=setTimeout(()=>{s.children(".off-canvas-close").removeClass("hidden")},1e3*w)),o.trigger(t.Event("awb-oc-opened"),[n])},close_off_canvas:function(n,e=!0){const a=t('.awb-off-canvas-wrap[data-id="'+n+'"]'),o=a.find(".awb-off-canvas"),s=window["off_canvas_"+n];if(0===a.length||void 0===s)return;let i=s.exit_animation;const c=s.exit_animation_direction&&"static"!==s.exit_animation_direction?this.capitalize(s.exit_animation_direction):"",f=s.exit_animation_speed||1,r=s.exit_animation_timing||"ease";if(("off"===s.status_css_animations||"desktop"===s.status_css_animations&&window.cssua.ua.mobile)&&(i=!1),i){if(this.animationsWithoutDirection.includes(i)||(i=i+"Out"+c),o.addClass("fusion-animated "+i),o.attr("data-animation-type",i),o.addClass("is-closing"),o.css({"animation-duration":f+"s","animation-timing-function":r}),"sliding-bar"===s.type&&"push"===s.transition&&"top"===s.position){const n={transition:"margin-top "+s.enter_animation_speed+"s",marginTop:0};let e="#wrapper";a.hasClass("init-for-studio")&&(e=".post-preview"),t(e).css(n);const o=t(".fusion-tb-header").find(".fusion-sticky-container");o.length&&o.each((function(){const n=this;void 0!==t(this).attr("data-top")&&(t(this).css("top",t(this).attr("data-top")),t(this).removeAttr("data-top"),setTimeout((function(){t(n).css("transition","")}),1e3*s.enter_animation_speed))}))}if("sliding-bar"===s.type&&"push"===s.transition&&("left"===s.position||"right"===s.position)){const n={transition:"margin-inline-start "+s.exit_animation_speed+"s",marginInlineStart:0};let e="#wrapper";a.hasClass("init-for-studio")&&(e=".post-preview"),t(e).css(n),t('#sliders-container .tfs-slider[data-parallax="1"]').length&&t('#sliders-container .tfs-slider[data-parallax="1"]').css(n)}}else"yes"===s.overlay&&a.hasClass("init-for-studio")&&o.addClass("is-closing"),"no"===s.overlay&&a.hasClass("init-for-studio")&&t("#icon-bar .go-back").click(),a.removeClass("awb-show");if(t('a[href^="#awb-oc__'+n+'"]').removeClass("awb-oc-active"),"yes"===s.overlay&&"no"===s.overlay_page_scrollbar&&t("html").css("overflow",""),setTimeout(()=>{this.removeHash()},10),e){const t=this.get(n,"close_count")||0;this.set(n,"close_count",t+1)}this.set(n,"closed",!0),clearTimeout(window.awb_oc_timeouts["close_after_time_"+n]),clearTimeout(window.awb_oc_timeouts["show_close_button_"+n]);parseInt(s.show_close_button_after_time)&&o.children(".off-canvas-close").addClass("hidden"),a.trigger(t.Event("awb-oc-closed"),[n])},removeHash(){const t=window.location.href.split("#")[0];history.replaceState({},"",t)},enableTrapFocus(t){if(!t.hasClass("type-popup"))return;const n=t.find(".awb-off-canvas"),e=n.find('a[href]:not([disabled]):visible, button:not([disabled]):visible, textarea:not([disabled]):visible, input[type="text"]:not([disabled]):visible, input[type="radio"]:not([disabled]):visible, input[type="checkbox"]:not([disabled]):visible, select:not([disabled]):visible'),a=e[0],o=e[e.length-1];setTimeout(()=>{n[0].focus()},100),n[0].addEventListener("keydown",(function(t){("Tab"===t.key||9===t.keyCode)&&(t.shiftKey?document.activeElement===a&&(o.focus(),t.preventDefault()):document.activeElement===o&&(a.focus(),t.preventDefault()))}))}},t(".awb-off-canvas").on("animationend",(function(n){if(n.target!==this)return;const e=t(this),a=e.parent();e.attr("data-animation-type")&&e.removeClass("fusion-animated").removeClass(e.attr("data-animation-type")).removeAttr("data-animation-type"),e.hasClass("is-closing")?(e.removeClass("is-closing"),e.addClass("oc-waiting-for-close"),a.removeClass("awb-show"),a.hasClass("init-for-studio")&&t("#icon-bar .go-back").click()):window.awbOffCanvas.enableTrapFocus(a)})),t(".awb-off-canvas-wrap").on("transitionend",(function(n){const e=t(this).find(".awb-off-canvas");e.hasClass("is-closing")&&t(this).hasClass("init-for-studio")&&(t("#icon-bar .go-back").click(),e.removeClass("is-closing")),e.removeClass("oc-waiting-for-close")})),t(window).on("load",(function(){if(location.hash&&location.hash.startsWith("#awb-oc__")||location.hash&&location.hash.startsWith("#awb-open-oc__")){const t=location.hash.split("__")[1];window.awbOffCanvas.open_off_canvas(t,!1,!1)}t(".awb-off-canvas-wrap.init-for-studio").each((function(n,e){const a=t(e).data("id");window.awbOffCanvas.open_off_canvas(a,!1,!1)})),t(".awb-off-canvas-wrap").each((function(){t(this).on("awb-oc-closed",(function(){t(this).find(".fusion-youtube iframe").each((function(){this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")})),t(this).find(".fusion-vimeo iframe").each((function(){new Vimeo.Player(this).pause()})),t(this).find("video").each((function(){t(this).get(0).pause()})),t(this).find(".mejs-audio").each((function(){t(this).find(".mejs-playpause-button.mejs-pause button").trigger("click")}))}))}))})),t("body").on("click",'a[href^="#awb-oc__"]',(function(n){n.preventDefault();const e=(t(this).attr("href")||"").split("__")[1];window.awbOffCanvas.open_off_canvas(e,!1,!0)})),t("body").on("click",'a[href^="#awb-open-oc__"]',(function(n){n.preventDefault();const e=(t(this).attr("href")||"").split("__")[1];window.awbOffCanvas.open_off_canvas(e,!1,!1)})),t("body").on("click",'a[href^="#awb-close-oc__"]',(function(n){n.preventDefault();const e=(t(this).attr("href")||"").split("__")[1];e?window.awbOffCanvas.close_off_canvas(e):t(".awb-off-canvas-wrap.awb-show").each((function(){const n=t(this).data("id");window.awbOffCanvas.close_off_canvas(n)})),window.awbOffCanvas.removeHash()})),t(".awb-off-canvas-wrap:not(.overlay-disable-close)").on("click",(function(n){if(n.target===this){const n=t(this).data("id");window.awbOffCanvas.close_off_canvas(n)}})),t(".close-on-anchor a").on("click",(function(){if((t(this).attr("href")||"").includes("#")){const n=t(this).closest(".awb-off-canvas-wrap").data("id");window.awbOffCanvas.close_off_canvas(n)}})),t(".off-canvas-close").on("click",(function(n){n.preventDefault();const e=t(this).closest(".awb-off-canvas-wrap").data("id");window.awbOffCanvas.close_off_canvas(e)})),t(document).on("keydown",(function(n){if(27!==n.keyCode)return;t(".awb-off-canvas-wrap.awb-show:not(.disable-close-on-esc)").each((function(n,e){const a=t(e).data("id");window.awbOffCanvas.close_off_canvas(a)}))})),t(".awb-off-canvas").on("mouseover",(function(){const n=t(this).closest(".awb-off-canvas-wrap").data("id"),e=window["off_canvas_"+n];parseInt(e.auto_close_after_time)&&window.awb_oc_timeouts["close_after_time_"+n]&&clearTimeout(window.awb_oc_timeouts["close_after_time_"+n])})),t(".awb-off-canvas").on("mouseleave",(function(){const n=t(this).closest(".awb-off-canvas-wrap").data("id"),e=window["off_canvas_"+n],a=parseInt(e.auto_close_after_time);a&&window.awb_oc_timeouts["close_after_time_"+n]&&(window.awb_oc_timeouts["close_after_time_"+n]=setTimeout(()=>{window.awbOffCanvas.close_off_canvas(n)},1e3*a))})),t("body").on("goback",(function(n){t(".post-preview").css({"margin-right":0,"margin-left":0})})),t(".awb-off-canvas-wrap").each((function(n,e){const a=t(e).data("id"),o=window["off_canvas_"+a],s=t("#wpadminbar"),i=s.outerHeight();if("full"===o.height&&s.length&&t(e).find(".awb-off-canvas").css("height",`calc(100vh - ${i}px)`),"sliding-bar"===o.type&&"top"===o.position&&s.length&&t(e).find(".awb-off-canvas").css("margin-top",i+"px"),"yes"===o.on_click){const n=o.on_click_element?t(o.on_click_element):null;n&&n.length&&(n.attr("data-off-canvas",o.on_click_element),t(document).on("click",o.on_click_element,(function(t){t.preventDefault(),window.awbOffCanvas.open_off_canvas(a,!1)})))}"yes"===o.on_add_to_cart&&t(document).on("added_to_cart",(function(){window.awbOffCanvas.open_off_canvas(a)}));let c=!1;if(o.frequency){if("close"===o.frequency){!0===window.awbOffCanvas.get(a,"closed")&&(c=!0)}if("once"===o.frequency){0{window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0},100),"yes"===o.time_on_page&&o.time_on_page_duration&&setTimeout(()=>{window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0},1e3*o.time_on_page_duration),"yes"===o.on_scroll){const n=o.scroll_direction,e=o.scroll_to,s=document.documentElement.scrollHeight;let i=o.scroll_position;if(i&&isNaN(i)&&(i=i.includes("%")?s/100*parseInt(i):parseInt(i)),"down"===n&&"element"===e){const t=o.scroll_element?document.querySelector(o.scroll_element):null;if(t){const n=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0,n.unobserve(t.target))})});n.observe(t)}}else t(window).on("scroll",(function(t){"up"===o.scroll_direction&&this.oldScroll>this.scrollY&&(o.isOpened||window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0),"down"===o.scroll_direction&&this.oldScroll=i&&(o.isOpened||window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0),this.oldScroll=this.scrollY}))}if("yes"===o.exit_intent){const t=function(n){null==n.relatedTarget&&"select"!==n.target.nodeName.toLowerCase()&&(window.awbOffCanvas.open_off_canvas(a),document.removeEventListener("mouseout",t),o.isOpened=!0)};document.addEventListener("mouseout",t)}if("yes"===o.after_inactivity&&o.inactivity_duration){const t=o.inactivity_duration;let n;const e=function(){n=window.setTimeout(s,1e3*t)},s=function(){o.isOpened||window.awbOffCanvas.open_off_canvas(a),o.isOpened=!0},i=function(){document.addEventListener("mousemove",c,!1),document.addEventListener("mousedown",c,!1),document.addEventListener("keypress",c,!1),document.addEventListener("touchmove",c,!1),document.addEventListener("scroll",c,!1),e()},c=function(){window.clearTimeout(n),e()};i()}}}))}(jQuery);