(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'business_consulting_lite_primary_color': '#f63b2b',
            'business_consulting_lite_second_color': '#084588',
            'business_consulting_lite_heading_color': '#181818',
            'business_consulting_lite_text_color': '#63646d',
            'business_consulting_lite_primary_fade' :'#ffe7e5',
            'business_consulting_lite_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);