<?php
/**
 * Plugin Name: All In One Image Viewer
 * Description: A powerful Gutenberg block plugin that lets you display images with advanced interactive features like zoom, magnify, map view, hotspots, and Comparison Slider.
 * Version: 1.0.9
 * Author: bPlugins
 * Author URI: http://bplugins.com
 * License: GPLv3 or later 
 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
 * Text Domain: image-viewer
 */
// ABS PATH
if ( !defined( 'ABSPATH' ) ) {
    exit;
}
if ( function_exists( 'iv_fs' ) ) {
    iv_fs()->set_basename( false, __FILE__ );
} else {
    // Constant
    define( 'BPIVB_PLUGIN_VERSION', ( isset( $_SERVER['HTTP_HOST'] ) && 'localhost' === $_SERVER['HTTP_HOST'] ? time() : '1.0.9' ) );
    define( 'BPIVB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    define( 'BPIVB_DIR', plugin_dir_url( __FILE__ ) );
    define( 'BPIVB_ASSETS_DIR', plugin_dir_url( __FILE__ ) . 'assets/' );
    define( 'BPIVB_HAS_PRO', file_exists( dirname( __FILE__ ) . '/vendor/freemius/start.php' ) );
    if ( !function_exists( 'iv_fs' ) ) {
        function iv_fs() {
            global $iv_fs;
            if ( !isset( $iv_fs ) ) {
                $fsLitePath = BPIVB_PLUGIN_PATH . 'vendor/freemius-lite/start.php';
                $fsPath = BPIVB_PLUGIN_PATH . 'vendor/freemius/start.php';
                // Include Freemius SDK.
                if ( BPIVB_HAS_PRO && file_exists( $fsPath ) ) {
                    require_once $fsPath;
                } else {
                    require_once $fsLitePath;
                }
                $iv_fs_Config = [
                    'id'                  => '21722',
                    'slug'                => 'image-viewer',
                    'premium_slug'        => 'image-viewer-pro',
                    'type'                => 'plugin',
                    'public_key'          => 'pk_7ca36303d5522e535067f3e4632f5',
                    'is_premium'          => false,
                    'premium_suffix'      => 'Pro',
                    'has_premium_version' => true,
                    'has_addons'          => false,
                    'has_paid_plans'      => true,
                    'menu'                => array(
                        'slug'       => 'edit.php?post_type=bpivb',
                        'first-path' => 'edit.php?post_type=bpivb&page=Image_viewer_block#/welcome',
                        'contact'    => false,
                        'support'    => false,
                    ),
                ];
                $iv_fs = ( BPIVB_HAS_PRO && file_exists( $fsPath ) ? fs_dynamic_init( $iv_fs_Config ) : fs_lite_dynamic_init( $iv_fs_Config ) );
            }
            return $iv_fs;
        }

        // Init Freemius.
        iv_fs();
        do_action( 'iv_fs_loaded' );
    }
    // ... Your plugin's main file logic ...
    require_once BPIVB_PLUGIN_PATH . 'includes/class-bpivbPlugin.php';
    if ( BPIVB_HAS_PRO ) {
        require_once BPIVB_PLUGIN_PATH . 'includes/LicenseActivation.php';
    }
    new bpivbPlugin();
}