File: /home/lgooir/public_html/wp-content/themes/woodmart/js/scripts/global/floatingBlocks.min.js
!function(h){woodmartThemeModule.floatingBlocks=function(){if(!woodmartThemeModule.$body.hasClass("page-template-maintenance")){let m=[],u={};const f={get(e){let o=Cookies.get(e);if(o&&"string"==typeof o)try{o=JSON.parse(o)}catch(e){o=[]}return o||[]},set(e,o){Cookies.set(e,JSON.stringify(o),{expires:7,path:"/",secure:woodmart_settings.cookie_secure_param})}},l={after_page_views:"onPageViews",after_sessions:"onSessions",time_to_show:"onTime",scroll_value:"onScroll",scroll_to_selector:"onScrollToSelector",inactivity_time:"onInactivity",click_times:"onClicks",selector:"onSelectorClick",parameters:"onUrlParam",hashtags:"onUrlHashtag",exit_intent:"onExitIntent"},c={onTime:function(e,o,t){setTimeout(()=>{if(d(e,"time_to_show"))return;t(e)},parseInt(o,10))},onScrollToSelector:function(n,i,a){let r=!1;woodmartThemeModule.$window.on("scroll",function(){var e,o,t,s;r||(e=woodmartThemeModule.$window.scrollTop(),o=woodmartThemeModule.$window.height(),i&&(s=woodmartThemeModule.$document.find(i)).length&&(s=(t=s.offset().top)+s.outerHeight(),t<=e+o)&&e<=s&&(r=!0,d(n,"scroll_to_selector")||a(n)))})},onScroll:function(s,n,i){let a=!1;woodmartThemeModule.$window.on("scroll",function(){if(!a){var o=woodmartThemeModule.$window.scrollTop(),t=o/(woodmartThemeModule.$document.height()-woodmartThemeModule.$window.height())*100;if(n){let e=!1;(e="string"==typeof n&&n.endsWith("%")?parseFloat(n)<=t:parseInt(n)<=o)&&(a=!0,d(s,"scroll_value")||i(s))}}})},onClicks:function(o,t,s){let n=0;woodmartThemeModule.$document.on("mousedown",function(){var e;++n>=parseInt(t,10)&&(n=0,(e=o.find(".wd-fb-wrap")).length&&!e.hasClass("wd-hide")||d(o,"click_times")||s(o))})},onSelectorClick:function(o,e,t){o.hasClass("wd-hide")||woodmartThemeModule.$document.on("click",e,function(e){e.preventDefault(),d(o,"selector")||t(o)})},onUrlParam:function(e,o,t){const s=new URLSearchParams(window.location.search);o.split(",").filter(Boolean).some(e=>{var[o,t]=e.trim().split("=");return o&&t?s.get(o)===t:s.has(e.trim())})&&!d(e,"parameters")&&t(e)},onUrlHashtag:function(e,o,t){if(o){const n=o.split(",").map(e=>e.trim()).filter(Boolean);function s(){const o=window.location.hash.trim();n.some(e=>e===o)&&!d(e,"hashtags")&&t(e)}s(),window.addEventListener("hashchange",s)}},onPageViews:function(e,o,t){var s="woodmart_page_views_"+e.attr("id"),n=parseInt(localStorage.getItem(s),10)||0;n++,localStorage.setItem(s,n),n>=parseInt(o,10)&&(localStorage.removeItem(s),d(e,"after_page_views")||t(e))},onSessions:function(e,o,t){var s=e.attr("id"),n="woodmart_session_"+s,s="woodmart_sessions_"+s;let i=parseInt(localStorage.getItem(s),10)||0;sessionStorage.getItem(n)||(sessionStorage.setItem(n,"1"),i++,localStorage.setItem(s,i)),i>=parseInt(o,10)&&(localStorage.removeItem(s),d(e,"after_sessions")||t(e))},onInactivity:function(e,o,t){let s;const n=parseInt(o,10);function i(){clearTimeout(s),s=setTimeout(()=>{if(d(e,"inactivity_time"))return;t(e)},n)}woodmartThemeModule.$document.on("mousemove keydown scroll",i),i()},onExitIntent:function(o,t){let s=!1;woodmartThemeModule.$document.on("mouseleave",function(e){s||d(o,"exit_intent")||e.clientY<=0&&(s=!0,t(o))})}};function n(e){var o=e.attr("id");u[o]||(u[o]=!0,m.push(e),1===m.length&&w(e))}function w(e){if(h.magnificPopup?.instance?.isOpen||"yes"===woodmart_settings.age_verify&&"confirmed"!==Cookies.get("woodmart_age_verify")){var o=h.magnificPopup.instance;if(!(o.isOpen&&o.wrap?.find(".wd-popup-builder, .wd-promo-popup").length))return void h(document).one("mfpClose",()=>setTimeout(()=>w(e),600))}const t=e.data("options")||{},s=e.attr("id");var o="1"===t?.close_btn,n=e.data("options")?.version||1;const i="woodmart_"+s+"_"+n;if("1"===t?.persistent_close){if(f.get(i).includes("persistent_closed"))return void m.shift();woodmartThemeModule.$document.on("mfpClose",function(){var e=f.get(i);e.includes("persistent_closed")||(e.push("persistent_closed"),f.set(i,e))})}var n="1"===t?.enable_page_scrolling,a="1"===t?.close_by_overlay,r="1"===t?.close_by_esc;let d=" wd-mfp-popup-wrap-"+s.replace("popup-",""),l=" wd-mfp-popup-bg-"+s.replace("popup-",""),c="wd-popup-close wd-action-btn wd-cross-icon",p=(n&&(d+=" wd-scrolling-on"),o||(c+=" wd-hide"),t?.close_btn_display&&(c+=" wd-style-"+t.close_btn_display),"");t?.animation&&(p="wd-animation-"+t.animation);h.magnificPopup.open({items:{src:e},type:"inline",removalDelay:600,fixedContentPos:!n,tClose:woodmart_settings.close,closeMarkup:'<div class="'+c+'"><a title="'+woodmart_settings.close+'" href="#" rel="nofollow"><span>'+woodmart_settings.close+"</span></a></div>",enableEscapeKey:r,closeOnBgClick:a,callbacks:{open:function(){this.wrap.find(".wd-popup-wrap").addClass(p),this.wrap.find(".wd-promo-popup").length?this.wrap.addClass(d+" wd-promo-popup-wrap"):this.wrap.addClass(d+" wd-popup-builder-wrap"),h(".mfp-bg").addClass(l),t?.close_by_selector&&e.find(t.close_by_selector).on("click",function(e){e.preventDefault(),h.magnificPopup.close()}),woodmartThemeModule.$document.trigger("wood-images-loaded"),woodmartThemeModule.$document.trigger("wdOpenPopup"),woodmartThemeModule.$document.trigger("wdPopupOpened."+s)},close:function(){if(u[s]=!1,m.shift(),0<m.length){const e=m[0];setTimeout(()=>w(e),0)}}}})}function i(e){const o=e.find(".wd-fb-wrap");o.hasClass("wd-out")||(o.removeClass("wd-hide"),o.hasClass("wd-animation")&&(o.removeClass("wd-out"),setTimeout(()=>{o.addClass("wd-in")},100)))}function a(e){const o=e.parents(".wd-fb-wrap");o.length&&(o.trigger("fbClose"),o.hasClass("wd-animation")?(o.removeClass("wd-in"),o.addClass("wd-out"),setTimeout(()=>{o.addClass("wd-hide");o.removeClass("wd-out")},600)):setTimeout(()=>{o.addClass("wd-hide")}))}function d(e,o){var t=e.attr("id"),s=(e.data("options")||{})?.version||1,n=e.data("triggers")||{};if("0"!==n[o]?.show_once){const i="woodmart_"+t+"_"+s;n=f.get(i);if(n.includes(o))return 1;e.hasClass("wd-popup")?woodmartThemeModule.$document.one("wdPopupOpened."+t,function(){var e=f.get(i);e.includes(o)||(e.push(o),f.set(i,e))}):(n.push(o),f.set(i,n))}}function r(e,o,t){for(var[s,n]of Object.entries(l))!o[s]?.value||"selector"===s&&e.hasClass("wd-popup")||("exit_intent"===s?c[n](e,t):c[n](e,o[s].value,t))}woodmartThemeModule.$document.on("click",".wd-fb-close",function(e){e.preventDefault(),a(h(this))}),h(".wd-fb-holder").each(function(){var e=h(this),o=e.data("triggers"),t=e.data("options")||{};const s=e.find(".wd-fb-wrap"),n="woodmart_"+e.attr("id")+"_"+(e.data("options")?.version||1);if("1"===t?.persistent_close){if(f.get(n).includes("persistent_closed"))return void s.addClass("wd-hide");woodmartThemeModule.$document.on("fbClose",function(){var e=f.get(n);e.includes("persistent_closed")||(e.push("persistent_closed"),f.set(n,e))})}t?.close_by_selector&&woodmartThemeModule.$document.on("click",t.close_by_selector,function(e){s.hasClass("wd-hide")||(e.preventDefault(),a(s.find(".wd-fb-close")))}),o&&"object"==typeof o?r(e,o,i):("1"===t?.persistent_close&&s.removeClass("wd-hide"),s.hasClass("wd-animation")&&("1"===t?.persistent_close?setTimeout(()=>{s.addClass("wd-in")},16):s.addClass("wd-in")))}),h(".wd-popup-builder, .wd-promo-popup").each(function(){var e,o,t=h(this),s=t.data("triggers")||{};if((e=(e=t).data("options")||{},(o=woodmartThemeModule.$window.width())<=768?"1"!==e.hide_popup_mobile:768<o&&o<=1024?"1"!==e.hide_popup_tablet:"1"!==e.hide_popup)&&(t.find(".mc4wp-form .mc4wp-response").length&&t.find(".mc4wp-form .mc4wp-response").children().length&&n(t),s&&"object"==typeof s)){if(s.selector?.value&&c.onSelectorClick(t,s.selector.value,n),t.hasClass("wd-promo-popup")){let e=Cookies.get("woodmart_shown_pages");if((e=e||0)<s.popup_pages)return e++,void Cookies.set("woodmart_shown_pages",e,{expires:7,path:"/",secure:woodmart_settings.cookie_secure_param})}r(t,s,n)}})}},woodmartThemeModule.$document.ready(function(){woodmartThemeModule.floatingBlocks()})}(jQuery);