Re-initiate FooBox Image Lightbox popup after facet refresh

<?php
// Add to your (child) theme's functions.php

add_action( 'facetwp_scripts', function() {
  ?>
    <script>
      document.addEventListener('facetwp-loaded', function() {
        if (FWP.loaded) {
            FOOBOX.init();
        }
      });
    </script>
  <?php
}, 100 );