(()=>{"use strict";const t=window.ReactDOM,n=window.React,e=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const n=["top","right","bottom","left"];return n.map((n=>t[n]||"")).every((t=>!t))?"":n.map((n=>t[n]||"0")).join(" ")}return""},i=window.ReactJSXRuntime,r=({attributes:t,id:n})=>{const{layout:r,alignment:a}=t,s=`#${n} .bpsc-fis-parallax-container`,o=`${s} .text-layer`,c=`${s} .image-layer`;return(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n        \n        ${s}{\n          min-height:${r?.section?.minHeight?.desktop};\n          margin:${e(r?.section?.margin?.desktop)};\n        }\n          \n        ${o}{\n          padding:${e(r?.section?.padding?.desktop)};\n          justify-content: ${a};\n        }\n\n        ${c}{\n          height:${r?.section?.minHeight?.desktop}\n        }\n\n\n        @media  (min-width:641px) and (max-width: 1024px){\n          ${s}{\n            min-height:${r?.section?.minHeight?.tablet};\n            margin:${e(r?.section?.margin?.tablet)};\n          }\n            \n          ${o}{\n            padding:${e(r?.section?.padding?.tablet)};\n          }\n  \n          ${c}{\n            height:${r?.section?.minHeight?.tablet}\n          }\n\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\n\t\n\t\n\t\t    @media (max-width: 480px){\n          ${s}{\n            min-height:${r?.section?.minHeight?.mobile};\n            margin:${e(r?.section?.margin?.mobile)};\n          }\n            \n          ${o}{\n            padding:${e(r?.section?.padding?.mobile)};\n          }\n  \n          ${c}{\n            height:${r?.section?.minHeight?.mobile}\n          }\n\t\t\t\t\t\n\t\t    }\n\t\t\t\t\n\t`}})},a=window.wp.blockEditor,s=()=>(0,i.jsx)(a.InnerBlocks,{template:[["core/heading",{content:"bPlugins",level:2,style:{spacing:{margin:"6px 0 19px 0"},typography:{fontSize:"72px",fontWeight:"900"},color:{text:"#fff"}}}],["core/paragraph",{content:"",style:{color:{text:"#fff"}}}]]}),o=({attributes:t,innerContent:e,isBackend:r=!1})=>{const{image:a}=t||"",o=(0,n.useRef)(null),c=(0,n.useRef)(null),l=(0,n.useRef)(null);return(0,i.jsxs)("div",{ref:o,className:"bpsc-fis-parallax-container",onMouseMove:t=>{const n=o.current,e=c.current,i=l.current;if(!n)return;const r=n.getBoundingClientRect(),a=(t.clientX-r.left-r.width/2)/r.width,s=(t.clientY-r.top-r.height/2)/r.height;e.style.transform=`translate(${20*a}px, ${20*s}px) scale(1.1)`,i.style.transform=`translate(${-30*a}px, ${-30*s}px)`},onMouseLeave:()=>{const t=c.current,n=l.current;t.style.transform="translate(0, 0) scale(1.1)",n.style.transform="translate(0, 0)"},children:[(0,i.jsx)("div",{ref:c,className:"image-layer",children:(0,i.jsx)("img",{src:a,alt:"JAPAY"})}),(0,i.jsx)("div",{ref:l,className:"text-layer",children:r?(0,i.jsx)("div",{children:(0,i.jsx)(s,{})}):(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:e}})})]})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-bpsc-floating-image-section").forEach((n=>{const e=JSON.parse(n.dataset.attributes),a=JSON.parse(n.dataset.content);(0,t.createRoot)(n).render((0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r,{attributes:e,id:n.id}),(0,i.jsx)(o,{attributes:e,innerContent:a})]})),n?.removeAttribute("data-attributes")}))}))})();