/* global FusionPageBuilderApp */
( function () {
	jQuery( document ).ready( function () {
		// WooCommerce shortocodes handler
		jQuery( 'body' ).on( 'change', '#fusion_fibofilters_shortcodes', function () {
			const shortoCodes = [ '[fibofilters]', '[fibofilters layout="horizontal"]' ],
				selected = jQuery( this ).val();

			// Update content
			if ( true === FusionPageBuilderApp.shortcodeGenerator ) {
				jQuery( '#generator_element_content' ).val( shortoCodes[ selected ] );
			} else {
				jQuery( '#element_content' ).val( shortoCodes[ selected ] );
			}
		} );
	} );
} )( jQuery );
