<?php
/**
 * Plugin Name: EveAI Chat Widget
 * Description: Integrates the Ask Eve AI (Evie) chat interface into your WordPress site.
 * Version: 2.0.18
 * Author: AskEveAI.com
 * Text Domain: eveai-chat
 * Domain Path: /languages
 * Requires at least: 5.8
 * Requires PHP: 7.4
 */

if (!defined('WPINC')) {
    die;
}

// Define plugin constants
define('EVEAI_CHAT_VERSION', '2.0.18');
define('EVEAI_CHAT_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('EVEAI_CHAT_PLUGIN_URL', plugin_dir_url(__FILE__));

// Autoloader
spl_autoload_register(function ($class) {
    $prefix = 'EveAI\\Chat\\';
    $base_dir = EVEAI_CHAT_PLUGIN_DIR . 'includes/';

    $len = strlen($prefix);
    if (strncmp($prefix, $class, $len) !== 0) {
        return;
    }

    $relative_class = substr($class, $len);
    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';

    if (file_exists($file)) {
        require $file;
    }
});

// Load the main plugin class
require_once EVEAI_CHAT_PLUGIN_DIR . 'includes/class-plugin.php';

// Initialize the plugin
function run_eveai_chat() {
    $plugin = \EveAI\Chat\Plugin::get_instance();
}

run_eveai_chat();