(function($){

    var $document = $(document);

    $document.off('builder.design.updated');
    $document.on('builder.design.updated', function() {
        var designs = {};

        $document.trigger('builder.predesign.get',[designs]);

        $.coreUtilites.ajaxRequest(
            {
                action:'design_updated_hook',
                product_id: builder_product_id,
                designs: designs
            },
            function(data){
                if(data.status == 'success' && data.message.length > 0) {
                    $.each(data.message,function(key, func){

                        console.log(func.trigger);
                        $document.trigger(func.trigger,[func.params]);

                    });
                }
            }
        );

    });

})(SWjQuery);