function openCorrespondingModal() {
	if ( TVD_CS_CONST.is_ttb_active ) {
		TVE.modal_open( 'page-wizard', {
			element: TVE.ActiveElement
		} );
	} else {
		TVE.main.sidebar_extra.openLandingPageModal();
	}
}

module.exports = {
	'tcb.should_open_page_wizard': ( shouldOpenWizard ) => {
		if ( TVD_CS_CONST.is_empty_page ) {
			if ( ! TVE.CONST.tve_post_constants.page_wizard ) {
				openCorrespondingModal();
				TVE.CONST.tve_post_constants.page_wizard = 1;
			}
			shouldOpenWizard = false;
		}

		return shouldOpenWizard;
	},

	/* Return only Coming Soon templates on the LP Modal */
	'tve.lp_modal.expand_default': () => ( {set: 'coming-soon', type: 'l'} ),

	'editor_loaded_callback': () => {
		jQuery( TVE.main ).on( 'tcb.open_templates_picker', event => {
			event.preventDefault();
			openCorrespondingModal();
		} );
	},
}