<?php 
defined( 'ABSPATH' ) || exit();

if( !class_exists( 'OVATEAM_assets' ) ){
	class OVATEAM_assets{

		public function __construct(){

			add_action( 'wp_enqueue_scripts', array( $this, 'ovateam_enqueue_scripts' ), 10, 0 );

			/* Add JS for Elementor */
			add_action( 'elementor/frontend/after_register_scripts', array( $this, 'ova_enqueue_scripts_elementor_team' ) );
			if( is_admin() ){
				add_action( 'admin_footer', array( $this, 'ova_team_admin_enqueue_scripts' ), 10, 2 );
			}
		}



		public function ovateam_enqueue_scripts(){

			// Init Css
			wp_enqueue_style( 'ovateam_style', OVATEAM_PLUGIN_URI.'assets/css/frontend/ovateam-style.css' );		

			// Init Js
			wp_enqueue_script( 'ovateam_script', OVATEAM_PLUGIN_URI.'assets/js/frontend/ovateam-script.js' );			

		}

		// Add JS for elementor
		public function ova_enqueue_scripts_elementor_team(){
			wp_enqueue_script( 'script-elementor-team', OVATEAM_PLUGIN_URI. 'assets/js/script-elementor.js', [ 'jquery' ], false, true );
		}


		public function ova_team_admin_enqueue_scripts(){

			// Jquery UI
			wp_enqueue_style( 'jquery-ui', OVATEAM_PLUGIN_URI.'assets/libs/jquery-ui/jquery-ui.min.css' );
			wp_enqueue_script( 'jquery-ui-tabs' );
		}


	}
	new OVATEAM_assets();
}
