(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'ngo_charity_donation_primary_color': '#ff4b89',
            'ngo_charity_donation_secondary_color': '#fd573b',
            'ngo_charity_donation_section_bg': '#f6f5ff',
            'ngo_charity_donation_heading_color': '#47445f',
            'ngo_charity_donation_text_color' :'#63646d',
            'ngo_charity_donation_primary_fade': '#fbecf1',
            'ngo_charity_donation_footer_bg': '#47445f',
            'ngo_charity_donation_post_bg': '#ffffff',
        };

        // Iterate over each setting and set it to its default value
        for (let settingId in defaultColors) {
            wp.customize(settingId).set(defaultColors[settingId]);
        }

        // Optionally refresh the preview
        wp.customize.previewer.refresh();
    }

    // Attach reset function to global scope
    window.resetColorsToDefault = resetColorsToDefault;

    $(document).ready(function() {
        $('.color-reset-btn').val('RESET'); // This adds the 'RESET' text inside the button
    });
})(jQuery);