   const response = await fetch(`{% url 'settings:compact_pdf' %}`, {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    'X-CSRFToken': getCookie('csrftoken'),
                },
            body: JSON.stringify({ enabled: enabled })
            });

        if (!response.ok) {
                throw new Error('Failed to update favorite status.');
            }
    }

    async function toggleStatusEmoji(checkbox, statusId) {