Add a “no more results” text when load more button has no more results to load

<?php
/** Add your message in an element with the class 'facetwp-load-more-complete' where you want the
 ** no more results message to display.
 ** for ex.   <div class="facetwp-load-more-complete facetwp-hidden">That's all</div>
 ** See: https://facetwp.com/help-center/facets/facet-types/pager/#display-a-no-more-results-message-below-the-load-more-button
 **/

add_action('facetwp_scripts', function () { ?>
    <script>
        (function($) {
            $().on('facetwp-loaded', function() {
                var is_visible = (FWP.settings.pager.page < FWP.settings.pager.total_pages);
                var method = is_visible ? 'addClass' : 'removeClass';
                $('.facetwp-load-more-complete')[method]('facetwp-hidden');
            });
        })(fUtil);
    </script>
<?php }, 100);