try{(()=>{'use strict';const processImageShapes=(currentDocument=document,isProcessOnLoad=false)=>{const wrapperElements=currentDocument?.querySelectorAll('.sppb-addon-image-shape');wrapperElements.forEach((wrapperElement)=>{const path=wrapperElement.querySelector('svg path');const image=wrapperElement.querySelector('img');if(!image||!path){return;}
const updateSVGStyle=(image)=>{const dataScale=image.getAttribute('data-scale')||1;const translateX=image.width/2;const translateY=image.height/2;path.setAttribute('transform','translate('+translateX+','+translateY+') scale('+dataScale+')');image.style.visibility=null;}
if(isProcessOnLoad){image.onload=()=>{updateSVGStyle(image);}
return;}
updateSVGStyle(image);})}
document.addEventListener('DOMContentLoaded',function(){processImageShapes(document,false);document.getElementById('sp-pagebuilder-view')?.addEventListener('load',()=>{const pageBuilderIframe=window.frames['sp-pagebuilder-view'];if(!pageBuilderIframe){return;}
const container=pageBuilderIframe?.window.document.getElementById('sp-pagebuilder-container');if(container){processImageShapes(container,true);const config={attributes:true,childList:true,subtree:true};const observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(mutation.type==='childList'||mutation.type==='subtree'){if(mutation.target===container||container.contains(mutation.target)){processImageShapes(container,true);}}});});observer.observe(container,config);}})});})();}catch(e){console.error('Error in file:/components/com_sppagebuilder/assets/js/addons/image.js; Error:'+e.message);};
try{(()=>{'use strict';document.addEventListener('DOMContentLoaded',function(){const elements=document.querySelectorAll(".sppb-addon-text-block");elements.forEach(element=>{const fullText=element.querySelector(".sppb-addon-content-full-text");const showMoreButtonElement=element.querySelector(".sppb-btn-show-more");const addonContentElement=element.querySelector(".sppb-addon-content");const handleClick=()=>{addonContentElement.innerHTML=fullText.innerHTML;};showMoreButtonElement?.addEventListener('click',handleClick);});})})();}catch(e){console.error('Error in file:/components/com_sppagebuilder/assets/js/addons/text_block.js; Error:'+e.message);};
