<?php
declare(strict_types=1);

namespace Instinctor\Core;

if (!defined('ABSPATH')) { exit; }

/**
 * TierManager — WordPress.org-distributed build.
 *
 * Stub: every feature is freely available; no license checks; no remote
 * calls. The standalone (full) build of the plugin ships a different
 * implementation that handles license tiers.
 */
class TierManager
{
    private static ?TierManager $instance = null;
    public function __construct() {}
    public static function instance(): self
    {
        if (self::$instance === null) self::$instance = new self();
        return self::$instance;
    }
    public static function reset(): void { self::$instance = null; }

    public static function isPro(): bool { return false; }
    public static function isFree(): bool { return true; }
    public static function isDegraded(): bool { return false; }
    public static function tier(): string { return 'free'; }

    public static function can(string $feature): bool { return true; }
    public static function canRenderBlock(string $blockType): bool { return true; }
    public static function canFeature(string $slug): bool { return true; }
    public static function hasActiveLicense(): bool { return true; }
    public static function canEnvironment(string $effect): bool { return true; }
    public static function can3dEffects(): bool { return true; }
    public static function canDepthImage(array $settings): bool { return true; }

    public static function isAdminContext(): bool { return is_admin(); }
    public static function isClientSiteBuilding(): bool { return false; }
    public static function isOwnerViewing(): bool { return false; }

    public static function upgradePrompt(string $blockType): string { return ''; }
    public static function isDevMode(): bool { return defined('WP_DEBUG') && WP_DEBUG; }

    public static function getJsData(): array
    {
        return [
            'tier'             => 'free',
            'isPro'            => false,
            'isFree'           => true,
            'isDegraded'       => false,
            'hasActiveLicense' => true,
        ];
    }
}
