facetwp show hide template based on facets selected

add_action( 'wp_head', function() {
?>
<script>
(function($) {
	$(document).on('facetwp-loaded', function() {
		if ('' != FWP.build_query_string()) {
			$('.facetwp-template').show();
		} else {
			$('.facetwp-template').hide();
		}
	 });
})(jQuery);
</script>
<?php
}, 100 );