<?php
/**
 * AIVT_License — Freemius wrapper. See docs/FREEMIUS_SETUP.md.
 */
if (!defined('ABSPATH')) exit;

class AIVT_License {

    public static function is_pro(): bool {
        $fs = function_exists('aivt_freemius') ? aivt_freemius() : null;
        return $fs ? (bool) $fs->is_paying() : false;
    }

    public static function plan_label(): string {
        $fs = function_exists('aivt_freemius') ? aivt_freemius() : null;
        if (!$fs) return 'Free';
        if ($fs->is_plan('agency', true)) return 'Agency';
        if ($fs->is_paying()) return 'Pro';
        if (method_exists($fs, 'is_trial') && $fs->is_trial()) return 'Trial';
        return 'Free';
    }

    /** @see aivt_can_automate() */
    public static function can_automate(): bool {
        return aivt_can_automate();
    }
}
