<?php
if (!defined('ABSPATH')) {
    exit;
}

class PF_Bootstrap {

    public static function init() {
        self::load_files();
    }

    /**
     * Minimální boot pro Elementor editor — pouze registrace widgetů a sync při uložení.
     * page-access a payment-widget-credentials se načtou lazy při elementor/document/after_save.
     *
     * @return void
     */
    public static function init_elementor_editor() {
        elementsell_boot_debug_require( 'includes/elementor.php' );
        elementsell_boot_debug_require( 'includes/elementor-sync.php' );
    }

    private static function load_files() {
        elementsell_boot_debug_require( 'includes/elementor.php' );

        if ( function_exists( 'elementsell_attach_elementor_widget_registration_hooks' ) ) {
            elementsell_attach_elementor_widget_registration_hooks();
        }

        elementsell_boot_debug_require( 'includes/elementor-sync.php' );
    }
}