(()=>{"use strict";function t(t=document){try{if("editor-canvas"===window.frameElement?.getAttribute?.("name"))return!0}catch(t){}const e=t?.body;return!!e&&(!!e.classList.contains("wp-admin")||(!!e.classList.contains("block-editor-iframe__body")||!!e.classList.contains("editor-styles-wrapper")))}document.addEventListener("DOMContentLoaded",function(){e.init()});const e={init:function(){this.holder=document.querySelectorAll(".qi-block-parallax-images"),this.holder.length&&[...this.holder].map(t=>{e.initItem(t)})},getRealCurrentItem:function(t){return"string"==typeof t&&""!==t&&(t=qiBlocksEditor.qodefGetCurrentBlockElement.get(t)),t},initItem:function(t){if(!(t=e.getRealCurrentItem(t)))return;("object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor).qodefWaitForImages.check(t,function(){e.setParallaxElements(t)})},setParallaxElements:function(e){const a=e.querySelectorAll(".qodef-e-parallax-image"),r=e.querySelector(".qodef-e-main-image");if(!r)return;const n=r.querySelector("img"),i=r.getAttribute("data-parallax-main");let o=40,l=-50,s=30,c=15;window.innerWidth>1024&&(i&&(o=i,s=Math.abs(parseInt(o,10)/.9)),n.setAttribute("data-parallax",'{"y" : '+o+' , "smoothness": '+s+"}"),a.forEach(t=>{const e=t.querySelector("img"),a=t.getAttribute("data-parallax");e&&(a&&(l=a,c=Math.abs(parseInt(l,10)/2.5)),e.setAttribute("data-parallax",'{"y" : '+l+' , "smoothness": '+c+"}"))}),setTimeout(()=>{e.querySelectorAll("[data-parallax]").length&&ParallaxScroll.init()},t()?600:0))}}})();