(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'minimal_education_primary_color': '#01b509',
            'education_insight_heading_color': '#2c2c2c',
            'education_insight_text_color': '#666c6e',
            'minimal_education_primary_fade': '#e5f7e6',
            'minimal_education_secondary_color': '#e98401',
            'minimal_education_third_color': '#238fbb',
            'minimal_education_fourth_color': '#ed5927',
            'education_insight_service_bg': '#271706',
            'education_insight_footer_bg': '#2c2c2c',
            'education_insight_post_bg': '#ffffff',
            'education_insight_primary_light' :'#ffbd0a',
        };

        // 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);