(function() { // Wait for everything to load if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initFlipbook); } else { initFlipbook(); } function initFlipbook() { // Check if flipbook data exists if (typeof FB3D_CLIENT_DATA === 'undefined') { console.error('FB3D_CLIENT_DATA not found'); return; } // Force reload the flipbook library var script = document.createElement('script'); script.src = '/wp-content/plugins/interactive-3d-flipbook-powered-physics-engine/assets/js/client-locale-loader.js?ver=1.16.17&reload=' + Date.now(); script.onload = function() { setTimeout(function() { if (window.FB3D_CLIENT_LOCALE && window.FB3D_CLIENT_LOCALE.render) { try { FB3D_CLIENT_LOCALE.render(); console.log('FlipBook manually initialized'); } catch(e) { console.error('FlipBook init failed:', e); } } }, 500); }; document.body.appendChild(script); } })();