Your IP : 216.73.216.215


Current Path : /proc/3/root/home/flapst5/.trash/
Upload File :
Current File : //proc/3/root/home/flapst5/.trash/snapshot-installer.php

<?php

/**
 * Snapshot Recovery installer
 * Version: 2.1.2
 * Build: 2025-01-15
 * Copyright 2009-2025 Incsub (https://incsub.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License (Version 2 - GPLv2) as published by
 * the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

// Source: build/_php_deps.php

// Source: src/lib/class_si_app.php
 //phpcs:ignore

/**
 * Snapshot Installer App
 */
class Si_App {

	/**
	 * Si_App singleton instance.
	 *
	 * @var \Si_App
	 */
	protected static $instance = null;

	/**
	 * Dummy Constructor.
	 */
	public function __construct() {}

	/**
	 * Gets the absolute current URL
	 *
	 * @return string
	 */
	public function get_base_url() {
		$protocol = ! empty( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS']
			? 'https'
			: 'http';
		$host     = ! empty( $_SERVER['HTTP_HOST'] )
			? rtrim( $_SERVER['HTTP_HOST'], '/' )
			: '';
		$uri      = ! empty( $_SERVER['PHP_SELF'] )
			? ltrim( $_SERVER['PHP_SELF'], '/' )
			: '';

		return "{$protocol}://{$host}/{$uri}";
	}


	/**
	 * Gets full URL to relative path
	 *
	 * @param string|null $relative_path [optional] Relative path.
	 *
	 * @return string
	 */
	public function get_url( $relative_path = null ) {
		$target = rtrim( dirname( $this->get_base_url() ), '/' );
		if ( null !== $relative_path ) {
			$target .= '/' . ltrim( $relative_path, '/' );
		}

		return $target;
	}



	/**
	 * Creates the single instance of Si_App
	 *
	 * @return Si_App
	 */
	public static function instance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	/**
	 * Boots up the Installer Script.
	 *
	 * @return void
	 */
	public function boot() {
		$template = new Si_View_Template();
		$template->out();
	}
}



// Source: src/lib/class_si_controller.php
 //phpcs:ignore

/**
 * Abstract class for controllers
 */
abstract class Si_Controller {

	/**
	 * Run function
	 *
	 * @return void
	 */
	abstract public function run();

	/**
	 * Enviornment model
	 *
	 * @var \Si_Model_Env
	 */
	protected $_env;

	/**
	 * Controller constructor setting env model
	 */
	public function __construct() {
		$this->_env = new Si_Model_Env();
	}
}



// Source: src/lib/class_si_model.php


/**
 * Base class for models
 */
abstract class Si_Model {

	/**
	 * Deep-trims value
	 *
	 * @param mixed $value Value to deep-trim.
	 *
	 * @return mixed
	 */
	public function deep_trim( $value ) {
		if ( ! is_array( $value ) ) {
			if ( is_numeric( $value ) && ! strstr( $value, '.' ) ) {
				$value = (int) $value;
			} else {
				$value = trim( $value );
			}

			return $value;
		}
		foreach ( $value as $key => $val ) {
			$value[ $key ] = $this->deep_trim( $val );
		}

		return $value;
	}
}



// Source: src/lib/class_si_request.php


/**
 * Request Handler
 */
class Si_Request {

	/**
	 * Supported request methods.
	 *
	 * @var array
	 */
	protected $methods = array( 'GET', 'POST' );

	/**
	 * Default request.
	 *
	 * @var string
	 */
	protected $method = 'GET';

	/**
	 * Store requests.
	 *
	 * @var mixed
	 */
	protected $request = null;

	/**
	 * Determines the.
	 */
	public function __construct() {
		$request_type = $_SERVER['REQUEST_METHOD'];

		if ( ! in_array( $request_type, $this->methods, true ) ) {
			$this->method = 'GET';
		} else {
			$this->method = $request_type;
		}

		switch ( $this->method ) {
			case 'POST':
				$this->request = $_POST;
				break;

			case 'GET':
			default:
				$this->request = $_GET;
				break;
		}
	}

	/**
	 * Checks if current request has the param
	 *
	 * @param string $name Param name.
	 *
	 * @return boolean
	 */
	public function has( $name ) {
		return isset( $this->request[ $name ] );
	}

	/**
	 * Get single or all the request parameters.
	 *
	 * If the passed argument is null we'll try to grab all the GET requests.
	 *
	 * @param string|null $name Param name.
	 *
	 * @return mixed
	 */
	public function get( $name ) {
		if ( isset( $this->request[ $name ] ) ) {
			return $this->request[ $name ];
		}

		return null;
	}

	/**
	 * Return all the requests
	 *
	 * @return mixed
	 */
	public function requests() {
		if ( array_key_exists( 'request', $this->request ) && 'ajax' === $this->request['request'] ) {
			unset( $this->request['request'] );
		}

		return $this->request;
	}
}



// Source: src/lib/class_si_response.php


/**
 * Response Manager class
 */
class Si_Response {

	/**
	 * Data for the response
	 *
	 * @var array
	 */
	protected $data = array();

	/**
	 * Set response data
	 *
	 * @param mixed $what data to set.
	 * @return void
	 */
	public function set( $what = null ) {
		if ( null !== $what ) {
			if ( is_array( $what ) ) {
				$this->data = $what;
			} else {
				$this->data['data'] = $what;
			}
		}
	}

	/**
	 * Get data
	 *
	 * @return array
	 */
	public function to_array() {
			return $this->data;
	}

	/**
	 * Get Json data
	 *
	 * @return string|false|void
	 */
	public function to_json() {
		if ( ! empty( $this->data ) ) {
			return json_encode( $this->data );
		}
	}
}



// Source: src/lib/class_si_view.php


/**
 * Base Class for View
 */
abstract class Si_View {

	/**
	 * Outputing base function
	 *
	 * @param array $params [optional] params to use.
	 * @return void
	 */
	abstract public function out( $params = array() );

	/**
	 * State
	 *
	 * @var mixed
	 */
	private $_state;

	/**
	 * Get state of view
	 *
	 * @return mixed
	 */
	public function get_state() {
		return $this->_state; }

	/**
	 * Set state
	 *
	 * @param mixed $state State to set.
	 * @return bool
	 */
	public function set_state( $state ) {
		return ! ! $this->_state = $state; }

	/**
	 * Quick, trimmed down string convention replacer
	 *
	 * @param string $str String to process.
	 *
	 * @return string
	 */
	public function quickdown( $str ) {
		$str = preg_replace( '/```([^`]+)```/', '<pre><code>\\1</code></pre>', $str );
		$str = preg_replace( '/`([^`]+)`/', '<code>\\1</code>', $str );

		return $str;
	}
}



// Source: src/lib/Controller/class_si_controller_database.php


/**
 * Database Controller
 */
class Si_Controller_Database extends Si_Controller {

	/**
	 * Stores the database credentials.
	 *
	 * @var array
	 */
	protected $credentials = array();

	/**
	 * Stores the error if any.
	 *
	 * @var array
	 */
	protected $errors = array();

	/**
	 * Stores the mysqli connection instance
	 *
	 * @var mysqli|null
	 */
	protected $connection = null;

	/**
	 * MySQLi connection error.
	 *
	 * @var mixed
	 */
	protected $connection_error = null;

	/**
	 * Error Message.
	 *
	 * @var string
	 */
	protected $error_message;

	/**
	 * We're not doing anything at the moment.
	 *
	 * @return void
	 */
	public function run() {}

	/**
	 * Set the DB creds
	 *
	 * @param array $params Db params.
	 * @return \Si_Controller_Database
	 */
	public function set_creds( $params ) {
		$creds  = array();
		$errors = array();

		if ( isset( $params['DB_HOST'] ) && ! empty( $params['DB_HOST'] ) ) {
			$host = Si_Helper_Sanitize::string( $params['DB_HOST'] );
			if ( Si_Helper_Validator::is_hostname( $host ) ) {
				$creds['DB_HOST'] = $host;
			} else {
				$errors['host'] = 'invalid_host';
			}
		} else {
			$errors['host'] = 'invalid_host';
		}

		if ( isset( $params['DB_PORT'] ) ) {
			$creds['DB_PORT'] = Si_Helper_Sanitize::int( $params['DB_PORT'] );
		} else {
			$errors['port'] = 'invalid_port';
		}

		if ( isset( $params['DB_USER'] ) && ! empty( $params['DB_USER'] ) ) {
			$creds['DB_USER'] = Si_Helper_Sanitize::string( $params['DB_USER'] );
		} else {
			$errors['user'] = 'invalid_user';
		}

		if ( isset( $params['DB_NAME'] ) && ! empty( $params['DB_NAME'] ) ) {
			$creds['DB_NAME'] = Si_Helper_Sanitize::string( $params['DB_NAME'] );
		} else {
			$errors['database'] = 'invalid_database';
		}

		if ( isset( $params['DB_PASSWORD'] ) && ! empty( $params['DB_PASSWORD'] ) ) {
			$creds['DB_PASSWORD'] = $params['DB_PASSWORD'];
		} else {
			$creds['DB_PASSWORD'] = '';
		}

		if ( count( $errors ) <= 0 ) {
			$this->credentials = $creds;
		} else {
			$this->errors = $errors;
		}

		return $this;
	}

	/**
	 * Checks if we have any database error
	 *
	 * @return boolean
	 */
	public function has_any_errors() {
		return count( $this->errors ) > 0;
	}

	/**
	 * Check if we can connect to the database.
	 *
	 * @return boolean
	 */
	public function can_connect() {
		$mysqli = $this->mysqli();

		if ( null === $mysqli ) {
			return false;
		}

		if ( $mysqli->connect_errno ) {
			$this->connection_error = $mysqli->connect_errno;
			return false;
		}
		$this->connection = $mysqli;

		return true;
	}

	/**
	 * Get the database connection or connect to the database.
	 *
	 * @return mysqli|false
	 */
	public function connection() {
		if ( null !== $this->connection && is_a( $this->connection, mysqli::class ) ) {
			return $this->connection;
		}

		$mysqli = $this->mysqli();

		if ( null === $mysqli ) {
			return false;
		}

		if ( $mysqli->connect_errno ) {
			$this->connection_error = $mysqli->connect_errno;
			return false;
		}

		$this->connection = $mysqli;

		return $mysqli;
	}

	/**
	 * Returns the mysqli connect error no.
	 *
	 * @return mixed
	 */
	public function get_connection_error() {
		return $this->connection_error;
	}

	/**
	 * Creates the new mysqli connection.
	 *
	 * @return mixed
	 */
	private function mysqli() {
		$creds = $this->credentials;

		if ( ! isset( $creds['DB_HOST'] ) || ! isset( $creds['DB_USER'] ) ) {
			return null;
		}

		$host = $creds['DB_HOST'];
		$user = $creds['DB_USER'];
		$pass = $creds['DB_PASSWORD'];
		$db   = $creds['DB_NAME'];

		$port = ( isset( $creds['DB_PORT'] ) ) ? (int) $creds['DB_PORT'] : (int) ini_get( 'mysqli.default_port' );

		if ( empty( $port ) ) {
			$port = 3306;
		}

		mysqli_report( MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT );
		$mysqli = null;

		try {
			$mysqli = new mysqli( $host, $user, $pass, $db, $port );
		} catch ( mysqli_sql_exception $e ) {
			$this->connection_error = $e->getCode();
			$this->error_message    = $e->getCode();
		}

		return $mysqli;
	}
}



// Source: src/lib/Controller/class_si_controller_requirements.php


/**
 * Requirements Check Controller
 */
class Si_Controller_Requirements extends Si_Controller {

	/**
	 * Run function
	 *
	 * @return void
	 */
	public function run() {}

	/**
	 * All steps
	 *
	 * @var array
	 */
	protected $steps = array(
		'backup_archive',
		'backup_integrity',
		'php_version',
		'mysqli',
		'zip_module',
		'open_basedir',
		'timeout',
	);

	/**
	 * List of failed steps
	 *
	 * @var array
	 */
	protected $failed = array();

	/**
	 * Checks if the requirement check has any errors.
	 *
	 * @return boolean
	 */
	public function has_failed() {
		return count( $this->failed ) > 0;
	}

	/**
	 * Returns failed Steps
	 *
	 * @return array
	 */
	public function get_failed_steps() {
		return $this->failed;
	}

	/**
	 * Analyze the requirements
	 *
	 * @return void
	 */
	public function check() {
		$failed_steps = array();

		foreach ( $this->steps as $step ) {
			$fn     = "check_{$step}";
			$result = $this->$fn();
			if ( ! $result ) {
				array_push( $failed_steps, $step );
			}
		}

		if ( false === $this->check_zip_module() && in_array( 'backup_archive', $failed_steps ) ) {
			$pos = array_search( 'backup_archive', $failed_steps );
			unset( $failed_steps[ $pos ] );
		}

		if ( in_array( 'backup_archive', $failed_steps ) && in_array( 'backup_integrity', $failed_steps ) ) {
			$pos = array_search( 'backup_integrity', $failed_steps );
			unset( $failed_steps[ $pos ] );
		}

		$this->failed = $failed_steps;
	}

	/**
	 * Check if MySQLi module is available
	 *
	 * @return boolean
	 */
	public function check_mysqli() {
		return function_exists( 'mysqli_connect' );
	}

	/**
	 * Checks for PHP Version
	 *
	 * @return boolean
	 */
	public function check_php_version() {
		return version_compare( PHP_VERSION, '7.4' ) >= 0;
	}

	/**
	 * Check for PHP Timeout
	 *
	 * @return boolean
	 */
	public function check_timeout() {
		return 0 === (int) ini_get( 'max_execution_time' ) || (int) ini_get( 'max_execution_time' ) >= 150;
	}

	/**
	 * Checks for open_basedir
	 *
	 * @return boolean
	 */
	public function check_open_basedir() {
		return ! ini_get( 'open_basedir' );
	}

	/**
	 * Checks for PHP Zip extension
	 *
	 * @return boolean
	 */
	public function check_zip_module() {
		if ( function_exists( 'php_ini_loaded_file' ) && function_exists( 'parse_ini_file' ) ) {
			$open_basedir_restriction = ini_get( 'open_basedir' );
			if ( empty( $open_basedir_restriction ) ) {
				$ini_path = php_ini_loaded_file();
				if ( $ini_path && file_exists( $ini_path ) ) {
					$ini = parse_ini_file( $ini_path );

					$disabled = ( isset( $ini['disable_classes'] ) && ! empty( $ini['disable_classes'] ) ) ? $ini['disable_classes'] : null;
					if ( null !== $disabled ) {
						if ( false !== strpos( $disabled, 'ZipArchive' ) ) {
							return false;
						}
					}
				}
			}
		}

		return class_exists( ZipArchive::class );
	}

	/**
	 * Check the backup archive.
	 *
	 * @return boolean
	 */
	public function check_backup_archive() {
		if ( false === $this->check_zip_module() ) {
			return false;
		}

		$archive = new Si_Model_Archive();
		$found   = $archive->get_snapshot();

		if ( $found ) {
			return true;
		}

		return false;
	}

	/**
	 * Check valid function
	 *
	 * @return bool
	 */
	public function check_backup_integrity() {
		$archive = new Si_Model_Archive();
		$found   = $archive->get_snapshot();

		if ( $found ) {
			return ( new Si_Helper_Zip( $found ) )->is_valid();
		}

		return false;
	}

	/**
	 * Get the timeout
	 *
	 * @return int
	 */
	public function get_timeout() {
		return (int) ini_get( 'max_execution_time' );
	}


	/**
	 * Check if this is a partial restore.
	 *
	 * @return mixed 'Invalid' when backup is invalid or Boolean when restore type is found.
	 */
	public function is_partial_restore() {
		if ( ! $this->check_backup_integrity() ) {
			return 'invalid';
		}

		$zip_archive = ( new Si_Helper_Zip( ( new Si_Model_Archive() )->get_snapshot() ) );
		return in_array( $zip_archive->get_backup_status(), [ 'files', 'database'], true );
	}

	/**
	 * Get partial restore type.
	 *
	 * @return string Restoration type.
	 */
	public function get_partial_restore_type() {
		$zip_archive = ( new Si_Helper_Zip( ( new Si_Model_Archive() )->get_snapshot() ) );
		return $zip_archive->get_backup_status();
	}

}



// Source: src/lib/Helper/class_si_helper_config.php


/**
 * Config helper class
 */
class Si_Helper_Config {

	/**
	 * Stores the Si_Helper_Filesystem instance.
	 *
	 * @var Si_Helper_Filesystem
	 */
	protected $fs = null;

	/**
	 * Stores the raw data
	 *
	 * @var string
	 */
	protected $raw = '';

	/**
	 * Stores the name of WordPress Configuration file.
	 *
	 * @var string
	 */
	protected $file = '';

	/**
	 * Stores the config file information.
	 *
	 * @var array
	 */
	protected $data = array();

	/**
	 * Si_Helper_Config constructor.
	 *
	 * Initializes the Filesystem class.
	 */
	public function __construct() {
		$fs       = new Si_Helper_Filesystem();
		$this->fs = $fs;

		$config_file = $this->get_config_file();
		$this->fs->set_path( $config_file );
	}

	/**
	 * Checks if the wp-config.php file exists along with 'snapshot-installer.php' file
	 *
	 * @return bool
	 */
	public function exists() {
		if ( isset( $this->file ) && '' !== $this->file ) {
			return $this->fs->exists( $this->file );
		}

		return false;
	}

	/**
	 * Gets the defaults so we have bare minimum we'll need to know defined
	 *
	 * @return array
	 */
	public function get_defaults() {
		return array(
			'DB_NAME'       => '',
			'DB_USER'       => '',
			'DB_PASSWORD'   => '',
			'DB_HOST'       => 'localhost',
			'DB_PORT'       => 3306,
			'DB_CHARSET'    => 'utf8',
			'DB_COLLATE'    => '',
			'$table_prefix' => 'wp_',
		);
	}

	/**
	 * Get the config file path
	 *
	 * @return string|false
	 */
	public function get_config_file() {
		$wp_config = SI_PATH_ROOT . '/wp-config.php';

		if (
			false !== $this->fs->exists( $wp_config ) &&
			true === $this->fs->readable( $wp_config )
		) {
			$this->file = $wp_config;

			return $wp_config;
		}

		return false;
	}

	/**
	 * Reads the config file
	 *
	 * @return Si_Helper_Config
	 */
	public function read() {
		$content = $this->fs->read( $this->file );

		if ( ! empty( $content ) ) {
			$this->raw = $content;
		}

		return $this;
	}

	/**
	 * Parses the contents of the 'wp-config.php' file.
	 *
	 * @return boolean
	 */
	public function parse() {
		$content = $this->raw;

		if ( empty( $content ) ) {
			return false;
		}

		$tokens = token_get_all( $content );

		$result    = array();
		$gathering = false;

		foreach ( $tokens as $token ) {
			if ( $gathering ) {
				if ( is_array( $token ) && ! empty( $token[0] ) && 'T_CONSTANT_ENCAPSED_STRING' === token_name( $token[0] ) ) { // Found a string.
					$tmp = isset( $token[1] ) ? $token[1] : false;

					if ( ! isset( $key ) ) {
						$key = trim( $tmp, "'\"" );
					} elseif ( ! isset( $value ) ) {
						$value = trim( $tmp, "'\"" );
					}

					if ( isset( $key ) && isset( $value ) ) {
						$result[ $key ] = $value;
					}
				}

				// End condition, we're not gathering anymore.
				if ( in_array( $token, array( ')', ';' ) ) ) {
					$gathering = false;
				}
			}

			// Restart the gathering cycle for defines.
			if ( ! $gathering && is_array( $token ) && ! empty( $token[0] ) && 'T_STRING' === token_name( $token[0] ) ) {
				$gathering = true;
				unset( $key );
				unset( $value );
			}

			// Restart the gathering cycle for variables.
			if ( ! $gathering && is_array( $token ) && ! empty( $token[0] ) && 'T_VARIABLE' === token_name( $token[0] ) ) {
				$gathering = true;
				$key       = ! empty( $token[1] ) ? $token[1] : false;

				if ( empty( $key ) ) {
					unset( $key );
				}
				unset( $value );
			}
		}

		if ( false !== strpos( $result['DB_HOST'], ':' ) ) {
			$hosts             = explode( ':', $result['DB_HOST'] );
			$result['DB_HOST'] = $hosts[0];
			$result['DB_PORT'] = $hosts[1];
		}

		$this->data = array_merge( $this->get_defaults(), $result );

		return ! empty( $this->data );
	}

	/**
	 * Returns the data
	 *
	 * @return array
	 */
	public function get_data() {
		return $this->data;
	}

	/**
	 * Update raw values in config file
	 *
	 * @param string $key Key to update.
	 * @param string $value New value to set.
	 *
	 * @return true
	 */
	public function update_raw( $key, $value ) {
		$pattern = strstr( $key, '$' )
			? preg_quote( $key, '/' ) . '\s*=\s*[\'"].*?[\'"];'
			: 'define\s*\(\s*[\'"]' . preg_quote( $key, '/' ) . '[\'"]\s*,\s*[\'"].*?[\'"]\s*\);';
		$value   = strstr( $key, '$' )
			? "{$key} = '{$value}';"
			: "define('{$key}', '{$value}');";

		$this->raw = preg_replace( "/{$pattern}/", $value, $this->raw );

		return true;
	}

	/**
	 * Get the RAW content.
	 *
	 * @return string
	 */
	public function get_raw_content() {
		return $this->raw;
	}

	/**
	 * Sets raw content
	 *
	 * @param mixed $content Content.
	 * @return void
	 */
	public function set_raw_content( $content ) {
		if ( ! empty( $content ) ) {
			$this->raw = $content;
		}
	}
}


// Source: src/lib/Helper/class_si_helper_debug.php


/**
 * Deals with all our debugging needs
 */
class Si_Helper_Debug {

	/**
	 * Formats the output variables
	 *
	 * @param mixed $args Args to export.
	 * @return string
	 */
	public static function inspect( $args ) {
		if ( is_array( $args ) && count( $args ) === 1 ) {
			$args = array_pop( $args );
		}

		return var_export( $args, 1 );
	}

	/**
	 * Outputs text-only
	 *
	 * @return void
	 */
	public static function text() {
		$args = 1 === func_num_args() ? func_get_arg( 0 ) : func_get_args();
		echo self::inspect( $args );
	}

	/**
	 * Outpusts text-only and dies
	 *
	 * @return void
	 */
	public static function textx() {
		$args = 1 === func_num_args() ? func_get_arg( 0 ) : func_get_args();
		self::text( $args );
		die;
	}

	/**
	 * Outpusts in html
	 *
	 * @return void
	 */
	public static function html() {
		$args = 1 === func_num_args() ? func_get_arg( 0 ) : func_get_args();
		echo '<pre>' . self::inspect( $args ) . '</pre>';
	}

	/**
	 * Outpusts in html and dies
	 *
	 * @return void
	 */
	public static function htmlx() {
		$args = 1 === func_num_args() ? func_get_arg( 0 ) : func_get_args();
		self::html( $args );
		die;
	}

	/**
	 * Logs the data
	 *
	 * @return void
	 */
	public static function log() {
		$args = 1 === func_num_args() ? func_get_arg( 0 ) : func_get_args();
		Si_Helper_Log::log( self::inspect( $args ) );
	}
}



// Source: src/lib/Helper/class_si_helper_error.php


/**
 * Defines our own error handler to handle the error.
 */
class Si_Helper_Error {

	/**
	 * Handle the error in our own way.
	 *
	 * @param int    $errno Error no.
	 * @param string $errstr Error string.
	 * @param string $errfile Error produced in file.
	 * @param string $errline Error produced on line.
	 *
	 * @return bool|void boolean or it may terminate the script execution with an exit status code.
	 */
	public function handle( $errno, $errstr, $errfile, $errline ) {
		if ( ! ( error_reporting() & $errno ) ) {
			// This error code is not included in error_reporting, so let it fall
			// through to the standard PHP error handler.
			return false;
		}

		// $errstr may need to be escaped:
		$errstr = htmlspecialchars( $errstr );

		switch ( $errno ) {
			case E_USER_ERROR:
				Si_Helper_Log::log( "[Error - {$errno}] {$errstr}" );
				echo "<b>My ERROR</b> [$errno] $errstr<br />\n";
				echo "  Fatal error on line $errline in file $errfile";
				echo ', PHP ' . PHP_VERSION . ' (' . PHP_OS . ")<br />\n";
				echo "Aborting...<br />\n";
				exit( 1 );

			case E_USER_WARNING:
				Si_Helper_Log::log( "[Error] {$errstr}" );
				session()->set( 'error_str', $errstr );
				echo "<b>WARNING</b> [$errno] $errstr<br />\n";
				// We're exiting when there is no space left on device and not on any other errors.
				if ( false !== stripos( $errstr, 'no space left on device' ) ) {
					exit( 1 );
				}
				break;

			case E_USER_NOTICE:
				Si_Helper_Log::log( "[Error] {$errstr}" );
				session()->set( 'error_str', $errstr );
				echo "<b>NOTICE</b> [$errno] $errstr<br />\n";
				if ( false !== stripos( $errstr, 'no space left on device' ) ) {
					exit( 1 );
				}
				break;

			default:
				Si_Helper_Log::log( "[Error {$errno}] {$errstr}" );
				echo "Unknown error type: [$errno] $errstr<br />\n";
				break;
		}

		// Prevents running through PHP's default error handler.
		return true;
	}
}



// Source: src/lib/Helper/class_si_helper_filesystem.php


/**
 * File_Not_Found_Exception class
 */
class File_Not_Found_Exception extends Exception {}

/**
 * File_Not_Readable_Exception class
 */
class File_Not_Readable_Exception extends Exception {}

/**
 * For individual file info
 */
class File_Info extends SplFileInfo {

	/**
	 * File_Info constructor calls SplFileInfo
	 *
	 * @param string $file File name.
	 */
	public function __construct( $file ) {
		parent::__construct( $file );
	}
}

/**
 * Filesystem Helper Class
 *
 * This class is responsible for the handling of all File system related tasks
 * such as listing directories, creating/opening files etc.
 */
class Si_Helper_Filesystem {

	/**
	 * Stores the current initialized path.
	 *
	 * @var string
	 */
	protected $path = '';

	/**
	 * Stores the content of the opened file.
	 *
	 * @var string
	 */
	protected $content = '';

	/**
	 * Si_Helper_Filesystem contructor.
	 */
	public function __construct() {
	}

	/**
	 * Set the path for the FileSystem
	 *
	 * @param string $path Path to initialize the FileSystem.
	 *
	 * @return void
	 */
	public function set_path( $path ) {
		$path       = realpath( $path );
		$path       = $this->normalize( $path );
		$this->path = $path;
	}

	/**
	 * Delete all files and sub directories in a given directory
	 *
	 * @param string $directory Directory to be removed.
	 * @return bool
	 */
	public function clean( $directory ) {
		$output = false;
		try {
			if ( ! is_dir( $directory ) || ! is_readable( $directory ) ) {
				throw new RuntimeException(
					sprintf(
						'Unable to read "%s" directory, maybe it does not exist or we don\'t have "read" permission on it.',
						$directory
					)
				);
			}

			$mode        = RecursiveIteratorIterator::CHILD_FIRST;
			$file_system = new RecursiveDirectoryIterator( $directory, FilesystemIterator::SKIP_DOTS );
			$iterator    = new RecursiveIteratorIterator( $file_system, $mode, RecursiveIteratorIterator::CATCH_GET_CHILD );
			if ( ! $iterator ) {
				throw new RuntimeException(
					sprintf(
						'Unable to list directory "%s".',
						$directory
					)
				);
			}

			foreach ( $iterator as $item ) {
				$item->isDir() && ! $item->isLink() ? @rmdir( $item->getPathname() ) : @unlink( $item->getPathname() );
			}
			$output = true;
		} catch ( RuntimeException $runtime_exception ) {
			Si_Helper_Log::log( 'FileSystem::clean :' . $runtime_exception->getMessage() );
		}

		return $output;
	}

	/**
	 * Recursively deletes files and directories from file system
	 *
	 * @param string $directory Directory.
	 * @param bool   $concat Concatenation flag.
	 * @return bool
	 */
	public function rmdir( $directory, $concat = false ) {
		if ( $concat ) {
			$directory = $this->concat( $directory );
		}

		if ( ! $this->clean( $directory ) ) {
			return false;
		}

		$files = scandir( $directory );
		if ( is_array( $files ) ) {
			$files = array_diff( $files, array( '..', '.' ) );
			if ( count( $files ) !== 0 ) {
				return $this->rmdir( $directory );
			}
		}

		return rmdir( $directory );
	}

	/**
	 * Normalize a file path.
	 *
	 * @param string $path File path.
	 * @return string
	 */
	public function normalize( $path ) {
		$path = str_replace( '\\', '/', $path );
		$path = preg_replace( '|(?<=.)/+|', '/', $path );
		if ( ':' === substr( $path, 1, 1 ) ) {
			$path = ucfirst( $path );
		}

		return $path;
	}

	/**
	 * Concatenates the path and the file
	 *
	 * @param string $file File path.
	 *
	 * @return string Complete file path.
	 */
	public function concat( $file ) {
		$file = $this->normalize( $file );
		$path = ( false !== strpos( $this->path, '/', -1 ) ) ? rtrim( $this->path, '/\\' ) : $this->path;
		$file = ( false !== strpos( $file, '/', 0 ) ) ? ltrim( $file, '/' ) : $file;

		return "{$path}/{$file}";
	}

	/**
	 * Check if the file exists.
	 *
	 * @param string $path Complete path.
	 *
	 * @return boolean
	 */
	public function exists( $path ) {
		return @file_exists( $path );
	}

	/**
	 * Gets the list of Matched files/directories
	 *
	 * @param string $pattern End path name.
	 * @return string|false Matched files/directories on success or False on failure
	 */
	public function exists_regex( $pattern ) {
		$path  = $this->concat( $pattern );
		$files = glob( $path, GLOB_NOSORT );

		return ! empty( $files ) && is_array( $files ) ? reset( $files ) : false;
	}

	/**
	 * Checks if the passed file is readable.
	 *
	 * @param string $file_path File path.
	 * @return boolean
	 */
	public function readable( $file_path ) {
		return is_readable( $file_path );
	}

	/**
	 * Lists down the file and folders in this directory.
	 *
	 * @param string|null $path  [optional] A directory filepath. Default to null.
	 * @param string      $exclude   [optional] Exclude file by extension. Default to empty string.
	 * @param int         $depth     [optional] A directory filepath -1|0|1... -1 to recurse through all the directories. Defalut to -1.
	 *
	 * @return array
	 *
	 * @throws UnexpectedValueException When path not existing.
	 */
	public function lists( $path = null, $exclude = '', $depth = -1 ) {
		if ( null === $path ) {
			$path = $this->path;
		}

		$files = new RecursiveDirectoryIterator( $path );
		$files->setFlags( RecursiveDirectoryIterator::SKIP_DOTS );

		$iterator = new RecursiveIteratorIterator( $files, RecursiveIteratorIterator::SELF_FIRST );
		$iterator->setMaxDepth( $depth );
		$r = array();

		foreach ( $iterator as $file ) {
			if ( true === $file->isFile() ) {
				if ( '' !== $exclude && $exclude === $file->getExtension() ) {
					continue;
				}
				$r[] = $file->getPathname();
			}
		}

		return $r;
	}

	/**
	 * Makes a directory
	 *
	 * @param string $dir Directory to be created.
	 * @param int    $perm Permissions.
	 * @param bool   $recursive [optional] Allows creation of nested directories. Default to true.
	 * @return string|false
	 */
	public function mkdir( $dir, $perm = 0755, $recursive = true ) {
		$path = $this->concat( $dir );

		if ( is_file( $path ) ) {
			$path = dirname( $path );
		}

		$created = false;
		if ( ! $this->exists( $path ) ) {
			$created = @mkdir( $path, $perm, $recursive );
		} else {
			return $path;
		}

		if ( $created ) {
			return $path;
		}

		return false;
	}

	/**
	 * Look for a file.
	 *
	 * @param string $file File to seek for.
	 * @param bool   $concat [optional] Path concatenation flag. Defalut to false.
	 * @return File_Info
	 *
	 * @throws File_Not_Found_Exception If file not found.
	 * @throws File_Not_Readable_Exception If file not readable.
	 */
	public function seek( $file, $concat = false ) {
		if ( $concat ) {
			$file = $this->concat( $file );
		}

		if ( ! $this->exists( $file ) ) {
			throw new File_Not_Found_Exception( "File: {$file} was not found!", 404 );
		}

		if ( ! $this->readable( $file ) ) {
			throw new File_Not_Readable_Exception( "File: {$file} is not readable", 401 );
		}

		return new File_Info( $file );
	}

	/**
	 * Returns the size from bytes into human readable format
	 *
	 * @param double  $bytes Bytes.
	 * @param integer $precision Precision digits.
	 *
	 * @return string Data in human readable format.
	 */
	public function get_formatted_size( $bytes, $precision = 2 ) {
		$units = array( 'B', 'KB', 'MB', 'GB', 'TB' );

		$bytes = max( $bytes, 0 );
		$pow   = floor( ( $bytes ? log( $bytes ) : 0 ) / log( 1024 ) );
		$pow   = min( $pow, count( $units ) - 1 );

		$bytes /= pow( 1024, $pow );

		return round( $bytes, $precision ) . ' ' . $units[ $pow ];
	}

	/**
	 * Reads the content of a file.
	 *
	 * @param string|null $file Full file path.
	 * @param bool        $concat [optional] Path concatenation flag. Defalut to false.
	 *
	 * @return string|false
	 */
	public function read( $file, $concat = false ) {
		if ( $concat ) {
			$file = $this->concat( $file );
		}

		$content = file_get_contents( $file );

		if ( ! empty( $content ) ) {
			$this->content = $content;

			return $content;
		}

		return false;
	}

	/**
	 * Get the root directory.
	 *
	 * @return string
	 */
	public function get_root_path(): string {
		return defined( 'SI_PATH_ROOT' ) ? SI_PATH_ROOT : getcwd();
	}

	/**
	 * Renames the file from old to new
	 *
	 * @param mixed $oldname Complete path of file to be renamed.
	 * @param mixed $newname New path of file.
	 *
	 * @return bool
	 */
	public function rename( string $oldname, string $newname ): bool {
		return @rename( $oldname, $newname );
	}

	/**
	 * Moves file from the given source to the directory root.
	 *
	 * @param string $source Complete file path including the file.
	 *
	 * @return boolean
	 */
	public function move( $source ) {
		$root = $this->get_root_path();
		$file = null;

		$source = $this->normalize( $source );
		$root   = $this->normalize( $root );

		if ( false !== $pos = strrpos( $source, 'www/' ) ) {
			$file = substr( $source, $pos + 4 );
		}

		try {
			$info = $this->seek( $source );
		} catch ( File_Not_Found_Exception $e ) {
			Si_Helper_Log::log( "[[Unzip - Move]] Could not find the file {$file}" );
		} catch ( File_Not_Readable_Exception $e ) {
			Si_Helper_Log::log( "[[Unzip - Move]] File not readable {$file}" );
		} catch ( Exception $e ) {
			Si_Helper_Log::log( "[[Unzip - Move]] Unknown error {$file}" );
		}

		$moved = false;
		if ( null !== $file ) {
			$destination = $root . '/' . $file;

			if ( ! file_exists( $destination ) && ! $info->isLink() ) {
				$dir = dirname( $destination );
				if ( ! file_exists( $dir ) ) {
					if ( false === @mkdir( $dir, 0755, true ) ) {
						$message = "[error] [Unzip - Move] Error creating {$dir}";
						Si_Helper_Log::log( $message );
					}
				}
			}

			if ( false === @rename( $source, $destination ) ) {
				// Try copying the file from source to destination.
				if ( false === @copy( $source, $destination ) ) {
					$message = "[error] [Unzip - Move] Error moving from {$source} to {$destination}";
					Si_Helper_Log::log( $message );
					$moved = false;
				} else {
					$this->clean( $source );
					$moved = true;
				}
			} else {
				$moved = true;
			}
		}

		return $moved;
	}

	/**
	 * Gets all the zips from the passed source
	 *
	 * @param string|null $path Complete path.
	 * @return array|false
	 */
	public function get_all_zips( $path = null ) {
		if ( null === $path ) {
			$path = SI_PATH_ROOT;
		}

		$pattern = "{$path}/*.zip";
		$files   = glob( $pattern );

		return is_array( $files ) ? $files : false;
	}

	/**
	 * Search the directory recursively.
	 *
	 * @param string      $pattern Regular expression.
	 * @param string|null $path    Root path of the directory to search for.
	 * @param int         $depth  [optional] A directory filepath -1|0|1... -1 to recurse through all the directories. Defalut to -1.
	 *
	 * @return array
	 */
	public function recursive_search( $pattern, $path = null, $depth = -1 ) {
		$path = ( null === $path ) ? $this->path : $path;

		$dir = new RecursiveDirectoryIterator( $path );
		$ite = new RecursiveIteratorIterator( $dir );
		$ite->setMaxDepth( $depth );
		$files = new RegexIterator( $ite, $pattern, RegexIterator::GET_MATCH );

		$file_list = array();

		foreach ( $files as $file ) {
			$file_list = array_merge( $file_list, $file );
		}

		return array_reverse( $file_list );
	}

	/**
	 * Update the content
	 *
	 * @param string $file File Path.
	 * @param string $content Content to put.
	 * @return bool
	 */
	public function put( $file, $content ) {
		if ( file_exists( $file ) ) {
			$len = file_put_contents( $file, $content );

			if ( $len ) {
				return true;
			}

			return false;
		}

		return false;
	}

	/**
	 * Get the temp working directory.
	 *
	 * @return string Complete path to the temp working directory.
	 */
	public function get_temp_dir() {
		if ( '' === $this->path ) {
			$path = SI_PATH_ROOT;
		}

		return $path . '/' . SI_TEMP_DIR;
	}
}



// Source: src/lib/Helper/class_si_helper_log.php


/**
 * Deals with output logging
 */
class Si_Helper_Log {

	const FILENAME = 'snapshot-installer.txt';

	/**
	 * Put log data
	 *
	 * @param mixed $msg Message to log.
	 * @return bool
	 */
	public static function log( $msg ) {
		$env  = new Si_Model_Env();
		$file = SI_PATH_ROOT . '/' . self::FILENAME;
		$date = date( 'Y-m-d H:i:s' );

		return error_log( "[{$date}] {$msg}\n", 3, $file );
	}

	/**
	 * Get the snapshot installer log file.
	 *
	 * @return string
	 */
	public static function get_file() {
		$path  = SI_PATH_ROOT;
		$path .= '/' . self::FILENAME;

		return $path;
	}

	/**
	 * Get the URL of the log file.
	 *
	 * @return string
	 */
	public static function get_log_url() {
		$url  = app()->get_url();
		$url .= '/' . self::FILENAME;

		return $url;
	}
}



// Source: src/lib/Helper/class_si_helper_sanitize.php


/**
 * Sanitization Helper
 */
class Si_Helper_Sanitize {

	/**
	 * Sanitize the given value to be URL.
	 *
	 * @param string $url URL string.
	 * @return mixed Sanitized url or false.
	 */
	public static function url( $url ) {
		return filter_var( $url, FILTER_SANITIZE_URL );
	}

	/**
	 * Sanitize the given string.
	 *
	 * @param string $string_val String for sanitization.
	 * @return string Sanitized string.
	 */
	public static function string( $string_val ) {
		return htmlspecialchars( strip_tags( $string_val ) );
	}

	/**
	 * Sanitize the integer.
	 *
	 * @param int $int_val Integer for sanitization.
	 * @return mixed Sanitized integer or false.
	 */
	public static function int( $int_val ) {
		return filter_var( $int_val, FILTER_SANITIZE_NUMBER_INT );
	}
}



// Source: src/lib/Helper/class_si_helper_session.php


/**
 * Session helper
 */
class Si_Helper_Session {

	/**
	 * Stores the instance.
	 *
	 * @var Si_Helper_Session|null
	 */
	protected static $instance = null;

	/**
	 * Stores the session data.
	 *
	 * @var array|null
	 */
	protected $data = null;

	/**
	 * Starts the session.
	 */
	public function __construct() {
		if ( ! session_id() ) {
			session_start();
		}
	}

	/**
	 * Creates the instance if not already created.
	 *
	 * @return Si_Helper_Session
	 */
	public static function instance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	/**
	 * Set the data and write it to the session.
	 *
	 * @param string $key Key for session.
	 * @param mixed  $value Value for session.
	 *
	 * @return void
	 */
	public function set( $key, $value ) {
		$data = $this->all();
		if ( isset( $data[ $key ] ) ) {
			$data[ $key ] = $value;
		} else {
			$data[ $key ] = $value;
		}
		$this->data = $data;
		$this->write();
	}

	/**
	 * Get the value by key
	 *
	 * @param string $key Session key.
	 * @return mixed
	 */
	public function get( $key ) {
		if ( isset( $this->data[ $key ] ) ) {
			$value = $this->data[ $key ];
		} else {
			$session = ( isset( $_SESSION['installer'] ) ) ? $_SESSION['installer'] : array();
			$value   = ( isset( $session[ $key ] ) ) ? $session[ $key ] : false;
		}

		return $value;
	}

	/**
	 * Get all the data stored in the session.
	 *
	 * @return array
	 */
	public function all() {
		$data = ( isset( $_SESSION['installer'] ) ) ? $_SESSION['installer'] : array();

		return $data;
	}

	/**
	 * Checks if current session has the data.
	 *
	 * @param string $key Name of the key.
	 *
	 * @return bool
	 */
	public function has( $key ) {
		$data = $this->all();
		return is_array( $data ) && array_key_exists( $key, $data );
	}

	/**
	 * Removes a value from session by Key.
	 *
	 * @param string $name Session key.
	 * @return void
	 */
	public function unset( $name ) {
		if ( isset( $this->data[ $name ] ) ) {
			unset( $this->data[ $name ] );
			$this->write();
		} else {
			$session = $_SESSION;
			if ( isset( $session[ $name ] ) ) {
				unset( $_SESSION[ $name ] );
			} elseif ( isset( $session['installer'][ $name ] ) ) {
				unset( $_SESSION['installer'][ $name ] );
			}
		}
	}

	/**
	 * Destroys all the session data.
	 *
	 * @return void
	 */
	public function destroy() {
		session_destroy();
	}

	/**
	 * Writes the data to the session.
	 *
	 * @return void
	 */
	public function write() {
		$_SESSION['installer'] = $this->data;
	}
}



// Source: src/lib/Helper/class_si_helper_sql.php


/**
 * This class is responsible for parsing the SQL file.
 */
class Si_Helper_Sql {

	/**
	 * Max allowed length.
	 * Size is set to 2MB
	 *
	 * @var int
	 */
	protected $max = 2097152;

	/**
	 * Stores the old database prefix.
	 *
	 * @var string
	 */
	protected $prefix = '';

	/**
	 * Stores the length.
	 *
	 * @var integer
	 */
	protected $length = 0;

	/**
	 * Current position.
	 *
	 * @var integer
	 */
	protected $position = 0;

	/**
	 * Stores file object.
	 *
	 * @var SplFileObject|null
	 */
	protected $file = null;

	/**
	 * Stores the query to perform multi_query
	 *
	 * @var string
	 */
	protected $query = '';

	/**
	 * Snapshot SQL Helper Constructor.
	 *
	 * @param string $file Complete path of the file.
	 */
	public function __construct( $file ) {
		if ( ! empty( $file ) ) {
			$this->file = new SplFileObject( $file, 'r' );
		} else {
			trigger_error( 'Cannot create the instance for SQL Helper!', E_USER_ERROR );
		}
	}

	/**
	 * Return the stat of the current file.
	 *
	 * @return array
	 */
	public function stat() {
		return array_slice( $this->file->fstat(), 13 );
	}

	/**
	 * Get total length stored
	 *
	 * @return int
	 */
	public function get_length() {
		return $this->length;
	}

	/**
	 * Get maximum length
	 *
	 * @return int
	 */
	public function get_max_length() {
		return $this->max;
	}

	/**
	 * Get current position
	 *
	 * @return int
	 */
	public function get_current_position() {
		return $this->position;
	}

	/**
	 * Read the sql file from certain position by bytes and
	 * collects the bunch of sql statements by the max size
	 * defined in the "$max" property.
	 *
	 * Since we're using the stream the memory shouldn't be a problem
	 * for us.
	 *
	 * @param integer $cursor Position in byte and not line.
	 *
	 * @return array
	 */
	public function seek( $cursor = 0 ) {
		if ( version_compare( PHP_VERSION, 8.1, '<' ) ) {
			ini_set( 'auto_detect_line_endings', true );
		}

		if ( $cursor > 0 ) {
			$this->file->fseek( $cursor );
			$this->length   = 0;
			$this->position = $cursor;
		}
		$this->query = '';

		// Move the cursor to the position.
		$response = array();

		$is_view   = false;
		$force_end = false;
		$tbl_name  = '';
		while ( ! $this->file->eof() ) {
			$line = $this->file->fgets();

			// Calculate the line at the beginning since we'll be escaping comments and blank lines.
			$this->length  += strlen( $line );
			$this->position = $this->length;

			// Skip comments and empty line.
			if (
				'--' === substr( $line, 0, 2 ) ||
				'#' === substr( $line, 0, 1 ) ||
				'/*' === substr( $line, 0, 2 )
				) {
				// check for view.
				if ( false !== strpos( $line, '# Snapshot view export', 0 ) ) {
					$is_view = true;
					break;
				}
				continue;
			}

			if ( false !== strpos( $line, 'Snapshot table export', 0 ) ) {
				continue;
			}

			$line = trim( $line );

			/**
			 * Parse table for logging.
			 */
			$data = session()->get( 'database' );
			if ( 'CREATE TABLE' === substr( $line, 0, 12 ) ||
				'DROP TABLE' === substr( $line, 0, 10 ) ||
				'INSERT INTO' === substr( $line, 0, 11 ) ) {
				if ( preg_match( '/(?:\`)([a-zA-z0-9_]{2,})(?:\`)/', $line, $matches ) ) {
					$old_table = ( isset( $matches[1] ) ) ? $matches[1] : '';

					$table = $old_table;

					if ( false !== strpos( $table, '_defender_', 0 ) ) {
						// Todo: we will add the support of Defender tables in future releases.
						$tbl_name  = $table;
						$force_end = true;
						break;
					}

					// new table prefix is changed from the old one.
					if ( $this->prefix !== $data['$table_prefix'] ) {
						if ( $old_table ) {
							$table = str_replace( $this->prefix, $data['$table_prefix'], $old_table );
						}
						$line = str_replace( $old_table, $table, $line );

						if ( 'INSERT INTO' === substr( $line, 0, 11 ) ) {
							// @todo to test and remove this block as overcomed in applying settings.
							$options  = $data['$table_prefix'] . 'options';
							$usermeta = $data['$table_prefix'] . 'usermeta';

							if ( $table === $options ) {
								$find    = $this->prefix . 'user_roles';
								$replace = $data['$table_prefix'] . 'user_roles';

								if ( false !== strrpos( $line, 'user_roles' ) ) {
									$line = str_replace( $find, $replace, $line );
								}
							}

							if ( $table === $usermeta ) {
								$capability_field       = $this->prefix . 'capabilities';
								$capability_replacement = $data['$table_prefix'] . 'capabilities';
								$user_level_field       = $this->prefix . 'user_level';
								$user_level_replacement = $data['$table_prefix'] . 'user_level';
								$dashboard_field        = $this->prefix . 'dashboard_quick_press_last_post_id';
								$dashboard_replacement  = $data['$table_prefix'] . 'dashboard_quick_press_last_post_id';

								if ( false !== strrpos( $line, 'capabilities' ) ) {
									$line = str_replace( $capability_field, $capability_replacement, $line );
								}

								if ( false !== strrpos( $line, 'user_level' ) ) {
									$line = str_replace( $user_level_field, $user_level_replacement, $line );
								}

								if ( false !== strrpos( $line, 'dashboard_quick_press_last_post_id' ) ) {
									$line = str_replace( $dashboard_field, $dashboard_replacement, $line );
								}
							}
						}
					}

					if ( 'INSERT INTO' === substr( $line, 0, 11 ) ) {
						$line = str_replace( 'INSERT INTO', 'INSERT IGNORE INTO', $line );
					}

					$msg = '';
					if ( 'CREATE TABLE' === substr( $line, 0, 12 ) ) {
						$msg = "[Query] Creating table: {$table}";
					}

					if ( 'DROP TABLE' === substr( $line, 0, 10 ) ) {
						$msg   = "[Query] Dropping old table: {$old_table}" . PHP_EOL;
						$msg  .= "[Query] Dropping table: {$table}" . PHP_EOL;
						$line .= PHP_EOL . 'DROP TABLE IF EXISTS ' . $old_table . ';';
					}

					if ( '' !== $msg ) {
						Si_Helper_Log::log( $msg );
					}
				}
			}

			if ( 'CONSTRAINT' === substr( $line, 0, 10 ) ) {
				$line = str_replace( $this->prefix, $data['$table_prefix'], $line );
			}

			$this->query .= $line;

			// We're at the end of the sql statement.
			if ( ';' === substr( $line, -1, 1 ) ) {
				$this->position = $this->file->ftell();
				if ( $this->length >= $this->max ) {
					$response['length'] = $this->length;
					break;
				}
			}
		}

		if ( $this->file->eof() ) {
			$response['end'] = true;
		}

		if ( $force_end ) {
			$response['query'] = '';
			$response['end']   = true;
		}

		$response['cursor'] = $this->position;
		$response['query']  = $this->query;
		$response['prefix'] = $this->prefix;

		if ( $is_view ) {
			$response['query']   = '';
			$response['end']     = true;
			$response['is_view'] = true;
		}

		return $response;
	}

	/**
	 * Set the database prefix.
	 *
	 * @param string $prefix Prefix to set.
	 * @return void
	 */
	public function set_prefix( $prefix ) {
		$this->prefix = $prefix;
	}
}



// Source: src/lib/Helper/class_si_helper_validator.php


/**
 * Helper class to validate.
 */
class Si_Helper_Validator {

	/**
	 * String Validator.
	 *
	 * @param mixed $value to check.
	 * @return boolean
	 */
	public static function is_string( $value ) {
		return is_string( $value );
	}

	/**
	 * Integer validation.
	 *
	 * @param mixed $value to check.
	 * @return mixed Filtered data or false
	 */
	public static function is_int( $value ) {
		return filter_var( $value, FILTER_VALIDATE_INT );
	}

	/**
	 * Url validation.
	 *
	 * @param mixed $value to check.
	 * @return mixed Filtered data or null
	 */
	public static function is_url( $value ) {
		return filter_var( $value, FILTER_VALIDATE_URL, array( 'flags' => FILTER_FLAG_PATH_REQUIRED | FILTER_FLAG_QUERY_REQUIRED | FILTER_NULL_ON_FAILURE ) );
	}

	/**
	 * IP Validation.
	 *
	 * @param mixed $value to chek.
	 * @return mixed Filtered data or false
	 */
	public static function is_ip( $value ) {
		return filter_var( $value, FILTER_VALIDATE_IP );
	}

	/**
	 * Check if the passed value is 'localhost'.
	 *
	 * @param mixed $value to check.
	 * @return boolean
	 */
	public static function is_localhost( $value ) {
		return 'localhost' === $value;
	}

	/**
	 * Validates the host.
	 *
	 * @param string $host to check.
	 * @return boolean
	 */
	public static function is_hostname( $host ) {
		return false !== filter_var( $host, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME );
	}
}



// Source: src/lib/Helper/class_si_helper_zip.php


/**
 * Zip Helpher
 */
class Si_Helper_Zip {

	/**
	 * Stores the zip error.
	 *
	 * @var array
	 */
	protected $errors = array(
		ZipArchive::ER_EXISTS => 'File already exists.',
		ZipArchive::ER_INCONS => 'Zip archive inconsistent.',
		ZipArchive::ER_INVAL  => 'Invalid argument.',
		ZipArchive::ER_MEMORY => 'Malloc failure.',
		ZipArchive::ER_NOENT  => 'No such file.',
		ZipArchive::ER_NOZIP  => 'Not a zip archive.',
		ZipArchive::ER_OPEN   => "Can't open file.",
		ZipArchive::ER_READ   => 'Read error.',
		ZipArchive::ER_SEEK   => 'Seek error.',
	);

	/**
	 * Stores the error triggered during the opening of zip.
	 *
	 * @var string
	 */
	protected $error = '';

	/**
	 * Stores the ZipArchive instance.
	 *
	 * @var \ZipArchive|null
	 */
	protected $zip_archive = null;

	/**
	 * Stores the complete archive path.
	 *
	 * @var string
	 */
	protected $zip_file = '';

	/**
	 * Stores the zip open handle
	 *
	 * @var mixed
	 */
	protected $handle = null;

	/**
	 * Si_Helper_Zip constructor.
	 *
	 * @param string $zip_file Complete archive path.
	 */
	public function __construct( $zip_file ) {
		if ( class_exists( ZipArchive::class ) ) {
			$this->zip_archive = new ZipArchive();
		}

		$this->zip_file = $zip_file;
	}

	/**
	 * Validates the archive.
	 *
	 * @return boolean
	 */
	public function is_valid() {
		if ( null === $this->zip_archive ) {
			return false;
		}

		$status = false;
		$opened = $this->open( $this->zip_file );

		if ( true === $opened ) {
			$status = true;
			$this->close();
		} else {
			$this->error = $opened['error'];
		}

		return $status;
	}

	/**
	 * Get the status of the zip file.
	 *
	 * @return array
	 */
	public function get_status() {
		$handle = $this->open();

		$response = array();

		if ( true === $handle ) {
			// Prepare the response.
			if ( method_exists( ZipArchive::class, 'count' ) ) {
				$count = $this->zip_archive->count();
			} else {
				$count = $this->zip_archive->numFiles;
			}
			$iterations = ceil( $count / 1000 );

			$backup_file = $this->zip_file;

			$response['backup_file'] = $backup_file;
			$response['total_files'] = $count;
			$response['iterations']  = $iterations;

			$log = "[Backup - Archive] File: {$backup_file} Total files: {$count}";
			Si_Helper_Log::log( $log );

			$this->close();
		} else {
			$response['error'] = $this->errors[ $handle ];
		}

		return $response;
	}

	/**
	 * Opens the zip archive
	 *
	 * @param string|null $file File path.
	 * @return true|array
	 */
	private function open( $file = null ) {
		if ( '' === $this->zip_file && ! is_null( $file ) ) {
			$this->zip_file = $file;
		}

		$handle = $this->zip_archive->open( $this->zip_file, 16 );

		$response = array();
		if ( true !== $handle ) {
			$response['status'] = 'error';
			if ( in_array( $handle, array_keys( $this->errors ) ) ) {
				$response['error']   = $handle;
				$response['message'] = $this->errors[ $handle ];
			} else {
				$response['error']   = 'unknown_error';
				$response['message'] = 'Unknown error';
			}
			$this->error = $response['error'];

			return $response;
		}

		return true;
	}

	/**
	 * Closes the zip archive
	 *
	 * @return void
	 */
	private function close() {
		$this->zip_archive->close();
	}

	/**
	 * Get certain number of files
	 *
	 * @param int $index Index.
	 * @param int $chunk_break Chunk break.
	 * @return array
	 */
	public function files( $index, $chunk_break = 1000 ) {
		$files = array();

		if ( 0 === $index ) {
			$start_pos = 0;
		} else {
			$start_pos = $index * $chunk_break;
		}

		$end_pos = $start_pos + $chunk_break;
		$log     = "[Unzip] Unzipping files from {$start_pos} to {$end_pos}";
		Si_Helper_Log::log( $log );

		if ( true === $this->open() ) {
			for ( $i = $start_pos; $i <= $end_pos; $i++ ) {
				$stat = $this->zip_archive->statIndex( $i );

				if ( is_array( $stat ) && ! empty( $stat ) ) {
					array_push( $files, $stat['name'] );
				}
			}
			$this->close();
		}

		return $files;
	}

	/**
	 * Extract specific files from the destination.
	 *
	 * @param string $destination Complete path.
	 * @param array  $files       List of files to extract to the destination.
	 *
	 * @return boolean
	 */
	public function extract( $destination, $files ) {
		if ( empty( $files ) ) {
			return false;
		}

		if ( true === $this->open() ) {
			$extracted = $this->zip_archive->extractTo( $destination, $files );
			$this->close();

			return $extracted;
		}

		return false;
	}

	/**
	 * Get the backup export type.
	 *
	 * @return string
	 */
	public function get_backup_status(): string {
		if ( true !== $this->open() ) {
			return 'invalid';
		}

		$manifest_content = $this->zip_archive->getFromName( 'manifest.json' );
		$this->close();

		if ( ! $manifest_content ) {
			return 'full_backup';
		}

		return is_string( $manifest_content ) ? json_decode( $manifest_content, true )['export_type'] : 'full_backup';
	}
}



// Source: src/lib/Model/class_si_model_archive.php


/**
 * Archive model
 */
class Si_Model_Archive extends Si_Model {

	/**
	 * Get the Snapshot backup archive patterns
	 *
	 * 1st Pattern: example-test7.tempurl.host_20240320_0427_683953cb410d.zip (Snapshot V4 - New name)
	 * 2nd Pattern: a1b2c3d4e5f6.zip             (Snapshot v4 - Old name)
	 * 3rd Pattern: full_anyname.zip             (Snapshot v3)
	 *
	 * @return array
	 */
	public function get_archive_patterns() {
		return array(
			'/[a-zA-Z0-9-]+\_[0-9]{8}\_[0-9]{4}\_[a-f0-9]{12}\.zip$/',
			'/(?:[^_])([a-f0-9]{12}\.zip$)/',
			'/(full\_.{2,}\.zip$)/',
		);
	}

	/**
	 * Get all the snapshots.
	 *
	 * @return array
	 */
	public function get_snapshots() {
		$filesystem = new Si_Helper_Filesystem();
		$path       = $filesystem->normalize( SI_PATH_ROOT );
		$snapshots  = $filesystem->recursive_search( '/.*\\.zip/', $path, 0 );

		return $snapshots;
	}

	/**
	 * Get the latest version Snapshot archive if multiple sources are found.
	 *
	 * @return string Complete path of snapshot archive.
	 */
	public function get_snapshot() {
		$snapshots = $this->get_snapshots();

		$found = false;
		if ( count( $snapshots ) > 1 ) {
			$found_snaps = array();

			// Multiple sources found test against the patterns.
			$patterns = $this->get_archive_patterns();
			foreach ( $snapshots as $snapshot ) {
				// Test for Snapshot v4 latest backup name.
				if ( preg_match( $patterns[0], $snapshot ) ) {
					$found_snaps[0][] = $snapshot;
				}

				// Test for Snapshot v4 older backup name.
				if ( preg_match( $patterns[1], $snapshot ) ) {
					$found_snaps[1][] = $snapshot;
				}

				// Test for Snapshot v3 backup name.
				if ( preg_match( $patterns[2], $snapshot ) ) {
					$found_snaps[2][] = $snapshot;
				}
			}
			if ( ! empty( $found_snaps ) ) {
				$i = 0;
				while ( $i < 3 ) {
					if ( ! empty( $found_snaps[ $i ] ) ) {
						$found = array_pop( $found_snaps[ $i ] );
						break;
					}
					++$i;
				}
			}
		} elseif ( count( $snapshots ) === 1 ) {
				$found = $snapshots[0];
		}

		return $found;
	}
}



// Source: src/lib/Model/class_si_model_env.php


/**
 * Env model
 */
class Si_Model_Env extends Si_Model {

	const TEMP_DIR   = 'TEMP_DIR';
	const PATH_ROOT  = 'PATH_ROOT';
	const ARCHIVE    = 'ARCHIVE';
	const TARGET     = 'TARGET';
	const TARGET_URL = 'TARGET_URL';

	/**
	 * Overrides.
	 *
	 * @var array
	 */
	private $_overrides = array();
	/**
	 * Overrriding flag.
	 *
	 * @var boolean
	 */
	private $_can_override = false;

	/**
	 * Starts the session
	 */
	public function __construct() {
		if ( ! session_id() ) {
			if ( @session_start() ) {
				$_SESSION['si_overrides'] = ! empty( $_SESSION['si_overrides'] ) && is_array( $_SESSION['si_overrides'] )
					? $_SESSION['si_overrides']
					: array();
				$this->_overrides         = $_SESSION['si_overrides'];
				$this->_can_override      = true;
			}
		}
	}

	/**
	 * Check if we can offer data overrides
	 *
	 * @return bool
	 */
	public function can_override() {
		return ! ! $this->_can_override;
	}

	/**
	 * Checks if we have any overrides
	 *
	 * @return bool
	 */
	public function has_overrides() {
		if ( ! $this->can_override() ) {
			return false;
		}

		return ! empty( $this->_overrides ) && ! empty( $_SESSION['si_overrides'] );
	}

	/**
	 * Option getter
	 *
	 * @param string $what Value key to get.
	 * @param mixed  $fallback Optional fallback.
	 *
	 * @return mixed Value or fallback
	 */
	public function get( $what, $fallback = false ) {
		$define = 'SI_' . strtoupper( $what );
		$method = 'get_' . strtolower( $what );

		if ( method_exists( $this, $method ) ) {
			return call_user_func( array( $this, $method ) );
		}

		if ( isset( $this->_overrides[ $what ] ) ) {
			return $this->_overrides[ $what ];
		}
		if ( defined( $define ) ) {
			return constant( $define );
		}

		return $fallback;
	}

	/**
	 * Sets override value
	 *
	 * @param string $what Value key to set.
	 * @param mixed  $value Value to set.
	 *
	 * @return bool
	 */
	public function set( $what, $value ) {
		if ( ! $this->can_override() ) {
			return false;
		}

		$this->_overrides[ $what ]         = $value;
		$_SESSION['si_overrides'][ $what ] = $value;

		return true;
	}

	/**
	 * Clears an override value
	 *
	 * @param string $what Value key to unset.
	 *
	 * @return bool
	 */
	public function drop( $what ) {
		if ( ! $this->can_override() ) {
			return false;
		}

		unset( $this->_overrides[ $what ] );
		if ( array_key_exists( $what, $this->_overrides ) ) {
			return false;
		}

		unset( $_SESSION['si_overrides'][ $what ] );
		if ( array_key_exists( $what, $_SESSION['si_overrides'] ) ) {
			return false;
		}

		return true;
	}
}



// Source: src/lib/Requests/class_si_requests_ajax.php


/**
 * Handles the AJAX requests.
 */
class Si_Requests_Ajax {

	/**
	 * List of all AJAX actions.
	 *
	 * @var array
	 */
	protected $actions = array(
		'change_screen',
		'analyze',
		'analyze_single',
		'check_config',
		'database',
		'deploy',
		'cleanup',
		'log',
		'restart',
	);

	/**
	 * List of all the screens.
	 *
	 * @var array
	 */
	protected $screens = array(
		'welcome',
		'requirements',
		'warning_files',
		'warning_database',
		'database',
		'deployment',
		'cleanup',
		'thankyou',
	);

	/**
	 * Error flag.
	 *
	 * @var boolean
	 */
	protected $is_error = false;

	/**
	 * Current AJAX action.
	 *
	 * @var string
	 */
	protected $action = '';

	/**
	 * Response.
	 *
	 * @var Si_Response
	 */
	protected $response;

	/**
	 * Si_Requests_Ajax constructor.
	 */
	public function __construct() {
		$this->response = new Si_Response();
	}

	/**
	 * Get all the AJAX actions.
	 *
	 * @return array
	 */
	public function actions() {
		return $this->actions;
	}

	/**
	 * Sets the current AJAX action.
	 *
	 * @param string $action Action to set.
	 *
	 * @return void
	 */
	public function set_action( $action = 'change_screen' ) {
		$this->action = $action;
	}

	/**
	 * AJAX request failed
	 *
	 * @return boolean
	 */
	public function has_error() {
		return $this->is_error;
	}

	/**
	 * Make the AJAX request
	 *
	 * @param Si_Request $request Requst instance.
	 *
	 * @return void
	 */
	public function request( $request ) {
		if ( ! method_exists( $this, $this->action ) ) {
			$this->is_error = true;
			die( "'{$this->action}' function is not available." );
		}

		$data = call_user_func( array( $this, $this->action ), $request->requests() );

		$response = array(
			'data' => $data,
		);

		if ( true === $this->has_error() ) {
			$response['status'] = 'error';
		} else {
			$response['status'] = 'success';
		}

		$this->response->set( $response );

		die( $this->response->to_json() );
	}

	/**
	 * Set the error flag
	 *
	 * @param boolean $error Error flag.
	 *
	 * @return void
	 */
	public function set_error( $error = false ) {
		$this->is_error = $error;
	}

	/**
	 * AJAX Handler:: change_screen
	 *
	 * @param array $request Request details.
	 *
	 * @return array
	 */
	public function change_screen( $request ) {
		if ( ! isset( $request['screen'] ) || empty( $request['screen'] ) ) {
			$this->set_error( true );
			return array(
				'error'   => 'empty_parameters',
				'message' => 'Sorry! Your request cannot be processed at the moment!',
			);
		}

		$screen = $request['screen'];

		$params = array();
		if ( 'database' === $screen ) {
			$params['url']         = app()->get_url();
			$params['show_toggle'] = ( new Si_Helper_Config() )->exists();
		}

		$view_class = 'Si_View_Partial_Screens_' . ucfirst( $screen );
		if ( in_array( $screen, array( 'warning_files', 'warning_database' ), true ) ) {
			$view_class = 'Si_View_Partial_Screens_' . ucwords( $screen, '_' );
		}

		$view = new $view_class();

		ob_start();
			$view->out( $params );
		$content = ob_get_clean();

		$response['html'] = $content;

		if ( 'requirements' === $screen ) {
			$response['nextRequest'] = 'analyze';
			$response['title']       = 'Requirements';
		} elseif ( 'warning_files' === $screen ) {
			ob_start();
			( new Si_View_Partial_Sidebar() )->out();
			$response['sidebar'] = ob_get_clean();
			$response['title']   = 'Requirements';
		} elseif ( 'warning_database' === $screen ) {
			$response['nextRequest'] = 'database';
			$response['title']       = 'Requirements';
		} elseif ( 'database' === $screen ) {
			$response['title'] = 'Database';
		} elseif ( 'deployment' === $screen ) {
			$response['nextRequest'] = 'deploy';
			$response['title']       = 'Deployment';
		} elseif ( 'cleanup' === $screen ) {
			$response['nextRequest'] = 'cleanup';
			$response['title']       = 'Cleanup';
		}

		$this->set_error( false );

		return $response;
	}

	/**
	 * AJAX Handler :: analyze
	 *
	 * Analyzes the requirements.
	 *
	 * @param array $request Request details.
	 * @return array
	 */
	public function analyze( $request ) {
		/**
		 * Requirements View.
		*/
		$view = new Si_View_Partial_Screens_Requirements();

		$analysis = new Si_Controller_Requirements();

		$analysis->check();

		$result = array(
			'nextScreen' => 'database',
		);

		$can_proceed = true;

		if ( $analysis->has_failed() ) {
			$this->set_error( true );
			ob_start();
				$view->results( $analysis );
			$html = ob_get_clean();

			$steps = $analysis->get_failed_steps();

			if ( count( $steps ) === 1 && isset( $steps[0] ) && 'timeout' === $steps[0] ) {
				// The timeout is low but user can proceed further.
				$result['forceProceed'] = true;
			} else {
				$can_proceed = false;
				unset( $result['nextScreen'] );
			}

			$result['html'] = $html;
		} else {
			$this->set_error( false );
			$result['nextRequest'] = 'change_screen';
		}

		if ( $analysis->is_partial_restore() && $can_proceed ) {
			$partial_restore_type = $analysis->get_partial_restore_type();
			session()->set( 'partial_restore_type', $partial_restore_type );
			$result['nextScreen']     = 'warning_' . $partial_restore_type;
			$result['partialRestore'] = true;

			Si_Helper_Log::log( '=== [Info] Detected partial restoration. Type ' . ucfirst( $partial_restore_type . ' ===' ) );

		}

		return $result;
	}

	/**
	 * Analyze the single requirement.
	 *
	 * @param array $request Request data.
	 * @return array
	 */
	public function analyze_single( $request ) {
		/**
		 * Requirements View.
		*/
		$view = new Si_View_Partial_Screens_Requirements();

		$result = array(
			'nextScreen' => 'database',
		);

		$can_proceed = true;

		$analysis = new Si_Controller_Requirements();
		$analysis->check();

		$analyzable = $request['what'];

		if ( $analysis->has_failed() ) {
			$this->set_error( true );

			$failed_steps = $analysis->get_failed_steps();
			ob_start();
				$view->results( $analysis );
			$failed_result = ob_get_clean();

			if ( count( $failed_steps ) === 1 && 'timeout' === $failed_steps[0] ) {
				$result['forceProceed'] = true;
				$result['nextScreen']   = 'database';
				if ( 'timeout' !== $analyzable ) {
					$result['remove_item'] = $analyzable;
				}
			} else {
				$result['failed_steps'] = $failed_steps;
				unset( $result['nextScreen'] );
				if ( ! in_array( $analyzable, $failed_steps ) ) {
					$result['remove_item'] = $analyzable;
				} else {
					$can_proceed = false;
				}
			}
			$result['html'] = $failed_result;

		} else {
			$this->set_error( 'false' );
			$result['nextRequest'] = 'change_screen';
		}

		if ( $analysis->is_partial_restore() && $can_proceed ) {
			$partial_restore_type = $analysis->get_partial_restore_type();
			session()->set( 'partial_restore_type', $partial_restore_type );
			$result['nextScreen']     = 'warning_' . $partial_restore_type;
			$result['partialRestore'] = true;
		}

		return $result;
	}

	/**
	 * Handles the AJAX request for database connection.
	 *
	 * @param array $request Request data.
	 * @return array
	 */
	public function database( $request ) {
		$result   = array();
		$database = new Si_Controller_Database();

		if ( isset( $request['configCreds'] ) && 'yes' === $request['configCreds'] ) {
			$wp_config = new Si_Helper_Config();
			$is_parsed = $wp_config->read()->parse();

			if ( $is_parsed ) {
				$creds = $wp_config->get_data();
			}
			$creds['$table_prefix'] = $request['table_prefix'];
			$creds['site_url']      = $request['site_url'];
		} else {
			$requested = $request;
			if ( isset( $requested['table_prefix'] ) ) {
				$prfx = $requested['table_prefix'];
				unset( $requested['table_prefix'] );
				unset( $requested['sub_action'] );
				unset( $requested['action'] );
				$requested['$table_prefix'] = $prfx;
			}
			$creds = $requested;
		}
		$db = $database->set_creds( $creds );

		if ( isset( $request['sub_action'] ) ) {
			if ( 'test_connection' === $request['sub_action'] ) {
				if ( true === $db->can_connect() ) {
					$message             = '[Database] Testing connection successful.';
					$result['connected'] = true;
					$result['database']  = $creds['DB_NAME'];
					$result['release']   = true;
					$this->set_error( false );
				} else {
					$this->set_error( true );
					$result['connected'] = false;
					$result['error']     = $db->get_connection_error();
					$message             = '[Database] Testing connection failed.';
				}
				Si_Helper_Log::log( $message );
			} elseif ( 'store_creds' === $request['sub_action'] ) {
				if ( true === $db->can_connect() ) {
					session()->set( 'database', $creds );
					$data = session()->get( 'database' );

					if ( is_array( $data ) ) {
						$this->set_error( false );
						$result['stored']      = $data;
						$result['nextRequest'] = 'change_screen';
						$result['nextScreen']  = 'deployment';
						Si_Helper_Log::log( '[Database] Proceeding with Deployment' );
					} else {
						$this->set_error( true );
						$result['stored'] = false;
					}
				}
			}
		}

		return $result;
	}

	/**
	 * Handles the deployment process.
	 *
	 * @param array $request Request data.
	 * @return array
	 */
	public function deploy( $request ) {
		$response = array();

		if ( isset( $request['index'] ) && 0 === (int) $request['index'] ) {
			Si_Helper_Log::log( '[Deployment] Started.' );
		}

		$fs    = new Si_Helper_Filesystem();
		$error = new Si_Helper_Error();

		$restore_type = session()->has( 'partial_restore_type' ) ? session()->get( 'partial_restore_type' ) : 'full_backup';

		// Get the zip file status.
		if ( isset( $request['sub_action'] ) && 'status' === $request['sub_action'] ) {
			// Get the backup file status.
			$archive  = new Si_Model_Archive();
			$snapshot = $archive->get_snapshot();

			if ( ! $snapshot ) {
				$this->set_error( true );
				Si_Helper_Log::log( '[Error] Backup not found' );
				$response['nextRequest'] = 'change_screen';
				$response['screen']      = 'failed';

				return $response;
			}

			// Check the backup file and see we can get it's status.
			$zip    = new Si_Helper_Zip( $snapshot );
			$status = $zip->get_status();

			if ( isset( $status['error'] ) ) {
				$this->set_error( true );
				Si_Helper_Log::log( '[Error] ' . $status['error'] );
				$response['nextRequest'] = 'change_screen';
				$response['screen']      = 'failed';

				return $response;
			}

			$fs->set_path( SI_PATH_ROOT );
			$path = $fs->mkdir( SI_TEMP_DIR, 0777 );
			if ( ! $path ) {
				$this->set_error( true );
				Si_Helper_Log::log( '[Error] Cannot create the temporary working directory' );
				$response['nextRequest'] = 'change_screen';
				$response['screen']      = 'failed';

				return $response;
			}

			$this->set_error( false );
			$response['backup']      = $status;
			$response['nextRequest'] = 'deploy';
			$response['sub_action']  = 'unzip';

			return $response;
		}

		// Unzip the zip file.
		if ( isset( $request['sub_action'] ) && 'unzip' === $request['sub_action'] ) {
			// Unzip the file.
			if ( ! isset( $request['backup_file'] ) ) {
				$this->set_error( true );
				$response['message'] = 'No backup file.';

				return $response;
			}

			$file       = $request['backup_file'];
			$index      = ( isset( $request['index'] ) ) ? (int) $request['index'] : 0;
			$iterations = (int) $request['iterations'];
			$percent    = (int) round( 60 / $iterations );

			if ( 'database' === $restore_type ) {
				// For database restore, we will set the percentage to 20.
				$percent = (int) round( 20 / $iterations );
			}

			$fs   = new Si_Helper_Filesystem();
			$dest = $fs->get_temp_dir();

			$zip = new Si_Helper_Zip( $file );

			if ( 0 === $index ) {
				/**
				 * Taking backup of current wp-config.php file if it exists.
				 */
				$root = $fs->get_root_path();
				if ( $fs->exists( "{$root}/wp-config.php" ) && in_array( $restore_type, array( 'files', 'full_backup' ), true ) ) {
					Si_Helper_Log::log( '[Deploy] Old `wp-config.php` file found. Renaming to config: `wp-config-old.php`.' );
					if ( false === $fs->rename( "{$root}/wp-config.php", "{$root}/wp-config-old.php" ) ) {
						Si_Helper_Log::log( "[Deploy] Could not rename `{$root}/wp-config.php`. Renaming to:  {$root}/wp-config-old.php." );
					}
				}
			}

			if ( ! $fs->exists( $file ) ) {
				// Error handling when file is deleted during deployment.
				$this->set_error( true );
				Si_Helper_Log::log( "[Deploy] Snapshot Archive: {$file} not found." );
				return array(
					'nextRequest' => 'change_screen',
					'nextScreen'  => 'failed',
				);
			}

			$zip_files = $zip->files( $index );

			// Use our custom error handler.
			set_error_handler( array( $error, 'handle' ) );

			if ( true === $zip->extract( $dest, $zip_files ) ) {
				if ( $fs->exists( $dest . '/www' ) ) {
					$files = $fs->lists( $dest . '/www', 'sql' );

					$unmove_files = session()->get( 'unmove_files' ) ?: array();

					foreach ( $files as $f ) {
						if ( true !== $fs->move( $f ) ) {
							if ( false === array_search( $f, $unmove_files ) ) {
								array_push( $unmove_files, $f );
							}
						}
					}
					session()->set( 'unmove_files', array_unique( $unmove_files ) );
				}

				$this->set_error( false );
				$response['nextRequest'] = 'deploy';
				$response['sub_action']  = 'unzip';
				$response['backup']      = array(
					'iterations'  => $iterations,
					'index'       => $index + 1,
					'backup_file' => $file,
				);

				if ( $percent < 1 ) {
					if ( 0 === $index % 2 ) {
						$percent = rand( 1, 2 );
					} else {
						$percent = 0;
					}
				}
				$response['percent'] = $percent;
			}

			// Restore error handler to the default one in PHP.
			restore_error_handler();

			if ( $index + 1 > $iterations ) {
				// Finished iterating.
				$this->set_error( false );
				$response['percent']     = 3;
				$response['nextRequest'] = 'deploy';
				$response['sub_action']  = 'clean_source';

				Si_Helper_Log::log( '[Deploy] Unzipping completed.' );

				if ( 'database' === $restore_type ) {
					$response['nextRequest'] = 'deploy';
					$response['sub_action']  = 'write_config';
					$response['percent']     = 3;
				}
			}
		}

		// Clean the source file
		if (
			isset( $request['sub_action'] ) &&
			'clean_source' === $request['sub_action'] &&
			in_array( $restore_type, array( 'full_backup', 'files' ), true )
		) {
			Si_Helper_Log::log( '[Deploy] Cleaning source files.' );
			$dest = $fs->get_temp_dir() . '/www';
			if ( true === $fs->rmdir( $dest ) ) {
				$this->set_error( false );
				$response['nextRequest'] = 'deploy';
				$response['sub_action']  = 'write_config';
				$response['percent']     = 3;
			} else {
				Si_Helper_Log::log( "[Deploy] Source clean: Could not remove directory: {$dest}. Please remove it manually." );
				$this->set_error( false );
				$response['nextRequest'] = 'deploy';
				$response['sub_action']  = 'write_config';
				$response['percent']     = 3;
			}

			if ( 'files' === $restore_type ) {
				$this->set_error( false );
				$response['nextRequest'] = 'change_screen';
				$response['screen']      = 'success';
			}
		}

		// Make necessary changes to the `wp-config.php` file in the ROOT
		if (
			isset( $request['sub_action'] ) &&
			'write_config' === $request['sub_action'] &&
			in_array( $restore_type, array( 'full_backup', 'database' ), true )
		) {
			$file = $fs->normalize( SI_PATH_ROOT ) . '/wp-config.php';

			if ( ! $fs->exists( $file ) ) {
				Si_Helper_Log::log( "[Deploy] Database: {$file} not found." );
			} else {
				try {
					$info = $fs->seek( $file );
				} catch ( File_Not_Found_Exception $e ) {
					$this->set_error( true );
					Si_Helper_Log::log( '[Error] ' . $e->getMessage() );

					return array(
						'message' => $e->getMessage(),
					);
				}

				if ( true === $info->isWritable() ) {
					$data = session()->get( 'database' );

					$config_content = $fs->read( $info->getPathname() );
					$config         = new Si_Helper_Config();
					$config->set_raw_content( $config_content );

					$config->parse();
					$existing_data = $config->get_data();
					session()->set( 'backup_prefix', $existing_data['$table_prefix'] );

					$host = $data['DB_HOST'];
					if ( isset( $data['DB_PORT'] ) && 3306 !== (int) $data['DB_PORT'] ) {
						$host .= ':' . $data['DB_PORT'];
					}

					$config->update_raw( 'DB_HOST', $host );
					$config->update_raw( 'DB_USER', $data['DB_USER'] );
					$config->update_raw( 'DB_NAME', $data['DB_NAME'] );
					$config->update_raw( 'DB_USER', $data['DB_USER'] );
					$config->update_raw( 'DB_PASSWORD', $data['DB_PASSWORD'] );
					$config->update_raw( '$table_prefix', $data['$table_prefix'] );

					if ( true === $fs->put( $file, $config->get_raw_content() ) ) {
						$this->set_error( false );
					} else {
						Si_Helper_Log::log( '[[Deploy]] Cannot set the updated credentials.' );
					}
				} else {
					Si_Helper_Log::log( '[[Deploy]] `wp-config.php` is not writable.' );
				}
			}

			// Since this step can be manually configured, we will proceed to next step anyhow!
			$response['nextRequest'] = 'deploy';
			$response['sub_action']  = 'installdb';
		}

		// Import the tables.
		if (
			isset( $request['sub_action'] ) &&
			'installdb' === $request['sub_action'] &&
			in_array( $restore_type, array( 'full_backup', 'database' ), true )
		) {
			// Install the database.
			$temp_dir      = $fs->get_temp_dir();
			$sql_files     = $fs->recursive_search( '/.*\\.sql/', $temp_dir . '/sql' );
			$prefix        = '';
			$backup_prefix = session()->get( 'backup_prefix' );
			if ( ! empty( $backup_prefix ) ) {
				$prefix = $backup_prefix;
			} elseif ( ! isset( $request['prefix'] ) ) {
				foreach ( $sql_files as $sql ) {
					$name = basename( $sql );
					$pos  = strpos( $name, 'posts.sql' );
					if ( false !== $pos ) {
						$named  = explode( 'posts.sql', $name );
						$prefix = $named[0];
						break;
					}
				}
			} else {
				$prefix = $request['prefix'];
			}

			$this->set_error( false );
			$max = 2 * pow( 1024, 2 );

			if ( ! isset( $request['file'] ) ) {
				$file = $sql_files[0];
			} else {
				$file = $request['file'];
			}

			$percent = (int) round( 30 / count( $sql_files ) );
			if ( $percent < 1 ) {
				$percent = rand( 0, 1 );
			}

			try {
				$info = $fs->seek( $file );
			} catch ( File_Not_Found_Exception $e ) {
				Si_Helper_Log::log( "[Error] [Database] - {$file} doesn't exist." );
			}

			// Use our custom error handler.
			set_error_handler( array( $error, 'handle' ) );
			$iterations = 1;
			$cursor     = 0;
			$index      = 1;
			$size       = $info->getSize();
			if ( $size > $max ) {
				$iterations = ceil( $size / $max );
				$index      = ( isset( $request['index'] ) ) ? $request['index'] : $index;
				$cursor     = ( isset( $request['cursor'] ) ) ? $request['cursor'] : $cursor;
			}

			$sql = new Si_Helper_Sql( $file );
			$sql->set_prefix( $prefix );

			$query     = $sql->seek( $cursor );
			$statement = $query['query'];
			if ( ! empty( $statement ) ) {
				$database = new Si_Controller_Database();

				$creds = session()->get( 'database' );
				$database->set_creds( $creds );
				$mysqli    = $database->connection();
				$performed = false;
				try {
					$mysqli->query( "SET SQL_MODE='ALLOW_INVALID_DATES';" );
					$mysqli->query( 'SET FOREIGN_KEY_CHECKS=0' );
					$mysqli->query( 'SET NAMES utf8mb4' );
					$performed = $mysqli->multi_query( $statement );
				} catch ( mysqli_sql_exception $e ) {
					Si_Helper_Log::log( '[Error] ' . $e->getMessage() );
				}

				if ( $performed ) {
					$default_timeout = ini_get( 'max_execution_time' );
					// Try setting the time limit to infinite.
					set_time_limit( 0 );
					while ( $mysqli->next_result() ) {
						if ( ! $mysqli->more_results() ) {
							break;
						}
					}
					set_time_limit( $default_timeout );

					$this->set_error( false );

					if ( isset( $query['end'] ) && $query['end'] ) {
						$current_index = array_search( $file, $sql_files );
						$next_index    = (int) $current_index + 1;

						if ( isset( $sql_files[ $next_index ] ) ) {
							$next_file = $sql_files[ $next_index ];

							if ( $next_file && file_exists( $next_file ) ) {
								$response['nextRequest'] = 'deploy';
								$response['sub_action']  = 'installdb';
								$response['percent']     = $percent;
								$response['sql_data']    = array(
									'file' => $next_file,
								);
							}
						} else {
							$this->set_error( 'false' );
							// Change the options table here.
							$response['nextRequest'] = 'deploy';
							$response['sub_action']  = 'settings';
						}
					} else {
						$this->set_error( false );
						if ( isset( $query['cursor'] ) && $query['cursor'] > 0 ) {
							$response['nextRequest'] = 'deploy';
							$response['sub_action']  = 'installdb';
							$response['sql_data']    = array(
								'file'   => $file,
								'cursor' => $query['cursor'],
							);
						}
					}
				} else {
					// Display the failed notice here.
					$this->set_error( true );
					$response['nextRequest'] = 'change_screen';
					$response['screen']      = 'failed';
				}
			} elseif ( isset( $query['is_view'] ) && $query['is_view'] ) {
					Si_Helper_log::log( '[Info - Skipping View]' );

					$current_index = array_search( $file, $sql_files );
					$next_index    = (int) $current_index + 1;

				if ( isset( $sql_files[ $next_index ] ) ) {
					$next_file = $sql_files[ $next_index ];

					if ( $next_file && file_exists( $next_file ) ) {
						$response['nextRequest'] = 'deploy';
						$response['sub_action']  = 'installdb';
						$response['percent']     = $percent;
						$response['sql_data']    = array(
							'file' => $next_file,
						);
					}
				} else {
					$this->set_error( 'false' );
					// Change the options table here.
					$response['nextRequest'] = 'deploy';
					$response['sub_action']  = 'settings';
				}
			} elseif ( isset( $query['end'] ) && $query['end'] ) {
				$this->set_error( false );
					$current_index = array_search( $file, $sql_files );
					$next_index    = (int) $current_index + 1;

				if ( isset( $sql_files[ $next_index ] ) ) {
					$next_file = $sql_files[ $next_index ];

					if ( $next_file && file_exists( $next_file ) ) {
						$response['nextRequest'] = 'deploy';
						$response['sub_action']  = 'installdb';
						$response['percent']     = $percent;
						$response['sql_data']    = array(
							'file' => $next_file,
						);
					}
				} else {
					$this->set_error( 'false' );
					$response['nextRequest'] = 'deploy';
					$response['sub_action']  = 'settings';
				}
			} else {
					// fail here.
					$this->set_error( true );
					$response['nextRequest'] = 'change_screen';
					$response['screen']      = 'failed';
					Si_Helper_Log::log( "[Error - Empty Statement] {$statement}" );
			}

			restore_error_handler();
		}

		if (
			isset( $request['sub_action'] ) &&
			'settings' === $request['sub_action'] &&
			in_array( $restore_type, array( 'full_backup', 'database' ), true )
		) {
			$database = new Si_Controller_Database();
			$creds    = session()->get( 'database' );
			$database->set_creds( $creds );
			$mysqli = $database->connection();
			$prefix = $creds['$table_prefix'];
			$url    = rtrim( $creds['site_url'], '\\/' );
			$table  = "{$prefix}options";

			try {
				$mysqli->query( "UPDATE `{$table}` SET `option_value` = '{$url}' WHERE `option_name` = 'siteurl'" );
				$mysqli->query( "UPDATE `{$table}` SET `option_value` = '{$url}' WHERE `option_name` = 'home'" );

				$sites      = $mysqli->query( "SELECT blog_id FROM {$prefix}blogs" );
				$old_prefix = session()->get( 'backup_prefix' );
				if ( $old_prefix !== $prefix ) {
					$mysqli->query( "UPDATE `{$prefix}options` SET `option_name` = REPLACE(`option_name`, '{$old_prefix}', '{$prefix}') WHERE `option_name` LIKE '{$old_prefix}%'" );
					if ( $sites->num_rows > 0 ) {   // multi site settings.
						$mysqli->query( "UPDATE `{$prefix}usermeta` SET `meta_key` = REPLACE(`meta_key`, '{$old_prefix}', '{$prefix}') WHERE `meta_key` LIKE '{$old_prefix}%_capabilities'" );
						$mysqli->query( "UPDATE `{$prefix}usermeta` SET `meta_key` = REPLACE(`meta_key`, '{$old_prefix}', '{$prefix}') WHERE `meta_key` LIKE '{$old_prefix}%_user_level'" );
						$mysqli->query( "UPDATE `{$prefix}usermeta` SET `meta_key` = REPLACE(`meta_key`, '{$old_prefix}', '{$prefix}') WHERE `meta_key` LIKE '{$old_prefix}%_user-settings'" );
						$mysqli->query( "UPDATE `{$prefix}usermeta` SET `meta_key` = REPLACE(`meta_key`, '{$old_prefix}', '{$prefix}') WHERE `meta_key` LIKE '{$old_prefix}%_user-settings-time'" );

						while ( $site = $sites->fetch_assoc() ) {
							$blog_id = $site['blog_id'];
							if ( '1' === $blog_id ) {
								continue;
							}
							$options_table = $prefix . $blog_id . '_options';

							$mysqli->query( "UPDATE `{$options_table}` SET `option_name` = REPLACE(`option_name`, '{$old_prefix}', '{$prefix}') WHERE `option_name` LIKE '{$old_prefix}%_user_roles'" );
						}
					}
				}
			} catch ( mysqli_sql_exception $e ) {
				Si_Helper_Log::log( '[Error] ' . $e->getMessage() );
			}

			$dest = $fs->get_temp_dir();
			$fs->rmdir( $dest );

			$response['nextRequest'] = 'change_screen';
			$response['screen']      = 'success';
		}

		return $response;
	}

	/**
	 * Handles the cleanup process.
	 *
	 * @param array $request Request data.
	 * @return array
	 */
	public function cleanup( $request ) {
		$response = array();
		if ( isset( $request['delete'] ) && 'self' === $request['delete'] ) {
			if ( 'snapshot-installer.php' === basename( __FILE__ ) ) {
				if ( true === unlink( __FILE__ ) ) {
					exit();
				}
			}
		}
		$not_cleaned = array();

		$session = session()->get( 'database' );

		$not_cleaned = $this->soft_clean();
		$file        = $this->hard_clean();

		if ( null !== $file ) {
			$not_cleaned['snapshot'] = $file;
		}

		$view = new Si_View_Partial_Screens_Cleanup();
		if ( count( $not_cleaned ) >= 1 ) {
			$this->set_error( true );
			ob_start();
				$view->failed( $not_cleaned );
			$html = ob_get_clean();
		} else {
			$this->set_error( false );
			ob_start();
				$view->results();
			$html                    = ob_get_clean();
			$response['redirect']    = ( is_array( $session ) && isset( $session['site_url'] ) ) ? $session['site_url'] : '#';
			$response['nextRequest'] = 'cleanup';
			$response['self']        = 'delete';
		}

		$response['html'] = $html;

		return $response;
	}

	/**
	 * Handles the display of log.
	 *
	 * @param array $request Request data.
	 * @return array
	 */
	public function log( $request ) {
		if ( isset( $request['sub_action'] ) && 'return_url' === $request['sub_action'] ) {
			$url = Si_Helper_Log::get_log_url();
			$this->set_error( false );
			return array(
				'url'   => $url,
				'title' => 'snapshot-installer',
			);
		}
		$fs      = new Si_Helper_Filesystem();
		$content = $fs->read( Si_Helper_Log::get_file() );
		$this->set_error( false );

		return array( 'html' => nl2br( $content ) );
	}

	/**
	 * Runs some housekeeping and restart the process from begining.
	 *
	 * @param array $request Request data.
	 * @return array
	 */
	public function restart( $request ) {
		$response = array();
		$this->soft_clean();

		$response['nextRequest'] = 'refresh';

		return $response;
	}

	/**
	 * Cleanup
	 *
	 * @return array
	 */
	protected function soft_clean() {
		$not_cleaned = array();

		// Clean the session.
		session()->destroy();

		$log = Si_Helper_Log::get_file();
		if ( file_exists( $log ) ) {
			if ( false === unlink( $log ) ) {
				$not_cleaned['log'] = $log;
			}
		}

		$fs   = new Si_Helper_Filesystem();
		$temp = $fs->get_temp_dir();
		if ( file_exists( $temp ) && false === $fs->rmdir( $temp ) ) {
			// Cannot remove the temp dir.
			$not_cleaned['temp_dir'] = $temp;
		}

		return $not_cleaned;
	}

	/**
	 * Deletes the snapshot backup archive.
	 *
	 * @return mixed Null upon success and File path upon failure to remove.
	 */
	protected function hard_clean() {
		$archive  = new Si_Model_Archive();
		$snapshot = $archive->get_snapshot();

		$file = null;
		if ( file_exists( $snapshot ) ) {
			if ( false === unlink( $snapshot ) ) {
				$file = $snapshot;
			}
		}

		return $file;
	}
}



// Source: src/lib/View/class_si_view_style.php


/**
 * Si_View_Style class extends Si_View and generates CSS styles for a specific view.
 */
class Si_View_Style extends Si_View {

	/**
	 * Outputs the CSS styles for the view.
	 *
	 * @param array $params Optional parameters for customizing the styles.
	 * @return void
	 */
	public function out( $params = array() ) {
		?>
		<style>
		*, *:before, *:after {
			box-sizing: border-box;
		}
		body {
			background: #F4F4F4;
			color: #555555;
			font-family: "Roboto", sans-serif;
			margin: 0;
			padding: 0;
		}

		.main-header h1 {
			text-align: center;
			text-transform: uppercase;
			margin: 0;
			padding: 0;
			margin-top: 20px;
			padding-left: 150px;
			line-height: 100px;
			font-size: 50px;
			font-family: "Roboto Condensed";
			letter-spacing: -2px;
		}
		.main-header svg {
			position: absolute;
			top: 0;
			left: 30px;
		}
		.main-header header {
			position: relative;
			height: 120px;
		}

		.body, .main-header header {
			width: 1000px;
			margin: 0 auto;
		}

		.body {
			background: #ffffff;
		}
		body h2 {
			padding: 18px 30px;
			border-bottom: 1px solid #EEEEEE;
			text-transform: uppercase;
			font-size: 18px;
			font-family: "Roboto Condensed";
			margin: 0;
		}
		.step {
			padding: 18px 30px;
			border-bottom: 1px solid #EEEEEE;
		}

		.step-title, .step-status {
			display: inline-block;
			float: left;
			line-height: 2em;
		}
		.step-title h3 {
			display: inline;
			margin: 0;
			padding: 0;
			font-size: 14px;
		}
		.step-title h3 a {
			text-decoration: none;
			color: #555555;
		}
		.step-title {
			margin-bottom: 18px;
		}
		.step-output {
			clear: both;
			padding: 20px 30px;
			border-radius: 3px;
		}
		.empty .step-title { margin: 0; }
		.empty .step-output { padding: 0; }


		.step-status {
			color: #fff;
			text-align: center;
			text-transform: uppercase;
			width: 100px;
			margin-left: 30px;
			font-size: 13px;
		}
		.step-status div { border-radius: 3px; }
		.step-status span { display: inline-block; padding: 8px 10px; line-height: 1em;}
		.step-status .success { background: #1ABC9C; }
		.step-status .failed { background: #FF6D6D; }
		.step-status .warning { background: #FECF2F; }
		.step-output { background: #F9F9F9; }

		button, a.button {
			background: #A9A9A9;
			color: #FFFFFF;
			text-decoration: none;
			text-transform: uppercase;
			border: none;
			padding: 10px 30px;
			font-size: 1em;
			border-radius: 4px;
			font-weight: 500;
			font-family: "Roboto";
			border-bottom: 3px solid #A9A9A9;
		}
		button.primary, a.button.primary {
			background: #19B4CF;
			color: #FFFFFF;
			border-bottom: 3px solid #1490A5;
		}
		</style>
		<?php
		$this->_check();
		$this->_configuration();
		$this->_deployment();
	}

	/**
	 * Generates CSS styles for the check section.
	 *
	 * @return void
	 */
	private function _check() {
		?>
		<style>
		/**
		 * --- Check step ---
		 */
		.check {
			padding: 15px 0;
			border-bottom: 1px solid #EEEEEE;
		}
		.check:first-child {
			padding-top: 5px;
		}
		.check:last-child {
			border: none;
		}
		.check .check-title {
			display: table-cell;
			width: 180px;
		}
		.check .check-status {
			display: table-cell;
			width: 100px;
			color: #FFFFFF;
			text-align: center;
			text-transform: uppercase;
			font-size: 13px;
		}
		.check .check-output {
			display: table-cell;
			padding-left: 20px;
		}

		.check .check-title h4 {
			margin: 0;
			padding: 0;
			font-size: 15px;
			font-weight: 500;
		}
		.check .check-status div { border-radius: 3px; }
		.check-status span { display: inline-block; padding: 8px 10px; }
		.check .success { background: #1ABC9C; }
		.check .failed { background: #FF6D6D; }
		.check .warning { background: #FECF2F; }
		</style>
		<?php
	}

	/**
	 * Generates CSS styles for the configuration section.
	 *
	 * @return void
	 */
	private function _configuration() {
		?>
		<style>
		/**
		 * --- Configuration step ---
		 */
		.state-configuration {
			font-size: 15px;
			line-height: 1.4em;
		}
		.state-configuration .error-message {
			background: #FF6D6D;
			color: #FFFFFF;
			padding: 10px;
			border-radius: 5px;
		}
		.state-configuration .step-output h3 {
			text-transform: uppercase;
			margin: 20px 0;
			margin-top: 30px;
			font-size: 18px;
			font-family: "Roboto Condensed";
		}
		form input {
			border: 1px solid #EEEEEE;
			padding: 10px;
			background: #FFFFFF;
			color: #2A6988;
			font-weight: bold;
		}
		.config-item {
			margin: 10px 0;
		}
		.config-item label span {
			display: inline-block;
			width: 200px;
			font-weight: 500;
		}
		.config-item input {
			width: 450px;
			border-radius: 3px;
			font-size: 15px;
		}

		.config-item input.error { border: 1px solid #f33; }
		.config-item input.warning { border: 1px solid #FECF2F; }

		.config-item.host input { width: 275px; }
		.config-item.host label[for="port"] span { padding-left: 25px; width: 65px; }
		.config-item.host label[for="port"] input { width: 100px; }

		.config-test {
			background: #EBFCFF;
			color: #487386;
			border: 1px solid #B5D3E0;
			padding: 0 20px;
			border-radius: 5px;
			margin: 20px 0;
		}
		.config-test .result-item {
			padding: 15px 0;
			border-bottom: 1px solid #B5D3E0;
		}
		.config-test .result-item:last-child {
			border: none;
		}
		.config-test .check-title {
			display: table-cell;
			width: 200px;
		}
		.config-test .check-status {
			display: table-cell;
			width: 100px;
			color: #FFFFFF;
			text-align: center;
			text-transform: uppercase;
		}
		.config-test .check-output {
			display: table-cell;
			padding-left: 20px;
		}
		.config-test .check-status div { border-radius: 3px; font-size: 13px; }
		.config-test .check-status div span { padding: 4px 5px; }
		.config-test .result-item .success { background: #1ABC9C; }
		.config-test .result-item .failed { background: #FF6D6D; }
		.config-test .result-item .warning { background: #FECF2F; }
		.config-test .result-item .stopped { background: #EAEAEA; color: #8B8B8B; }

		.config-actions {
			margin: 20px 0;
		}

		.continue p {
			display: inline-block;
		}
		.continue p:first-child {
			width: 80%;
		}
		.continue p:last-child {
			float: right;
		}
		</style>
		<?php
	}

	/**
	 * Generates CSS styles for the deployment section.
	 *
	 * @return void
	 */
	private function _deployment() {
		?>
		<style>
		/**
		* --- Deployment step ---
		*/
		.deployment header {
			text-align: center;
		}
		.deployment header h3 {
			text-transform: uppercase;
			font-family: "Roboto Condensed";
			font-weight: normal;
			font-size: 24px;
			margin-bottom: 15px;
		}
		</style>
		<?php
		$this->_deployment_failure();
		$this->_deployment_success();
		$this->_progress_bar();
		$this->_cleanup();
	}

	/**
	 * Generates CSS styles for the deployment failure section.
	 *
	 * @return void
	 */
	private function _deployment_failure() {
		?>
		<style>
		/**
		* Failure
		*/
		.deployment.failure {
			text-align: center;
		}
		.deployment.failure .error {
			background: #FF6D6D;
			color: #FFFFFF;
			padding: 10px;
			border-radius: 5px;
		}
		</style>
		<?php
	}

	/**
	 * Generates CSS styles for the deployment success section.
	 *
	 * @return void
	 */
	private function _deployment_success() {
		?>
		<style>
		/**
		* Success
		*/
		.deployment.success {
			text-align: center;
		}
		.deployment.success .success {
			background: #1ABC9C;
			color: #FFFFFF;
			padding: 10px;
			border-radius: 5px;
		}
		.deployment.actions {
			text-align: center;
		}
		.deployment.actions p {
			display: inline-block;
		}
		</style>
		<?php
	}

	/**
	 * Generates CSS styles for the progress bar component.
	 *
	 * @return void
	 */
	private function _progress_bar() {
		?>
		<style>
		.progress .progress-bar_wrapper {
		}
		.progress .progress-bar {
			background: #14485F;
			border-radius: 5px;
			padding: 5px;
			height: 50px;
		}
		.progress .progress-bar_indicator {
			background: #FECF2F;
			color: #14485F;
			border-radius: 5px;
			white-space: nowrap;
			line-height: 50px;
		}
		.progress .progress-bar_indicator span {
			padding: 0 10px;
		}
		.progress .progress-bar_indicator.percentage-only span.progress-bar_message {
			display: none;
		}
		.progress .progress-info {
			text-align: center;
			font-size: 12px;
		}
		/**
		* Progress bar color and animation
		*/
		.progress .progress-bar_indicator {
			background-image: linear-gradient(135deg,rgba(255,255,255,.4) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.4) 50%,rgba(255,255,255,.4) 75%,transparent 75%,transparent);	  	 		 	 	   	 		   		
			background-color: #FECF2F;
			background-size: 38px 38px;
			border-top-left-radius: 5px;
			border-bottom-left-radius: 5px;
			box-shadow: 0 1px 1px rgba(0,0,0,.75);
			height: 40px;
			line-height: 40px;
			min-width: 5%;
			animation: si-animate-progress-bars 2s linear infinite;
		}
		@keyframes si-animate-progress-bars {
			from  { background-position: 38px 0; }
			to    { background-position: 0 0; }
		}
		</style>
		<?php
	}

	/**
	 * Generates CSS styles for the cleanup section.
	 *
	 * @return void
	 */
	private function _cleanup() {
		?>
		<style>
		/**
		* Success
		*/
		.cleanup.success {
			text-align: center;
		}
		.cleanup.success div, .cleanup.warning div {
			color: #FFFFFF;
			padding: 10px;
			border-radius: 5px;
			text-align: center;
		}
		.cleanup.actions {
			text-align: center;
		}
		.cleanup.actions p {
			display: inline-block;
		}

		.cleanup-status {
			text-transform: uppercase;
		}
		.cleanup-status h3 {
			display: inline-block;
			font-family: "Roboto Condensed";
		}
		.cleanup-status div {
			display: inline-block;
			margin-left: 30px;
			width: 100px;
			border-radius: 3px;
			font-size: 13px;
			padding: 4px 5px;
			text-align: center;
		}
		.cleanup-status .success { background: #1ABC9C; color: #FFFFFF; }
		.cleanup-status .warning { background: #FECF2F; color: #FFFFFF; }

		.cleanup.success .success { background: #1ABC9C; }
		.cleanup.warning .warning { background: #FECF2F; }

		.cleanup-results-root {
			background: #EBFCFF;
			color: #487386;
			border: 1px solid #B5D3E0;
			padding: 0 20px;
			border-radius: 5px;
			margin: 20px 0;
		}
		.cleanup-results-root .result-item {
			padding: 15px 0;
			border-bottom: 1px solid #B5D3E0;
		}
		.cleanup-results-root .result-item:last-child {
			border: none;
		}
		.cleanup-results-root .result-item-title {
			display: table-cell;
			padding-right: 20px;
			width: 80%;
		}
		.cleanup-results-root .result-item-status {
			display: table-cell;
			width: 100px;
			min-width: 100px;
			color: #FFFFFF;
			text-align: center;
			text-transform: uppercase;
		}
		.cleanup-results-root .result-item-status div { border-radius: 3px; font-size: 13px; }
		.cleanup-results-root .result-item-status div span { display: inline-block; padding: 8px 10px; }
		.cleanup-results-root .result-item .success { background: #1ABC9C; }
		.cleanup-results-root .result-item .failed { background: #FF6D6D; }
		.cleanup-results-root .result-item .warning { background: #FECF2F; }
		</style>
		<?php
	}
}



// Source: src/lib/View/class_si_view_template.php


/**
 * Class Si_View_Template
 *
 * Represents a view template.
 */
class Si_View_Template extends Si_View {

	/**
	 * Outputs the HTML structure for the view template.
	 *
	 * @param array $params Optional parameters for customizing the view.
	 * @return void
	 */
	public function out( $params = array() ) {
		$header  = new Si_View_Partial_Header();
		$styles  = new Si_View_Partial_Styles();
		$scripts = new Si_View_Partial_Scripts();
		$sidebar = new Si_View_Partial_Sidebar();
		$content = new Si_View_Partial_Content();
		$footer  = new Si_View_Partial_Footer();
		$log     = new Si_View_Partial_Screens_Log();
		?>
		<!DOCTYPE html>
		<html lang="en">
			<head>
				<meta charset="UTF-8">
				<meta http-equiv="X-UA-Compatible" content="IE=edge">
				<meta name="viewport" content="width=device-width, initial-scale=1.0">
				<meta name="author" content="Incsub">

				<title>Snapshot Restore Wizard</title>

				<link rel="preconnect" href="https://fonts.googleapis.com">
				<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
				<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet">

				<?php $styles->out(); ?>
			</head>
			<body class="screen-welcome">
				<div class="sui-page">
					<div class="sui-body">
						<div class="sui-container">
							<?php $header->out(); ?>

							<div class="sui-row general-overview">
								<div class="sui-col-md-3" id="main-sidebar">
									<?php $sidebar->out(); ?>
								</div>
								<div class="sui-col-md-9">
									<?php $content->out(); ?>
								</div>
							</div>
							<div class="sui-row log-overview">
								<div class="sui-col-md-12">
									<?php $log->out(); ?>
								</div>
							</div>
						</div>
					</div>

					<?php $footer->out(); ?>
				</div>

				<?php $scripts->out(); ?>
			</body>
		</html>
		<?php
	}
}



// Source: src/lib/View/Images/class_si_view_images_logo.php


/**
 * Represents a view for displaying a logo image.
 */
class Si_View_Images_Logo extends Si_View {

	/**
	 * Outputs the SVG logo image.
	 *
	 * @param array $params Optional parameters for customizing the logo display.
	 * @return void
	 */
	public function out( $params = array() ) {
		?>
<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
	<rect width="38" height="38" rx="10" fill="#35104C" />
	<path
		d="M30.2412 11.7304L20.2295 6.02201C19.8587 5.80733 19.4489 5.7 19 5.7C18.5511 5.7 18.1413 5.80733 17.7705 6.02201L7.75878 11.7304C7.36846 11.9451 7.05621 12.2476 6.82201 12.6379C6.60734 13.0283 6.5 13.4479 6.5 13.8967V24.2012C6.5 24.65 6.60734 25.0696 6.82201 25.46C7.05621 25.8503 7.36846 26.1528 7.75878 26.3674L17.7705 32.0759C18.1413 32.2906 18.5511 32.3979 19 32.3979C19.4489 32.3979 19.8587 32.2906 20.2295 32.0759L30.2412 26.3674C30.6315 26.1528 30.934 25.8503 31.1487 25.46C31.3829 25.0696 31.5 24.65 31.5 24.2012V13.8967C31.5 13.4479 31.3829 13.0283 31.1487 12.6379C30.934 12.2476 30.6315 11.9451 30.2412 11.7304ZM28.9824 13.8967V24.2012L19 29.9096L9.01756 24.2012V13.8967L19 8.18829L28.9824 13.8967ZM11.5059 16.5607H21.4883V14.0431H11.5059V16.5607ZM16.5117 24.0548H26.4941V21.5372H16.5117V24.0548ZM24.9133 13.8089L19.9075 22.474L22.0738 23.7035L27.0796 15.0677L24.9133 13.8089ZM15.9262 14.3944L10.9204 23.0302L13.0867 24.289L15.5896 19.9564L18.0925 15.6239L15.9262 14.3944ZM17.4192 11.3206L22.4251 19.9564L24.5621 18.7269L19.5855 10.0618L17.4192 11.3206ZM13.4379 19.371L18.4145 28.0361L20.5808 26.7773L15.5749 18.1414L13.4379 19.371Z"
		fill="white" fill-opacity="0.5" />
	<path
		d="M30.2412 11.7304L20.2295 6.02201C19.8587 5.80733 19.4489 5.7 19 5.7C18.5511 5.7 18.1413 5.80733 17.7705 6.02201L7.75878 11.7304C7.36846 11.9451 7.05621 12.2476 6.82201 12.6379C6.60734 13.0283 6.5 13.4479 6.5 13.8967V24.2012C6.5 24.65 6.60734 25.0696 6.82201 25.46C7.05621 25.8503 7.36846 26.1528 7.75878 26.3674L17.7705 32.0759C18.1413 32.2906 18.5511 32.3979 19 32.3979C19.4489 32.3979 19.8587 32.2906 20.2295 32.0759L30.2412 26.3674C30.6315 26.1528 30.934 25.8503 31.1487 25.46C31.3829 25.0696 31.5 24.65 31.5 24.2012V13.8967C31.5 13.4479 31.3829 13.0283 31.1487 12.6379C30.934 12.2476 30.6315 11.9451 30.2412 11.7304ZM28.9824 13.8967V24.2012L19 29.9096L9.01756 24.2012V13.8967L19 8.18829L28.9824 13.8967Z"
		fill="white" />
</svg>
		<?php
	}
}



// Source: src/lib/View/Partial/class_si_view_partial_content.php


/**
 * Represents a partial view for displaying content.
 */
class Si_View_Partial_Content extends Si_View {

	/**
	 * Outputs the content area with specific elements.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$welcome = new Si_View_Partial_Screens_Welcome();
		?>
		<div class="content-area">
			<?php $welcome->out(); ?>

			<div id="cleanup" class="screen"></div>	<!-- /#cleanup -->
		</div>
		<?php
	}
}



// Source: src/lib/View/Partial/class_si_view_partial_footer.php


/**
 * Represents a partial view for footer.
 */
class Si_View_Partial_Footer extends Si_View {

	/**
	 * Outputs the footer.
	 *
	 * @param array $params Optional parameters for customizing.
	 *
	 * @return void
	 */
	public function out( $params = array() ) {
		$creds = session()->get( 'database' );
		$url   = ( isset( $creds['site_url'] ) ) ? $creds['site_url'] : '#';
		$base  = app()->get_url();
		?>
		<footer class="site-footer">
			<div class="sui-container">
				<div class="sui-footer d-flex justify-between align-center">
					<div class="footer-items footer-column-left">
						<a href="#" class="sui-btn sui-btn-ghost sui-btn-sm sui-btn-icon database-screen mr-10 back-btn" data-screen="welcome">
							<span class="icon">
								<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
									<path d="M0.703125 5.50391L5.26172 0.945312C5.29297 0.914063 5.32812 0.890625 5.36719 0.875C5.41406 0.859375 5.46094 0.851562 5.50781 0.851562C5.5625 0.851562 5.60938 0.859375 5.64844 0.875C5.69531 0.890625 5.73438 0.914063 5.76562 0.945312L6.49219 1.68359C6.52344 1.71484 6.54688 1.75391 6.5625 1.80078C6.58594 1.83984 6.59766 1.88281 6.59766 1.92969C6.59766 1.98437 6.58594 2.03516 6.5625 2.08203C6.54688 2.12109 6.52344 2.15625 6.49219 2.1875L3.79688 4.88281H11.0742C11.082 4.88281 11.0859 4.88281 11.0859 4.88281C11.1719 4.88281 11.2461 4.91406 11.3086 4.97656C11.3711 5.03125 11.4023 5.10156 11.4023 5.1875V6.3125C11.4023 6.39844 11.3711 6.47266 11.3086 6.53516C11.2461 6.58984 11.1719 6.61719 11.0859 6.61719H3.79688L6.50391 9.32422C6.53516 9.35547 6.55859 9.39453 6.57422 9.44141C6.59766 9.48047 6.60938 9.52344 6.60938 9.57031C6.60938 9.61719 6.59766 9.66406 6.57422 9.71094C6.55859 9.75781 6.53516 9.79688 6.50391 9.82812L5.76562 10.5547C5.73438 10.5859 5.69531 10.6094 5.64844 10.625C5.60938 10.6406 5.5625 10.6484 5.50781 10.6484C5.46094 10.6484 5.41406 10.6406 5.36719 10.625C5.32812 10.6094 5.29297 10.5859 5.26172 10.5547L0.703125 5.99609C0.671875 5.96484 0.644531 5.92969 0.621094 5.89062C0.605469 5.84375 0.597656 5.79688 0.597656 5.75C0.597656 5.70312 0.605469 5.66016 0.621094 5.62109C0.644531 5.57422 0.671875 5.53516 0.703125 5.50391Z" fill="#888888"/>
								</svg>
							</span>
							BACK
						</a>

						<a href="#" class="sui-btn sui-btn-block sui-btn-gray sui-btn-sm sui-btn-icon database-screen btn-test-connection">
							<span class="icon icon-refresh">
								<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
									<path d="M3.65625 8.38672C3.65625 8.39453 3.66016 8.40234 3.66797 8.41016C3.67578 8.41016 3.68359 8.41406 3.69141 8.42188C4.08984 8.77344 4.54688 9.02344 5.0625 9.17188C5.58594 9.32031 6.11719 9.34766 6.65625 9.25391C7.26562 9.15234 7.80469 8.91016 8.27344 8.52734C8.74219 8.14453 9.09375 7.67578 9.32812 7.12109C9.42969 6.88672 9.59766 6.72266 9.83203 6.62891C10.0742 6.52734 10.3164 6.52734 10.5586 6.62891C10.793 6.72266 10.957 6.89062 11.0508 7.13281C11.1523 7.375 11.1523 7.61328 11.0508 7.84766C10.8789 8.26953 10.6562 8.66406 10.3828 9.03125C10.1094 9.39062 9.79688 9.71094 9.44531 9.99219C9.09375 10.2734 8.71094 10.5078 8.29688 10.6953C7.88281 10.8828 7.44531 11.0195 6.98438 11.1055C6.57031 11.1758 6.16016 11.1992 5.75391 11.1758C5.34766 11.1523 4.94922 11.0859 4.55859 10.9766C4.17578 10.8672 3.80469 10.7188 3.44531 10.5312C3.08594 10.3359 2.75391 10.1016 2.44922 9.82812C2.41797 9.79688 2.38281 9.76953 2.34375 9.74609C2.3125 9.71484 2.28125 9.68359 2.25 9.65234L1.69922 10.1445C1.62891 10.207 1.55078 10.2578 1.46484 10.2969C1.37891 10.3281 1.28906 10.3438 1.19531 10.3438C0.992188 10.3438 0.816406 10.2695 0.667969 10.1211C0.519531 9.97266 0.445312 9.79688 0.445312 9.59375V7.0625C0.445312 7.04688 0.445312 7.03516 0.445312 7.02734C0.453125 7.01172 0.457031 6.99609 0.457031 6.98047C0.480469 6.77734 0.570312 6.61328 0.726562 6.48828C0.890625 6.35547 1.07422 6.29688 1.27734 6.3125L3.79688 6.58203C3.88281 6.58984 3.96875 6.61719 4.05469 6.66406C4.14062 6.70312 4.21094 6.75781 4.26562 6.82812C4.40625 6.97656 4.46875 7.15625 4.45312 7.36719C4.44531 7.57031 4.36719 7.74219 4.21875 7.88281L3.65625 8.38672ZM8.40234 3.11328C8.39453 3.11328 8.38672 3.10937 8.37891 3.10156C8.37109 3.09375 8.36328 3.08594 8.35547 3.07812C7.94922 2.71875 7.48438 2.46484 6.96094 2.31641C6.44531 2.16797 5.91797 2.14453 5.37891 2.24609C4.77734 2.34766 4.23828 2.58984 3.76172 2.97266C3.29297 3.34766 2.94531 3.8125 2.71875 4.36719C2.61719 4.60938 2.44531 4.78125 2.20312 4.88281C1.96094 4.97656 1.72266 4.97266 1.48828 4.87109C1.24609 4.76953 1.07422 4.60156 0.972656 4.36719C0.878906 4.125 0.882812 3.88281 0.984375 3.64062C1.16406 3.21875 1.39062 2.82812 1.66406 2.46875C1.9375 2.10938 2.24609 1.78906 2.58984 1.50781C2.94141 1.22656 3.32422 0.992188 3.73828 0.804688C4.15234 0.609375 4.58984 0.472656 5.05078 0.394531C5.46484 0.324219 5.875 0.300781 6.28125 0.324219C6.69531 0.339844 7.09375 0.402344 7.47656 0.511719C7.86719 0.621094 8.24219 0.773438 8.60156 0.96875C8.95312 1.16406 9.28516 1.39844 9.59766 1.67188C9.62891 1.70312 9.66016 1.73438 9.69141 1.76562C9.73047 1.79687 9.76562 1.82813 9.79688 1.85938L10.3594 1.35547C10.4297 1.29297 10.5078 1.24609 10.5938 1.21484C10.6797 1.17578 10.7695 1.15625 10.8633 1.15625C11.0742 1.15625 11.25 1.23047 11.3906 1.37891C11.5391 1.52734 11.6133 1.70312 11.6133 1.90625V4.4375C11.6133 4.44531 11.6133 4.45703 11.6133 4.47266C11.6133 4.48828 11.6133 4.50391 11.6133 4.51953C11.5898 4.72266 11.4961 4.89062 11.332 5.02344C11.1758 5.14844 10.9961 5.19922 10.793 5.17578L8.27344 4.91797C8.17969 4.91016 8.08984 4.88672 8.00391 4.84766C7.92578 4.80078 7.85547 4.74219 7.79297 4.67188C7.66016 4.51562 7.59766 4.33594 7.60547 4.13281C7.61328 3.92188 7.69531 3.75 7.85156 3.61719L8.40234 3.11328Z" fill="#FFFFFF"/>
								</svg>
							</span>
							TEST CONNECTION
						</a>

						<a href="#" class="sui-btn sui-btn-ghost sui-btn-sm sui-btn-icon requirements-screen btn-check-again sui-hidden">
							<span class="icon icon-refresh">
								<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
									<path d="M3.65625 8.38672C3.65625 8.39453 3.66016 8.40234 3.66797 8.41016C3.67578 8.41016 3.68359 8.41406 3.69141 8.42188C4.08984 8.77344 4.54688 9.02344 5.0625 9.17188C5.58594 9.32031 6.11719 9.34766 6.65625 9.25391C7.26562 9.15234 7.80469 8.91016 8.27344 8.52734C8.74219 8.14453 9.09375 7.67578 9.32812 7.12109C9.42969 6.88672 9.59766 6.72266 9.83203 6.62891C10.0742 6.52734 10.3164 6.52734 10.5586 6.62891C10.793 6.72266 10.957 6.89062 11.0508 7.13281C11.1523 7.375 11.1523 7.61328 11.0508 7.84766C10.8789 8.26953 10.6562 8.66406 10.3828 9.03125C10.1094 9.39062 9.79688 9.71094 9.44531 9.99219C9.09375 10.2734 8.71094 10.5078 8.29688 10.6953C7.88281 10.8828 7.44531 11.0195 6.98438 11.1055C6.57031 11.1758 6.16016 11.1992 5.75391 11.1758C5.34766 11.1523 4.94922 11.0859 4.55859 10.9766C4.17578 10.8672 3.80469 10.7188 3.44531 10.5312C3.08594 10.3359 2.75391 10.1016 2.44922 9.82812C2.41797 9.79688 2.38281 9.76953 2.34375 9.74609C2.3125 9.71484 2.28125 9.68359 2.25 9.65234L1.69922 10.1445C1.62891 10.207 1.55078 10.2578 1.46484 10.2969C1.37891 10.3281 1.28906 10.3438 1.19531 10.3438C0.992188 10.3438 0.816406 10.2695 0.667969 10.1211C0.519531 9.97266 0.445312 9.79688 0.445312 9.59375V7.0625C0.445312 7.04688 0.445312 7.03516 0.445312 7.02734C0.453125 7.01172 0.457031 6.99609 0.457031 6.98047C0.480469 6.77734 0.570312 6.61328 0.726562 6.48828C0.890625 6.35547 1.07422 6.29688 1.27734 6.3125L3.79688 6.58203C3.88281 6.58984 3.96875 6.61719 4.05469 6.66406C4.14062 6.70312 4.21094 6.75781 4.26562 6.82812C4.40625 6.97656 4.46875 7.15625 4.45312 7.36719C4.44531 7.57031 4.36719 7.74219 4.21875 7.88281L3.65625 8.38672ZM8.40234 3.11328C8.39453 3.11328 8.38672 3.10937 8.37891 3.10156C8.37109 3.09375 8.36328 3.08594 8.35547 3.07812C7.94922 2.71875 7.48438 2.46484 6.96094 2.31641C6.44531 2.16797 5.91797 2.14453 5.37891 2.24609C4.77734 2.34766 4.23828 2.58984 3.76172 2.97266C3.29297 3.34766 2.94531 3.8125 2.71875 4.36719C2.61719 4.60938 2.44531 4.78125 2.20312 4.88281C1.96094 4.97656 1.72266 4.97266 1.48828 4.87109C1.24609 4.76953 1.07422 4.60156 0.972656 4.36719C0.878906 4.125 0.882812 3.88281 0.984375 3.64062C1.16406 3.21875 1.39062 2.82812 1.66406 2.46875C1.9375 2.10938 2.24609 1.78906 2.58984 1.50781C2.94141 1.22656 3.32422 0.992188 3.73828 0.804688C4.15234 0.609375 4.58984 0.472656 5.05078 0.394531C5.46484 0.324219 5.875 0.300781 6.28125 0.324219C6.69531 0.339844 7.09375 0.402344 7.47656 0.511719C7.86719 0.621094 8.24219 0.773438 8.60156 0.96875C8.95312 1.16406 9.28516 1.39844 9.59766 1.67188C9.62891 1.70312 9.66016 1.73438 9.69141 1.76562C9.73047 1.79687 9.76562 1.82813 9.79688 1.85938L10.3594 1.35547C10.4297 1.29297 10.5078 1.24609 10.5938 1.21484C10.6797 1.17578 10.7695 1.15625 10.8633 1.15625C11.0742 1.15625 11.25 1.23047 11.3906 1.37891C11.5391 1.52734 11.6133 1.70312 11.6133 1.90625V4.4375C11.6133 4.44531 11.6133 4.45703 11.6133 4.47266C11.6133 4.48828 11.6133 4.50391 11.6133 4.51953C11.5898 4.72266 11.4961 4.89062 11.332 5.02344C11.1758 5.14844 10.9961 5.19922 10.793 5.17578L8.27344 4.91797C8.17969 4.91016 8.08984 4.88672 8.00391 4.84766C7.92578 4.80078 7.85547 4.74219 7.79297 4.67188C7.66016 4.51562 7.59766 4.33594 7.60547 4.13281C7.61328 3.92188 7.69531 3.75 7.85156 3.61719L8.40234 3.11328Z" fill="#888888"/>
								</svg>
							</span>
							CHECK AGAIN
						</a>

						<a href="<?php echo $base; ?>" target="_blank" class="sui-btn sui-btn-ghost sui-btn-sm sui-btn-icon success-screen">
							<span class="icon">
								<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
									<path d="M6 0.75C5.17188 0.75 4.39453 0.90625 3.66797 1.21875C2.93359 1.53125 2.29297 1.96094 1.74609 2.50781C1.20703 3.04688 0.78125 3.68359 0.46875 4.41797C0.15625 5.14453 0 5.92188 0 6.75C0 7.57812 0.15625 8.35547 0.46875 9.08203C0.78125 9.81641 1.20703 10.457 1.74609 11.0039C2.29297 11.543 2.93359 11.9688 3.66797 12.2812C4.39453 12.5938 5.17188 12.75 6 12.75C6.82812 12.75 7.60547 12.5938 8.33203 12.2812C9.06641 11.9688 9.70312 11.543 10.2422 11.0039C10.7891 10.457 11.2188 9.81641 11.5312 9.08203C11.8438 8.35547 12 7.57812 12 6.75C12 5.92188 11.8438 5.14453 11.5312 4.41797C11.2188 3.68359 10.7891 3.04688 10.2422 2.50781C9.70312 1.96094 9.06641 1.53125 8.33203 1.21875C7.60547 0.90625 6.82812 0.75 6 0.75ZM10.8516 6.19922H9.375C9.34375 5.76953 9.28516 5.35547 9.19922 4.95703C9.10547 4.55859 8.98438 4.1875 8.83594 3.84375C8.69531 3.5 8.52734 3.1875 8.33203 2.90625C8.13672 2.625 7.92578 2.38281 7.69922 2.17969C8.12109 2.33594 8.51172 2.54688 8.87109 2.8125C9.23828 3.07812 9.55859 3.38672 9.83203 3.73828C10.1055 4.08203 10.3281 4.45703 10.5 4.86328C10.6719 5.27734 10.7852 5.71484 10.8398 6.17578L10.8516 6.19922ZM5.40234 2.75391V6.1875H3.75C3.78125 5.75781 3.84766 5.35938 3.94922 4.99219C4.05078 4.61719 4.17578 4.28516 4.32422 3.99609C4.47266 3.69922 4.63672 3.44531 4.81641 3.23438C5.00391 3.02344 5.19531 2.86328 5.39062 2.75391H5.40234ZM5.39062 7.3125V10.7461C5.19531 10.6367 5.00391 10.4766 4.81641 10.2656C4.63672 10.0547 4.47266 9.80469 4.32422 9.51562C4.17578 9.21875 4.05078 8.88672 3.94922 8.51953C3.84766 8.15234 3.78125 7.75391 3.75 7.32422L5.39062 7.3125ZM6.51562 10.7812V7.3125H8.25C8.21875 7.75781 8.14844 8.17188 8.03906 8.55469C7.92969 8.9375 7.79688 9.27734 7.64062 9.57422C7.48438 9.87109 7.30859 10.125 7.11328 10.3359C6.91797 10.5391 6.71875 10.6914 6.51562 10.793V10.7812ZM6.51562 6.1875V2.70703C6.71875 2.80859 6.91797 2.96484 7.11328 3.17578C7.30859 3.37891 7.48438 3.63281 7.64062 3.9375C7.79688 4.23438 7.92969 4.57422 8.03906 4.95703C8.14844 5.33984 8.21875 5.75391 8.25 6.19922L6.51562 6.1875ZM4.30078 2.17969C4.06641 2.38281 3.85547 2.625 3.66797 2.90625C3.47266 3.19531 3.30078 3.51172 3.15234 3.85547C3.01172 4.19922 2.89453 4.56641 2.80078 4.95703C2.70703 5.35547 2.64844 5.76953 2.625 6.19922H1.14844C1.20312 5.73047 1.32031 5.28906 1.5 4.875C1.67188 4.46094 1.89453 4.08203 2.16797 3.73828C2.44141 3.39453 2.75391 3.08984 3.10547 2.82422C3.46484 2.55859 3.85156 2.34766 4.26562 2.19141L4.30078 2.17969ZM1.14844 7.3125H2.625C2.65625 7.74219 2.71875 8.15625 2.8125 8.55469C2.89844 8.94531 3.01172 9.3125 3.15234 9.65625C3.30078 9.99219 3.47266 10.3008 3.66797 10.582C3.86328 10.8633 4.07422 11.1094 4.30078 11.3203C3.87891 11.1562 3.48828 10.9414 3.12891 10.6758C2.76953 10.4102 2.45312 10.1094 2.17969 9.77344C1.90625 9.42969 1.67969 9.05078 1.5 8.63672C1.32812 8.23047 1.21484 7.79688 1.16016 7.33594L1.14844 7.3125ZM7.69922 11.3203C7.92578 11.1094 8.13672 10.8633 8.33203 10.582C8.52734 10.3008 8.69531 9.98828 8.83594 9.64453C8.98438 9.30078 9.10547 8.93359 9.19922 8.54297C9.28516 8.15234 9.34375 7.74219 9.375 7.3125H10.8516C10.7891 7.77344 10.6719 8.21094 10.5 8.625C10.3203 9.03906 10.0938 9.41797 9.82031 9.76172C9.55469 10.1055 9.24609 10.4102 8.89453 10.6758C8.53516 10.9336 8.14844 11.1445 7.73438 11.3086L7.69922 11.3203Z" fill="#888888"/>
								</svg>
							</span>
							VIEW SITE
						</a>

						<a href="#" target="_blank" class="sui-btn sui-btn-ghost sui-btn-sm sui-btn-icon failed-btns view-log-btn">
							<span class="icon">
								<svg width="12" height="12" viewBox="0 0 12 9" fill="none" xmlns="http://www.w3.org/2000/svg">
									<path d="M6 7.375C6.35938 7.375 6.69922 7.30469 7.01953 7.16406C7.33984 7.03125 7.61719 6.84766 7.85156 6.61328C8.09375 6.37109 8.28125 6.08984 8.41406 5.76953C8.55469 5.44922 8.625 5.10938 8.625 4.75C8.625 4.39062 8.55469 4.05078 8.41406 3.73047C8.28125 3.41016 8.09375 3.13281 7.85156 2.89844C7.61719 2.65625 7.33984 2.46875 7.01953 2.33594C6.69922 2.19531 6.35938 2.125 6 2.125C5.64062 2.125 5.30078 2.19531 4.98047 2.33594C4.66016 2.46875 4.37891 2.65625 4.13672 2.89844C3.90234 3.13281 3.71875 3.41016 3.58594 3.73047C3.44531 4.05078 3.375 4.39062 3.375 4.75C3.375 5.10938 3.44531 5.44922 3.58594 5.76953C3.71875 6.08984 3.90234 6.37109 4.13672 6.61328C4.37891 6.84766 4.66016 7.03125 4.98047 7.16406C5.30078 7.30469 5.64062 7.375 6 7.375ZM0 4.75C0 4.75 0.105469 4.53516 0.316406 4.10547C0.527344 3.67578 0.871094 3.20312 1.34766 2.6875C1.82422 2.17188 2.44531 1.69922 3.21094 1.26953C3.96875 0.839844 4.89844 0.625 6 0.625C7.10156 0.625 8.03125 0.839844 8.78906 1.26953C9.55469 1.69922 10.1758 2.17188 10.6523 2.6875C11.1289 3.20312 11.4727 3.67578 11.6836 4.10547C11.8945 4.53516 12 4.75 12 4.75C12 4.75 11.8945 4.96484 11.6836 5.39453C11.4727 5.82422 11.1289 6.29688 10.6523 6.8125C10.1758 7.32812 9.55469 7.80078 8.78906 8.23047C8.03125 8.66016 7.10156 8.875 6 8.875C4.89844 8.875 3.96875 8.66016 3.21094 8.23047C2.44531 7.80078 1.82422 7.32812 1.34766 6.8125C0.871094 6.29688 0.527344 5.82422 0.316406 5.39453C0.105469 4.96484 0 4.75 0 4.75ZM6 5.875C6.3125 5.875 6.57812 5.76562 6.79688 5.54688C7.01562 5.32812 7.125 5.0625 7.125 4.75C7.125 4.4375 7.01562 4.17188 6.79688 3.95312C6.57812 3.73438 6.3125 3.625 6 3.625C5.6875 3.625 5.42188 3.73438 5.20312 3.95312C4.98438 4.17188 4.875 4.4375 4.875 4.75C4.875 5.0625 4.98438 5.32812 5.20312 5.54688C5.42188 5.76562 5.6875 5.875 6 5.875Z" fill="#888888"/>
								</svg>
							</span>
							VIEW LOGS
						</a>

						<a href="#" target="_blank" class="sui-btn sui-btn-ghost sui-btn-sm sui-btn-icon failed-btns refresh-log-btn">
							<span class="icon icon-refresh">
								<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
									<path d="M3.65625 8.38672C3.65625 8.39453 3.66016 8.40234 3.66797 8.41016C3.67578 8.41016 3.68359 8.41406 3.69141 8.42188C4.08984 8.77344 4.54688 9.02344 5.0625 9.17188C5.58594 9.32031 6.11719 9.34766 6.65625 9.25391C7.26562 9.15234 7.80469 8.91016 8.27344 8.52734C8.74219 8.14453 9.09375 7.67578 9.32812 7.12109C9.42969 6.88672 9.59766 6.72266 9.83203 6.62891C10.0742 6.52734 10.3164 6.52734 10.5586 6.62891C10.793 6.72266 10.957 6.89062 11.0508 7.13281C11.1523 7.375 11.1523 7.61328 11.0508 7.84766C10.8789 8.26953 10.6562 8.66406 10.3828 9.03125C10.1094 9.39062 9.79688 9.71094 9.44531 9.99219C9.09375 10.2734 8.71094 10.5078 8.29688 10.6953C7.88281 10.8828 7.44531 11.0195 6.98438 11.1055C6.57031 11.1758 6.16016 11.1992 5.75391 11.1758C5.34766 11.1523 4.94922 11.0859 4.55859 10.9766C4.17578 10.8672 3.80469 10.7188 3.44531 10.5312C3.08594 10.3359 2.75391 10.1016 2.44922 9.82812C2.41797 9.79688 2.38281 9.76953 2.34375 9.74609C2.3125 9.71484 2.28125 9.68359 2.25 9.65234L1.69922 10.1445C1.62891 10.207 1.55078 10.2578 1.46484 10.2969C1.37891 10.3281 1.28906 10.3438 1.19531 10.3438C0.992188 10.3438 0.816406 10.2695 0.667969 10.1211C0.519531 9.97266 0.445312 9.79688 0.445312 9.59375V7.0625C0.445312 7.04688 0.445312 7.03516 0.445312 7.02734C0.453125 7.01172 0.457031 6.99609 0.457031 6.98047C0.480469 6.77734 0.570312 6.61328 0.726562 6.48828C0.890625 6.35547 1.07422 6.29688 1.27734 6.3125L3.79688 6.58203C3.88281 6.58984 3.96875 6.61719 4.05469 6.66406C4.14062 6.70312 4.21094 6.75781 4.26562 6.82812C4.40625 6.97656 4.46875 7.15625 4.45312 7.36719C4.44531 7.57031 4.36719 7.74219 4.21875 7.88281L3.65625 8.38672ZM8.40234 3.11328C8.39453 3.11328 8.38672 3.10937 8.37891 3.10156C8.37109 3.09375 8.36328 3.08594 8.35547 3.07812C7.94922 2.71875 7.48438 2.46484 6.96094 2.31641C6.44531 2.16797 5.91797 2.14453 5.37891 2.24609C4.77734 2.34766 4.23828 2.58984 3.76172 2.97266C3.29297 3.34766 2.94531 3.8125 2.71875 4.36719C2.61719 4.60938 2.44531 4.78125 2.20312 4.88281C1.96094 4.97656 1.72266 4.97266 1.48828 4.87109C1.24609 4.76953 1.07422 4.60156 0.972656 4.36719C0.878906 4.125 0.882812 3.88281 0.984375 3.64062C1.16406 3.21875 1.39062 2.82812 1.66406 2.46875C1.9375 2.10938 2.24609 1.78906 2.58984 1.50781C2.94141 1.22656 3.32422 0.992188 3.73828 0.804688C4.15234 0.609375 4.58984 0.472656 5.05078 0.394531C5.46484 0.324219 5.875 0.300781 6.28125 0.324219C6.69531 0.339844 7.09375 0.402344 7.47656 0.511719C7.86719 0.621094 8.24219 0.773438 8.60156 0.96875C8.95312 1.16406 9.28516 1.39844 9.59766 1.67188C9.62891 1.70312 9.66016 1.73438 9.69141 1.76562C9.73047 1.79687 9.76562 1.82813 9.79688 1.85938L10.3594 1.35547C10.4297 1.29297 10.5078 1.24609 10.5938 1.21484C10.6797 1.17578 10.7695 1.15625 10.8633 1.15625C11.0742 1.15625 11.25 1.23047 11.3906 1.37891C11.5391 1.52734 11.6133 1.70312 11.6133 1.90625V4.4375C11.6133 4.44531 11.6133 4.45703 11.6133 4.47266C11.6133 4.48828 11.6133 4.50391 11.6133 4.51953C11.5898 4.72266 11.4961 4.89062 11.332 5.02344C11.1758 5.14844 10.9961 5.19922 10.793 5.17578L8.27344 4.91797C8.17969 4.91016 8.08984 4.88672 8.00391 4.84766C7.92578 4.80078 7.85547 4.74219 7.79297 4.67188C7.66016 4.51562 7.59766 4.33594 7.60547 4.13281C7.61328 3.92188 7.69531 3.75 7.85156 3.61719L8.40234 3.11328Z" fill="#888888"/>
								</svg>
							</span>
							REFRESH LOGS
						</a>
					</div>
					<div class="footer-items footer-column-right d-flex align-center">
						<span class="mr-20 success-screen">
							<span class="mr-5 di-b" style="position: relative; top: 1px">
								<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
									<path d="M6 0.75C6.41406 0.75 6.8125 0.789063 7.19531 0.867188C7.58594 0.945312 7.96484 1.0625 8.33203 1.21875C8.69922 1.375 9.04297 1.5625 9.36328 1.78125C9.68359 1.99219 9.97656 2.23047 10.2422 2.49609C10.5156 2.76953 10.7578 3.06641 10.9688 3.38672C11.1875 3.70703 11.375 4.05078 11.5312 4.41797C11.6875 4.77734 11.8047 5.15234 11.8828 5.54297C11.9609 5.93359 12 6.33594 12 6.75C12 7.16406 11.9609 7.56641 11.8828 7.95703C11.8047 8.33984 11.6875 8.71484 11.5312 9.08203C11.375 9.44922 11.1875 9.79297 10.9688 10.1133C10.7578 10.4336 10.5195 10.7266 10.2539 10.9922C9.98047 11.2656 9.68359 11.5117 9.36328 11.7305C9.04297 11.9414 8.69922 12.125 8.33203 12.2812C7.97266 12.4375 7.59766 12.5547 7.20703 12.6328C6.81641 12.7109 6.41406 12.75 6 12.75C5.58594 12.75 5.18359 12.7109 4.79297 12.6328C4.41016 12.5547 4.03516 12.4375 3.66797 12.2812C3.30078 12.125 2.95703 11.9414 2.63672 11.7305C2.31641 11.5117 2.02344 11.2695 1.75781 11.0039C1.48438 10.7305 1.23828 10.4336 1.01953 10.1133C0.808594 9.79297 0.625 9.44922 0.46875 9.08203C0.3125 8.72266 0.195312 8.34766 0.117188 7.95703C0.0390625 7.56641 0 7.16406 0 6.75C0 6.33594 0.0390625 5.9375 0.117188 5.55469C0.195312 5.16406 0.3125 4.78516 0.46875 4.41797C0.625 4.05078 0.808594 3.70703 1.01953 3.38672C1.23828 3.06641 1.48047 2.77344 1.74609 2.50781C2.01953 2.23437 2.31641 1.99219 2.63672 1.78125C2.95703 1.5625 3.30078 1.375 3.66797 1.21875C4.02734 1.0625 4.40234 0.945312 4.79297 0.867188C5.18359 0.789063 5.58594 0.75 6 0.75ZM6 6C5.78906 6 5.60938 6.07422 5.46094 6.22266C5.32031 6.36328 5.25 6.53906 5.25 6.75V9C5.25 9.21094 5.32031 9.39062 5.46094 9.53906C5.60938 9.67969 5.78906 9.75 6 9.75C6.21094 9.75 6.38672 9.67969 6.52734 9.53906C6.67578 9.39062 6.75 9.21094 6.75 9V6.75C6.75 6.53906 6.67578 6.36328 6.52734 6.22266C6.38672 6.07422 6.21094 6 6 6ZM6 5.25C6.21094 5.25 6.38672 5.17969 6.52734 5.03906C6.67578 4.89062 6.75 4.71094 6.75 4.5C6.75 4.28906 6.67578 4.11328 6.52734 3.97266C6.38672 3.82422 6.21094 3.75 6 3.75C5.78906 3.75 5.60938 3.82422 5.46094 3.97266C5.32031 4.11328 5.25 4.28906 5.25 4.5C5.25 4.71094 5.32031 4.89062 5.46094 5.03906C5.60938 5.17969 5.78906 5.25 6 5.25Z" fill="#888888"/>
								</svg>
							</span>
							Recommended
						</span>
						<a href="#" id="next-screen" data-screen="requirements" class="sui-btn sui-btn-block sui-btn-sm sui-btn-blue next-screen">GET STARTED</a>
						<a href="#" class="sui-btn sui-btn-block sui-btn-sm sui-btn-gray failed-btns download-log">
							<span class="icon">
								<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
								<path d="M10.9102 5.69141H8.41406C8.26562 5.69141 8.12891 5.73828 8.00391 5.83203C7.88672 5.91797 7.80469 6.03125 7.75781 6.17188C7.63281 6.54688 7.41016 6.85547 7.08984 7.09766C6.76953 7.33984 6.40625 7.46094 6 7.46094C5.59375 7.46094 5.23047 7.34375 4.91016 7.10938C4.58984 6.86719 4.37109 6.5625 4.25391 6.19531C4.20703 6.04688 4.12109 5.92578 3.99609 5.83203C3.87109 5.73828 3.73438 5.69141 3.58594 5.69141H1.08984C0.902344 5.69141 0.738281 5.76172 0.597656 5.90234C0.464844 6.03516 0.398438 6.19922 0.398438 6.39453V10.3789C0.398438 10.5742 0.464844 10.7422 0.597656 10.8828C0.738281 11.0156 0.902344 11.082 1.08984 11.082H10.9102C11.0977 11.082 11.2578 11.0156 11.3906 10.8828C11.5312 10.7422 11.6016 10.5742 11.6016 10.3789V6.39453C11.6016 6.19922 11.5312 6.03516 11.3906 5.90234C11.2578 5.76172 11.0977 5.69141 10.9102 5.69141ZM5.84766 6.06641C5.87109 6.08984 5.89453 6.10938 5.91797 6.125C5.94141 6.14062 5.96875 6.14844 6 6.14844C6.00781 6.14844 6.01172 6.14844 6.01172 6.14844C6.04297 6.14844 6.07031 6.14062 6.09375 6.125C6.11719 6.10938 6.14062 6.08984 6.16406 6.06641L8.09766 3.34766C8.10547 3.33203 8.11328 3.31641 8.12109 3.30078C8.12891 3.27734 8.13281 3.25391 8.13281 3.23047C8.13281 3.18359 8.11328 3.14063 8.07422 3.10156C8.04297 3.0625 8 3.04297 7.94531 3.04297C7.94531 3.04297 7.94141 3.04297 7.93359 3.04297H7.03125V0.605469C7.03125 0.550781 7.01172 0.507812 6.97266 0.476562C6.94141 0.4375 6.89844 0.417969 6.84375 0.417969H5.15625C5.10938 0.417969 5.06641 0.4375 5.02734 0.476562C4.98828 0.507812 4.96875 0.550781 4.96875 0.605469V3.04297H4.05469C4.00781 3.04297 3.96484 3.0625 3.92578 3.10156C3.88672 3.14063 3.86719 3.18359 3.86719 3.23047C3.86719 3.25391 3.87109 3.27734 3.87891 3.30078C3.88672 3.31641 3.89453 3.33203 3.90234 3.34766L5.84766 6.06641Z" fill="white"/>
								</svg>
							</span>
							DOWNLOAD LOG
						</a>
						<a href="#" class="sui-btn sui-btn-block sui-btn-sm sui-btn-gray failed-btns btn-retry">
							<span class="icon">

							<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M8.625 6.49219L9.87891 5.25C9.90234 5.21875 9.92188 5.1875 9.9375 5.15625C9.95312 5.11719 9.96094 5.07812 9.96094 5.03906C9.96094 5 9.95312 4.96094 9.9375 4.92188C9.92188 4.88281 9.90234 4.85156 9.87891 4.82812L8.83594 3.78516C8.8125 3.76172 8.78125 3.74219 8.74219 3.72656C8.70312 3.71094 8.66406 3.70312 8.625 3.70312C8.58594 3.70312 8.54688 3.71094 8.50781 3.72656C8.47656 3.74219 8.44531 3.76172 8.41406 3.78516L7.17188 5.03906L8.625 6.49219ZM6.55078 5.66016L1.04297 11.168C1.00391 11.207 0.972656 11.2539 0.949219 11.3086C0.925781 11.3633 0.914062 11.4219 0.914062 11.4844C0.914062 11.5391 0.925781 11.5938 0.949219 11.6484C0.972656 11.7031 1.00391 11.75 1.04297 11.7891L1.875 12.6211C1.91406 12.6602 1.95703 12.6914 2.00391 12.7148C2.05859 12.7383 2.11719 12.75 2.17969 12.75C2.24219 12.75 2.30078 12.7383 2.35547 12.7148C2.41016 12.6914 2.45703 12.6602 2.49609 12.6211L8.00391 7.11328L6.55078 5.66016ZM3.84375 2.4375L4.01953 2.91797C4.10547 3.13672 4.23047 3.33203 4.39453 3.50391C4.56641 3.66797 4.76172 3.79297 4.98047 3.87891L5.46094 4.05469L4.99219 4.23047C4.76562 4.31641 4.56641 4.44531 4.39453 4.61719C4.23047 4.78125 4.10938 4.97266 4.03125 5.19141L3.84375 5.67188L3.67969 5.20312C3.59375 4.97656 3.46484 4.78125 3.29297 4.61719C3.12891 4.44531 2.9375 4.31641 2.71875 4.23047L2.23828 4.05469L2.70703 3.87891C2.93359 3.79297 3.12891 3.66797 3.29297 3.50391C3.46484 3.33984 3.59375 3.14844 3.67969 2.92969L3.84375 2.4375ZM7.38281 0.75L7.5 1.06641C7.55469 1.22266 7.63672 1.35938 7.74609 1.47656C7.86328 1.59375 8 1.67969 8.15625 1.73438L8.48438 1.85156L8.15625 1.96875C8.00781 2.03125 7.875 2.12109 7.75781 2.23828C7.64062 2.34766 7.55469 2.47656 7.5 2.625L7.38281 2.95312L7.25391 2.625C7.19922 2.47656 7.11328 2.34375 6.99609 2.22656C6.88672 2.10938 6.75391 2.02344 6.59766 1.96875L6.26953 1.85156L6.59766 1.72266C6.74609 1.66797 6.87891 1.58594 6.99609 1.47656C7.11328 1.35938 7.19922 1.22266 7.25391 1.06641L7.38281 0.75ZM10.2422 8.35547L10.3359 8.60156C10.3828 8.71875 10.4492 8.82031 10.5352 8.90625C10.6211 8.99219 10.7227 9.05859 10.8398 9.10547L11.0859 9.19922L10.8398 9.28125C10.7227 9.32812 10.6211 9.39453 10.5352 9.48047C10.4492 9.56641 10.3828 9.66797 10.3359 9.78516L10.2422 10.043L10.1484 9.79688C10.1094 9.67969 10.043 9.57812 9.94922 9.49219C9.86328 9.39844 9.76562 9.33203 9.65625 9.29297L9.39844 9.19922L9.64453 9.10547C9.76172 9.05859 9.86328 8.99219 9.94922 8.90625C10.043 8.82031 10.1094 8.71875 10.1484 8.60156L10.2422 8.35547Z" fill="white"/>
							</svg>

							</span>
							ClEAN UP FILES AND TRY AGAIN
						</a>

					</div>
				</div>
			</div>
		</footer>
		<?php
	}
}



// Source: src/lib/View/Partial/class_si_view_partial_header.php


/**
 * Represents a partial view for header.
 */
class Si_View_Partial_Header extends Si_View {

	/**
	 * Outputs the header.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$logo = new Si_View_Images_Logo();
		?>
		<header class="sui-header d-flex justify-between align-top py-30">
			<div class="snapshot-header--img d-flex align-center">
				<div class="snapshot-logo--svg">
					<?php $logo->out(); ?>
				</div>
				<div class="snapshot-logo--brand">
					<h1 class="text-logo">Snapshot</h1>
					<h5 class="logo-description">Restore Wizard</h5>
				</div>
			</div>
			<div class="snapshot-docs--link">
				<a href="https://wpmudev.com/docs/wpmu-dev-plugins/snapshot-4-0/#restore-with-an-installer-file" target="_blank" class="sui-btn sui-btn-icon sui-btn-outline sui-btn-sm sui-btn-ghost">
					<span class="icon">
						<svg width="13" height="13" viewBox="0 0 13 10" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M6.70703 9.02734C6.51172 9.02734 6.19141 8.98047 5.74609 8.88672C5.29297 8.79297 4.83594 8.65625 4.375 8.47656C3.91406 8.28906 3.50781 8.05859 3.15625 7.78516C2.80469 7.50391 2.62891 7.17969 2.62891 6.8125V5.16016L6.57812 6.75391C6.60156 6.76172 6.62109 6.76953 6.63672 6.77734C6.66016 6.77734 6.68359 6.77734 6.70703 6.77734C6.73047 6.77734 6.75391 6.77734 6.77734 6.77734C6.80078 6.76953 6.82031 6.76172 6.83594 6.75391L10.7383 5.17188L10.7852 5.19531V6.8125C10.7852 7.1875 10.6094 7.51172 10.2578 7.78516C9.90625 8.06641 9.5 8.30078 9.03906 8.48828C8.57812 8.66797 8.125 8.80469 7.67969 8.89844C7.22656 8.98438 6.90234 9.02734 6.70703 9.02734ZM13 9.25L12.2266 8.33594L11.4648 9.25V4.98438C11.4648 4.96875 11.4648 4.93359 11.4648 4.87891C11.4648 4.82422 11.4648 4.79688 11.4648 4.79688L9.32031 3.71875L13 4.52734V9.25ZM12.1211 3.89453L7.92578 3.07422C7.89453 3.07422 7.87109 3.08203 7.85547 3.09766C7.83984 3.11328 7.83203 3.13281 7.83203 3.15625C7.83203 3.17188 7.83594 3.18359 7.84375 3.19141C7.85156 3.19922 7.85938 3.20703 7.86719 3.21484L10.1289 4.70312L6.70703 6.08594L1.5625 4C1.33594 3.90625 1.17188 3.74609 1.07031 3.51953C0.976562 3.29297 0.976562 3.0625 1.07031 2.82812C1.11719 2.71875 1.18359 2.62109 1.26953 2.53516C1.35547 2.44922 1.45312 2.38281 1.5625 2.33594L6.70703 0.25L12.1211 2.44141C12.3242 2.51953 12.4648 2.66016 12.543 2.86328C12.6289 3.05859 12.6328 3.25781 12.5547 3.46094C12.5156 3.5625 12.457 3.65234 12.3789 3.73047C12.3086 3.80078 12.2227 3.85547 12.1211 3.89453Z" fill="#888888"/>
						</svg>
					</span>
					DOCUMENTATION
				</a>
			</div>
		</header>
		<?php
	}
}



// Source: src/lib/View/Partial/class_si_view_partial_scripts.php


/**
 * Represents a partial view for scripts.
 */
class Si_View_Partial_Scripts extends Si_View {

	/**
	 * Outputs the scripts.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$base_url = app()->get_base_url();
		?>
		<script>
			const baseUrl = '<?php echo $base_url; ?>';
			const contentArea = document.querySelector('.content-area');
			const testConnection = document.querySelector('.btn-test-connection');
			const nextScreenBtn = document.querySelector('#next-screen');
			const viewLog = document.querySelector('.view-log-btn');
			const refreshLog = document.querySelector('.refresh-log-btn');
			const backBtn = document.querySelector('.back-btn');
			const retryBtn = document.querySelector('.btn-retry');
			const checkBtn = document.querySelector('.btn-check-again');
			const downloadLog = document.querySelector('.download-log');
			const nextScreenForce = document.querySelector( '.next-screen--force' );

			// Event bindings
			if (contentArea) {
				contentArea.addEventListener('click', (e) => {
					let el = e.target;
					if (el.closest('.accordion-header')) {
						el = el.closest('.accordion-header');
					}

					if (el.classList.contains('accordion-header')) {
						e.preventDefault();
						const item = el.parentNode;

						if (item) {
							if (item.classList.contains('open')) {
								item.classList.remove('open');
							} else {
								item.classList.add('open');
							}
						}
					}

					if (el.closest('.analyze-requirement')) {
						el = el.closest('.analyze-requirement');
					}

					if (el.classList.contains('analyze-requirement')) {
						e.preventDefault();
						const check = el.dataset.name;
						if (el.classList.contains('disabled')) {
							return false;
						}
						el.classList.add('disabled');
						el.classList.add('spin');
						AJAX.analyzeSingle(el, check);
					}

					if (el.closest('.sui-toggle')) {
						el = el.closest('.sui-toggle');
					}

					if (el.classList.contains('sui-toggle')) {
						e.preventDefault();
						const input = el.querySelector('input');
						const box = el.closest('#database-configs').querySelector('.use-existing-db--creds');
						const noticeBox = el.closest('#database-configs').querySelector('.database-notice');
						if (box) {
							input.checked = !input.checked;
							if (input.checked) {
								box.style.display = 'none';
							} else {
								box.style.display = 'block';
								nextScreenBtn.classList.add('disabled');
								if (nextScreenBtn.classList.contains('disabled')) {
									nextScreenBtn.setAttribute('title', 'Please click on "Test Connection" to test the connection first!');
								} else {
									nextScreenBtn.removeAttribute('title');
								}

								if (noticeBox) {
									const notices = noticeBox.querySelectorAll('.sui-notice');
									noticeBox.style.display = 'none';
									notices.forEach((notice) => {
										notice.style.display = 'none';
									});

								}

							}
						}
					}

					if (el.closest('.view-log')) {
						el = el.closest('.view-log');
					}

					if (el.classList.contains('view-log')) {

					}
				});
			}

			// Test connection.
			if (testConnection) {
				testConnection.addEventListener('click', function(e){
					let el = e.target;
					if (el.closest('.btn-test-connection')) {
						el = el.closest('.btn-test-connection');
					}

					if (el.classList.contains('btn-test-connection')) {
						e.preventDefault();
						AJAX.database(el);
					}
				});
			}

			// Change Screen.
			if (nextScreenBtn) {
				nextScreenBtn.addEventListener('mouseenter', function(e) {
					const el = e.target;
					const datasets = el.dataset;
					let timer = null;
					if (el.classList.contains('disabled') && 'database' === datasets.screen) {
						if (null !== timer) {
							return;
						}
						testConnection.classList.add('click-me');
						timer = setTimeout(function(){
							testConnection.classList.remove('click-me');
							timer = null;
						}, 2000);
					}
				});
			}

			document.addEventListener('click', function(e) {
				const el = e.target;
				if ( el.classList.contains( 'next-screen--force' ) ) {
					e.preventDefault();
					AJAX.change_screen( el );
				}
			});

			if (viewLog) {
				viewLog.addEventListener('click', function(e) {
					e.preventDefault();
					const el = e.target;
					AJAX.loadLog(el);
				});
			}

			if (checkBtn) {
				checkBtn.addEventListener('click', (e) => {
					e.preventDefault();
					const el = e.target;
					if (el.classList.contains('disabled')) {
						return;
					}
					el.classList.add('spin');
					el.classList.add('disabled');
					AJAX.analyze(nextScreenBtn, null);
					setTimeout(() => {
						el.classList.remove('disabled');
						el.classList.remove('spin');
					}, 2000);
				});
			}

			if (refreshLog) {
				refreshLog.addEventListener('click', function(e) {
					e.preventDefault();
					const el = e.target;

					AJAX.refreshLog(el);
				});
			}

			if (downloadLog) {
				downloadLog.addEventListener('click', function(e){
					e.preventDefault();
					const el = e.target;

					AJAX.getLogUrl(el);
				});
			}

			if (retryBtn) {
				retryBtn.addEventListener('click', (e) => {
					e.preventDefault();
					const el = e.target;
					AJAX.cleanStart(el);
				});
			}

			if (backBtn) {
				backBtn.addEventListener('click', function(e) {
					e.preventDefault();
					const el = e.target;

					const screen = el.dataset.screen;
					const data = {
						action: 'change_screen',
						screen: screen,
					};

					const url = AJAX.getUrl(data);
					const req = fetch(url);
					req
						.then(response => response.json())
						.then((result) => {
							if ('success' === result.status) {
								const bodyClass = document.body.className;
								document.body.classList.replace(bodyClass, `screen-${screen}`);
								document.querySelector('.sui-page').classList.remove('analysis-complete');
								document.querySelector('[data-name=requirements]').classList.remove('success');
								document.querySelector('[data-name=database]').classList.remove('active');
								nextScreenBtn.innerHTML = 'GET STARTED';
								nextScreenBtn.classList.remove('disabled');
								nextScreenBtn.setAttribute('data-screen', 'requirements');
								contentArea.innerHTML = result.data.html;
							}
						})
						.catch((err) => {
							console.log(err);
						});
				});
			}

			function getFormData(data) {
				const formData = new FormData();
				formData.append('request', 'ajax');
				formData.append('action', data.action);

				if ('change_screen' === data.action && 'screen' in data) {
					formData.append('screen', data.screen);
				}
				return formData;
			}

			const UI = {

				progress: function() {
					const bar = document.querySelector('.progress-bar');
					if (!bar) {
						return;
					}
					const text = bar.querySelector('.loading-percent');
					const innerBar = bar.querySelector('.loading-inner');
					var times = 0;

					let base = parseFloat(100 / 6).toFixed(0);
					var interval = setInterval(() => {
						times++;
						let percentage = times * base;

						if (3 === times) {
							percentage = 50;
						}

						if (6 === times) {
							percentage = 100;
							bar.querySelector('.loading-icon').classList.remove('spin');
							clearInterval(interval);
						}
						text.innerHTML = percentage + '%';
						innerBar.style.width = '100%';
					}, 500 );
				}
			};

			/**
			 * AJAX requests grouped to single object.
			 */
			const AJAX = {
				loading: false,

				/**
				 * Build the AJAX url based upon the passed data.
				 */
				getUrl: function(data) {
					let url = baseUrl + '?request=ajax';

					if ('object' === typeof data) {
						for (var key in data) {
							const val = data[key];
							url += `&${key}=${val}`;
						}
					}

					return url;
				},

				/**
				 * Ajax request to change the screen.
				 */
				change_screen: function(sel) {
					const _self = this;

					if (sel.classList.contains('disabled')) {
						return;
					}

					let el = sel;

					el.classList.add('disabled');

					const dataSet = el.dataset;
					let screen  = dataSet.screen;

					const bodyEl = document.body;
					const data = {
						action: 'change_screen',
						screen: screen
					};

					const ajaxUrl = _self.getUrl(data);
					const content = document.querySelector('.content-area');
					const steps = document.querySelector('.steps');
					const req = fetch(ajaxUrl);
					let title = document.title;
					req
						.then(res => res.json())
						.then((result) => {
							if ('success' === result.status) {
								content.innerHTML = result.data.html;
								let className = bodyEl.className;
								let name = screen;
								if ('success' === screen) {
									name = 'cleanup';
									screen = 'cleanup';
								}

								if ( sel.classList.contains( 'next-screen--force' ) ) {
									el = nextScreenBtn;
								}

								bodyEl.classList.replace(className, `screen-${screen}`);

								if ( 'failed' === screen ) {
									name = 'deployment';
								}

								if ( 'warning_files' === screen || 'warning_database' === screen ) {
									name = 'requirements';
								}

								const currentStep = steps.querySelector(`[data-name=${name}]`);
								currentStep.classList.add('active');

								if ('title' in result.data) {
									if (title.includes('|')) {
										const splitted = title.split( ' | ' );
										title = splitted[1];
									}
									document.title = result.data.title + ' | ' + title;
								}

								if ('requirements' === screen) {

								} else if ( 'warning_files' === screen || 'warning_database' === screen ) {
									const sidebar = document.querySelector( '#main-sidebar' );
									if ( 'warning_files' === screen ) {
										sidebar.innerHTML = '';
										sidebar.innerHTML = result.data.sidebar;
									}

									if ( ! sidebar.querySelector( `[data-name=${name}]` ).classList.contains( 'active' ) ) {
										sidebar.querySelector( `[data-name=${name}]` ).classList.add( 'active' );
									}
								} else if ('database' === screen) {
									currentStep.previousElementSibling.classList.remove('active');
									currentStep.previousElementSibling.classList.add('success');
									currentStep.classList.add('active');
									nextScreenBtn.setAttribute('title', 'Please click on "Test Connection" to test the connection first!');
									el.innerHTML = `DEPLOYMENT&nbsp;
									<svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M11.2969 5.50391L6.73828 0.945312C6.70703 0.914063 6.66797 0.890625 6.62109 0.875C6.58203 0.859375 6.53516 0.851562 6.48047 0.851562C6.43359 0.851562 6.38672 0.859375 6.33984 0.875C6.30078 0.890625 6.26562 0.914063 6.23438 0.945312L5.50781 1.68359C5.46875 1.71484 5.44141 1.75391 5.42578 1.80078C5.41016 1.83984 5.40234 1.88281 5.40234 1.92969C5.40234 1.97656 5.41016 2.02344 5.42578 2.07031C5.44141 2.10938 5.46875 2.14453 5.50781 2.17578L8.20312 4.88281H0.914062C0.828125 4.88281 0.753906 4.91406 0.691406 4.97656C0.636719 5.03125 0.609375 5.10156 0.609375 5.1875V6.3125C0.609375 6.39844 0.636719 6.47266 0.691406 6.53516C0.753906 6.58984 0.828125 6.61719 0.914062 6.61719H8.20312L5.50781 9.32422C5.47656 9.35547 5.44922 9.39453 5.42578 9.44141C5.41016 9.48047 5.40234 9.52344 5.40234 9.57031C5.40234 9.61719 5.41016 9.66406 5.42578 9.71094C5.44922 9.75781 5.47656 9.79688 5.50781 9.82812L6.23438 10.5547C6.26562 10.5859 6.30078 10.6094 6.33984 10.625C6.38672 10.6406 6.43359 10.6484 6.48047 10.6484C6.53516 10.6484 6.58203 10.6406 6.62109 10.625C6.66797 10.6094 6.70703 10.5859 6.73828 10.5547L11.2969 5.99609C11.3281 5.96484 11.3516 5.92969 11.3672 5.89062C11.3828 5.84375 11.3906 5.79688 11.3906 5.75C11.3906 5.70312 11.3828 5.66016 11.3672 5.62109C11.3516 5.57422 11.3281 5.53516 11.2969 5.50391Z" fill="#AAAAAA"/>
									</svg>`;
								} else if ('deployment' === screen) {
									el.removeAttribute('title');
									currentStep.previousElementSibling.classList.remove('active');
									currentStep.previousElementSibling.classList.add('success');
									currentStep.classList.add('active');
								} else if ('failed' === screen) {

								} else if ('cleanup' === screen) {
									currentStep.previousElementSibling.classList.remove('active');
									currentStep.previousElementSibling.classList.add('success');
									currentStep.classList.add('active');

									el.classList.remove('disabled');
									el.innerHTML = `<span class="icon mr-5"><svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M8.625 6.49219L9.87891 5.25C9.90234 5.21875 9.92188 5.1875 9.9375 5.15625C9.95312 5.11719 9.96094 5.07812 9.96094 5.03906C9.96094 5 9.95312 4.96094 9.9375 4.92188C9.92188 4.88281 9.90234 4.85156 9.87891 4.82812L8.83594 3.78516C8.8125 3.76172 8.78125 3.74219 8.74219 3.72656C8.70312 3.71094 8.66406 3.70312 8.625 3.70312C8.58594 3.70312 8.54688 3.71094 8.50781 3.72656C8.47656 3.74219 8.44531 3.76172 8.41406 3.78516L7.17188 5.03906L8.625 6.49219ZM6.55078 5.66016L1.04297 11.168C1.00391 11.207 0.972656 11.2539 0.949219 11.3086C0.925781 11.3633 0.914062 11.4219 0.914062 11.4844C0.914062 11.5391 0.925781 11.5938 0.949219 11.6484C0.972656 11.7031 1.00391 11.75 1.04297 11.7891L1.875 12.6211C1.91406 12.6602 1.95703 12.6914 2.00391 12.7148C2.05859 12.7383 2.11719 12.75 2.17969 12.75C2.24219 12.75 2.30078 12.7383 2.35547 12.7148C2.41016 12.6914 2.45703 12.6602 2.49609 12.6211L8.00391 7.11328L6.55078 5.66016ZM3.84375 2.4375L4.01953 2.91797C4.10547 3.13672 4.23047 3.33203 4.39453 3.50391C4.56641 3.66797 4.76172 3.79297 4.98047 3.87891L5.46094 4.05469L4.99219 4.23047C4.76562 4.31641 4.56641 4.44531 4.39453 4.61719C4.23047 4.78125 4.10938 4.97266 4.03125 5.19141L3.84375 5.67188L3.67969 5.20312C3.59375 4.97656 3.46484 4.78125 3.29297 4.61719C3.12891 4.44531 2.9375 4.31641 2.71875 4.23047L2.23828 4.05469L2.70703 3.87891C2.93359 3.79297 3.12891 3.66797 3.29297 3.50391C3.46484 3.33984 3.59375 3.14844 3.67969 2.92969L3.84375 2.4375ZM7.38281 0.75L7.5 1.06641C7.55469 1.22266 7.63672 1.35938 7.74609 1.47656C7.86328 1.59375 8 1.67969 8.15625 1.73438L8.48438 1.85156L8.15625 1.96875C8.00781 2.03125 7.875 2.12109 7.75781 2.23828C7.64062 2.34766 7.55469 2.47656 7.5 2.625L7.38281 2.95312L7.25391 2.625C7.19922 2.47656 7.11328 2.34375 6.99609 2.22656C6.88672 2.10938 6.75391 2.02344 6.59766 1.96875L6.26953 1.85156L6.59766 1.72266C6.74609 1.66797 6.87891 1.58594 6.99609 1.47656C7.11328 1.35938 7.19922 1.22266 7.25391 1.06641L7.38281 0.75ZM10.2422 8.35547L10.3359 8.60156C10.3828 8.71875 10.4492 8.82031 10.5352 8.90625C10.6211 8.99219 10.7227 9.05859 10.8398 9.10547L11.0859 9.19922L10.8398 9.28125C10.7227 9.32812 10.6211 9.39453 10.5352 9.48047C10.4492 9.56641 10.3828 9.66797 10.3359 9.78516L10.2422 10.043L10.1484 9.79688C10.1094 9.67969 10.043 9.57812 9.94922 9.49219C9.86328 9.39844 9.76562 9.33203 9.65625 9.29297L9.39844 9.19922L9.64453 9.10547C9.76172 9.05859 9.86328 8.99219 9.94922 8.90625C10.043 8.82031 10.1094 8.71875 10.1484 8.60156L10.2422 8.35547Z" fill="white"/>
									</svg></span>
									Run Cleanup`;
									el.removeAttribute('data-screen');
									el.setAttribute('data-screen', 'cleanup');
								}

								if ('nextRequest' in result.data && '' !== result.data.nextRequest) {
									const nextRequest = result.data.nextRequest;
									const keys = Object.keys(AJAX);
									if (keys.includes(nextRequest)) {
										let newData = null;
										if ('deploy' === result.data.nextRequest) {
											newData = { collect: 'status' };
										}
										AJAX[nextRequest](el, newData);
									}
								}
							} else if ('error' === result.status) {

							}
						})
						.catch((err) => {
							console.error(err);
						});
				},

				/**
				 * Ajax request to analyze the requirements
				 */
				analyze: function(el, data) {
					const _self = this;
					// Individual analysis required.
					let type = 'individual';

					// Prepare the data for AJAX request.
					let ajax = {
						action: 'analyze',
					}

					if (null === data) {
						// Analyze all the requirements
						ajax.type = 'all';
					} else {
						ajax.type = 'individual';
						ajax.what = data;
					}

					UI.progress();
					const analysis = document.querySelector('#requirements-analysis');
					const steps = document.querySelector('.steps');
					const ajaxUrl = _self.getUrl(ajax);
					const req = fetch(ajaxUrl);
					req
						.then(data => data.json())
						.then((result) => {
							setTimeout(function(){
								const list = steps.querySelector('[data-name=requirements]');

								if ('success' === result.status) {
									if ('change_screen' === result.data.nextRequest) {
										if (list.classList.contains('active')) {
											list.classList.remove('active');
										}
										list.classList.add('success');
										el.setAttribute('data-screen', result.data.nextScreen);
										if (el.classList.contains('disabled')) {
											el.classList.remove('disabled');
										}
										_self[result.data.nextRequest](el);
									}
								} else if ('error' === result.status) {
									analysis.innerHTML = result.data.html;
									document.querySelector('.sui-page').classList.add('analysis-complete');

									if ('forceProceed' in result.data && result.data.forceProceed) {
										el.setAttribute('data-screen', result.data.nextScreen);

										el.innerHTML = `Proceed Anyway&nbsp;
										<svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M11.2969 5.50391L6.73828 0.945312C6.70703 0.914063 6.66797 0.890625 6.62109 0.875C6.58203 0.859375 6.53516 0.851562 6.48047 0.851562C6.43359 0.851562 6.38672 0.859375 6.33984 0.875C6.30078 0.890625 6.26562 0.914063 6.23438 0.945312L5.50781 1.68359C5.46875 1.71484 5.44141 1.75391 5.42578 1.80078C5.41016 1.83984 5.40234 1.88281 5.40234 1.92969C5.40234 1.97656 5.41016 2.02344 5.42578 2.07031C5.44141 2.10938 5.46875 2.14453 5.50781 2.17578L8.20312 4.88281H0.914062C0.828125 4.88281 0.753906 4.91406 0.691406 4.97656C0.636719 5.03125 0.609375 5.10156 0.609375 5.1875V6.3125C0.609375 6.39844 0.636719 6.47266 0.691406 6.53516C0.753906 6.58984 0.828125 6.61719 0.914062 6.61719H8.20312L5.50781 9.32422C5.47656 9.35547 5.44922 9.39453 5.42578 9.44141C5.41016 9.48047 5.40234 9.52344 5.40234 9.57031C5.40234 9.61719 5.41016 9.66406 5.42578 9.71094C5.44922 9.75781 5.47656 9.79688 5.50781 9.82812L6.23438 10.5547C6.26562 10.5859 6.30078 10.6094 6.33984 10.625C6.38672 10.6406 6.43359 10.6484 6.48047 10.6484C6.53516 10.6484 6.58203 10.6406 6.62109 10.625C6.66797 10.6094 6.70703 10.5859 6.73828 10.5547L11.2969 5.99609C11.3281 5.96484 11.3516 5.92969 11.3672 5.89062C11.3828 5.84375 11.3906 5.79688 11.3906 5.75C11.3906 5.70312 11.3828 5.66016 11.3672 5.62109C11.3516 5.57422 11.3281 5.53516 11.2969 5.50391Z" fill="#FFFFFF"/>
										</svg>`;
										if (el.classList.contains('disabled')) {
											el.classList.remove('disabled');
										}

										if (checkBtn) {
											checkBtn.style.display = 'none';
										}
									} else {
										document.querySelector('.btn-check-again').classList.remove('sui-hidden');
										el.innerHTML = `Proceed&nbsp;
										<svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M11.2969 5.50391L6.73828 0.945312C6.70703 0.914063 6.66797 0.890625 6.62109 0.875C6.58203 0.859375 6.53516 0.851562 6.48047 0.851562C6.43359 0.851562 6.38672 0.859375 6.33984 0.875C6.30078 0.890625 6.26562 0.914063 6.23438 0.945312L5.50781 1.68359C5.46875 1.71484 5.44141 1.75391 5.42578 1.80078C5.41016 1.83984 5.40234 1.88281 5.40234 1.92969C5.40234 1.97656 5.41016 2.02344 5.42578 2.07031C5.44141 2.10938 5.46875 2.14453 5.50781 2.17578L8.20312 4.88281H0.914062C0.828125 4.88281 0.753906 4.91406 0.691406 4.97656C0.636719 5.03125 0.609375 5.10156 0.609375 5.1875V6.3125C0.609375 6.39844 0.636719 6.47266 0.691406 6.53516C0.753906 6.58984 0.828125 6.61719 0.914062 6.61719H8.20312L5.50781 9.32422C5.47656 9.35547 5.44922 9.39453 5.42578 9.44141C5.41016 9.48047 5.40234 9.52344 5.40234 9.57031C5.40234 9.61719 5.41016 9.66406 5.42578 9.71094C5.44922 9.75781 5.47656 9.79688 5.50781 9.82812L6.23438 10.5547C6.26562 10.5859 6.30078 10.6094 6.33984 10.625C6.38672 10.6406 6.43359 10.6484 6.48047 10.6484C6.53516 10.6484 6.58203 10.6406 6.62109 10.625C6.66797 10.6094 6.70703 10.5859 6.73828 10.5547L11.2969 5.99609C11.3281 5.96484 11.3516 5.92969 11.3672 5.89062C11.3828 5.84375 11.3906 5.79688 11.3906 5.75C11.3906 5.70312 11.3828 5.66016 11.3672 5.62109C11.3516 5.57422 11.3281 5.53516 11.2969 5.50391Z" fill="#AAAAAA"/>
										</svg>`;
									}
								}
							}, 2000);
						})
						.catch((err) => {
							console.error(err);
						})
				},

				/**
				 * Analyze the single requirement check request.
				 */
				analyzeSingle: function(el, scr) {
					const _self = this;
					// Prepare the data for AJAX request.

					let ajax = {
						action: 'analyze_single',
						type: 'individual',
						what: scr,
					}

					const analysis = document.querySelector('#requirements-analysis');
					const steps = document.querySelector('.steps');
					const mainBtn = document.querySelector('#next-screen');
					mainBtn.classList.add('disabled');

					const ajaxUrl = _self.getUrl(ajax);

					const req = fetch(ajaxUrl);
					req
						.then(data => data.json())
						.then((result) => {
							const list = steps.querySelector('[data-name=requirements]');
							setTimeout(() => {
								if ('success' === result.status) {
									if ('nextScreen' in result.data) {
										if (list.classList.contains('active')) {
											list.classList.remove('active');
										}
										list.classList.add('success');
										mainBtn.removeAttribute('data-screen');
										mainBtn.setAttribute('data-screen', result.data.nextScreen);
										if (mainBtn.classList.contains('disabled')) {
											mainBtn.classList.remove('disabled');
										}

										el.classList.remove('spin');
										el.classList.remove('disabled');
										document.querySelector('.sui-page').classList.add('analysis-complete');

										mainBtn.innerHTML = 'Proceed';

										if ('remove_item' in result.data && scr === result.data.remove_item) {
											const item = el.closest('.accordion-item');
											const parent = item.parentNode;
											const box = el.closest('.box');
											parent.removeChild(item);
											box.parentNode.removeChild(box);
										}

										if ('nextRequest' in result.data && 'change_screen' === result.data.nextRequest) {
											_self[result.data.nextRequest](mainBtn);
										}
									}
								} else if ('error' === result.status) {
									el.classList.remove('spin');
									el.classList.remove('disabled');
									document.querySelector('.sui-page').classList.add('analysis-complete');

									if ('remove_item' in result.data && scr === result.data.remove_item) {
										const item = el.closest('.accordion-item');
										const parent = item.parentNode;
										parent.removeChild(item);
									}

									if ('html' in result.data) {
										analysis.innerHTML = result.data.html;
										const item = contentArea.querySelector('.'+scr);

										if (item) {
											item.classList.add('open');
										}

										mainBtn.innerHTML = `Proceed&nbsp;
										<svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M11.2969 5.50391L6.73828 0.945312C6.70703 0.914063 6.66797 0.890625 6.62109 0.875C6.58203 0.859375 6.53516 0.851562 6.48047 0.851562C6.43359 0.851562 6.38672 0.859375 6.33984 0.875C6.30078 0.890625 6.26562 0.914063 6.23438 0.945312L5.50781 1.68359C5.46875 1.71484 5.44141 1.75391 5.42578 1.80078C5.41016 1.83984 5.40234 1.88281 5.40234 1.92969C5.40234 1.97656 5.41016 2.02344 5.42578 2.07031C5.44141 2.10938 5.46875 2.14453 5.50781 2.17578L8.20312 4.88281H0.914062C0.828125 4.88281 0.753906 4.91406 0.691406 4.97656C0.636719 5.03125 0.609375 5.10156 0.609375 5.1875V6.3125C0.609375 6.39844 0.636719 6.47266 0.691406 6.53516C0.753906 6.58984 0.828125 6.61719 0.914062 6.61719H8.20312L5.50781 9.32422C5.47656 9.35547 5.44922 9.39453 5.42578 9.44141C5.41016 9.48047 5.40234 9.52344 5.40234 9.57031C5.40234 9.61719 5.41016 9.66406 5.42578 9.71094C5.44922 9.75781 5.47656 9.79688 5.50781 9.82812L6.23438 10.5547C6.26562 10.5859 6.30078 10.6094 6.33984 10.625C6.38672 10.6406 6.43359 10.6484 6.48047 10.6484C6.53516 10.6484 6.58203 10.6406 6.62109 10.625C6.66797 10.6094 6.70703 10.5859 6.73828 10.5547L11.2969 5.99609C11.3281 5.96484 11.3516 5.92969 11.3672 5.89062C11.3828 5.84375 11.3906 5.79688 11.3906 5.75C11.3906 5.70312 11.3828 5.66016 11.3672 5.62109C11.3516 5.57422 11.3281 5.53516 11.2969 5.50391Z" fill="#AAAAAA"/>
										</svg>`;
									}

									if ('forceProceed' in result.data && result.data.forceProceed) {
										mainBtn.setAttribute('data-screen', result.data.nextScreen);
										mainBtn.innerHTML = `Proceed Anyway&nbsp;
										<svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M11.2969 5.50391L6.73828 0.945312C6.70703 0.914063 6.66797 0.890625 6.62109 0.875C6.58203 0.859375 6.53516 0.851562 6.48047 0.851562C6.43359 0.851562 6.38672 0.859375 6.33984 0.875C6.30078 0.890625 6.26562 0.914063 6.23438 0.945312L5.50781 1.68359C5.46875 1.71484 5.44141 1.75391 5.42578 1.80078C5.41016 1.83984 5.40234 1.88281 5.40234 1.92969C5.40234 1.97656 5.41016 2.02344 5.42578 2.07031C5.44141 2.10938 5.46875 2.14453 5.50781 2.17578L8.20312 4.88281H0.914062C0.828125 4.88281 0.753906 4.91406 0.691406 4.97656C0.636719 5.03125 0.609375 5.10156 0.609375 5.1875V6.3125C0.609375 6.39844 0.636719 6.47266 0.691406 6.53516C0.753906 6.58984 0.828125 6.61719 0.914062 6.61719H8.20312L5.50781 9.32422C5.47656 9.35547 5.44922 9.39453 5.42578 9.44141C5.41016 9.48047 5.40234 9.52344 5.40234 9.57031C5.40234 9.61719 5.41016 9.66406 5.42578 9.71094C5.44922 9.75781 5.47656 9.79688 5.50781 9.82812L6.23438 10.5547C6.26562 10.5859 6.30078 10.6094 6.33984 10.625C6.38672 10.6406 6.43359 10.6484 6.48047 10.6484C6.53516 10.6484 6.58203 10.6406 6.62109 10.625C6.66797 10.6094 6.70703 10.5859 6.73828 10.5547L11.2969 5.99609C11.3281 5.96484 11.3516 5.92969 11.3672 5.89062C11.3828 5.84375 11.3906 5.79688 11.3906 5.75C11.3906 5.70312 11.3828 5.66016 11.3672 5.62109C11.3516 5.57422 11.3281 5.53516 11.2969 5.50391Z" fill="#FFFFFF"/>
										</svg>`;
										if (mainBtn.classList.contains('disabled')) {
											mainBtn.classList.remove('disabled');
										}
									}
								}
							}, 1000 );

						})
						.catch((err) => {
							console.error(err);
						})
				},

				/**
				 * Tests and stores data to the database
				 */
				database: function( el ) {
					const _self = this;

					const form = contentArea.querySelector( '#database-creds-form' );

					if ( ! form ) {
						// Make sure we're processing the HTMLFormElement.
						return;
					}

					const fd = new FormData( form );

					let params = {
						action: 'database',
					};

					if ( el.classList.contains( 'disabled' ) ) {
						return;
					}

					let nextBtn = nextScreenBtn;

					let proceed = true;
					let isSiteUrlValidationError = false;

					if (fd.has('table_prefix') && '' === fd.get('table_prefix')) {
						form.querySelector('[name=table_prefix]').classList.add('error');
						proceed = false;
					} else {
						form.querySelector('[name=table_prefix]').classList.remove('error');
					}

					if (fd.has('site_url') && '' === fd.get('site_url')) {
						form.querySelector('[name=site_url]').classList.add('error');
						proceed = false;
						isSiteUrlValidationError = true;
					} else {
						let protocol;
						try {
							protocol = (new URL(fd.get('site_url'))).protocol;
						} catch (e) {
						}

						if ('http:' !== protocol && 'https:' !== protocol) {
							form.querySelector('[name=site_url]').classList.add('error');
							proceed = false;
							isSiteUrlValidationError = true;
						} else {
							form.querySelector('[name=site_url]').classList.remove('error');
						}
					}
					if (fd.has('config-creds')) {
						Object.assign(params, {configCreds: 'yes'});
						Object.assign(params, {site_url: fd.get('site_url')});
						Object.assign(params, {table_prefix: fd.get('table_prefix')});
					} else {
						// Validate the form data.
						if (fd.has('DB_HOST') && '' === fd.get('DB_HOST')) {
							contentArea.querySelector('[name=DB_HOST]').classList.add('error');
							proceed = false;
						} else {
							contentArea.querySelector('[name=DB_HOST]').classList.remove('error');
						}

						if (fd.has('DB_PORT') && '' === fd.get('DB_PORT')) {
							contentArea.querySelector('[name=DB_PORT]').classList.add('error');
							proceed = false;
						} else {
							contentArea.querySelector('[name=DB_PORT]').classList.remove('error');
						}

						if (fd.has('DB_NAME') && '' === fd.get('DB_NAME')) {
							contentArea.querySelector('[name=DB_NAME]').classList.add('error');
							proceed = false;
						} else {
							contentArea.querySelector('[name=DB_NAME]').classList.remove('error');
						}

						if (fd.has('DB_USER') && '' === fd.get('DB_USER')) {
							contentArea.querySelector('[name=DB_USER]').classList.add('error');
							proceed = false;
						} else {
							contentArea.querySelector('[name=DB_USER]').classList.remove('error');
						}
					}

					const block = contentArea.querySelector('.database-notice');
					const notices = block.querySelectorAll('.sui-notice');
					if (!proceed) {
						// Display the error message.
						notices.forEach((nel) => {
							nel.style.display = 'none';
							if ((isSiteUrlValidationError ? 'validation-error-site-url' : 'validation-error') === nel.getAttribute('id')) {
								nel.style.display = 'block';
							}
						});
						block.style.display = 'block';
						return false;
					} else {
						// Hide the error message.
						block.style.display = 'none';
						notices.forEach((nel) => {
							nel.style.display = 'none';
						});
					}

					el.classList.add('disabled');
					el.classList.add('spin');

					if (el.classList.contains('btn-test-connection')) {
						Object.assign(params, {
							sub_action: 'test_connection',
						});

					} else {
						Object.assign(params, {
							sub_action: 'store_creds',
						});
					}

					if (!fd.has('config-creds')) {
						const info = {};
						for (let key of fd.keys()) {
							info[key] = fd.get(key);
						}
						info['DB_PASSWORD'] = encodeURIComponent( info['DB_PASSWORD'] );
						Object.assign(params, info);
					}

					const ajaxUrl = _self.getUrl(params);

					let req = fetch(ajaxUrl);

					req
						.then(data => data.json())
						.then((result) => {

							if ('success' === result.status) {
								if ('connected' in result.data) {
									if ('release' in result.data && result.data.release) {
										nextBtn.classList.remove('disabled');
										nextBtn.innerHTML = `DEPLOYMENT&nbsp;
										<svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M11.2969 5.50391L6.73828 0.945312C6.70703 0.914063 6.66797 0.890625 6.62109 0.875C6.58203 0.859375 6.53516 0.851562 6.48047 0.851562C6.43359 0.851562 6.38672 0.859375 6.33984 0.875C6.30078 0.890625 6.26562 0.914063 6.23438 0.945312L5.50781 1.68359C5.46875 1.71484 5.44141 1.75391 5.42578 1.80078C5.41016 1.83984 5.40234 1.88281 5.40234 1.92969C5.40234 1.97656 5.41016 2.02344 5.42578 2.07031C5.44141 2.10938 5.46875 2.14453 5.50781 2.17578L8.20312 4.88281H0.914062C0.828125 4.88281 0.753906 4.91406 0.691406 4.97656C0.636719 5.03125 0.609375 5.10156 0.609375 5.1875V6.3125C0.609375 6.39844 0.636719 6.47266 0.691406 6.53516C0.753906 6.58984 0.828125 6.61719 0.914062 6.61719H8.20312L5.50781 9.32422C5.47656 9.35547 5.44922 9.39453 5.42578 9.44141C5.41016 9.48047 5.40234 9.52344 5.40234 9.57031C5.40234 9.61719 5.41016 9.66406 5.42578 9.71094C5.44922 9.75781 5.47656 9.79688 5.50781 9.82812L6.23438 10.5547C6.26562 10.5859 6.30078 10.6094 6.33984 10.625C6.38672 10.6406 6.43359 10.6484 6.48047 10.6484C6.53516 10.6484 6.58203 10.6406 6.62109 10.625C6.66797 10.6094 6.70703 10.5859 6.73828 10.5547L11.2969 5.99609C11.3281 5.96484 11.3516 5.92969 11.3672 5.89062C11.3828 5.84375 11.3906 5.79688 11.3906 5.75C11.3906 5.70312 11.3828 5.66016 11.3672 5.62109C11.3516 5.57422 11.3281 5.53516 11.2969 5.50391Z" fill="#FFFFFF"/>
										</svg>`;
										nextBtn.removeAttribute('data-screen');
										nextBtn.setAttribute('data-action', 'save-creds');
									}

									notices.forEach((notice) => {
										if ('test-connection--success' === notice.getAttribute('id')) {
											const msg = notice.querySelector('.sui-notice-message');
											let content = msg.innerHTML;
											msg.innerHTML = content.replace('%s', result.data.database);
											notice.style.display = 'block';
										} else {
											notice.style.display = 'none';
										}
									});
									block.style.display = 'block';
								}

								if ('nextRequest' in result.data && 'change_screen' === result.data.nextRequest) {
									nextBtn.removeAttribute('data-action');
									nextBtn.setAttribute('data-screen', result.data.nextScreen);
									if (nextBtn.classList.contains('disabled')) {
										nextBtn.classList.remove('disabled');
									}
									AJAX[result.data.nextRequest](nextBtn);
								}
							} else if ('error' === result.status) {
								notices.forEach((notice) => {
									if ('test-connection--error' === notice.getAttribute('id')) {
										notice.style.display = 'block';
									} else {
										notice.style.display = 'none';
									}
								});
								block.style.display = 'block';
							}

							el.classList.remove('spin');
							el.classList.remove('disabled');
						})
						.catch((err) => {
							console.error(err);
						});
				},

				/**
				 * Deploy the site.
				 */
				deploy: function(el, params = null) {
					const _self = this;

					if (null !== params) {
						el.classList.add('disabled');
						if ('collect' in params && 'status' === params.collect) {
							let data = {
								action: 'deploy',
								sub_action: 'status',
							};
							const ajaxUrl = _self.getUrl(data);
							let req = fetch(ajaxUrl);
							req
								.then(response => response.json())
								.then((result) => {
									if ('success' === result.status) {
										if ('nextRequest' in result.data && 'deploy' === result.data.nextRequest) {
											if ('sub_action' in result.data ) {
												const params = {};

												if ('unzip' === result.data.sub_action) {
													const backup = result.data.backup;
													backup.action = result.data.nextRequest;
													backup.sub_action = result.data.sub_action;

													if (!backup.hasOwnProperty('index')) {
														backup.index = 0;
													}
													_self[result.data.nextRequest](el, backup);
												}
											}
										}
									} else if ('error' === result.status) {
										if ('nextRequest' in result.data) {
											el.classList.remove('disabled');
											el.removeAttribute('data-screen');
											el.setAttribute('data-screen', result.data.screen);
											_self[result.data.nextRequest](el);
										}
									}
								})
								.catch((err) => {
									console.log(err);
								})

						}

						if ('action' in params) {
							const loadingBlock = contentArea.querySelector('.loading-block');
							const backupWidth = loadingBlock.querySelector('.loading-inner');
							const backupPC = loadingBlock.querySelector('.loading-percent');

							const ajaxUrl = _self.getUrl(params);
							const req = fetch(ajaxUrl);
							req
								.then(response => response.json())
								.then((result) => {
									if ('success' === result.status) {
										if ('nextRequest' in result.data && 'deploy' === result.data.nextRequest) {
											if ('sub_action' in result.data ) {
												const params = {};

												if ('percent' in result.data) {
													let pc = parseInt(backupPC.innerHTML);
													if ('unzip' === result.data.sub_action && pc <= 60) {
														pc += result.data.percent;
													}

													if ('installdb' === result.data.sub_action && pc <= 90) {
														pc += result.data.percent;
													}

													backupWidth.style.width = pc + '%';
													backupPC.innerHTML = pc + '%';
												}

												if ('unzip' === result.data.sub_action) {
													const backup = result.data.backup;
													backup.action = result.data.nextRequest;
													backup.sub_action = result.data.sub_action;

													if (!backup.hasOwnProperty('index')) {
														backup.index = 0;
													}

													_self[result.data.nextRequest](el, backup);
												} else if ('clean_source' === result.data.sub_action) {
													const cleanSource = {
														action: result.data.nextRequest,
														sub_action: result.data.sub_action,
													};
													_self[result.data.nextRequest](el, cleanSource);
												} else if ('write_config' === result.data.sub_action) {
													const write = {
														action: result.data.nextRequest,
														sub_action: result.data.sub_action
													};
													_self[result.data.nextRequest](el, write);
												} else if ('installdb' === result.data.sub_action) {
													let install = {};
													if ('sql_data' in result.data) {
														install = result.data.sql_data;
													}
													install.action = result.data.nextRequest;
													install.sub_action = result.data.sub_action;
													contentArea.querySelector('.deploy-status').innerHTML = 'Installing Database &hellip;';
													contentArea.querySelector('.action-unpacking').classList.remove('current');
													contentArea.querySelector('.action-unpacking').classList.add('done');
													contentArea.querySelector('.action-database').classList.remove('waiting');
													contentArea.querySelector('.action-database').classList.add('current');
													setTimeout(() => {
														_self[result.data.nextRequest](el, install);
													}, 1000);
													// Prepare the parameter for installing the database
												} else if ('settings' === result.data.sub_action) {
													contentArea.querySelector('.deploy-status').innerHTML = 'Applying Settings &hellip;';
													contentArea.querySelector('.action-database').classList.remove('current');
													contentArea.querySelector('.action-database').classList.add('done');
													contentArea.querySelector('.action-settings').classList.remove('waiting');
													contentArea.querySelector('.action-settings').classList.add('current');
													const data = {
														action: result.data.nextRequest,
														sub_action: result.data.sub_action
													};
													setTimeout(() => {
														_self[result.data.nextRequest](el, data);
													}, 2000);
												}
											}
										}

										if ('nextRequest' in result.data && 'change_screen' === result.data.nextRequest) {
											if ('screen' in result.data) {
												el.removeAttribute('data-screen');
												el.removeAttribute('title');
												el.setAttribute('data-screen', result.data.screen);
												if (el.classList.contains('disabled')) {
													el.classList.remove('disabled');
												}
												_self[result.data.nextRequest](el);
											}
										}
									} else if ('error' === result.status) {
										if ('nextRequest' in result.data) {
											el.classList.remove('disabled');
											el.removeAttribute('data-screen');
											el.setAttribute('data-screen', result.data.screen);
											_self[result.data.nextRequest](el);
										}
									}
								})
								.catch((err) => {
									if ('sub_action' in params && 'unzip' === params.sub_action) {
										el.removeAttribute('data-screen');
										el.setAttribute('data-screen', 'failed');
										if (el.classList.contains('disabled')) {
											el.classList.remove('disabled');
										}
										_self.change_screen(el);
									} else {
										console.error(err);
									}
								});
						}

					}
				},

				/**
				 * Clean the source files.
				 */
				cleanup: function(el) {
					const _self = this;
					let data = {
						action: 'cleanup',
					};
					UI.progress();
					const cleanUpEl = document.querySelector('#cleanup-process');
					const steps = document.querySelector('.steps');
					el.classList.add('disabled');

					const ajaxUrl = _self.getUrl(data);
					const req = fetch(ajaxUrl);
					req.then(response => response.json())
						.then((result) => {
							if ('success' === result.status) {
								const list = steps.querySelector('[data-name=cleanup]');
								if (list.classList.contains('active')) {
									list.classList.remove('active');
								}
								cleanUpEl.innerHTML = result.data.html;
								list.classList.add('success');
								cleanUpEl.innerHTML = result.data.html;
								const viewSite = el.closest('.sui-footer').querySelector('.success-screen');
								const cl = el.closest('.sui-footer').querySelector('.footer-column-left');
								const cr = el.closest(".footer-column-right");

								if (cl.hasChildNodes()) {
									const lc = cr.childNodes;
									lc.forEach((lc) => {
										if (lc.style) {
											lc.style.display = 'none';
										}
									});
								}
								if (cr.hasChildNodes()) {
									const children = cr.childNodes;
									children.forEach((child) => {
										if (child.style) {
											child.style.display = 'none';
										}
									});
								}
								cr.appendChild(viewSite);
								el.style.display = 'none';

								setTimeout(() => {
									if ('nextRequest' in result.data && 'cleanup' === result.data.nextRequest) {
										if ('self' in result.data && 'delete' === result.data.self) {
											let data = _self.getUrl({
												action: 'cleanup',
												delete: 'self'
											})

											const req = fetch(data);
										}
									}
								}, 1000);

								setTimeout(() => {
									window.location.href = result.data.redirect;
								}, 2000);
							}

						})
						.catch((err) => {
							console.error(err);
						});
				},

				/**
				 * Clean and start the setup process.
				 */
				cleanStart: function(el) {
					const _self = this;
					let data = {
						action: 'restart',
					};
					el.classList.add('disabled');

					const ajaxUrl = _self.getUrl(data);
					const req = fetch(ajaxUrl);
					req.then(response => response.json())
						.then((result) => {
							window.location.reload();
						})
						.catch((err) => {
							console.error(err);
						});
				},

				// Get the log file contents
				loadLog: function(el) {
					const _self = this;
					if (_self.loading) {
						return;
					}

					_self.loading = true;

					let bodyClass = document.body.className;
					let screen = 'logs';

					const data = {
						action: 'log'
					};

					const ajaxUrl = _self.getUrl(data);
					const req = fetch(ajaxUrl);
					req
						.then(response => response.json())
						.then((result) => {
							if ('success' === result.status) {
								let content = result.data.html;
								if ('' === content) {
									content = 'Log file is empty';
								}
								document.querySelector('.log-loader').innerHTML = content;
								document.body.classList.replace(bodyClass, `screen-${screen}`);
							} else if ('error' === result.status) {

							}
							_self.loading = false;
						})
						.catch((err) => {
							console.error(err);
						});
				},

				// Get the log url for download.
				getLogUrl: function(el) {
					const _self = this;
					if (_self.loading) {
						return;
					}

					_self.loading = true;

					let bodyClass = document.body.className;
					let screen = 'logs';

					const data = {
						action: 'log',
						sub_action: 'return_url'
					};

					const ajaxUrl = _self.getUrl(data);
					const req = fetch(ajaxUrl);
					req
						.then(response => response.json())
						.then((result) => {
							if ('success' === result.status) {
								let url = result.data.url;
								var element = document.createElement('a');
								element.setAttribute('href', result.data.url);
								element.setAttribute('download', result.data.title);
								element.style.display = 'none';
								document.body.appendChild(element);

								element.click();

								document.body.removeChild(element);
							} else if ('error' === result.status) {

							}
							_self.loading = false;
						})
						.catch((err) => {
							console.error(err);
						});
				},

				// Get the log file contents
				refreshLog: function(el) {
					const _self = this;
					if (_self.loading) {
						return;
					}

					el.classList.add('spin');
					el.classList.add('disabled');

					_self.loading = true;

					const data = {
						action: 'log'
					};

					const ajaxUrl = _self.getUrl(data);
					const req = fetch(ajaxUrl);
					req
						.then(response => response.json())
						.then((result) => {
							if ('success' === result.status) {
								let content = result.data.html;
								if ('' === content) {
									content = 'Log file is empty';
								}
								document.querySelector('.log-loader').innerHTML = content;
							} else if ('error' === result.status) {

							}
							_self.loading = false;
							el.classList.remove('spin');
							el.classList.remove('disabled');
						})
						.catch((err) => {
							console.error(err);
						});
				},


			};

			if (nextScreenBtn) {
				nextScreenBtn.addEventListener('click', (e) => {
					e.preventDefault();
					const el = e.target;
					const datasets = el.dataset;

					if ('screen' in datasets) {
						AJAX.change_screen(el);
					} else if ('action' in datasets) {
						AJAX.database(el);
					}
				});
			}
		</script>
		<?php
	}
}



// Source: src/lib/View/Partial/class_si_view_partial_sidebar.php


/**
 * Represents a partial view for sidebar.
 */
class Si_View_Partial_Sidebar extends Si_View {

	/**
	 * Outputs the sidebar.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$restore_what = session()->get( 'partial_restore_type' ) ? session()->get( 'partial_restore_type' ) : null;
		$counter = 2;
		?>
		<div class="sidebar">
			<ul class="steps">
				<li class="step-1" data-name="requirements">
					<span class="indicator">
						<span class="counter">1</span>
						<span class="indicate-complete">
							<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M10.9092 1.30859L10.2324 0.642578C10.1895 0.599609 10.1393 0.567383 10.082 0.545898C10.0247 0.517253 9.96387 0.50293 9.89941 0.50293C9.83496 0.50293 9.77409 0.517253 9.7168 0.545898C9.65951 0.567383 9.60938 0.599609 9.56641 0.642578L4.61426 5.60547L2.43359 3.4248C2.39062 3.38184 2.34049 3.34961 2.2832 3.32812C2.22591 3.29948 2.16504 3.28516 2.10059 3.28516C2.03613 3.28516 1.97526 3.29948 1.91797 3.32812C1.86068 3.34961 1.81055 3.38184 1.76758 3.4248L1.09082 4.10156C1.04785 4.14453 1.01204 4.19466 0.983398 4.25195C0.961914 4.30924 0.951172 4.37012 0.951172 4.43457C0.951172 4.49902 0.961914 4.5599 0.983398 4.61719C1.01204 4.67448 1.04785 4.72461 1.09082 4.76758L3.94824 7.60352C4.03418 7.68229 4.13444 7.74674 4.24902 7.79688C4.36361 7.84701 4.48535 7.87207 4.61426 7.87207C4.74316 7.87207 4.86491 7.84701 4.97949 7.79688C5.09408 7.74674 5.19434 7.68229 5.28027 7.60352L10.9092 1.97461C10.9521 1.93164 10.9844 1.88151 11.0059 1.82422C11.0345 1.76693 11.0488 1.70605 11.0488 1.6416C11.0488 1.57715 11.0345 1.51628 11.0059 1.45898C10.9844 1.40169 10.9521 1.35156 10.9092 1.30859Z" fill="white"/>
							</svg>
						</span>
					</span>
					<span class="step-text">Requirements Check</span>
				</li>

				<?php if ( 'files' !== $restore_what ) : ?>
				<li class="step-2" data-name="database">
					<span class="indicator">
						<span class="counter"><?php echo $counter; ?></span>
						<span class="indicate-complete">
							<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M10.9092 1.30859L10.2324 0.642578C10.1895 0.599609 10.1393 0.567383 10.082 0.545898C10.0247 0.517253 9.96387 0.50293 9.89941 0.50293C9.83496 0.50293 9.77409 0.517253 9.7168 0.545898C9.65951 0.567383 9.60938 0.599609 9.56641 0.642578L4.61426 5.60547L2.43359 3.4248C2.39062 3.38184 2.34049 3.34961 2.2832 3.32812C2.22591 3.29948 2.16504 3.28516 2.10059 3.28516C2.03613 3.28516 1.97526 3.29948 1.91797 3.32812C1.86068 3.34961 1.81055 3.38184 1.76758 3.4248L1.09082 4.10156C1.04785 4.14453 1.01204 4.19466 0.983398 4.25195C0.961914 4.30924 0.951172 4.37012 0.951172 4.43457C0.951172 4.49902 0.961914 4.5599 0.983398 4.61719C1.01204 4.67448 1.04785 4.72461 1.09082 4.76758L3.94824 7.60352C4.03418 7.68229 4.13444 7.74674 4.24902 7.79688C4.36361 7.84701 4.48535 7.87207 4.61426 7.87207C4.74316 7.87207 4.86491 7.84701 4.97949 7.79688C5.09408 7.74674 5.19434 7.68229 5.28027 7.60352L10.9092 1.97461C10.9521 1.93164 10.9844 1.88151 11.0059 1.82422C11.0345 1.76693 11.0488 1.70605 11.0488 1.6416C11.0488 1.57715 11.0345 1.51628 11.0059 1.45898C10.9844 1.40169 10.9521 1.35156 10.9092 1.30859Z" fill="white"/>
							</svg>
						</span>
					</span>
					<span class="step-text">Database Configuration</span>
				</li>
				<?php $counter++; ?>
				<?php endif; ?>

				<li class="step-3" data-name="deployment">
					<span class="indicator">
						<span class="counter"><?php echo $counter; ?></span>
						<span class="indicate-complete">
							<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M10.9092 1.30859L10.2324 0.642578C10.1895 0.599609 10.1393 0.567383 10.082 0.545898C10.0247 0.517253 9.96387 0.50293 9.89941 0.50293C9.83496 0.50293 9.77409 0.517253 9.7168 0.545898C9.65951 0.567383 9.60938 0.599609 9.56641 0.642578L4.61426 5.60547L2.43359 3.4248C2.39062 3.38184 2.34049 3.34961 2.2832 3.32812C2.22591 3.29948 2.16504 3.28516 2.10059 3.28516C2.03613 3.28516 1.97526 3.29948 1.91797 3.32812C1.86068 3.34961 1.81055 3.38184 1.76758 3.4248L1.09082 4.10156C1.04785 4.14453 1.01204 4.19466 0.983398 4.25195C0.961914 4.30924 0.951172 4.37012 0.951172 4.43457C0.951172 4.49902 0.961914 4.5599 0.983398 4.61719C1.01204 4.67448 1.04785 4.72461 1.09082 4.76758L3.94824 7.60352C4.03418 7.68229 4.13444 7.74674 4.24902 7.79688C4.36361 7.84701 4.48535 7.87207 4.61426 7.87207C4.74316 7.87207 4.86491 7.84701 4.97949 7.79688C5.09408 7.74674 5.19434 7.68229 5.28027 7.60352L10.9092 1.97461C10.9521 1.93164 10.9844 1.88151 11.0059 1.82422C11.0345 1.76693 11.0488 1.70605 11.0488 1.6416C11.0488 1.57715 11.0345 1.51628 11.0059 1.45898C10.9844 1.40169 10.9521 1.35156 10.9092 1.30859Z" fill="white"/>
							</svg>
						</span>
					</span>
					<span class="step-text">Deployment</span>
				</li>
				<?php $counter++; ?>
				<li class="step-4" data-name="cleanup">
					<span class="indicator">
						<span class="counter"><?php echo $counter; ?></span>
						<span class="indicate-complete">
							<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">
							<path d="M10.9092 1.30859L10.2324 0.642578C10.1895 0.599609 10.1393 0.567383 10.082 0.545898C10.0247 0.517253 9.96387 0.50293 9.89941 0.50293C9.83496 0.50293 9.77409 0.517253 9.7168 0.545898C9.65951 0.567383 9.60938 0.599609 9.56641 0.642578L4.61426 5.60547L2.43359 3.4248C2.39062 3.38184 2.34049 3.34961 2.2832 3.32812C2.22591 3.29948 2.16504 3.28516 2.10059 3.28516C2.03613 3.28516 1.97526 3.29948 1.91797 3.32812C1.86068 3.34961 1.81055 3.38184 1.76758 3.4248L1.09082 4.10156C1.04785 4.14453 1.01204 4.19466 0.983398 4.25195C0.961914 4.30924 0.951172 4.37012 0.951172 4.43457C0.951172 4.49902 0.961914 4.5599 0.983398 4.61719C1.01204 4.67448 1.04785 4.72461 1.09082 4.76758L3.94824 7.60352C4.03418 7.68229 4.13444 7.74674 4.24902 7.79688C4.36361 7.84701 4.48535 7.87207 4.61426 7.87207C4.74316 7.87207 4.86491 7.84701 4.97949 7.79688C5.09408 7.74674 5.19434 7.68229 5.28027 7.60352L10.9092 1.97461C10.9521 1.93164 10.9844 1.88151 11.0059 1.82422C11.0345 1.76693 11.0488 1.70605 11.0488 1.6416C11.0488 1.57715 11.0345 1.51628 11.0059 1.45898C10.9844 1.40169 10.9521 1.35156 10.9092 1.30859Z" fill="white"/>
							</svg>
						</span>
					</span>
					<span class="step-text">Finish and Cleanup</span>
				</li>
			</ul>
		</div>
		<?php
	}
}



// Source: src/lib/View/Partial/class_si_view_partial_styles.php


/**
 * Represents a partial view for styles.
 */
class Si_View_Partial_Styles extends Si_View {

	/**
	 * Outputs the styles.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		?>
		<style>
			* {
				margin: 0;
				padding: 0;
			}

			*,
			*::before,
			*::after {
				box-sizing: border-box;
			}

			a {
				text-decoration: none;
			}

			body {
				font-family: 'Roboto', sans-serif;
				font-size: 13px;
				line-height: 22px;
				font-weight: 400;
				font-style: normal;
				letter-spacing: -0.25px;
				color: #888888;
			}

			hr {
				border-color: #E6E6E6;
				border-top-width: 1px;
				border-top-style: solid;
				border-bottom: none;
				box-shadow: none;
			}

			body p a {
				color: #17A8E3;
			}

			/**
			* Helper Classes
			*/
			.sui-hidden {
				display: none;
			}

			.d-flex {
				display: flex;
			}

			.flex-wrap {
				flex-wrap: wrap;
			}

			.justify-between {
				justify-content: space-between;
			}

			.align-top {
				align-items: top;
			}

			.align-center {
				align-items: center;
			}

			.di-b {
				display: inline-block;
			}

			/**
			* Border
			*/
			.bs-1 {
				border: 1px solid #E6E6E6;
			}

			.br-4 {
				border-radius: 4px;
			}

			/**
			* Font
			*/
			.fw-normal {
				font-weight: normal;
			}

			.fw-500 {
				font-weight: 500;
			}

			.fw-700 {
				font-weight: 700;
			}

			.fw-900 {
				font-weight: 900;
			}

			/**
			* Margins & Paddings
			*/
			.px-20 {
				padding-left: 20px;
				padding-right: 20px;
			}

			.px-30 {
				padding-left: 30px;
				padding-right: 30px;
			}

			.px-100 {
				padding-left: 100px;
				padding-right: 100px;
			}

			.py-20 {
				padding-top: 20px;
				padding-bottom: 20px;
			}

			.py-30 {
				padding-top: 30px;
				padding-bottom: 30px;
			}

			.p-10 {
				padding: 10px;
			}

			.p-20 {
				padding: 20px;
			}

			.p-30 {
				padding: 30px;
			}

			.ml-10 {
				margin-left: 10px;
			}

			.mb-30 {
				margin-bottom: 30px;
			}

			.mt-0 {
				margin-top: 0;
			}

			.mt-2 {
				margin-top: 2px;
			}

			.mt-3 {
				margin-top: 3px;
			}

			.mt-5 {
				margin-top: 5px;
			}

			.mt-10 {
				margin-top: 10px;
			}

			.mt-30 {
				margin-top: 30px;
			}

			.mr-5 {
				margin-right: 5px;;
			}

			.mr-10 {
				margin-right: 10px;
			}

			.mr-20 {
				margin-right: 20px;
			}

			.my-20 {
				margin-top: 20px;
				margin-bottom: 20px;
			}

			.my-30 {
				margin-top: 30px;
				margin-bottom: 30px;
			}

			/**
			* Elements
			*/
			.sui-toggle {
				display: block;
				opacity: 1;
				position: relative;
				cursor: pointer;
			}

			.sui-toggle input {
				width: 1px;
				min-width: 1px;
				height: 1px;
				min-height: 1px;
				overflow: hidden;
				clip: rect(1px,1px,1px,1px);
				-webkit-clip-path: inset(50%);
				clip-path: inset(50%);
				position: absolute!important;
				margin: -1px;
				padding: 0;
				border: 0;
				word-wrap: normal!important;
			}

			.sui-toggle .sui-toggle-slider {
				width: 34px;
				height: 16px;
				float: left;
				display: block;
				position: relative;
				margin: 3px 0;
				padding: 0;
				border: 0;
				border-radius: 8px;
				background-color: #aaa;
				-webkit-transition: all .3s ease;
				transition: all .3s ease;
				opacity: 1;
			}

			.sui-toggle input:checked~.sui-toggle-slider {
				background-color: #17a8e3;
			}

			.sui-toggle input:checked~.sui-toggle-slider:before {
				-webkit-transform: translateX(18px);
				transform: translateX(18px);
			}

			.sui-toggle-slider:before {
				content: " ";
				width: 14px;
				height: 14px;
				position: absolute;
				top: 1px;
				left: 1px;
				border-radius: 16px;
				background-color: #fff;
				-webkit-transition: .2s linear;
				transition: .2s linear;
			}

			/**
			* Alert
			*/
			.sui-notice {
				background-color: #fff;
				padding: 15px 20px;
				border-radius: 4px;
			}

			.content-block .sui-notice .sui-notice-message p{
				color: #333;
			}

			.sui-notice.error {
				box-shadow: inset 2px 0px 0px #FF6D6D, inset 0px 0px 0px 1px #E6E6E6;
			}

			.sui-notice.error .sui-notice-message code {
				background-color: #f8f8f8;
				display: block;
				margin-top: 10px;
				padding: 5px 10px;
			}

			.sui-notice.warning {
				box-shadow: inset 2px 0px 0px #FECF2F, inset 0px 0px 0px 1px #E6E6E6;
			}

			.sui-notice.success {
				box-shadow: inset 2px 0px 0px #1ABC9C, inset 0px 0px 0px 1px #E6E6E6;
			}

			.sui-notice .sui-notice-content {
				align-items: flex-start;
			}

			.database-notice .sui-notice.success .sui-notice-content {
				align-items: center;
			}

			.database-notice .sui-notice.validation-error .sui-notice-content {
				align-items: center;
			}

			.sui-notice.validation-error .sui-notice-content .sui-notice-message {
				top: 1px;
				position: relative;
			}

			.sui-notice .sui-notice-content .icon {
				line-height: 100%;
			}

			/**
			* Form Fields
			*/
			.sui-form-group {
				margin-bottom: 20px;
			}

			.sui-form-group label {
				font-family: Roboto;
				font-style: normal;
				font-weight: bold;
				font-size: 12px;
				line-height: 16px;
				letter-spacing: -0.25px;
				color: #AAAAAA;
			}

			.sui-form-group .sui-form-control {
				display: block;
				background: #FAFAFA;
				border-width: 1px;
				border-style: solid;
				border-color: #DDD;
				box-sizing: border-box;
				border-radius: 4px;
				width: 100%;
				height: 40px;
				margin: 0;
				padding: 9px 14px;
			}

			.sui-form-group .sui-form-control.error {
				border-color: #FF6D6D;
			}

			.sui-form-group .sui-form-control:active {
				border: 1px solid #aaa;
			}

			.sui-form-group .sui-form-control::placeholder {
				color: #aaa;
				opacity: 1; /* Firefox */
			}

			.sui-form-group .sui-form-control:-ms-input-placeholder { /* Internet Explorer 10-11 */
				color: #aaa;
			}

			.sui-form-group .sui-form-control::-ms-input-placeholder { /* Microsoft Edge */
				color: #aaa;
			}

			/**
			* Main Body
			*/
			.sui-page {
				width: 100%;
				height: 100vh;
				background-color: #f2f2f2;
			}

			.sui-page .sui-body {
				height: 100%;
				padding-bottom: 90px;
				overflow-y: auto;
			}

			.sui-page * {
				box-sizing: border-box;
			}

			.sui-btn {
				font-family: Roboto;
				font-style: normal;
				font-weight: 500;
				font-size: 12px;
				line-height: 16px;
				letter-spacing: -0.25px;
				text-transform: uppercase;
				border-radius: 4px;
			}

			.sui-btn-block {
				display: inline-block;
			}

			.sui-btn-blue {
				color: #fff;
				background-color: #17A8E3;
				border-width: 2px;
				border-style: solid;
				border-color: #17A8E3;
			}

			.sui-btn-gray {
				background-color: #888888;
				border-radius: 4px;
				color: #fff;
			}

			.sui-btn.sui-btn-icon .icon {
				margin-right: 5px;
				position: relative;
				top: 2px;
			}

			.sui-btn-ghost {
				border: 2px solid #DDDDDD;
				box-sizing: border-box;
				border-radius: 4px;
				color: #888;
			}

			.sui-btn.disabled {
				border-color: #E6E6E6;
				background: #E6E6E6;
				border-radius: 4px;
				color: #AAAAAA;
				cursor: default;
			}

			.sui-btn-sm {
				padding: 7px 16px;
			}

			.sui-btn-md {
				padding: 7px 33px;
			}

			.sui-body {
			}

			.sui-container {
				width: 1170px;
				margin: 0 auto;
			}

			.sui-row {
				display: -webkit-box;
				display: -ms-flexbox;
				display: flex;
				-ms-flex-flow: wrap;
				flex-flow: wrap;
				margin-right: -15px;
				margin-left: -15px;
			}

			.sui-row .sui-col {
				-webkit-box-flex: 1;
				-ms-flex: 1;
				flex: 1;
			}

			.sui-row [class*=sui-col-] {
				padding-left: 15px;
				padding-right: 15px;
				-webkit-box-flex: 0;
				-ms-flex: 0 0 auto;
				flex: 0 0 auto;
				width: 100%;
				max-width: 100%;
				-ms-flex-preferred-size: 100%;
				flex-basis: 100%;
			}

			.sui-row .sui-col-lg-2 {
				width: 16.6666666667%;
				max-width: 16.6666666667%;
				-ms-flex-preferred-size: 16.6666666667%;
				flex-basis: 16.6666666667%;
			}

			.sui-row .sui-col-md-3 {
				width: 25%;
				max-width: 25%;
				-ms-flex-preferred-size: 25%;
				flex-basis: 25%;
			}

			.sui-row .sui-col-md-4 {
				width: 33.6666666667%;
				max-width: 33.6666666667%;
				-ms-flex-preferred-size: 33.6666666667%;
				flex-basis: 33.6666666667%;
			}

			.sui-row .sui-col-md-8 {
				width: 66.3333333333%;
				max-width: 66.3333333333%;
				-ms-flex-preferred-size: 66.3333333333%;
				flex-basis: 66.3333333333%;
			}

			.sui-row .sui-col-md-9 {
				width: 75%;
				max-width: 75%;
				-ms-flex-preferred-size: 75%;
				flex-basis: 75%;
			}

			.sui-row .sui-col-md-10 {
				width: 83.3333333333%;
				max-width: 83.3333333333%;
				-ms-flex-preferred-size: 83.3333333333%;
				flex-basis: 83.3333333333%;
			}

			.sui-row .sui-col-md-12 {
				width: 100%;
				max-width: 100%;
				-ms-flex-preferred-size: 100%;
				flex-basis: 100%;
			}

			.sui-header,
			.sui-footer {
				height: 90px;
			}

			.sui-header .snapshot-header--img {
				height: 40px;
			}

			.sui-header .snapshot-logo--brand {
				margin-left: 15px;
			}

			.snapshot-logo--brand .text-logo {
				font-size: 22px;
				font-style: normal;
				font-weight: 500;
				line-height: 24px;
				letter-spacing: -0.25px;
				color: #333;
			}

			.snapshot-logo--brand .logo-description {
				line-height: 18px;
				font-weight: 500;
				font-style: normal;
				font-size: 13px;
				color: #999999;
			}

			.steps {
				list-style-type: none;
				font-size: 15px;
				line-height: 22px;
				margin-top: 60px;
			}

			.steps li {
				margin-bottom: 30px;
				position: relative;
				z-index: 2;
			}

			.steps li .step-text {
				color: #333;
			}

			.steps li::after {
				border-width: 1px;
				border-style: solid;
				border-color: #D8D8D8;
				background: #D8D8D8;
				content: '';
				position: absolute;
				top: 24px;
				left: 11px;
				height: 30px;
				z-index: 1;
			}

			.steps li.success::after {
				border-color: #1ABC9C;
				background-color: #1ABC9C;
			}

			.steps li:last-of-type::after {
				background: transparent;
				border: none;
			}

			.steps li .indicator .indicate-complete,
			.steps li.success .indicator .counter {
				display: none;
			}

			.steps li.success .indicator .indicate-complete {
				display: inline-block;
			}

			.steps li.success .indicator {
				background-color: #1ABC9C;
				border-color: #1ABC9C;
				color: #1ABC9C;
			}

			.steps li .indicator {
				border-radius: 50%;
				border-width: 2px;
				border-style: solid;
				border-color: #DDD;
				display: inline-block;
				font-size: 11px;
				width: 24px;
				height: 24px;
				line-height: 16px;
				font-weight: 700;
				font-style: normal;
				padding: 5px 7px;
				color: #888;
				background-color: #fff;
				position: relative;
				z-index: 2;
			}

			.steps li .indicator .counter {
				line-height: 13px;
				position: relative;
				top: -2px;
			}

			.steps li.success .indicator  {
				padding: 3px;
			}

			.steps li.active {
				font-weight: 500;
			}

			.steps li.active .indicator {
				border-color: #333;
				color: #333;
			}
			.steps li.active .step-text {
				color: #333;
			}

			.steps li .step-text {
				margin-left: 15px;
				position:relative;
			}

			.success-screen {
				display: none;
			}

			.sui-body .sui-container > .sui-row {
				min-height: 460px;
				overflow-y: auto;
			}

			.content-area {
				background-color: #fff;
				border-color: #fff;
				border-radius: 5px;
				box-shadow: 0px 2px 0px #DDDDDD;
				width: 100%;
				min-height: 430px;
				padding: 30px 50px;
				margin-bottom: 30px;
			}

			.screen-cleanup .success-screen {
				display: inline-block;
			}

			.failed-btns {
				display: none;
			}

			.screen-failed .failed-btns {
				display: inline-block;
			}

			.text-center {
				text-align: center;
			}

			.text-left {
				text-align: left;
			}

			.title-block span {
				font-family: Roboto;
				font-style: normal;
				font-weight: 500;
				font-size: 11px;
				line-height: 22px;
				text-align: center;
				color: #888888;
			}

			.title-block {
				margin-bottom: 15px;
			}

			.title-block h2{
				font-family: Roboto;
				font-style: normal;
				font-weight: bold;
				font-size: 22px;
				line-height: 30px;
				text-align: center;
				letter-spacing: -0.25px;
				color: #333333;
			}

			.content-block {
				width: 600px;
				margin: 0 auto;
			}

			.content-block p {
				font-family: Roboto;
				font-style: normal;
				font-weight: normal;
				font-size: 13px;
				line-height: 22px;
				letter-spacing: -0.25px;
				color: #888888;
			}

			#screen-welcome .rocket-logo {
				margin-bottom: 25px;
			}

			.box {
				background-color: #f8f8f8;
			}

			.inner-box {
				background: #FFFFFF;
				border: 1px solid #E6E6E6;
				box-sizing: border-box;
				border-radius: 5px;
			}

			.small-text {
				font-style: normal;
				font-weight: normal;
				font-size: 12px;
				line-height: 22px;
				text-align: center;
				letter-spacing: -0.1px;
			}

			.inner-box .flex-item {
				margin-right: 5px;
				width: 35px;
			}
			.inner-box .flex-item.loading-block {
				width: 240px;
				height: 10px;
				border-radius: 5px;
				background-color: #E6E6E6;
			}

			.loading-block .loading-inner {
				background: #17A8E3;
				width: 0%;
				height: 100%;
				border-radius: 5px;
				transition: width 3s ease-out;
			}

			.loading-icon svg {
				margin-top: 3px;
			}

			.spin .icon-refresh svg {
				animation: spin 2s linear infinite;
			}

			.loading-icon.spin svg {
				animation: spin 2s linear infinite;
			}

			/**
			* Accordion
			*/
			.accordion .accordion-item {
				text-align: left;
				background: #fff;
				box-shadow: 0px 2px 7px rgba(0, 0, 0, 0.05);
				border-radius: 5px;
			}

			.accordion .accordion-item:first-of-type {
				margin-top: 0;
			}

			.accordion .accordion-item:last-of-type {
				margin-bottom: 0;
			}

			.accordion .accordion-item h4 span:last-child{
				font-weight: 500;
			}

			.accordion-item.skipped-items .accordion-body h4 {
				color: #333;
			}

			.exclamation-icon {
				padding: 3px 7px;
				margin-right: 10px;
				font-size: 11px;
				line-height: 11px;
				color: #fff;
				border-radius: 50%;
				font-weight: bold;
			}

			.error .exclamation-icon {
				background-color: #FF6D6D;
			}

			.warning .exclamation-icon {
				background-color: #FECF2F;
			}

			.accordion .accordion-item.warning .exclamation-icon {
				background-color: #FECF2F;
			}

			.accordion .accordion-item.open {
				box-shadow: 0px 0px 0px 4px rgba(0, 0, 0, 0.02), 0px 4px 15px rgba(0, 0, 0, 0.05);
				border-radius: 4px;
			}

			.accordion .accordion-item .accordion-body {
				height: 0;
				overflow: hidden;
				transition: 1s ease height;
			}

			.accordion-item .accordion-content {
				border-top: 1px solid #E6E6E6;
				border-bottom: 1px solid #E6E6E6;
			}

			.accordion .accordion-item.open .accordion-body {
				height: auto;
			}

			.accordion-item .accordion-content p:first-of-type {
				margin-top: 0;
			}

			.accordion-item .accordion-content p {
				text-align: left;
				margin-bottom: 20px;
			}

			.accordion-item .accordion-content strong + p {
				margin-top: 5px;
			}
			.accordion-item .accordion-content p:last-of-type {
				margin-bottom: 0;
			}

			.accordion-item .accordion-header {
				cursor: pointer;
				font-size: 13px;
				font-weight: 500;
				font-style: normal;
				line-height: 22px;
			}

			.accordion-header h4 {
				color: #333;
			}

			.accordion-header .counter {
				border-radius: 10px;
				padding: 3px 10px;
				color: #333333;
				font-size: 10px;
				line-height: 12px;
				background-color: #FECF2F;
				margin-left: 10px;
			}

			.accordion-item.open .arrow {
				transform: rotate(-180deg);
			}

			.accordion-content p+strong {
				color: #333;
			}

			.analyze-requirement.spin span.icon-refresh svg {
				animation: spin 2s linear infinite;
			}

			.db-exists--desc h4 {
				color: #666;
			}

			.deploy-action {
				list-style-type: none;
				display: block;
				width: 260px;
				margin: 20px auto 0;
			}

			.deploy-action li {
				display: flex;
				justify-content: space-between;
				color: #aaa;
				margin-bottom: 5px;
			}

			.deploy-action li.current,
			.deploy-action li.done {
				color: #666;
			}

			.deploy-action li.current .check-icon,
			.deploy-action li.done .loading-icon,
			.deploy-action li.waiting .check-icon,
			.deploy-action li.waiting .loading-icon  {
				display: none;
			}

			.deploy-action li.done .check-icon {
				display: inline;
			}

			.site-footer {
				box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.06);
				position: fixed;
				z-index: 10;
				background-color: #fff;
				width: 100%;
				bottom: 0;
			}

			.sui-footer .footer-column-left .database-screen{
				display: none;
			}

			.screen-database .sui-footer .footer-column-left .database-screen{
				display: inline-block;
			}

			.sui-btn.click-me {
				-webkit-animation: swing 0.5ss ease;
				animation: swing 0.5s ease;
				-webkit-animation-iteration-count: 3;
				animation-iteration-count: 3;
				/* animation: blink 0.5s;
				animation-iteration-count: 3; */
			}

			.sui-btn.btn-test-connection.disabled .icon svg path{
				fill: #AAAAAA !important;
			}

			.files-list {
				list-style: none;
				color: #333;
			}

			.files-list li {
				padding: 9px 20px;
			}

			.files-list li:nth-child(odd) {
				background-color: #F8F8F8;
			}

			/** Log */
			.log-overview {
				display: none;
			}

			.screen-logs .sui-body > .sui-container {
				padding-bottom: 30px;
			}

			.screen-logs .general-overview {
				display: none;
			}

			.screen-logs .log-overview {
				display: block;
			}

			.btn-check-again {
				display: none;
			}

			.screen-logs .view-log-btn,
			.screen-logs .next-screen {
				display: none;
			}

			.screen-failed .refresh-log-btn,
			.screen-failed .next-screen,
			.screen-failed .download-log {
				display: none;
			}

			.screen-logs .refresh-log-btn,
			.screen-logs .download-log {
				display: inline-block;
			}

			.screen-logs .log-overview .log-screen {
				background: #fff;
			}

			.log-overview .log-result {
				border-radius: 4px;
				background: #fff;
				box-shadow: 0px 2px 0px #DDDDDD;
				border-radius: 5px;
			}

			.log-result .content-block {
				width: 900px;
				margin: 0 auto;
			}

			.log-result .box .inner-box {
				background: #FFFFFF;
				box-shadow: 0px 2px 7px rgba(0, 0, 0, 0.05);
				border-radius: 4px;
			}

			.log-result .log-loader {
				background: #FAFAFA;
				border: 1px solid #DDDDDD;
				box-sizing: border-box;
				border-radius: 4px;
				height: 380px;
				overflow: scroll;
			}

			/*
			| ---- CSS Animation ----|
			*/

			@keyframes blink { 50% { background-color:#DDD; color: #fff; border-color: #DDD; }  }

			@-webkit-keyframes spin {
				0% { -webkit-transform: rotate(0deg); }
				100% { -webkit-transform: rotate(360deg); }
			}

			/* Standard syntax */
			@keyframes spin {
				0% { -webkit-transform: rotate(0deg); }
				100% { -webkit-transform: rotate(360deg); }
			}

			@-webkit-keyframes swing{
				15% {
					-webkit-transform: translateX(5px);
					transform: translateX(5px);
				}
				30% {
					-webkit-transform: translateX(-5px);
					transform: translateX(-5px);
				}
				50% {
					-webkit-transform: translateX(3px);
					transform: translateX(3px);
				}
				65% {
					-webkit-transform: translateX(-3px);
					transform: translateX(-3px);
				}
				80% {
					-webkit-transform: translateX(2px);
					transform: translateX(2px);
				}
				100% {
					-webkit-transform: translateX(0);
					transform: translateX(0);
				}
			}
			@keyframes swing
			{
				15% {
					-webkit-transform: translateX(5px);
					transform: translateX(5px);
				}
				30% {
					-webkit-transform: translateX(-5px);
					transform: translateX(-5px);
				}
				50% {
					-webkit-transform: translateX(3px);
					transform: translateX(3px);
				}
				65% {
					-webkit-transform: translateX(-3px);
					transform: translateX(-3px);
				}
				80% {
					-webkit-transform: translateX(2px);
					transform: translateX(2px);
				}
				100% {
					-webkit-transform: translateX(0);
					transform: translateX(0);
				}
			}
		</style>
		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_partial_screens_warning_database.php


/**
 * Partial view for failure.
 */
class Si_View_Partial_Screens_Warning_Database extends Si_View {

	/**
	 * Outputs the failure screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$error = session()->get( 'error_str' );
		if ( $error && ! empty( $error ) ) {
			session()->unset( 'error_str' );
		}
		?>
		<div class="deployment-result my-30">
			<div class="text-center">
				<div class="title-block">
					<span>Snapshot Restore</span>
					<h2>Attention: Partial Database Restore in Progress</h2>
				</div>
			</div>

			<div class="content-block">

				<div class="box p-30 mt-30">
					<div role="alert" class="sui-notice warning" aria-live="assertive" tabindex="-1">
						<div class="sui-notice-content d-flex">
							<span class="exclamation-icon mt-5">!</span>
							<div class="sui-notice-message">
								<p>Please be aware: This action may result in site malfunction due to missing files, as it involves partial restoration and not a full backup.</p>

								<a href="#" data-screen="database" class="sui-btn sui-btn-sm sui-btn-block sui-btn-blue mt-30 next-screen--force">Continue</a>
							</div>
						</div>
					</div>
				</div>
			</div>

		</div>
		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_cleanup.php


/**
 * Partial view for cleanup.
 */
class Si_View_Partial_Screens_Cleanup extends Si_View {

	/**
	 * Display the cleanup screen content.
	 *
	 * @param array $params Customizing params.
	 * @return void
	 */
	public function out( $params = array() ) {
		?>
		<div id="cleanup-process" class="screen">

			<div class="cleaning-up">
				<div class="text-center">
					<div class="title-block">
						<span>Snapshot Restore</span>
						<h2>Running Cleanup</h2>
					</div>

					<div class="content-block">
						<p>Removing migration files from your server.</p>

						<div class="box px-100 py-30 mt-30">
							<div class="d-flex align-center inner-box p-20 progress-bar">
								<div class="flex-item loading-icon spin">
									<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M8 0C7.72917 0 7.5 0.09375 7.3125 0.28125C7.125 0.46875 7.03125 0.697917 7.03125 0.96875V3.34375C7.03125 3.61458 7.125 3.84375 7.3125 4.03125C7.5 4.21875 7.72917 4.3125 8 4.3125C8.27083 4.3125 8.5 4.21875 8.6875 4.03125C8.875 3.84375 8.96875 3.61458 8.96875 3.34375V0.96875C8.96875 0.697917 8.875 0.46875 8.6875 0.28125C8.5 0.09375 8.27083 0 8 0ZM8 11.6875C7.72917 11.6875 7.5 11.7812 7.3125 11.9688C7.125 12.1562 7.03125 12.3854 7.03125 12.6562V15.0312C7.03125 15.3021 7.125 15.5312 7.3125 15.7188C7.5 15.9062 7.72917 16 8 16C8.27083 16 8.5 15.9062 8.6875 15.7188C8.875 15.5312 8.96875 15.3021 8.96875 15.0312V12.6562C8.96875 12.3854 8.875 12.1562 8.6875 11.9688C8.5 11.7812 8.27083 11.6875 8 11.6875ZM11.2969 5.6875C11.4323 5.6875 11.5573 5.66146 11.6719 5.60938C11.7865 5.55729 11.8906 5.48438 11.9844 5.39062L13.6562 3.71875C13.75 3.63542 13.8229 3.53125 13.875 3.40625C13.9271 3.28125 13.9531 3.15104 13.9531 3.01562C13.9531 2.74479 13.8594 2.51562 13.6719 2.32812C13.4844 2.14062 13.2552 2.04688 12.9844 2.04688C12.849 2.04688 12.7188 2.07292 12.5938 2.125C12.4688 2.17708 12.3646 2.25 12.2812 2.34375L10.6094 4.01562C10.5156 4.10938 10.4427 4.21875 10.3906 4.34375C10.3385 4.45833 10.3125 4.57812 10.3125 4.70312C10.3125 4.97396 10.4062 5.20833 10.5938 5.40625C10.7917 5.59375 11.026 5.6875 11.2969 5.6875ZM4.70312 10.3125C4.56771 10.3125 4.44271 10.3385 4.32812 10.3906C4.21354 10.4427 4.10938 10.5156 4.01562 10.6094L2.34375 12.2812C2.25 12.3646 2.17708 12.4688 2.125 12.5938C2.07292 12.7188 2.04688 12.849 2.04688 12.9844C2.04688 13.2552 2.14062 13.4844 2.32812 13.6719C2.51562 13.8594 2.74479 13.9531 3.01562 13.9531C3.15104 13.9531 3.28125 13.9271 3.40625 13.875C3.53125 13.8229 3.63542 13.75 3.71875 13.6562L5.39062 11.9844C5.48438 11.8906 5.55729 11.7865 5.60938 11.6719C5.66146 11.5469 5.6875 11.4219 5.6875 11.2969C5.6875 11.026 5.58854 10.7969 5.39062 10.6094C5.20312 10.4115 4.97396 10.3125 4.70312 10.3125ZM15.0312 7.03125H12.6562C12.3854 7.03125 12.1562 7.125 11.9688 7.3125C11.7812 7.5 11.6875 7.72917 11.6875 8C11.6875 8.27083 11.7812 8.5 11.9688 8.6875C12.1562 8.875 12.3854 8.96875 12.6562 8.96875H15.0312C15.3021 8.96875 15.5312 8.875 15.7188 8.6875C15.9062 8.5 16 8.27083 16 8C16 7.72917 15.9062 7.5 15.7188 7.3125C15.5312 7.125 15.3021 7.03125 15.0312 7.03125ZM4.3125 8C4.3125 7.72917 4.21875 7.5 4.03125 7.3125C3.84375 7.125 3.61458 7.03125 3.34375 7.03125H0.96875C0.697917 7.03125 0.46875 7.125 0.28125 7.3125C0.09375 7.5 0 7.72917 0 8C0 8.27083 0.09375 8.5 0.28125 8.6875C0.46875 8.875 0.697917 8.96875 0.96875 8.96875H3.34375C3.61458 8.96875 3.84375 8.875 4.03125 8.6875C4.21875 8.5 4.3125 8.27083 4.3125 8ZM11.9844 10.6094C11.8906 10.5156 11.7812 10.4427 11.6562 10.3906C11.5417 10.3281 11.4115 10.2969 11.2656 10.2969C11.0052 10.2969 10.776 10.3958 10.5781 10.5938C10.3906 10.7812 10.2969 11.0052 10.2969 11.2656C10.2969 11.4115 10.3229 11.5469 10.375 11.6719C10.4375 11.7865 10.5156 11.8906 10.6094 11.9844L12.2812 13.6562C12.3646 13.75 12.4688 13.8229 12.5938 13.875C12.7188 13.9271 12.849 13.9531 12.9844 13.9531C13.2552 13.9531 13.4844 13.8594 13.6719 13.6719C13.8594 13.4844 13.9531 13.2552 13.9531 12.9844C13.9531 12.849 13.9271 12.7188 13.875 12.5938C13.8229 12.4688 13.75 12.3646 13.6562 12.2812L11.9844 10.6094ZM3.71875 2.34375C3.63542 2.26042 3.53646 2.19792 3.42188 2.15625C3.30729 2.10417 3.18229 2.07812 3.04688 2.07812C2.77604 2.07812 2.54688 2.17188 2.35938 2.35938C2.17188 2.54688 2.07812 2.77604 2.07812 3.04688C2.07812 3.18229 2.09896 3.30729 2.14062 3.42188C2.19271 3.53646 2.26042 3.63542 2.34375 3.71875L4.01562 5.39062C4.10938 5.48438 4.21354 5.5625 4.32812 5.625C4.45312 5.67708 4.58854 5.70312 4.73438 5.70312C4.99479 5.70312 5.21875 5.60938 5.40625 5.42188C5.60417 5.22396 5.70312 4.99479 5.70312 4.73438C5.70312 4.58854 5.67188 4.45833 5.60938 4.34375C5.55729 4.21875 5.48438 4.10938 5.39062 4.01562L3.71875 2.34375Z" fill="#888888"/>
									</svg>
								</div>
								<div class="flex-item loading-percent">0%</div>
								<div class="flex-item loading-block">
									<div class="loading-inner" style="width: 0%;"></div>
								</div>
								<div class="flex-item loading-cancel">
									<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M7.6875 6L11.3594 2.32812C11.4115 2.27604 11.4531 2.21354 11.4844 2.14062C11.526 2.05729 11.5469 1.96875 11.5469 1.875C11.5469 1.79167 11.526 1.71354 11.4844 1.64062C11.4531 1.55729 11.4115 1.48438 11.3594 1.42188L10.5625 0.640625C10.5 0.578125 10.4323 0.53125 10.3594 0.5C10.2865 0.46875 10.2031 0.453125 10.1094 0.453125C10.026 0.453125 9.94271 0.46875 9.85938 0.5C9.78646 0.53125 9.71875 0.578125 9.65625 0.640625L5.98438 4.3125L2.3125 0.640625C2.26042 0.588542 2.19271 0.546875 2.10938 0.515625C2.03646 0.473958 1.95833 0.453125 1.875 0.453125C1.78125 0.453125 1.69792 0.473958 1.625 0.515625C1.55208 0.546875 1.48438 0.588542 1.42188 0.640625L0.640625 1.42188C0.578125 1.48438 0.53125 1.55729 0.5 1.64062C0.46875 1.71354 0.453125 1.79167 0.453125 1.875C0.453125 1.96875 0.46875 2.05729 0.5 2.14062C0.53125 2.21354 0.578125 2.27604 0.640625 2.32812L4.29688 6L0.640625 9.67188C0.578125 9.72396 0.53125 9.79167 0.5 9.875C0.46875 9.94792 0.453125 10.0312 0.453125 10.125C0.453125 10.2083 0.46875 10.2917 0.5 10.375C0.53125 10.4479 0.578125 10.5156 0.640625 10.5781L1.42188 11.3594C1.48438 11.4219 1.55208 11.4688 1.625 11.5C1.70833 11.5312 1.79167 11.5469 1.875 11.5469C1.96875 11.5469 2.05208 11.5312 2.125 11.5C2.20833 11.4688 2.27604 11.4219 2.32812 11.3594L6 7.6875L9.67188 11.3594C9.72396 11.4219 9.78646 11.4688 9.85938 11.5C9.94271 11.5312 10.0312 11.5469 10.125 11.5469C10.2083 11.5469 10.2865 11.5312 10.3594 11.5C10.4427 11.4688 10.5156 11.4219 10.5781 11.3594L11.3594 10.5781C11.4219 10.5156 11.4688 10.4479 11.5 10.375C11.5312 10.2917 11.5469 10.2083 11.5469 10.125C11.5469 10.0312 11.5312 9.94792 11.5 9.875C11.4688 9.79167 11.4219 9.71875 11.3594 9.65625L7.6875 6Z" fill="#AAAAAA"/>
									</svg>
								</div>
							</div>
							<p class="mt-10">Removing Files...</p>
						</div>

						<div class="p-30 small-text">
							<p>This will take just a few seconds.</p>
						</div>
					</div>
				</div>
			</div>
		</div>	<!-- /#cleanup-process -->
		<?php
	}

	/**
	 * Display the results screen content.
	 *
	 * @param array $params Customizing params.
	 * @return void
	 */
	public function results( $params = array() ) {
		?>
		<div class="cleanup-result">

			<div class="text-center">
				<div class="rocket-logo">
					<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
						<circle cx="50" cy="50" r="50" fill="#F8F8F8"/>
						<g clip-path="url(#clip0_630_5957)">
							<path opacity="0.4" d="M42.7783 47.9539C45.8729 44.8953 47.2041 41.6578 49.7408 39.1172C50.8971 37.9578 51.3174 36.2078 51.7244 34.5148C52.0721 33.0695 52.7986 30 54.3752 30C56.2502 30 60.0002 30.625 60.0002 36.3633C60.0002 39.6773 57.9689 41.5359 57.4002 43.75H65.3478C67.9564 43.75 69.9877 45.918 70.0002 48.2891C70.0064 49.6906 69.4103 51.1992 68.4814 52.132L68.4728 52.1414C69.2416 53.9641 69.1166 56.5164 67.7455 58.3492C68.4236 60.3727 67.74 62.8578 66.4658 64.1898C66.8018 65.5648 66.6408 66.7352 65.9853 67.6766C64.3908 69.968 60.4393 70 57.0971 70H56.8752C53.1033 70 50.0158 68.625 47.5346 67.5211C46.2846 66.9672 44.658 66.2805 43.4213 66.2578C43.1756 66.2533 42.9416 66.1525 42.7695 65.9772C42.5973 65.8019 42.5009 65.566 42.501 65.3203V48.6195C42.501 48.4958 42.5255 48.3732 42.5731 48.259C42.6207 48.1447 42.6904 48.0411 42.7783 47.9539Z" fill="#35104C"/>
							<path d="M38.125 47.5H31.875C31.3777 47.5 30.9008 47.6975 30.5492 48.0492C30.1975 48.4008 30 48.8777 30 49.375V68.125C30 68.6223 30.1975 69.0992 30.5492 69.4508C30.9008 69.8025 31.3777 70 31.875 70H38.125C38.6223 70 39.0992 69.8025 39.4508 69.4508C39.8025 69.0992 40 68.6223 40 68.125V49.375C40 48.8777 39.8025 48.4008 39.4508 48.0492C39.0992 47.6975 38.6223 47.5 38.125 47.5ZM35 66.875C34.6292 66.875 34.2666 66.765 33.9583 66.559C33.65 66.353 33.4096 66.0601 33.2677 65.7175C33.1258 65.3749 33.0887 64.9979 33.161 64.6342C33.2334 64.2705 33.412 63.9364 33.6742 63.6742C33.9364 63.412 34.2705 63.2334 34.6342 63.161C34.9979 63.0887 35.3749 63.1258 35.7175 63.2677C36.0601 63.4096 36.353 63.65 36.559 63.9583C36.765 64.2666 36.875 64.6292 36.875 65C36.875 65.4973 36.6775 65.9742 36.3258 66.3258C35.9742 66.6775 35.4973 66.875 35 66.875Z" fill="#35104C"/>
						</g>
						<defs>
							<clipPath id="clip0_630_5957">
								<rect width="40" height="40" fill="white" transform="translate(30 30)"/>
							</clipPath>
						</defs>
					</svg>
				</div>
				<div class="title-block mt-30">
					<span>Snapshot Restore</span>
					<h2>Cleanup Complete</h2>
				</div>

				<div class="content-block">
					<p>All restore files were successfully removed and your restored site is now ready for use.</p>
				</div>
			</div>
		</div>
		<?php
	}

	/**
	 * Callback for cleanup failure
	 *
	 * @param array $params Customizing params.
	 * @return void
	 */
	public function failed( $params = array() ) {
		// Not required at the moment.
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_database.php


/**
 * Partial view for database.
 */
class Si_View_Partial_Screens_Database extends Si_View {

	/**
	 * Outputs the database screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		?>
		<div id="database-configs" class="screen mb-30">
			<div class="text-center">
				<div class="title-block">
					<span>Snapshot Restore</span>
					<h2>Database Configuration</h2>
				</div>
			</div>

			<div class="content-block">
				<div class="text-center">
					<p>Let's connect to your database. We recommend creating a new database. However, if you'd like to use an existing database, ensure you use a different database prefix to avoid data loss.</p>
				</div>

				<form action="#" id="database-creds-form">
					<?php if ( isset( $params['show_toggle'] ) && $params['show_toggle'] ) : ?>
						<div class="sui-existing-db p-30 bs-1 br-4 mt-30">
							<div class="d-flex">
								<div class="switcher">
									<label for="use_existing_creds" class="sui-toggle">
										<input type="checkbox" id="use_existing_creds" name="config-creds" value="yes">
										<!-- ELEMENT: Toggle slider. -->
										<span class="sui-toggle-slider" aria-hidden="true"></span>
									</label>
								</div>
								<div class="db-exists--desc ml-10 text-left">
									<h4 class="fw-500">Use the database credentials from your current wp-config file</h4>
									<p class="text-left mt-10">Snapshot has detected an existing WordPress installation on your site. Enable this option to automatically fetch the database credentials from the existing <strong>wp-config.php</strong> file. </p>
								</div>
							</div>
						</div>
					<?php endif; ?>

					<div class="box p-30 mt-30 database-notice" style="display: none;">
						<div role="alert" class="sui-notice error validation-error" id="validation-error" style="display: none;" aria-live="assertive" tabindex="-1">
							<div class="sui-notice-content d-flex">
								<span class="exclamation-icon">!</span>
								<div class="sui-notice-message">
									<p>Please enter the database credentials!</p>
								</div>
							</div>
						</div>

						<div role="alert" class="sui-notice error validation-error" id="validation-error-site-url" style="display: none;" aria-live="assertive" tabindex="-1">
							<div class="sui-notice-content d-flex">
								<span class="exclamation-icon">!</span>
								<div class="sui-notice-message">
									<p>Please enter the database credentials and a valid Site URL!</p>
								</div>
							</div>
						</div>

						<div role="alert" class="sui-notice error" id="test-connection--error" style="display: none;" aria-live="assertive" tabindex="-1">
							<div class="sui-notice-content d-flex">
								<span class="exclamation-icon mt-2">!</span>
								<div class="sui-notice-message">
									<p>Couldn't connect to the database. Please make sure the database credentials you're using are correct and try again.</p>
								</div>
							</div>
						</div>

						<div role="alert" class="sui-notice success" id="test-connection--success" style="display: none;" aria-live="assertive" tabindex="-1">
							<div class="sui-notice-content d-flex">
								<span class="icon mr-10">
									<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M13.6562 2.34375C13.2917 1.97917 12.8958 1.65104 12.4688 1.35938C12.0417 1.07812 11.5885 0.838542 11.1094 0.640625C10.6302 0.432292 10.1302 0.270833 9.60938 0.15625C9.08854 0.0520833 8.55208 0 8 0C6.89583 0 5.85938 0.208333 4.89062 0.625C3.91146 1.04167 3.05729 1.61458 2.32812 2.34375C1.60938 3.0625 1.04167 3.91146 0.625 4.89062C0.208333 5.85938 0 6.89583 0 8C0 9.10417 0.208333 10.1406 0.625 11.1094C1.04167 12.0885 1.60938 12.9427 2.32812 13.6719C3.05729 14.3906 3.91146 14.9583 4.89062 15.375C5.85938 15.7917 6.89583 16 8 16C8.55208 16 9.08854 15.9479 9.60938 15.8438C10.1302 15.7292 10.6302 15.5677 11.1094 15.3594C11.5885 15.1615 12.0417 14.9219 12.4688 14.6406C12.8958 14.349 13.2917 14.0208 13.6562 13.6562C14.0208 13.2917 14.349 12.8958 14.6406 12.4688C14.9219 12.0417 15.1615 11.5885 15.3594 11.1094C15.5677 10.6302 15.7292 10.1302 15.8438 9.60938C15.9479 9.08854 16 8.55208 16 8C16 7.44792 15.9479 6.91146 15.8438 6.39062C15.7292 5.86979 15.5677 5.36979 15.3594 4.89062C15.1615 4.41146 14.9219 3.95833 14.6406 3.53125C14.349 3.10417 14.0208 2.70833 13.6562 2.34375ZM11.3281 6.64062L7.39062 10.5625C7.30729 10.6458 7.20833 10.7135 7.09375 10.7656C6.98958 10.8177 6.875 10.8438 6.75 10.8438C6.61458 10.8438 6.48958 10.8177 6.375 10.7656C6.27083 10.7135 6.17708 10.6458 6.09375 10.5625L4.10938 8.57812C4.05729 8.52604 4.01562 8.46354 3.98438 8.39062C3.95312 8.31771 3.9375 8.24479 3.9375 8.17188C3.9375 8.08854 3.95312 8.01042 3.98438 7.9375C4.01562 7.86458 4.05729 7.80208 4.10938 7.75L4.57812 7.28125C4.63021 7.22917 4.69271 7.1875 4.76562 7.15625C4.83854 7.125 4.91667 7.10938 5 7.10938C5.08333 7.10938 5.15625 7.125 5.21875 7.15625C5.29167 7.1875 5.35938 7.22917 5.42188 7.28125L6.75 8.60938L10.0156 5.32812C10.0677 5.27604 10.1302 5.23438 10.2031 5.20312C10.276 5.17188 10.3542 5.15625 10.4375 5.15625C10.5208 5.15625 10.599 5.17188 10.6719 5.20312C10.7448 5.23438 10.8073 5.27604 10.8594 5.32812L11.3281 5.79688C11.3802 5.84896 11.4219 5.91146 11.4531 5.98438C11.4844 6.05729 11.5 6.13542 11.5 6.21875C11.5 6.30208 11.4844 6.38021 11.4531 6.45312C11.4219 6.52604 11.3802 6.58854 11.3281 6.64062Z" fill="#1ABC9C"/>
									</svg>
								</span>
								<div class="sui-notice-message">
									<p>Connection to the database <strong>%s</strong> was successful.</p>
								</div>
							</div>
						</div>
					</div>

					<div class="p-30 bs-1 br-4 mt-30">
						<div class="form-holder">
							<div class="use-existing-db--creds">
								<div class="sui-row">
									<div class="sui-col-md-8">
										<div class="sui-form-group">
											<label for="db_host">Database Host</label>
											<input type="text" name="DB_HOST" id="db_host" class="sui-form-control" placeholder="Enter your database host name">
										</div>
									</div>
									<div class="sui-col-md-4">
										<div class="sui-form-group">
											<label for="db_port">Port</label>
											<input type="text" name="DB_PORT" id="db_port" class="sui-form-control" value="3306">
										</div>
									</div>
								</div>

								<div class="sui-form-group">
									<label for="db_name">Database Name</label>
									<input type="text" name="DB_NAME" id="db_name" class="sui-form-control" placeholder="Enter your database name">
								</div>

								<div class="sui-form-group">
									<label for="db_user">Database Username</label>
									<input type="text" name="DB_USER" id="db_user" class="sui-form-control" placeholder="Enter your database username">
								</div>

								<div class="sui-form-group">
									<label for="db_pass">Database Password</label>
									<input type="password" id="db_pass" name="DB_PASSWORD" class="sui-form-control" placeholder="Enter your database password">
								</div>
							</div>

							<div class="sui-form-group">
								<label for="db_prefix">Database Prefix</label>
								<input type="text" id="db_prefix" name="table_prefix" class="sui-form-control" placeholder="Enter your database table prefix" value="wp_">
							</div>

							<hr class="my-30">

							<div class="sui-form-group mt-0">
								<label for="site_url">New Site URL</label>
								<input type="text" id="site_url" name="site_url" class="sui-form-control" placeholder="Enter your new site URL" value="<?php echo ( isset( $params['url'] ) ) ? Si_Helper_Sanitize::url( $params['url'] ) : 'https://example.com'; ?>">
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>	<!-- /#database-configs -->
		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_deployment.php


/**
 * Partial view for deployment.
 */
class Si_View_Partial_Screens_Deployment extends Si_View {

	/**
	 * Outputs the deployment screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$restore_type = session()->has( 'partial_restore_type' ) ? session()->get( 'partial_restore_type' ) : 'full_backup';
		?>
		<div id="deployment" class="screen">
			<div class="deploying">
				<div class="text-center">
					<div class="title-block">
						<span>Snapshot Restore</span>
						<h2>Running Deployment</h2>
					</div>
				</div>

				<div class="content-block">
					<div class="text-center">
						<p>Please keep this window open while we restore your website. This can take anywhere from a few seconds to a few minutes depending on the size of your archive and database.</p>

						<div class="box px-100 py-30 my-30">
							<div class="d-flex align-center inner-box p-20 loading-block">
								<div class="flex-item loading-icon">
									<span class="loading-icon spin">
										<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M8 0C7.72917 0 7.5 0.09375 7.3125 0.28125C7.125 0.46875 7.03125 0.697917 7.03125 0.96875V3.34375C7.03125 3.61458 7.125 3.84375 7.3125 4.03125C7.5 4.21875 7.72917 4.3125 8 4.3125C8.27083 4.3125 8.5 4.21875 8.6875 4.03125C8.875 3.84375 8.96875 3.61458 8.96875 3.34375V0.96875C8.96875 0.697917 8.875 0.46875 8.6875 0.28125C8.5 0.09375 8.27083 0 8 0ZM8 11.6875C7.72917 11.6875 7.5 11.7812 7.3125 11.9688C7.125 12.1562 7.03125 12.3854 7.03125 12.6562V15.0312C7.03125 15.3021 7.125 15.5312 7.3125 15.7188C7.5 15.9062 7.72917 16 8 16C8.27083 16 8.5 15.9062 8.6875 15.7188C8.875 15.5312 8.96875 15.3021 8.96875 15.0312V12.6562C8.96875 12.3854 8.875 12.1562 8.6875 11.9688C8.5 11.7812 8.27083 11.6875 8 11.6875ZM11.2969 5.6875C11.4323 5.6875 11.5573 5.66146 11.6719 5.60938C11.7865 5.55729 11.8906 5.48438 11.9844 5.39062L13.6562 3.71875C13.75 3.63542 13.8229 3.53125 13.875 3.40625C13.9271 3.28125 13.9531 3.15104 13.9531 3.01562C13.9531 2.74479 13.8594 2.51562 13.6719 2.32812C13.4844 2.14062 13.2552 2.04688 12.9844 2.04688C12.849 2.04688 12.7188 2.07292 12.5938 2.125C12.4688 2.17708 12.3646 2.25 12.2812 2.34375L10.6094 4.01562C10.5156 4.10938 10.4427 4.21875 10.3906 4.34375C10.3385 4.45833 10.3125 4.57812 10.3125 4.70312C10.3125 4.97396 10.4062 5.20833 10.5938 5.40625C10.7917 5.59375 11.026 5.6875 11.2969 5.6875ZM4.70312 10.3125C4.56771 10.3125 4.44271 10.3385 4.32812 10.3906C4.21354 10.4427 4.10938 10.5156 4.01562 10.6094L2.34375 12.2812C2.25 12.3646 2.17708 12.4688 2.125 12.5938C2.07292 12.7188 2.04688 12.849 2.04688 12.9844C2.04688 13.2552 2.14062 13.4844 2.32812 13.6719C2.51562 13.8594 2.74479 13.9531 3.01562 13.9531C3.15104 13.9531 3.28125 13.9271 3.40625 13.875C3.53125 13.8229 3.63542 13.75 3.71875 13.6562L5.39062 11.9844C5.48438 11.8906 5.55729 11.7865 5.60938 11.6719C5.66146 11.5469 5.6875 11.4219 5.6875 11.2969C5.6875 11.026 5.58854 10.7969 5.39062 10.6094C5.20312 10.4115 4.97396 10.3125 4.70312 10.3125ZM15.0312 7.03125H12.6562C12.3854 7.03125 12.1562 7.125 11.9688 7.3125C11.7812 7.5 11.6875 7.72917 11.6875 8C11.6875 8.27083 11.7812 8.5 11.9688 8.6875C12.1562 8.875 12.3854 8.96875 12.6562 8.96875H15.0312C15.3021 8.96875 15.5312 8.875 15.7188 8.6875C15.9062 8.5 16 8.27083 16 8C16 7.72917 15.9062 7.5 15.7188 7.3125C15.5312 7.125 15.3021 7.03125 15.0312 7.03125ZM4.3125 8C4.3125 7.72917 4.21875 7.5 4.03125 7.3125C3.84375 7.125 3.61458 7.03125 3.34375 7.03125H0.96875C0.697917 7.03125 0.46875 7.125 0.28125 7.3125C0.09375 7.5 0 7.72917 0 8C0 8.27083 0.09375 8.5 0.28125 8.6875C0.46875 8.875 0.697917 8.96875 0.96875 8.96875H3.34375C3.61458 8.96875 3.84375 8.875 4.03125 8.6875C4.21875 8.5 4.3125 8.27083 4.3125 8ZM11.9844 10.6094C11.8906 10.5156 11.7812 10.4427 11.6562 10.3906C11.5417 10.3281 11.4115 10.2969 11.2656 10.2969C11.0052 10.2969 10.776 10.3958 10.5781 10.5938C10.3906 10.7812 10.2969 11.0052 10.2969 11.2656C10.2969 11.4115 10.3229 11.5469 10.375 11.6719C10.4375 11.7865 10.5156 11.8906 10.6094 11.9844L12.2812 13.6562C12.3646 13.75 12.4688 13.8229 12.5938 13.875C12.7188 13.9271 12.849 13.9531 12.9844 13.9531C13.2552 13.9531 13.4844 13.8594 13.6719 13.6719C13.8594 13.4844 13.9531 13.2552 13.9531 12.9844C13.9531 12.849 13.9271 12.7188 13.875 12.5938C13.8229 12.4688 13.75 12.3646 13.6562 12.2812L11.9844 10.6094ZM3.71875 2.34375C3.63542 2.26042 3.53646 2.19792 3.42188 2.15625C3.30729 2.10417 3.18229 2.07812 3.04688 2.07812C2.77604 2.07812 2.54688 2.17188 2.35938 2.35938C2.17188 2.54688 2.07812 2.77604 2.07812 3.04688C2.07812 3.18229 2.09896 3.30729 2.14062 3.42188C2.19271 3.53646 2.26042 3.63542 2.34375 3.71875L4.01562 5.39062C4.10938 5.48438 4.21354 5.5625 4.32812 5.625C4.45312 5.67708 4.58854 5.70312 4.73438 5.70312C4.99479 5.70312 5.21875 5.60938 5.40625 5.42188C5.60417 5.22396 5.70312 4.99479 5.70312 4.73438C5.70312 4.58854 5.67188 4.45833 5.60938 4.34375C5.55729 4.21875 5.48438 4.10938 5.39062 4.01562L3.71875 2.34375Z" fill="#888888"/>
										</svg>
									</span>
								</div>
								<div class="flex-item loading-percent">1%</div>
								<div class="flex-item loading-block">
									<div class="loading-inner" style="width: 3%;"></div>
								</div>
							</div>
							<p class="deploy-status mt-10">Unpacking files&hellip;</p>

							<ul class="deploy-action">
								<li class="action action-unpacking current">
									<span>Unpacking Archive</span>
									<span class="loading-icon spin">
										<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M6 0.75C5.79688 0.75 5.625 0.820312 5.48438 0.960938C5.34375 1.10156 5.27344 1.27344 5.27344 1.47656V3.25781C5.27344 3.46094 5.34375 3.63281 5.48438 3.77344C5.625 3.91406 5.79688 3.98438 6 3.98438C6.20312 3.98438 6.375 3.91406 6.51562 3.77344C6.65625 3.63281 6.72656 3.46094 6.72656 3.25781V1.47656C6.72656 1.27344 6.65625 1.10156 6.51562 0.960938C6.375 0.820312 6.20312 0.75 6 0.75ZM6 9.51562C5.79688 9.51562 5.625 9.58594 5.48438 9.72656C5.34375 9.86719 5.27344 10.0391 5.27344 10.2422V12.0234C5.27344 12.2266 5.34375 12.3984 5.48438 12.5391C5.625 12.6797 5.79688 12.75 6 12.75C6.20312 12.75 6.375 12.6797 6.51562 12.5391C6.65625 12.3984 6.72656 12.2266 6.72656 12.0234V10.2422C6.72656 10.0391 6.65625 9.86719 6.51562 9.72656C6.375 9.58594 6.20312 9.51562 6 9.51562ZM8.47266 5.01562C8.57422 5.01562 8.66797 4.99609 8.75391 4.95703C8.83984 4.91797 8.91797 4.86328 8.98828 4.79297L10.2422 3.53906C10.3125 3.47656 10.3672 3.39844 10.4062 3.30469C10.4453 3.21094 10.4648 3.11328 10.4648 3.01172C10.4648 2.80859 10.3945 2.63672 10.2539 2.49609C10.1133 2.35547 9.94141 2.28516 9.73828 2.28516C9.63672 2.28516 9.53906 2.30469 9.44531 2.34375C9.35156 2.38281 9.27344 2.4375 9.21094 2.50781L7.95703 3.76172C7.88672 3.83203 7.83203 3.91406 7.79297 4.00781C7.75391 4.09375 7.73438 4.18359 7.73438 4.27734C7.73438 4.48047 7.80469 4.65625 7.94531 4.80469C8.09375 4.94531 8.26953 5.01562 8.47266 5.01562ZM3.52734 8.48438C3.42578 8.48438 3.33203 8.50391 3.24609 8.54297C3.16016 8.58203 3.08203 8.63672 3.01172 8.70703L1.75781 9.96094C1.6875 10.0234 1.63281 10.1016 1.59375 10.1953C1.55469 10.2891 1.53516 10.3867 1.53516 10.4883C1.53516 10.6914 1.60547 10.8633 1.74609 11.0039C1.88672 11.1445 2.05859 11.2148 2.26172 11.2148C2.36328 11.2148 2.46094 11.1953 2.55469 11.1562C2.64844 11.1172 2.72656 11.0625 2.78906 10.9922L4.04297 9.73828C4.11328 9.66797 4.16797 9.58984 4.20703 9.50391C4.24609 9.41016 4.26562 9.31641 4.26562 9.22266C4.26562 9.01953 4.19141 8.84766 4.04297 8.70703C3.90234 8.55859 3.73047 8.48438 3.52734 8.48438ZM11.2734 6.02344H9.49219C9.28906 6.02344 9.11719 6.09375 8.97656 6.23438C8.83594 6.375 8.76562 6.54688 8.76562 6.75C8.76562 6.95312 8.83594 7.125 8.97656 7.26562C9.11719 7.40625 9.28906 7.47656 9.49219 7.47656H11.2734C11.4766 7.47656 11.6484 7.40625 11.7891 7.26562C11.9297 7.125 12 6.95312 12 6.75C12 6.54688 11.9297 6.375 11.7891 6.23438C11.6484 6.09375 11.4766 6.02344 11.2734 6.02344ZM3.23438 6.75C3.23438 6.54688 3.16406 6.375 3.02344 6.23438C2.88281 6.09375 2.71094 6.02344 2.50781 6.02344H0.726562C0.523438 6.02344 0.351562 6.09375 0.210938 6.23438C0.0703125 6.375 0 6.54688 0 6.75C0 6.95312 0.0703125 7.125 0.210938 7.26562C0.351562 7.40625 0.523438 7.47656 0.726562 7.47656H2.50781C2.71094 7.47656 2.88281 7.40625 3.02344 7.26562C3.16406 7.125 3.23438 6.95312 3.23438 6.75ZM8.98828 8.70703C8.91797 8.63672 8.83594 8.58203 8.74219 8.54297C8.65625 8.49609 8.55859 8.47266 8.44922 8.47266C8.25391 8.47266 8.08203 8.54688 7.93359 8.69531C7.79297 8.83594 7.72266 9.00391 7.72266 9.19922C7.72266 9.30859 7.74219 9.41016 7.78125 9.50391C7.82812 9.58984 7.88672 9.66797 7.95703 9.73828L9.21094 10.9922C9.27344 11.0625 9.35156 11.1172 9.44531 11.1562C9.53906 11.1953 9.63672 11.2148 9.73828 11.2148C9.94141 11.2148 10.1133 11.1445 10.2539 11.0039C10.3945 10.8633 10.4648 10.6914 10.4648 10.4883C10.4648 10.3867 10.4453 10.2891 10.4062 10.1953C10.3672 10.1016 10.3125 10.0234 10.2422 9.96094L8.98828 8.70703ZM2.78906 2.50781C2.72656 2.44531 2.65234 2.39844 2.56641 2.36719C2.48047 2.32812 2.38672 2.30859 2.28516 2.30859C2.08203 2.30859 1.91016 2.37891 1.76953 2.51953C1.62891 2.66016 1.55859 2.83203 1.55859 3.03516C1.55859 3.13672 1.57422 3.23047 1.60547 3.31641C1.64453 3.40234 1.69531 3.47656 1.75781 3.53906L3.01172 4.79297C3.08203 4.86328 3.16016 4.92188 3.24609 4.96875C3.33984 5.00781 3.44141 5.02734 3.55078 5.02734C3.74609 5.02734 3.91406 4.95703 4.05469 4.81641C4.20312 4.66797 4.27734 4.49609 4.27734 4.30078C4.27734 4.19141 4.25391 4.09375 4.20703 4.00781C4.16797 3.91406 4.11328 3.83203 4.04297 3.76172L2.78906 2.50781Z" fill="#888888"/>
										</svg>
									</span>
									<span class="check-icon">
										<svg width="12" height="9" viewBox="0 0 12 9" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M11.3555 1.60938L10.6172 0.882812C10.5703 0.835938 10.5156 0.800781 10.4531 0.777344C10.3906 0.746094 10.3242 0.730469 10.2539 0.730469C10.1836 0.730469 10.1172 0.746094 10.0547 0.777344C9.99219 0.800781 9.9375 0.835938 9.89062 0.882812L4.48828 6.29688L2.10938 3.91797C2.0625 3.87109 2.00781 3.83594 1.94531 3.8125C1.88281 3.78125 1.81641 3.76562 1.74609 3.76562C1.67578 3.76562 1.60938 3.78125 1.54688 3.8125C1.48438 3.83594 1.42969 3.87109 1.38281 3.91797L0.644531 4.65625C0.597656 4.70312 0.558594 4.75781 0.527344 4.82031C0.503906 4.88281 0.492188 4.94922 0.492188 5.01953C0.492188 5.08984 0.503906 5.15625 0.527344 5.21875C0.558594 5.28125 0.597656 5.33594 0.644531 5.38281L3.76172 8.47656C3.85547 8.5625 3.96484 8.63281 4.08984 8.6875C4.21484 8.74219 4.34766 8.76953 4.48828 8.76953C4.62891 8.76953 4.76172 8.74219 4.88672 8.6875C5.01172 8.63281 5.12109 8.5625 5.21484 8.47656L11.3555 2.33594C11.4023 2.28906 11.4375 2.23438 11.4609 2.17188C11.4922 2.10937 11.5078 2.04297 11.5078 1.97266C11.5078 1.90234 11.4922 1.83594 11.4609 1.77344C11.4375 1.71094 11.4023 1.65625 11.3555 1.60938Z" fill="#888888"/>
										</svg>
									</span>
								</li>

								<?php if ( 'files'!== $restore_type ) : ?>
									<li class="action action-database waiting">
										<span>Installing Database</span>
										<span class="loading-icon spin">
											<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M6 0.75C5.79688 0.75 5.625 0.820312 5.48438 0.960938C5.34375 1.10156 5.27344 1.27344 5.27344 1.47656V3.25781C5.27344 3.46094 5.34375 3.63281 5.48438 3.77344C5.625 3.91406 5.79688 3.98438 6 3.98438C6.20312 3.98438 6.375 3.91406 6.51562 3.77344C6.65625 3.63281 6.72656 3.46094 6.72656 3.25781V1.47656C6.72656 1.27344 6.65625 1.10156 6.51562 0.960938C6.375 0.820312 6.20312 0.75 6 0.75ZM6 9.51562C5.79688 9.51562 5.625 9.58594 5.48438 9.72656C5.34375 9.86719 5.27344 10.0391 5.27344 10.2422V12.0234C5.27344 12.2266 5.34375 12.3984 5.48438 12.5391C5.625 12.6797 5.79688 12.75 6 12.75C6.20312 12.75 6.375 12.6797 6.51562 12.5391C6.65625 12.3984 6.72656 12.2266 6.72656 12.0234V10.2422C6.72656 10.0391 6.65625 9.86719 6.51562 9.72656C6.375 9.58594 6.20312 9.51562 6 9.51562ZM8.47266 5.01562C8.57422 5.01562 8.66797 4.99609 8.75391 4.95703C8.83984 4.91797 8.91797 4.86328 8.98828 4.79297L10.2422 3.53906C10.3125 3.47656 10.3672 3.39844 10.4062 3.30469C10.4453 3.21094 10.4648 3.11328 10.4648 3.01172C10.4648 2.80859 10.3945 2.63672 10.2539 2.49609C10.1133 2.35547 9.94141 2.28516 9.73828 2.28516C9.63672 2.28516 9.53906 2.30469 9.44531 2.34375C9.35156 2.38281 9.27344 2.4375 9.21094 2.50781L7.95703 3.76172C7.88672 3.83203 7.83203 3.91406 7.79297 4.00781C7.75391 4.09375 7.73438 4.18359 7.73438 4.27734C7.73438 4.48047 7.80469 4.65625 7.94531 4.80469C8.09375 4.94531 8.26953 5.01562 8.47266 5.01562ZM3.52734 8.48438C3.42578 8.48438 3.33203 8.50391 3.24609 8.54297C3.16016 8.58203 3.08203 8.63672 3.01172 8.70703L1.75781 9.96094C1.6875 10.0234 1.63281 10.1016 1.59375 10.1953C1.55469 10.2891 1.53516 10.3867 1.53516 10.4883C1.53516 10.6914 1.60547 10.8633 1.74609 11.0039C1.88672 11.1445 2.05859 11.2148 2.26172 11.2148C2.36328 11.2148 2.46094 11.1953 2.55469 11.1562C2.64844 11.1172 2.72656 11.0625 2.78906 10.9922L4.04297 9.73828C4.11328 9.66797 4.16797 9.58984 4.20703 9.50391C4.24609 9.41016 4.26562 9.31641 4.26562 9.22266C4.26562 9.01953 4.19141 8.84766 4.04297 8.70703C3.90234 8.55859 3.73047 8.48438 3.52734 8.48438ZM11.2734 6.02344H9.49219C9.28906 6.02344 9.11719 6.09375 8.97656 6.23438C8.83594 6.375 8.76562 6.54688 8.76562 6.75C8.76562 6.95312 8.83594 7.125 8.97656 7.26562C9.11719 7.40625 9.28906 7.47656 9.49219 7.47656H11.2734C11.4766 7.47656 11.6484 7.40625 11.7891 7.26562C11.9297 7.125 12 6.95312 12 6.75C12 6.54688 11.9297 6.375 11.7891 6.23438C11.6484 6.09375 11.4766 6.02344 11.2734 6.02344ZM3.23438 6.75C3.23438 6.54688 3.16406 6.375 3.02344 6.23438C2.88281 6.09375 2.71094 6.02344 2.50781 6.02344H0.726562C0.523438 6.02344 0.351562 6.09375 0.210938 6.23438C0.0703125 6.375 0 6.54688 0 6.75C0 6.95312 0.0703125 7.125 0.210938 7.26562C0.351562 7.40625 0.523438 7.47656 0.726562 7.47656H2.50781C2.71094 7.47656 2.88281 7.40625 3.02344 7.26562C3.16406 7.125 3.23438 6.95312 3.23438 6.75ZM8.98828 8.70703C8.91797 8.63672 8.83594 8.58203 8.74219 8.54297C8.65625 8.49609 8.55859 8.47266 8.44922 8.47266C8.25391 8.47266 8.08203 8.54688 7.93359 8.69531C7.79297 8.83594 7.72266 9.00391 7.72266 9.19922C7.72266 9.30859 7.74219 9.41016 7.78125 9.50391C7.82812 9.58984 7.88672 9.66797 7.95703 9.73828L9.21094 10.9922C9.27344 11.0625 9.35156 11.1172 9.44531 11.1562C9.53906 11.1953 9.63672 11.2148 9.73828 11.2148C9.94141 11.2148 10.1133 11.1445 10.2539 11.0039C10.3945 10.8633 10.4648 10.6914 10.4648 10.4883C10.4648 10.3867 10.4453 10.2891 10.4062 10.1953C10.3672 10.1016 10.3125 10.0234 10.2422 9.96094L8.98828 8.70703ZM2.78906 2.50781C2.72656 2.44531 2.65234 2.39844 2.56641 2.36719C2.48047 2.32812 2.38672 2.30859 2.28516 2.30859C2.08203 2.30859 1.91016 2.37891 1.76953 2.51953C1.62891 2.66016 1.55859 2.83203 1.55859 3.03516C1.55859 3.13672 1.57422 3.23047 1.60547 3.31641C1.64453 3.40234 1.69531 3.47656 1.75781 3.53906L3.01172 4.79297C3.08203 4.86328 3.16016 4.92188 3.24609 4.96875C3.33984 5.00781 3.44141 5.02734 3.55078 5.02734C3.74609 5.02734 3.91406 4.95703 4.05469 4.81641C4.20312 4.66797 4.27734 4.49609 4.27734 4.30078C4.27734 4.19141 4.25391 4.09375 4.20703 4.00781C4.16797 3.91406 4.11328 3.83203 4.04297 3.76172L2.78906 2.50781Z" fill="#888888"/>
											</svg>
										</span>
										<span class="check-icon">
											<svg width="12" height="9" viewBox="0 0 12 9" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M11.3555 1.60938L10.6172 0.882812C10.5703 0.835938 10.5156 0.800781 10.4531 0.777344C10.3906 0.746094 10.3242 0.730469 10.2539 0.730469C10.1836 0.730469 10.1172 0.746094 10.0547 0.777344C9.99219 0.800781 9.9375 0.835938 9.89062 0.882812L4.48828 6.29688L2.10938 3.91797C2.0625 3.87109 2.00781 3.83594 1.94531 3.8125C1.88281 3.78125 1.81641 3.76562 1.74609 3.76562C1.67578 3.76562 1.60938 3.78125 1.54688 3.8125C1.48438 3.83594 1.42969 3.87109 1.38281 3.91797L0.644531 4.65625C0.597656 4.70312 0.558594 4.75781 0.527344 4.82031C0.503906 4.88281 0.492188 4.94922 0.492188 5.01953C0.492188 5.08984 0.503906 5.15625 0.527344 5.21875C0.558594 5.28125 0.597656 5.33594 0.644531 5.38281L3.76172 8.47656C3.85547 8.5625 3.96484 8.63281 4.08984 8.6875C4.21484 8.74219 4.34766 8.76953 4.48828 8.76953C4.62891 8.76953 4.76172 8.74219 4.88672 8.6875C5.01172 8.63281 5.12109 8.5625 5.21484 8.47656L11.3555 2.33594C11.4023 2.28906 11.4375 2.23438 11.4609 2.17188C11.4922 2.10937 11.5078 2.04297 11.5078 1.97266C11.5078 1.90234 11.4922 1.83594 11.4609 1.77344C11.4375 1.71094 11.4023 1.65625 11.3555 1.60938Z" fill="#888888"/>
											</svg>
										</span>
									</li>
									<li class="action action-settings waiting">
										<span>Applying Settings</span>
										<span class="loading-icon spin">
											<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M6 0.75C5.79688 0.75 5.625 0.820312 5.48438 0.960938C5.34375 1.10156 5.27344 1.27344 5.27344 1.47656V3.25781C5.27344 3.46094 5.34375 3.63281 5.48438 3.77344C5.625 3.91406 5.79688 3.98438 6 3.98438C6.20312 3.98438 6.375 3.91406 6.51562 3.77344C6.65625 3.63281 6.72656 3.46094 6.72656 3.25781V1.47656C6.72656 1.27344 6.65625 1.10156 6.51562 0.960938C6.375 0.820312 6.20312 0.75 6 0.75ZM6 9.51562C5.79688 9.51562 5.625 9.58594 5.48438 9.72656C5.34375 9.86719 5.27344 10.0391 5.27344 10.2422V12.0234C5.27344 12.2266 5.34375 12.3984 5.48438 12.5391C5.625 12.6797 5.79688 12.75 6 12.75C6.20312 12.75 6.375 12.6797 6.51562 12.5391C6.65625 12.3984 6.72656 12.2266 6.72656 12.0234V10.2422C6.72656 10.0391 6.65625 9.86719 6.51562 9.72656C6.375 9.58594 6.20312 9.51562 6 9.51562ZM8.47266 5.01562C8.57422 5.01562 8.66797 4.99609 8.75391 4.95703C8.83984 4.91797 8.91797 4.86328 8.98828 4.79297L10.2422 3.53906C10.3125 3.47656 10.3672 3.39844 10.4062 3.30469C10.4453 3.21094 10.4648 3.11328 10.4648 3.01172C10.4648 2.80859 10.3945 2.63672 10.2539 2.49609C10.1133 2.35547 9.94141 2.28516 9.73828 2.28516C9.63672 2.28516 9.53906 2.30469 9.44531 2.34375C9.35156 2.38281 9.27344 2.4375 9.21094 2.50781L7.95703 3.76172C7.88672 3.83203 7.83203 3.91406 7.79297 4.00781C7.75391 4.09375 7.73438 4.18359 7.73438 4.27734C7.73438 4.48047 7.80469 4.65625 7.94531 4.80469C8.09375 4.94531 8.26953 5.01562 8.47266 5.01562ZM3.52734 8.48438C3.42578 8.48438 3.33203 8.50391 3.24609 8.54297C3.16016 8.58203 3.08203 8.63672 3.01172 8.70703L1.75781 9.96094C1.6875 10.0234 1.63281 10.1016 1.59375 10.1953C1.55469 10.2891 1.53516 10.3867 1.53516 10.4883C1.53516 10.6914 1.60547 10.8633 1.74609 11.0039C1.88672 11.1445 2.05859 11.2148 2.26172 11.2148C2.36328 11.2148 2.46094 11.1953 2.55469 11.1562C2.64844 11.1172 2.72656 11.0625 2.78906 10.9922L4.04297 9.73828C4.11328 9.66797 4.16797 9.58984 4.20703 9.50391C4.24609 9.41016 4.26562 9.31641 4.26562 9.22266C4.26562 9.01953 4.19141 8.84766 4.04297 8.70703C3.90234 8.55859 3.73047 8.48438 3.52734 8.48438ZM11.2734 6.02344H9.49219C9.28906 6.02344 9.11719 6.09375 8.97656 6.23438C8.83594 6.375 8.76562 6.54688 8.76562 6.75C8.76562 6.95312 8.83594 7.125 8.97656 7.26562C9.11719 7.40625 9.28906 7.47656 9.49219 7.47656H11.2734C11.4766 7.47656 11.6484 7.40625 11.7891 7.26562C11.9297 7.125 12 6.95312 12 6.75C12 6.54688 11.9297 6.375 11.7891 6.23438C11.6484 6.09375 11.4766 6.02344 11.2734 6.02344ZM3.23438 6.75C3.23438 6.54688 3.16406 6.375 3.02344 6.23438C2.88281 6.09375 2.71094 6.02344 2.50781 6.02344H0.726562C0.523438 6.02344 0.351562 6.09375 0.210938 6.23438C0.0703125 6.375 0 6.54688 0 6.75C0 6.95312 0.0703125 7.125 0.210938 7.26562C0.351562 7.40625 0.523438 7.47656 0.726562 7.47656H2.50781C2.71094 7.47656 2.88281 7.40625 3.02344 7.26562C3.16406 7.125 3.23438 6.95312 3.23438 6.75ZM8.98828 8.70703C8.91797 8.63672 8.83594 8.58203 8.74219 8.54297C8.65625 8.49609 8.55859 8.47266 8.44922 8.47266C8.25391 8.47266 8.08203 8.54688 7.93359 8.69531C7.79297 8.83594 7.72266 9.00391 7.72266 9.19922C7.72266 9.30859 7.74219 9.41016 7.78125 9.50391C7.82812 9.58984 7.88672 9.66797 7.95703 9.73828L9.21094 10.9922C9.27344 11.0625 9.35156 11.1172 9.44531 11.1562C9.53906 11.1953 9.63672 11.2148 9.73828 11.2148C9.94141 11.2148 10.1133 11.1445 10.2539 11.0039C10.3945 10.8633 10.4648 10.6914 10.4648 10.4883C10.4648 10.3867 10.4453 10.2891 10.4062 10.1953C10.3672 10.1016 10.3125 10.0234 10.2422 9.96094L8.98828 8.70703ZM2.78906 2.50781C2.72656 2.44531 2.65234 2.39844 2.56641 2.36719C2.48047 2.32812 2.38672 2.30859 2.28516 2.30859C2.08203 2.30859 1.91016 2.37891 1.76953 2.51953C1.62891 2.66016 1.55859 2.83203 1.55859 3.03516C1.55859 3.13672 1.57422 3.23047 1.60547 3.31641C1.64453 3.40234 1.69531 3.47656 1.75781 3.53906L3.01172 4.79297C3.08203 4.86328 3.16016 4.92188 3.24609 4.96875C3.33984 5.00781 3.44141 5.02734 3.55078 5.02734C3.74609 5.02734 3.91406 4.95703 4.05469 4.81641C4.20312 4.66797 4.27734 4.49609 4.27734 4.30078C4.27734 4.19141 4.25391 4.09375 4.20703 4.00781C4.16797 3.91406 4.11328 3.83203 4.04297 3.76172L2.78906 2.50781Z" fill="#888888"/>
											</svg>
										</span>
										<span class="check-icon">
											<svg width="12" height="9" viewBox="0 0 12 9" fill="none" xmlns="http://www.w3.org/2000/svg">
											<path d="M11.3555 1.60938L10.6172 0.882812C10.5703 0.835938 10.5156 0.800781 10.4531 0.777344C10.3906 0.746094 10.3242 0.730469 10.2539 0.730469C10.1836 0.730469 10.1172 0.746094 10.0547 0.777344C9.99219 0.800781 9.9375 0.835938 9.89062 0.882812L4.48828 6.29688L2.10938 3.91797C2.0625 3.87109 2.00781 3.83594 1.94531 3.8125C1.88281 3.78125 1.81641 3.76562 1.74609 3.76562C1.67578 3.76562 1.60938 3.78125 1.54688 3.8125C1.48438 3.83594 1.42969 3.87109 1.38281 3.91797L0.644531 4.65625C0.597656 4.70312 0.558594 4.75781 0.527344 4.82031C0.503906 4.88281 0.492188 4.94922 0.492188 5.01953C0.492188 5.08984 0.503906 5.15625 0.527344 5.21875C0.558594 5.28125 0.597656 5.33594 0.644531 5.38281L3.76172 8.47656C3.85547 8.5625 3.96484 8.63281 4.08984 8.6875C4.21484 8.74219 4.34766 8.76953 4.48828 8.76953C4.62891 8.76953 4.76172 8.74219 4.88672 8.6875C5.01172 8.63281 5.12109 8.5625 5.21484 8.47656L11.3555 2.33594C11.4023 2.28906 11.4375 2.23438 11.4609 2.17188C11.4922 2.10937 11.5078 2.04297 11.5078 1.97266C11.5078 1.90234 11.4922 1.83594 11.4609 1.77344C11.4375 1.71094 11.4023 1.65625 11.3555 1.60938Z" fill="#888888"/>
											</svg>
										</span>
									</li>
								<?php endif; ?>
							</ul>
						</div>

						<p>Click View Logs to review the restore activities logs.</p>
					</div>
				</div>
			</div>

			<div class="deployment-result"></div>
		</div>	<!-- /#deployment -->
		<?php
	}

	/**
	 * Deployment failed
	 *
	 * @param array $params Customizing params.
	 * @return void
	 */
	public function failed( $params = array() ) {
		?>
		<div class="deployment-failed my-30">
			<div class="text-center">
				<div class="title-block">
					<span>Snapshot Restore</span>
					<h2>Deployment Failed</h2>
				</div>
			</div>

			<div class="content-block">
				<div class="text-center">
					<p>Snapshot could not complete the restoration process</p>
				</div>

				<div class="box p-30 mt-30">
					<div role="alert" class="sui-notice error" aria-live="assertive" tabindex="-1">
						<div class="sui-notice-content d-flex">
							<span class="exclamation-icon mt-5">!</span>
							<div class="sui-notice-message">
								<p>There was an error while trying to restore your site! Click View Logs to learn more, and then fix any issues before trying again.</p>
							</div>
						</div>
					</div>
				</div>

				<div class="text-center my-30">
					<p>Click View Logs to review the restore activities logs.</p>
				</div>
			</div>
		</div>
		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_failed.php


/**
 * Partial view for failure.
 */
class Si_View_Partial_Screens_Failed extends Si_View {

	/**
	 * Outputs the failure screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$error = session()->get( 'error_str' );
		if ( $error && ! empty( $error ) ) {
			session()->unset( 'error_str' );
		}
		?>
		<div class="deployment-result my-30">
			<div class="text-center">
				<div class="title-block">
					<span>Snapshot Restore</span>
					<h2>Deployment Failed</h2>
				</div>
			</div>

			<div class="content-block">
				<div class="text-center">
					<p>Snapshot could not complete the restoration process</p>
				</div>

				<div class="box p-30 mt-30">
					<div role="alert" class="sui-notice error" aria-live="assertive" tabindex="-1">
						<div class="sui-notice-content d-flex">
							<span class="exclamation-icon mt-5">!</span>
							<div class="sui-notice-message">
								<p>
									There was an error while trying to restore your site! Click View Logs to learn more, and then fix any issues before trying again.
									<?php if ( $error && '' !== $error ) : ?>
										<br>
										<code><?php echo $error; ?></code>
									<?php endif; ?>
								</p>
							</div>
						</div>
					</div>
				</div>

				<div class="text-center my-30">
					<p>Click View Logs to review the restore activities logs.</p>
				</div>
			</div>

		</div>
		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_log.php


/**
 * Partial view for log.
 */
class Si_View_Partial_Screens_Log extends Si_View {

	/**
	 * Outputs the log screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		?>
		<div class="log-result py-30 mb-30">
			<div class="text-center">
				<div class="title-block">
					<span>Snapshot Restore</span>
					<h2>Snapshot Restore Log</h2>
				</div>
			</div>

			<div class="content-block">
				<div class="text-center">
					<p>Here are the logs for the latest restoration. Use them to debug any issues you may have encountered.</p>
				</div>

				<div class="box p-30 mt-30">
					<div class="inner-box p-30">
						<div class="p-10 log-loader"></div>
					</div>
				</div>

				<div class="text-center my-30">
					<p>Logs will be automatically refreshed each time you initiate a new restoration.</p>
				</div>
			</div>

		</div>
		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_requirements.php
 // phpcs:ignore

/**
 * Partial view for requirements.
 */
class Si_View_Partial_Screens_Requirements extends Si_View {

	/**
	 * Stores Si_Controller_Requirements instance
	 *
	 * @var Si_Controller_Requirements|null
	 */
	protected $requirements = null;

	/**
	 * Outputs the requirements screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		?>
		<div id="requirements-analysis" class="screen">
			<div class="analyzing">
				<div class="text-center">
					<div class="title-block">
						<span>Snapshot Restore</span>
						<h2>Requirements</h2>
					</div>

					<div class="content-block">
						<p>Analyzing your site to confirm it meets the necessary requirements for this restoration.</p>

						<div class="box px-100 py-30 mt-30">
							<div class="d-flex align-center inner-box p-20 progress-bar">
								<div class="flex-item loading-icon spin">
									<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M8 0C7.72917 0 7.5 0.09375 7.3125 0.28125C7.125 0.46875 7.03125 0.697917 7.03125 0.96875V3.34375C7.03125 3.61458 7.125 3.84375 7.3125 4.03125C7.5 4.21875 7.72917 4.3125 8 4.3125C8.27083 4.3125 8.5 4.21875 8.6875 4.03125C8.875 3.84375 8.96875 3.61458 8.96875 3.34375V0.96875C8.96875 0.697917 8.875 0.46875 8.6875 0.28125C8.5 0.09375 8.27083 0 8 0ZM8 11.6875C7.72917 11.6875 7.5 11.7812 7.3125 11.9688C7.125 12.1562 7.03125 12.3854 7.03125 12.6562V15.0312C7.03125 15.3021 7.125 15.5312 7.3125 15.7188C7.5 15.9062 7.72917 16 8 16C8.27083 16 8.5 15.9062 8.6875 15.7188C8.875 15.5312 8.96875 15.3021 8.96875 15.0312V12.6562C8.96875 12.3854 8.875 12.1562 8.6875 11.9688C8.5 11.7812 8.27083 11.6875 8 11.6875ZM11.2969 5.6875C11.4323 5.6875 11.5573 5.66146 11.6719 5.60938C11.7865 5.55729 11.8906 5.48438 11.9844 5.39062L13.6562 3.71875C13.75 3.63542 13.8229 3.53125 13.875 3.40625C13.9271 3.28125 13.9531 3.15104 13.9531 3.01562C13.9531 2.74479 13.8594 2.51562 13.6719 2.32812C13.4844 2.14062 13.2552 2.04688 12.9844 2.04688C12.849 2.04688 12.7188 2.07292 12.5938 2.125C12.4688 2.17708 12.3646 2.25 12.2812 2.34375L10.6094 4.01562C10.5156 4.10938 10.4427 4.21875 10.3906 4.34375C10.3385 4.45833 10.3125 4.57812 10.3125 4.70312C10.3125 4.97396 10.4062 5.20833 10.5938 5.40625C10.7917 5.59375 11.026 5.6875 11.2969 5.6875ZM4.70312 10.3125C4.56771 10.3125 4.44271 10.3385 4.32812 10.3906C4.21354 10.4427 4.10938 10.5156 4.01562 10.6094L2.34375 12.2812C2.25 12.3646 2.17708 12.4688 2.125 12.5938C2.07292 12.7188 2.04688 12.849 2.04688 12.9844C2.04688 13.2552 2.14062 13.4844 2.32812 13.6719C2.51562 13.8594 2.74479 13.9531 3.01562 13.9531C3.15104 13.9531 3.28125 13.9271 3.40625 13.875C3.53125 13.8229 3.63542 13.75 3.71875 13.6562L5.39062 11.9844C5.48438 11.8906 5.55729 11.7865 5.60938 11.6719C5.66146 11.5469 5.6875 11.4219 5.6875 11.2969C5.6875 11.026 5.58854 10.7969 5.39062 10.6094C5.20312 10.4115 4.97396 10.3125 4.70312 10.3125ZM15.0312 7.03125H12.6562C12.3854 7.03125 12.1562 7.125 11.9688 7.3125C11.7812 7.5 11.6875 7.72917 11.6875 8C11.6875 8.27083 11.7812 8.5 11.9688 8.6875C12.1562 8.875 12.3854 8.96875 12.6562 8.96875H15.0312C15.3021 8.96875 15.5312 8.875 15.7188 8.6875C15.9062 8.5 16 8.27083 16 8C16 7.72917 15.9062 7.5 15.7188 7.3125C15.5312 7.125 15.3021 7.03125 15.0312 7.03125ZM4.3125 8C4.3125 7.72917 4.21875 7.5 4.03125 7.3125C3.84375 7.125 3.61458 7.03125 3.34375 7.03125H0.96875C0.697917 7.03125 0.46875 7.125 0.28125 7.3125C0.09375 7.5 0 7.72917 0 8C0 8.27083 0.09375 8.5 0.28125 8.6875C0.46875 8.875 0.697917 8.96875 0.96875 8.96875H3.34375C3.61458 8.96875 3.84375 8.875 4.03125 8.6875C4.21875 8.5 4.3125 8.27083 4.3125 8ZM11.9844 10.6094C11.8906 10.5156 11.7812 10.4427 11.6562 10.3906C11.5417 10.3281 11.4115 10.2969 11.2656 10.2969C11.0052 10.2969 10.776 10.3958 10.5781 10.5938C10.3906 10.7812 10.2969 11.0052 10.2969 11.2656C10.2969 11.4115 10.3229 11.5469 10.375 11.6719C10.4375 11.7865 10.5156 11.8906 10.6094 11.9844L12.2812 13.6562C12.3646 13.75 12.4688 13.8229 12.5938 13.875C12.7188 13.9271 12.849 13.9531 12.9844 13.9531C13.2552 13.9531 13.4844 13.8594 13.6719 13.6719C13.8594 13.4844 13.9531 13.2552 13.9531 12.9844C13.9531 12.849 13.9271 12.7188 13.875 12.5938C13.8229 12.4688 13.75 12.3646 13.6562 12.2812L11.9844 10.6094ZM3.71875 2.34375C3.63542 2.26042 3.53646 2.19792 3.42188 2.15625C3.30729 2.10417 3.18229 2.07812 3.04688 2.07812C2.77604 2.07812 2.54688 2.17188 2.35938 2.35938C2.17188 2.54688 2.07812 2.77604 2.07812 3.04688C2.07812 3.18229 2.09896 3.30729 2.14062 3.42188C2.19271 3.53646 2.26042 3.63542 2.34375 3.71875L4.01562 5.39062C4.10938 5.48438 4.21354 5.5625 4.32812 5.625C4.45312 5.67708 4.58854 5.70312 4.73438 5.70312C4.99479 5.70312 5.21875 5.60938 5.40625 5.42188C5.60417 5.22396 5.70312 4.99479 5.70312 4.73438C5.70312 4.58854 5.67188 4.45833 5.60938 4.34375C5.55729 4.21875 5.48438 4.10938 5.39062 4.01562L3.71875 2.34375Z" fill="#888888"/>
									</svg>
								</div>
								<div class="flex-item loading-percent">0%</div>
								<div class="flex-item loading-block">
									<div class="loading-inner" style="width: 0%;"></div>
								</div>
								<div class="flex-item loading-cancel">
									<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M7.6875 6L11.3594 2.32812C11.4115 2.27604 11.4531 2.21354 11.4844 2.14062C11.526 2.05729 11.5469 1.96875 11.5469 1.875C11.5469 1.79167 11.526 1.71354 11.4844 1.64062C11.4531 1.55729 11.4115 1.48438 11.3594 1.42188L10.5625 0.640625C10.5 0.578125 10.4323 0.53125 10.3594 0.5C10.2865 0.46875 10.2031 0.453125 10.1094 0.453125C10.026 0.453125 9.94271 0.46875 9.85938 0.5C9.78646 0.53125 9.71875 0.578125 9.65625 0.640625L5.98438 4.3125L2.3125 0.640625C2.26042 0.588542 2.19271 0.546875 2.10938 0.515625C2.03646 0.473958 1.95833 0.453125 1.875 0.453125C1.78125 0.453125 1.69792 0.473958 1.625 0.515625C1.55208 0.546875 1.48438 0.588542 1.42188 0.640625L0.640625 1.42188C0.578125 1.48438 0.53125 1.55729 0.5 1.64062C0.46875 1.71354 0.453125 1.79167 0.453125 1.875C0.453125 1.96875 0.46875 2.05729 0.5 2.14062C0.53125 2.21354 0.578125 2.27604 0.640625 2.32812L4.29688 6L0.640625 9.67188C0.578125 9.72396 0.53125 9.79167 0.5 9.875C0.46875 9.94792 0.453125 10.0312 0.453125 10.125C0.453125 10.2083 0.46875 10.2917 0.5 10.375C0.53125 10.4479 0.578125 10.5156 0.640625 10.5781L1.42188 11.3594C1.48438 11.4219 1.55208 11.4688 1.625 11.5C1.70833 11.5312 1.79167 11.5469 1.875 11.5469C1.96875 11.5469 2.05208 11.5312 2.125 11.5C2.20833 11.4688 2.27604 11.4219 2.32812 11.3594L6 7.6875L9.67188 11.3594C9.72396 11.4219 9.78646 11.4688 9.85938 11.5C9.94271 11.5312 10.0312 11.5469 10.125 11.5469C10.2083 11.5469 10.2865 11.5312 10.3594 11.5C10.4427 11.4688 10.5156 11.4219 10.5781 11.3594L11.3594 10.5781C11.4219 10.5156 11.4688 10.4479 11.5 10.375C11.5312 10.2917 11.5469 10.2083 11.5469 10.125C11.5469 10.0312 11.5312 9.94792 11.5 9.875C11.4688 9.79167 11.4219 9.71875 11.3594 9.65625L7.6875 6Z" fill="#AAAAAA"/>
									</svg>
								</div>
							</div>
							<p class="mt-10">Analyzing requirements</p>
						</div>

						<div class="p-30 small-text">
							<p>This will take just a few seconds.</p>
						</div>
					</div>
				</div>
			</div>
		</div>	<!-- /#requirements-analysis -->
		<?php
	}

	/**
	 * Requirements analysis result.
	 *
	 * @param Si_Controller_Requirements $requirements Requirements Instance.
	 *
	 * @return void
	 */
	public function results( $requirements ) {
		if ( $requirements instanceof Si_Controller_Requirements ) {
			$this->requirements = $requirements;

			$failed_steps = $requirements->get_failed_steps();

			$content = 'If you have fixed the issues listed above, click Check Again to reanalyze your site.';
			if ( count( $failed_steps ) === 1 && isset( $failed_steps[0] ) && 'timeout' === $failed_steps[0] ) {
				$content .= ' If you\'d like to proceed without addressing the issues listed above, you can click Proceed Anyway.';
			}
			?>
			<div class="analysis-result">
				<div class="text-center">
					<div class="title-block">
						<span>Snapshot Restore</span>
						<h2>Requirements</h2>
					</div>

					<div class="content-block">
						<p>Oops! We found some issues below that might affect your restoration process. Expand each issue listed below for instructions on how to fix it.</p>

						<div class="box p-30 mt-30">
							<div class="accordion">

								<?php
								foreach ( $failed_steps as $step ) {
									$fn = "html_{$step}";
									$this->$fn( $step );
								}
								?>

							</div>
						</div>

						<div class="p-30 small-text">
							<p><?php echo $content; ?></p>
						</div>
					</div>
				</div>
			</div>
			<?php
		}
	}

	/**
	 * Timeout html.
	 *
	 * @param string $class_name Class name.
	 * @return void
	 */
	public function html_timeout( $class_name ) {
		?>
		<div class="accordion-item my-20 warning <?php echo $class_name; ?>">
			<div class="accordion-header px-30 py-20 d-flex justify-between">
				<h4 class="d-flex align-center">
					<span class="exclamation-icon">!</span>
					<span>Max Execution Time is too low</span>
				</h4>
				<span class="arrow">
					<svg width="12" height="7" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M10.8047 1.09766C10.8359 1.12891 10.8633 1.16406 10.8867 1.20312C10.9102 1.24219 10.9297 1.28125 10.9453 1.32031C10.9609 1.35938 10.9727 1.40234 10.9805 1.44922C10.9961 1.49609 11.0039 1.54297 11.0039 1.58984C11.0039 1.58984 11.0039 1.59375 11.0039 1.60156C11.0039 1.60156 11.0039 1.60547 11.0039 1.61328C11.0039 1.66016 10.9961 1.70703 10.9805 1.75391C10.9727 1.80078 10.9609 1.84375 10.9453 1.88281C10.9297 1.92969 10.9062 1.97266 10.875 2.01172C10.8516 2.04297 10.8281 2.07422 10.8047 2.10547L6.50391 6.40625C6.47266 6.4375 6.4375 6.46484 6.39844 6.48828C6.35938 6.51172 6.32031 6.53125 6.28125 6.54688C6.24219 6.57031 6.19531 6.58594 6.14062 6.59375C6.09375 6.60156 6.04688 6.60547 6 6.60547C5.94531 6.60547 5.89453 6.60156 5.84766 6.59375C5.80078 6.58594 5.75781 6.57031 5.71875 6.54688C5.67188 6.53125 5.62891 6.51172 5.58984 6.48828C5.55859 6.46484 5.52344 6.4375 5.48438 6.40625L1.19531 2.10547C1.17188 2.07422 1.14453 2.04297 1.11328 2.01172C1.08984 1.97266 1.07031 1.92969 1.05469 1.88281C1.03906 1.84375 1.02344 1.80078 1.00781 1.75391C1 1.70703 0.996094 1.66016 0.996094 1.61328C0.996094 1.60547 0.996094 1.60156 0.996094 1.60156C0.996094 1.55469 1 1.50781 1.00781 1.46094C1.02344 1.41406 1.03906 1.36719 1.05469 1.32031C1.07031 1.28125 1.08984 1.24219 1.11328 1.20312C1.13672 1.16406 1.16406 1.12891 1.19531 1.09766L1.69922 0.59375C1.73047 0.5625 1.76562 0.535156 1.80469 0.511719C1.84375 0.488281 1.88281 0.46875 1.92188 0.453125C1.96094 0.429688 2.00391 0.414062 2.05078 0.40625C2.09766 0.398438 2.14844 0.394531 2.20312 0.394531C2.25 0.394531 2.29688 0.398438 2.34375 0.40625C2.39062 0.414062 2.43359 0.429688 2.47266 0.453125C2.51953 0.46875 2.55859 0.488281 2.58984 0.511719C2.62891 0.535156 2.66406 0.5625 2.69531 0.59375L6 3.88672L9.29297 0.605469C9.35547 0.550781 9.42578 0.503906 9.50391 0.464844C9.58984 0.425781 9.67969 0.40625 9.77344 0.40625C9.78125 0.40625 9.78516 0.40625 9.78516 0.40625C9.83984 0.40625 9.89062 0.414062 9.9375 0.429688C9.98438 0.4375 10.0273 0.449219 10.0664 0.464844C10.1133 0.480469 10.1523 0.503906 10.1836 0.535156C10.2227 0.558594 10.2578 0.585938 10.2891 0.617188L10.8047 1.09766Z" fill="#888888"/>
					</svg>
				</span>
			</div>
			<div class="accordion-body">
				<div class="accordion-content px-30 py-30">
					<p><strong>php_value max_execution_time</strong> is set to <strong><?php echo $this->requirements->get_timeout(); ?></strong> which is too low. A minimum execution time of <strong>150</strong> seconds is recommended to give the migration process the best chance of succeeding.</p>
					<strong>How to Fix</strong>

					<p>Access your <strong>.htaccess</strong> file and add <strong>php_value max_execution_time 150</strong> or add this line to <strong>php.ini max_execution_time = 150</strong>. If you use a managed host, contact them directly to have it updated.</p>
				</div>
				<?php $this->accordion_footer( 'timeout' ); ?>
			</div>
		</div>
		<?php
	}

	/**
	 * No backup archive found.
	 *
	 * @param string $class_name Class name.
	 * @return void
	 */
	public function html_backup_archive( $class_name ) {
		$requirements = $this->requirements;
		?>
		<div class="accordion-item my-20 error <?php echo $class_name; ?>">
			<div class="accordion-header px-30 py-20 d-flex justify-between">
				<h4 class="d-flex align-center">
					<span class="exclamation-icon">!</span>
					<span>Backup Archive not found</span>
				</h4>
				<span class="arrow">
					<svg width="12" height="7" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M10.8047 1.09766C10.8359 1.12891 10.8633 1.16406 10.8867 1.20312C10.9102 1.24219 10.9297 1.28125 10.9453 1.32031C10.9609 1.35938 10.9727 1.40234 10.9805 1.44922C10.9961 1.49609 11.0039 1.54297 11.0039 1.58984C11.0039 1.58984 11.0039 1.59375 11.0039 1.60156C11.0039 1.60156 11.0039 1.60547 11.0039 1.61328C11.0039 1.66016 10.9961 1.70703 10.9805 1.75391C10.9727 1.80078 10.9609 1.84375 10.9453 1.88281C10.9297 1.92969 10.9062 1.97266 10.875 2.01172C10.8516 2.04297 10.8281 2.07422 10.8047 2.10547L6.50391 6.40625C6.47266 6.4375 6.4375 6.46484 6.39844 6.48828C6.35938 6.51172 6.32031 6.53125 6.28125 6.54688C6.24219 6.57031 6.19531 6.58594 6.14062 6.59375C6.09375 6.60156 6.04688 6.60547 6 6.60547C5.94531 6.60547 5.89453 6.60156 5.84766 6.59375C5.80078 6.58594 5.75781 6.57031 5.71875 6.54688C5.67188 6.53125 5.62891 6.51172 5.58984 6.48828C5.55859 6.46484 5.52344 6.4375 5.48438 6.40625L1.19531 2.10547C1.17188 2.07422 1.14453 2.04297 1.11328 2.01172C1.08984 1.97266 1.07031 1.92969 1.05469 1.88281C1.03906 1.84375 1.02344 1.80078 1.00781 1.75391C1 1.70703 0.996094 1.66016 0.996094 1.61328C0.996094 1.60547 0.996094 1.60156 0.996094 1.60156C0.996094 1.55469 1 1.50781 1.00781 1.46094C1.02344 1.41406 1.03906 1.36719 1.05469 1.32031C1.07031 1.28125 1.08984 1.24219 1.11328 1.20312C1.13672 1.16406 1.16406 1.12891 1.19531 1.09766L1.69922 0.59375C1.73047 0.5625 1.76562 0.535156 1.80469 0.511719C1.84375 0.488281 1.88281 0.46875 1.92188 0.453125C1.96094 0.429688 2.00391 0.414062 2.05078 0.40625C2.09766 0.398438 2.14844 0.394531 2.20312 0.394531C2.25 0.394531 2.29688 0.398438 2.34375 0.40625C2.39062 0.414062 2.43359 0.429688 2.47266 0.453125C2.51953 0.46875 2.55859 0.488281 2.58984 0.511719C2.62891 0.535156 2.66406 0.5625 2.69531 0.59375L6 3.88672L9.29297 0.605469C9.35547 0.550781 9.42578 0.503906 9.50391 0.464844C9.58984 0.425781 9.67969 0.40625 9.77344 0.40625C9.78125 0.40625 9.78516 0.40625 9.78516 0.40625C9.83984 0.40625 9.89062 0.414062 9.9375 0.429688C9.98438 0.4375 10.0273 0.449219 10.0664 0.464844C10.1133 0.480469 10.1523 0.503906 10.1836 0.535156C10.2227 0.558594 10.2578 0.585938 10.2891 0.617188L10.8047 1.09766Z" fill="#888888"/>
					</svg>
				</span>
			</div>
			<div class="accordion-body">
				<div class="accordion-content px-30 py-30 ">
					<p>We were not able to find a site backup archive in the same directory as the snapshot-installer script.</p>

					<strong>How to Fix</strong>
					<p>Please make sure you uploaded the backup file you wish to restore to the same directory as this snapshot-installer script.</p>
				</div>
				<?php $this->accordion_footer( 'backupArchive' ); ?>
			</div>

		</div>
		<?php
	}

	/**
	 * Zip file is not a correct file.
	 *
	 * @param string $class_name Class name.
	 * @return void
	 */
	public function html_backup_integrity( $class_name ) {
		?>
		<div class="accordion-item my-20 error <?php echo $class_name; ?>">
			<div class="accordion-header px-30 py-20 d-flex justify-between">
				<h4 class="d-flex align-center">
					<span class="exclamation-icon">!</span>
					<span>Corrupted Backup Archive</span>
				</h4>
				<span class="arrow">
					<svg width="12" height="7" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M10.8047 1.09766C10.8359 1.12891 10.8633 1.16406 10.8867 1.20312C10.9102 1.24219 10.9297 1.28125 10.9453 1.32031C10.9609 1.35938 10.9727 1.40234 10.9805 1.44922C10.9961 1.49609 11.0039 1.54297 11.0039 1.58984C11.0039 1.58984 11.0039 1.59375 11.0039 1.60156C11.0039 1.60156 11.0039 1.60547 11.0039 1.61328C11.0039 1.66016 10.9961 1.70703 10.9805 1.75391C10.9727 1.80078 10.9609 1.84375 10.9453 1.88281C10.9297 1.92969 10.9062 1.97266 10.875 2.01172C10.8516 2.04297 10.8281 2.07422 10.8047 2.10547L6.50391 6.40625C6.47266 6.4375 6.4375 6.46484 6.39844 6.48828C6.35938 6.51172 6.32031 6.53125 6.28125 6.54688C6.24219 6.57031 6.19531 6.58594 6.14062 6.59375C6.09375 6.60156 6.04688 6.60547 6 6.60547C5.94531 6.60547 5.89453 6.60156 5.84766 6.59375C5.80078 6.58594 5.75781 6.57031 5.71875 6.54688C5.67188 6.53125 5.62891 6.51172 5.58984 6.48828C5.55859 6.46484 5.52344 6.4375 5.48438 6.40625L1.19531 2.10547C1.17188 2.07422 1.14453 2.04297 1.11328 2.01172C1.08984 1.97266 1.07031 1.92969 1.05469 1.88281C1.03906 1.84375 1.02344 1.80078 1.00781 1.75391C1 1.70703 0.996094 1.66016 0.996094 1.61328C0.996094 1.60547 0.996094 1.60156 0.996094 1.60156C0.996094 1.55469 1 1.50781 1.00781 1.46094C1.02344 1.41406 1.03906 1.36719 1.05469 1.32031C1.07031 1.28125 1.08984 1.24219 1.11328 1.20312C1.13672 1.16406 1.16406 1.12891 1.19531 1.09766L1.69922 0.59375C1.73047 0.5625 1.76562 0.535156 1.80469 0.511719C1.84375 0.488281 1.88281 0.46875 1.92188 0.453125C1.96094 0.429688 2.00391 0.414062 2.05078 0.40625C2.09766 0.398438 2.14844 0.394531 2.20312 0.394531C2.25 0.394531 2.29688 0.398438 2.34375 0.40625C2.39062 0.414062 2.43359 0.429688 2.47266 0.453125C2.51953 0.46875 2.55859 0.488281 2.58984 0.511719C2.62891 0.535156 2.66406 0.5625 2.69531 0.59375L6 3.88672L9.29297 0.605469C9.35547 0.550781 9.42578 0.503906 9.50391 0.464844C9.58984 0.425781 9.67969 0.40625 9.77344 0.40625C9.78125 0.40625 9.78516 0.40625 9.78516 0.40625C9.83984 0.40625 9.89062 0.414062 9.9375 0.429688C9.98438 0.4375 10.0273 0.449219 10.0664 0.464844C10.1133 0.480469 10.1523 0.503906 10.1836 0.535156C10.2227 0.558594 10.2578 0.585938 10.2891 0.617188L10.8047 1.09766Z" fill="#888888"/>
					</svg>
				</span>
			</div>
			<div class="accordion-body">
				<div class="accordion-content px-30 py-30 ">
					<p>We are unable to restore the site backup as the backup zip file seems corrupted.</p>

					<strong>How to Fix</strong>
					<p>Please download a new backup zip file, upload it to the same directory, then run the Snapshot installer wizard. If the issue persists, please contact our Support Team.</p>
				</div>
				<?php $this->accordion_footer( 'backupIntegrity' ); ?>
			</div>

		</div>
		<?php
	}

	/**
	 * Open BaseDir html.
	 *
	 * @param string $class_name Class.
	 * @return void
	 */
	public function html_open_basedir( $class_name ) {
		?>
		<div class="accordion-item my-20 error <?php echo $class_name; ?>">
			<div class="accordion-header px-30 py-20 d-flex justify-between">
				<h4 class="d-flex align-center">
					<span class="exclamation-icon">!</span>
					<span>Open_basedir is enabled</span>
				</h4>
				<span class="arrow">
					<svg width="12" height="7" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M10.8047 1.09766C10.8359 1.12891 10.8633 1.16406 10.8867 1.20312C10.9102 1.24219 10.9297 1.28125 10.9453 1.32031C10.9609 1.35938 10.9727 1.40234 10.9805 1.44922C10.9961 1.49609 11.0039 1.54297 11.0039 1.58984C11.0039 1.58984 11.0039 1.59375 11.0039 1.60156C11.0039 1.60156 11.0039 1.60547 11.0039 1.61328C11.0039 1.66016 10.9961 1.70703 10.9805 1.75391C10.9727 1.80078 10.9609 1.84375 10.9453 1.88281C10.9297 1.92969 10.9062 1.97266 10.875 2.01172C10.8516 2.04297 10.8281 2.07422 10.8047 2.10547L6.50391 6.40625C6.47266 6.4375 6.4375 6.46484 6.39844 6.48828C6.35938 6.51172 6.32031 6.53125 6.28125 6.54688C6.24219 6.57031 6.19531 6.58594 6.14062 6.59375C6.09375 6.60156 6.04688 6.60547 6 6.60547C5.94531 6.60547 5.89453 6.60156 5.84766 6.59375C5.80078 6.58594 5.75781 6.57031 5.71875 6.54688C5.67188 6.53125 5.62891 6.51172 5.58984 6.48828C5.55859 6.46484 5.52344 6.4375 5.48438 6.40625L1.19531 2.10547C1.17188 2.07422 1.14453 2.04297 1.11328 2.01172C1.08984 1.97266 1.07031 1.92969 1.05469 1.88281C1.03906 1.84375 1.02344 1.80078 1.00781 1.75391C1 1.70703 0.996094 1.66016 0.996094 1.61328C0.996094 1.60547 0.996094 1.60156 0.996094 1.60156C0.996094 1.55469 1 1.50781 1.00781 1.46094C1.02344 1.41406 1.03906 1.36719 1.05469 1.32031C1.07031 1.28125 1.08984 1.24219 1.11328 1.20312C1.13672 1.16406 1.16406 1.12891 1.19531 1.09766L1.69922 0.59375C1.73047 0.5625 1.76562 0.535156 1.80469 0.511719C1.84375 0.488281 1.88281 0.46875 1.92188 0.453125C1.96094 0.429688 2.00391 0.414062 2.05078 0.40625C2.09766 0.398438 2.14844 0.394531 2.20312 0.394531C2.25 0.394531 2.29688 0.398438 2.34375 0.40625C2.39062 0.414062 2.43359 0.429688 2.47266 0.453125C2.51953 0.46875 2.55859 0.488281 2.58984 0.511719C2.62891 0.535156 2.66406 0.5625 2.69531 0.59375L6 3.88672L9.29297 0.605469C9.35547 0.550781 9.42578 0.503906 9.50391 0.464844C9.58984 0.425781 9.67969 0.40625 9.77344 0.40625C9.78125 0.40625 9.78516 0.40625 9.78516 0.40625C9.83984 0.40625 9.89062 0.414062 9.9375 0.429688C9.98438 0.4375 10.0273 0.449219 10.0664 0.464844C10.1133 0.480469 10.1523 0.503906 10.1836 0.535156C10.2227 0.558594 10.2578 0.585938 10.2891 0.617188L10.8047 1.09766Z" fill="#888888"/>
					</svg>
				</span>
			</div>
			<div class="accordion-body">
				<div class="accordion-content px-30 py-30">
					<p><strong>open_basedir</strong> is enabled. Issues can occur when this directive is enabled and we recommend disabling this.</p>
					<strong>How to Fix</strong>

					<p>Please disable this value in your php.ini file, open your php.ini and look for the open_basedir line and comment it. Or in your cPanel, find the setting for open_basedir and set it to None. You might need to restart your server.</p>
				</div>
				<?php $this->accordion_footer( 'openBaseDir' ); ?>
			</div>
		</div>
		<?php
	}

	/**
	 * ZipArchive html.
	 *
	 * @param string $class_name Class name.
	 * @return void
	 */
	public function html_zip_module( $class_name ) {
		?>
		<div class="accordion-item my-20 error <?php echo $class_name; ?>">
			<div class="accordion-header px-30 py-20 d-flex justify-between">
				<h4 class="d-flex align-center">
					<span class="exclamation-icon">!</span>
					<span>Zip module not found</span>
				</h4>
				<span class="arrow">
					<svg width="12" height="7" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M10.8047 1.09766C10.8359 1.12891 10.8633 1.16406 10.8867 1.20312C10.9102 1.24219 10.9297 1.28125 10.9453 1.32031C10.9609 1.35938 10.9727 1.40234 10.9805 1.44922C10.9961 1.49609 11.0039 1.54297 11.0039 1.58984C11.0039 1.58984 11.0039 1.59375 11.0039 1.60156C11.0039 1.60156 11.0039 1.60547 11.0039 1.61328C11.0039 1.66016 10.9961 1.70703 10.9805 1.75391C10.9727 1.80078 10.9609 1.84375 10.9453 1.88281C10.9297 1.92969 10.9062 1.97266 10.875 2.01172C10.8516 2.04297 10.8281 2.07422 10.8047 2.10547L6.50391 6.40625C6.47266 6.4375 6.4375 6.46484 6.39844 6.48828C6.35938 6.51172 6.32031 6.53125 6.28125 6.54688C6.24219 6.57031 6.19531 6.58594 6.14062 6.59375C6.09375 6.60156 6.04688 6.60547 6 6.60547C5.94531 6.60547 5.89453 6.60156 5.84766 6.59375C5.80078 6.58594 5.75781 6.57031 5.71875 6.54688C5.67188 6.53125 5.62891 6.51172 5.58984 6.48828C5.55859 6.46484 5.52344 6.4375 5.48438 6.40625L1.19531 2.10547C1.17188 2.07422 1.14453 2.04297 1.11328 2.01172C1.08984 1.97266 1.07031 1.92969 1.05469 1.88281C1.03906 1.84375 1.02344 1.80078 1.00781 1.75391C1 1.70703 0.996094 1.66016 0.996094 1.61328C0.996094 1.60547 0.996094 1.60156 0.996094 1.60156C0.996094 1.55469 1 1.50781 1.00781 1.46094C1.02344 1.41406 1.03906 1.36719 1.05469 1.32031C1.07031 1.28125 1.08984 1.24219 1.11328 1.20312C1.13672 1.16406 1.16406 1.12891 1.19531 1.09766L1.69922 0.59375C1.73047 0.5625 1.76562 0.535156 1.80469 0.511719C1.84375 0.488281 1.88281 0.46875 1.92188 0.453125C1.96094 0.429688 2.00391 0.414062 2.05078 0.40625C2.09766 0.398438 2.14844 0.394531 2.20312 0.394531C2.25 0.394531 2.29688 0.398438 2.34375 0.40625C2.39062 0.414062 2.43359 0.429688 2.47266 0.453125C2.51953 0.46875 2.55859 0.488281 2.58984 0.511719C2.62891 0.535156 2.66406 0.5625 2.69531 0.59375L6 3.88672L9.29297 0.605469C9.35547 0.550781 9.42578 0.503906 9.50391 0.464844C9.58984 0.425781 9.67969 0.40625 9.77344 0.40625C9.78125 0.40625 9.78516 0.40625 9.78516 0.40625C9.83984 0.40625 9.89062 0.414062 9.9375 0.429688C9.98438 0.4375 10.0273 0.449219 10.0664 0.464844C10.1133 0.480469 10.1523 0.503906 10.1836 0.535156C10.2227 0.558594 10.2578 0.585938 10.2891 0.617188L10.8047 1.09766Z" fill="#888888"/>
					</svg>
				</span>
			</div>
			<div class="accordion-body">
				<div class="accordion-content px-30 py-30 ">
					<p>To unpack the zip file, Snapshot needs the <strong>Zip Module</strong> to be installed and enabled.</p>
					<strong>How to Fix</strong>

					<p>If the Zip extension is not installed or enabled in the current PHP version, please enable it. If you use a managed host, contact them directly to have it updated.</p>
				</div>
				<?php $this->accordion_footer( 'zipModule' ); ?>
			</div>
		</div>
		<?php
	}

	/**
	 * MySQLi module html.
	 *
	 * @param string $class_name Class name.
	 * @return void
	 */
	public function html_mysqli( $class_name ) {
		?>
		<div class="accordion-item my-20 error <?php echo $class_name; ?>">
			<div class="accordion-header px-30 py-20 d-flex justify-between">
				<h4 class="d-flex align-center">
					<span class="exclamation-icon">!</span>
					<span>PHP MySQLi module not found</span>
				</h4>
				<span class="arrow">
					<svg width="12" height="7" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M10.8047 1.09766C10.8359 1.12891 10.8633 1.16406 10.8867 1.20312C10.9102 1.24219 10.9297 1.28125 10.9453 1.32031C10.9609 1.35938 10.9727 1.40234 10.9805 1.44922C10.9961 1.49609 11.0039 1.54297 11.0039 1.58984C11.0039 1.58984 11.0039 1.59375 11.0039 1.60156C11.0039 1.60156 11.0039 1.60547 11.0039 1.61328C11.0039 1.66016 10.9961 1.70703 10.9805 1.75391C10.9727 1.80078 10.9609 1.84375 10.9453 1.88281C10.9297 1.92969 10.9062 1.97266 10.875 2.01172C10.8516 2.04297 10.8281 2.07422 10.8047 2.10547L6.50391 6.40625C6.47266 6.4375 6.4375 6.46484 6.39844 6.48828C6.35938 6.51172 6.32031 6.53125 6.28125 6.54688C6.24219 6.57031 6.19531 6.58594 6.14062 6.59375C6.09375 6.60156 6.04688 6.60547 6 6.60547C5.94531 6.60547 5.89453 6.60156 5.84766 6.59375C5.80078 6.58594 5.75781 6.57031 5.71875 6.54688C5.67188 6.53125 5.62891 6.51172 5.58984 6.48828C5.55859 6.46484 5.52344 6.4375 5.48438 6.40625L1.19531 2.10547C1.17188 2.07422 1.14453 2.04297 1.11328 2.01172C1.08984 1.97266 1.07031 1.92969 1.05469 1.88281C1.03906 1.84375 1.02344 1.80078 1.00781 1.75391C1 1.70703 0.996094 1.66016 0.996094 1.61328C0.996094 1.60547 0.996094 1.60156 0.996094 1.60156C0.996094 1.55469 1 1.50781 1.00781 1.46094C1.02344 1.41406 1.03906 1.36719 1.05469 1.32031C1.07031 1.28125 1.08984 1.24219 1.11328 1.20312C1.13672 1.16406 1.16406 1.12891 1.19531 1.09766L1.69922 0.59375C1.73047 0.5625 1.76562 0.535156 1.80469 0.511719C1.84375 0.488281 1.88281 0.46875 1.92188 0.453125C1.96094 0.429688 2.00391 0.414062 2.05078 0.40625C2.09766 0.398438 2.14844 0.394531 2.20312 0.394531C2.25 0.394531 2.29688 0.398438 2.34375 0.40625C2.39062 0.414062 2.43359 0.429688 2.47266 0.453125C2.51953 0.46875 2.55859 0.488281 2.58984 0.511719C2.62891 0.535156 2.66406 0.5625 2.69531 0.59375L6 3.88672L9.29297 0.605469C9.35547 0.550781 9.42578 0.503906 9.50391 0.464844C9.58984 0.425781 9.67969 0.40625 9.77344 0.40625C9.78125 0.40625 9.78516 0.40625 9.78516 0.40625C9.83984 0.40625 9.89062 0.414062 9.9375 0.429688C9.98438 0.4375 10.0273 0.449219 10.0664 0.464844C10.1133 0.480469 10.1523 0.503906 10.1836 0.535156C10.2227 0.558594 10.2578 0.585938 10.2891 0.617188L10.8047 1.09766Z" fill="#888888"/>
					</svg>
				</span>
			</div>
			<div class="accordion-body">
				<div class="accordion-content px-30 py-30 ">
					<p>Snapshot requires the <strong>MySQLi</strong> module to be installed and enabled on the target server.</p>

					<strong>How to Fix</strong>
					<p>If you use a managed host, contact them directly to have this module installed and enabled.</p>
				</div>
				<?php $this->accordion_footer( 'mysqli' ); ?>
			</div>

		</div>
		<?php
	}

	/**
	 * PHP Version html.
	 *
	 * @param string $class_name Class name.
	 * @return void
	 */
	public function html_php_version( $class_name ) {
		?>
		<div class="accordion-item my-20 error <?php echo $class_name; ?>">
			<div class="accordion-header px-30 py-20 d-flex justify-between">
				<h4 class="d-flex align-center">
					<span class="exclamation-icon">!</span>
					<span>PHP v7.1 or newer is required</span>
				</h4>
				<span class="arrow">
					<svg width="12" height="7" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M10.8047 1.09766C10.8359 1.12891 10.8633 1.16406 10.8867 1.20312C10.9102 1.24219 10.9297 1.28125 10.9453 1.32031C10.9609 1.35938 10.9727 1.40234 10.9805 1.44922C10.9961 1.49609 11.0039 1.54297 11.0039 1.58984C11.0039 1.58984 11.0039 1.59375 11.0039 1.60156C11.0039 1.60156 11.0039 1.60547 11.0039 1.61328C11.0039 1.66016 10.9961 1.70703 10.9805 1.75391C10.9727 1.80078 10.9609 1.84375 10.9453 1.88281C10.9297 1.92969 10.9062 1.97266 10.875 2.01172C10.8516 2.04297 10.8281 2.07422 10.8047 2.10547L6.50391 6.40625C6.47266 6.4375 6.4375 6.46484 6.39844 6.48828C6.35938 6.51172 6.32031 6.53125 6.28125 6.54688C6.24219 6.57031 6.19531 6.58594 6.14062 6.59375C6.09375 6.60156 6.04688 6.60547 6 6.60547C5.94531 6.60547 5.89453 6.60156 5.84766 6.59375C5.80078 6.58594 5.75781 6.57031 5.71875 6.54688C5.67188 6.53125 5.62891 6.51172 5.58984 6.48828C5.55859 6.46484 5.52344 6.4375 5.48438 6.40625L1.19531 2.10547C1.17188 2.07422 1.14453 2.04297 1.11328 2.01172C1.08984 1.97266 1.07031 1.92969 1.05469 1.88281C1.03906 1.84375 1.02344 1.80078 1.00781 1.75391C1 1.70703 0.996094 1.66016 0.996094 1.61328C0.996094 1.60547 0.996094 1.60156 0.996094 1.60156C0.996094 1.55469 1 1.50781 1.00781 1.46094C1.02344 1.41406 1.03906 1.36719 1.05469 1.32031C1.07031 1.28125 1.08984 1.24219 1.11328 1.20312C1.13672 1.16406 1.16406 1.12891 1.19531 1.09766L1.69922 0.59375C1.73047 0.5625 1.76562 0.535156 1.80469 0.511719C1.84375 0.488281 1.88281 0.46875 1.92188 0.453125C1.96094 0.429688 2.00391 0.414062 2.05078 0.40625C2.09766 0.398438 2.14844 0.394531 2.20312 0.394531C2.25 0.394531 2.29688 0.398438 2.34375 0.40625C2.39062 0.414062 2.43359 0.429688 2.47266 0.453125C2.51953 0.46875 2.55859 0.488281 2.58984 0.511719C2.62891 0.535156 2.66406 0.5625 2.69531 0.59375L6 3.88672L9.29297 0.605469C9.35547 0.550781 9.42578 0.503906 9.50391 0.464844C9.58984 0.425781 9.67969 0.40625 9.77344 0.40625C9.78125 0.40625 9.78516 0.40625 9.78516 0.40625C9.83984 0.40625 9.89062 0.414062 9.9375 0.429688C9.98438 0.4375 10.0273 0.449219 10.0664 0.464844C10.1133 0.480469 10.1523 0.503906 10.1836 0.535156C10.2227 0.558594 10.2578 0.585938 10.2891 0.617188L10.8047 1.09766Z" fill="#888888"/>
					</svg>
				</span>
			</div>
			<div class="accordion-body">
				<div class="accordion-content px-30 py-30 ">
					<p>Your current version of <strong>PHP</strong> is <strong><?php echo PHP_VERSION; ?></strong> which is lower than the version required by Snapshot to proceed with this restoration. The minimum required version of <strong>PHP</strong> is <strong>7</strong> or above</p>

					<strong>How to Fix</strong>
					<p>You need to upgrade your PHP version to the latest stable release. You can either contact your hosting provider and ask them to update your PHP version, or do it yourself following an official WordPress tutorial on <a href="https://wordpress.org/support/update-php/" target="_blank">updating your PHP version.</a></p>
				</div>
				<?php $this->accordion_footer( 'phpVersion' ); ?>
			</div>
		</div>
		<?php
	}

	/**
	 * Accordion footer.
	 *
	 * @param string $class_name Class name.
	 * @return void
	 */
	public function accordion_footer( $class_name ) {
		?>
		<div class="accordion-footer p-30">
			<a href="#" data-name="<?php echo $class_name; ?>" class="sui-btn sui-btn-icon sui-btn-sm sui-btn-ghost analyze-requirement">
				<span class="icon icon-refresh">
					<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
						<path d="M3.65625 8.38672C3.65625 8.39453 3.66016 8.40234 3.66797 8.41016C3.67578 8.41016 3.68359 8.41406 3.69141 8.42188C4.08984 8.77344 4.54688 9.02344 5.0625 9.17188C5.58594 9.32031 6.11719 9.34766 6.65625 9.25391C7.26562 9.15234 7.80469 8.91016 8.27344 8.52734C8.74219 8.14453 9.09375 7.67578 9.32812 7.12109C9.42969 6.88672 9.59766 6.72266 9.83203 6.62891C10.0742 6.52734 10.3164 6.52734 10.5586 6.62891C10.793 6.72266 10.957 6.89062 11.0508 7.13281C11.1523 7.375 11.1523 7.61328 11.0508 7.84766C10.8789 8.26953 10.6562 8.66406 10.3828 9.03125C10.1094 9.39062 9.79688 9.71094 9.44531 9.99219C9.09375 10.2734 8.71094 10.5078 8.29688 10.6953C7.88281 10.8828 7.44531 11.0195 6.98438 11.1055C6.57031 11.1758 6.16016 11.1992 5.75391 11.1758C5.34766 11.1523 4.94922 11.0859 4.55859 10.9766C4.17578 10.8672 3.80469 10.7188 3.44531 10.5312C3.08594 10.3359 2.75391 10.1016 2.44922 9.82812C2.41797 9.79688 2.38281 9.76953 2.34375 9.74609C2.3125 9.71484 2.28125 9.68359 2.25 9.65234L1.69922 10.1445C1.62891 10.207 1.55078 10.2578 1.46484 10.2969C1.37891 10.3281 1.28906 10.3438 1.19531 10.3438C0.992188 10.3438 0.816406 10.2695 0.667969 10.1211C0.519531 9.97266 0.445312 9.79688 0.445312 9.59375V7.0625C0.445312 7.04688 0.445312 7.03516 0.445312 7.02734C0.453125 7.01172 0.457031 6.99609 0.457031 6.98047C0.480469 6.77734 0.570312 6.61328 0.726562 6.48828C0.890625 6.35547 1.07422 6.29688 1.27734 6.3125L3.79688 6.58203C3.88281 6.58984 3.96875 6.61719 4.05469 6.66406C4.14062 6.70312 4.21094 6.75781 4.26562 6.82812C4.40625 6.97656 4.46875 7.15625 4.45312 7.36719C4.44531 7.57031 4.36719 7.74219 4.21875 7.88281L3.65625 8.38672ZM8.40234 3.11328C8.39453 3.11328 8.38672 3.10937 8.37891 3.10156C8.37109 3.09375 8.36328 3.08594 8.35547 3.07812C7.94922 2.71875 7.48438 2.46484 6.96094 2.31641C6.44531 2.16797 5.91797 2.14453 5.37891 2.24609C4.77734 2.34766 4.23828 2.58984 3.76172 2.97266C3.29297 3.34766 2.94531 3.8125 2.71875 4.36719C2.61719 4.60938 2.44531 4.78125 2.20312 4.88281C1.96094 4.97656 1.72266 4.97266 1.48828 4.87109C1.24609 4.76953 1.07422 4.60156 0.972656 4.36719C0.878906 4.125 0.882812 3.88281 0.984375 3.64062C1.16406 3.21875 1.39062 2.82812 1.66406 2.46875C1.9375 2.10938 2.24609 1.78906 2.58984 1.50781C2.94141 1.22656 3.32422 0.992188 3.73828 0.804688C4.15234 0.609375 4.58984 0.472656 5.05078 0.394531C5.46484 0.324219 5.875 0.300781 6.28125 0.324219C6.69531 0.339844 7.09375 0.402344 7.47656 0.511719C7.86719 0.621094 8.24219 0.773438 8.60156 0.96875C8.95312 1.16406 9.28516 1.39844 9.59766 1.67188C9.62891 1.70312 9.66016 1.73438 9.69141 1.76562C9.73047 1.79687 9.76562 1.82813 9.79688 1.85938L10.3594 1.35547C10.4297 1.29297 10.5078 1.24609 10.5938 1.21484C10.6797 1.17578 10.7695 1.15625 10.8633 1.15625C11.0742 1.15625 11.25 1.23047 11.3906 1.37891C11.5391 1.52734 11.6133 1.70312 11.6133 1.90625V4.4375C11.6133 4.44531 11.6133 4.45703 11.6133 4.47266C11.6133 4.48828 11.6133 4.50391 11.6133 4.51953C11.5898 4.72266 11.4961 4.89062 11.332 5.02344C11.1758 5.14844 10.9961 5.19922 10.793 5.17578L8.27344 4.91797C8.17969 4.91016 8.08984 4.88672 8.00391 4.84766C7.92578 4.80078 7.85547 4.74219 7.79297 4.67188C7.66016 4.51562 7.59766 4.33594 7.60547 4.13281C7.61328 3.92188 7.69531 3.75 7.85156 3.61719L8.40234 3.11328Z" fill="#888888"/>
					</svg>
				</span>
				RE-CHECK
			</a>
		</div>

		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_success.php


/**
 * Partial view for success.
 */
class Si_View_Partial_Screens_Success extends Si_View {

	/**
	 * Outputs the success screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$files = session()->get( 'unmove_files' );
		?>
		<div id="screen-deployment-success" class="screen mt-30">
			<div class="text-center">
				<div class="rocket-logo">
					<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
						<circle cx="50" cy="50" r="50" fill="#F8F8F8"/>
						<g clip-path="url(#clip0_630_5871)">
							<path opacity="0.4" d="M42.7781 47.9539C45.8726 44.8953 47.2039 41.6578 49.7406 39.1172C50.8968 37.9578 51.3171 36.2078 51.7242 34.5148C52.0718 33.0695 52.7984 30 54.3749 30C56.2499 30 59.9999 30.625 59.9999 36.3633C59.9999 39.6773 57.9687 41.5359 57.3999 43.75H65.3476C67.9562 43.75 69.9874 45.918 69.9999 48.2891C70.0062 49.6906 69.4101 51.1992 68.4812 52.132L68.4726 52.1414C69.2414 53.9641 69.1164 56.5164 67.7453 58.3492C68.4234 60.3727 67.7398 62.8578 66.4656 64.1898C66.8015 65.5648 66.6406 66.7352 65.9851 67.6766C64.3906 69.968 60.439 70 57.0968 70H56.8749C53.1031 70 50.0156 68.625 47.5343 67.5211C46.2843 66.9672 44.6578 66.2805 43.421 66.2578C43.1754 66.2533 42.9413 66.1525 42.7692 65.9772C42.5971 65.8019 42.5007 65.566 42.5007 65.3203V48.6195C42.5007 48.4958 42.5252 48.3732 42.5728 48.259C42.6204 48.1447 42.6902 48.0411 42.7781 47.9539Z" fill="#35104C"/>
							<path d="M38.125 47.5H31.875C31.3777 47.5 30.9008 47.6975 30.5492 48.0492C30.1975 48.4008 30 48.8777 30 49.375V68.125C30 68.6223 30.1975 69.0992 30.5492 69.4508C30.9008 69.8025 31.3777 70 31.875 70H38.125C38.6223 70 39.0992 69.8025 39.4508 69.4508C39.8025 69.0992 40 68.6223 40 68.125V49.375C40 48.8777 39.8025 48.4008 39.4508 48.0492C39.0992 47.6975 38.6223 47.5 38.125 47.5ZM35 66.875C34.6292 66.875 34.2666 66.765 33.9583 66.559C33.65 66.353 33.4096 66.0601 33.2677 65.7175C33.1258 65.3749 33.0887 64.9979 33.161 64.6342C33.2334 64.2705 33.412 63.9364 33.6742 63.6742C33.9364 63.412 34.2705 63.2334 34.6342 63.161C34.9979 63.0887 35.3749 63.1258 35.7175 63.2677C36.0601 63.4096 36.353 63.65 36.559 63.9583C36.765 64.2666 36.875 64.6292 36.875 65C36.875 65.4973 36.6775 65.9742 36.3258 66.3258C35.9742 66.6775 35.4973 66.875 35 66.875Z" fill="#35104C"/>
						</g>
						<defs>
							<clipPath id="clip0_630_5871">
								<rect width="40" height="40" fill="white" transform="translate(30 30)"/>
							</clipPath>
						</defs>
				</div>
				<div class="welcome-content">
					<div class="title-block">
						<span>Snapshot Restore</span>
						<h2>Restore Complete</h2>
					</div>

					<div class="content-block">
						<p>Yay! Snapshot has successfully restored your site. For security reasons, we recommend clicking Run Cleanup to clear the backup files from your server.</p>

						<?php if ( $files && is_array( $files ) ) : ?>
							<div class="box p-30 my-30">
								<div class="accordion">
									<div class="accordion-item skipped-items my-20 error">
										<div class="accordion-header px-30 py-20 d-flex justify-between">
											<h4 class="d-flex align-center">
												<span>One or more files could not be restored</span>
												<span class="counter"><?php echo count( $files ); ?></span>
											</h4>
											<span class="arrow">
												<svg width="12" height="7" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg">
													<path d="M10.8047 1.09766C10.8359 1.12891 10.8633 1.16406 10.8867 1.20312C10.9102 1.24219 10.9297 1.28125 10.9453 1.32031C10.9609 1.35938 10.9727 1.40234 10.9805 1.44922C10.9961 1.49609 11.0039 1.54297 11.0039 1.58984C11.0039 1.58984 11.0039 1.59375 11.0039 1.60156C11.0039 1.60156 11.0039 1.60547 11.0039 1.61328C11.0039 1.66016 10.9961 1.70703 10.9805 1.75391C10.9727 1.80078 10.9609 1.84375 10.9453 1.88281C10.9297 1.92969 10.9062 1.97266 10.875 2.01172C10.8516 2.04297 10.8281 2.07422 10.8047 2.10547L6.50391 6.40625C6.47266 6.4375 6.4375 6.46484 6.39844 6.48828C6.35938 6.51172 6.32031 6.53125 6.28125 6.54688C6.24219 6.57031 6.19531 6.58594 6.14062 6.59375C6.09375 6.60156 6.04688 6.60547 6 6.60547C5.94531 6.60547 5.89453 6.60156 5.84766 6.59375C5.80078 6.58594 5.75781 6.57031 5.71875 6.54688C5.67188 6.53125 5.62891 6.51172 5.58984 6.48828C5.55859 6.46484 5.52344 6.4375 5.48438 6.40625L1.19531 2.10547C1.17188 2.07422 1.14453 2.04297 1.11328 2.01172C1.08984 1.97266 1.07031 1.92969 1.05469 1.88281C1.03906 1.84375 1.02344 1.80078 1.00781 1.75391C1 1.70703 0.996094 1.66016 0.996094 1.61328C0.996094 1.60547 0.996094 1.60156 0.996094 1.60156C0.996094 1.55469 1 1.50781 1.00781 1.46094C1.02344 1.41406 1.03906 1.36719 1.05469 1.32031C1.07031 1.28125 1.08984 1.24219 1.11328 1.20312C1.13672 1.16406 1.16406 1.12891 1.19531 1.09766L1.69922 0.59375C1.73047 0.5625 1.76562 0.535156 1.80469 0.511719C1.84375 0.488281 1.88281 0.46875 1.92188 0.453125C1.96094 0.429688 2.00391 0.414062 2.05078 0.40625C2.09766 0.398438 2.14844 0.394531 2.20312 0.394531C2.25 0.394531 2.29688 0.398438 2.34375 0.40625C2.39062 0.414062 2.43359 0.429688 2.47266 0.453125C2.51953 0.46875 2.55859 0.488281 2.58984 0.511719C2.62891 0.535156 2.66406 0.5625 2.69531 0.59375L6 3.88672L9.29297 0.605469C9.35547 0.550781 9.42578 0.503906 9.50391 0.464844C9.58984 0.425781 9.67969 0.40625 9.77344 0.40625C9.78125 0.40625 9.78516 0.40625 9.78516 0.40625C9.83984 0.40625 9.89062 0.414062 9.9375 0.429688C9.98438 0.4375 10.0273 0.449219 10.0664 0.464844C10.1133 0.480469 10.1523 0.503906 10.1836 0.535156C10.2227 0.558594 10.2578 0.585938 10.2891 0.617188L10.8047 1.09766Z" fill="#888888"/>
												</svg>
											</span>
										</div>
										<div class="accordion-body">
											<div class="accordion-content px-30 py-30">
												<div role="alert" class="sui-notice warning" aria-live="assertive" tabindex="-1">
													<div class="sui-notice-content d-flex">
														<span class="exclamation-icon mt-3">!</span>
														<div class="sui-notice-message">
															<p>One or more files listed below was skipped because Snapshot doesn’t have the permissions required to restore them.</p>
														</div>
													</div>
												</div>

												<h4 class="mt-30">Skipped files</h4>
												<ul class="skipped-files files-list mt-3">
													<?php foreach ( $files as $file ) : ?>
														<li><?php echo $file; ?></li>
													<?php endforeach; ?>
												</ul>
											</div>
										</div>
									</div>

								</div>
							</div>

							<p>Expand the notice above to see more details, and feel free to restore these files manually.</p>
						<?php endif; ?>
					</div>
				</div>
			</div>
		</div>	<!-- /#screen-welcome -->
		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_warning_files.php


/**
 * Partial view for failure.
 */
class Si_View_Partial_Screens_Warning_Files extends Si_View {

	/**
	 * Outputs the failure screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		$error = session()->get( 'error_str' );
		if ( $error && ! empty( $error ) ) {
			session()->unset( 'error_str' );
		}
		?>
		<div class="deployment-result my-30">
			<div class="text-center">
				<div class="title-block">
					<span>Snapshot Restore</span>
					<h2>Attention: Partial File Restore in Progress</h2>
				</div>
			</div>

			<div class="content-block">
				<div class="box p-30 mt-30">
					<div role="alert" class="sui-notice warning" aria-live="assertive" tabindex="-1">
						<div class="sui-notice-content d-flex">
							<span class="exclamation-icon mt-5">!</span>
							<div class="sui-notice-message">
								<p>Please be aware: This action may result in site malfunction due to missing database tables, as it involves partial restoration and not a full backup.</p>

								<a href="#" data-screen="deployment" class="sui-btn sui-btn-sm sui-btn-block sui-btn-blue mt-30 next-screen--force">Continue</a>
							</div>
						</div>
					</div>
				</div>
			</div>

		</div>
		<?php
	}
}



// Source: src/lib/View/Partial/Screens/class_si_view_partial_screens_welcome.php


/**
 * Partial view for welcome.
 */
class Si_View_Partial_Screens_Welcome extends Si_View {

	/**
	 * Outputs the welcome screen.
	 *
	 * @param array $params Optional parameters for customizing.
	 * @return void
	 */
	public function out( $params = array() ) {
		?>
		<div id="screen-welcome" class="screen">
			<div class="text-center">
				<div class="rocket-logo">
					<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
						<circle cx="50" cy="50" r="50" fill="#F8F8F8"/>
						<g clip-path="url(#clip0_598_5931)">
							<path opacity="0.4" d="M31.9963 57.5681C29.8252 59.7394 28.7521 65.171 29.0483 70.9505C34.8518 71.2493 40.2678 70.1651 42.4304 68.0022C45.8137 64.6193 46.0309 60.1088 42.9602 57.0381C39.8898 53.9677 35.3793 54.1851 31.9963 57.5681ZM39.9712 64.3754C39.07 65.2768 36.8129 65.7285 34.3944 65.6038C34.2714 63.1957 34.7186 60.9324 35.6234 60.0276C37.0327 58.6179 38.9125 58.5273 40.192 59.8068C41.4711 61.0864 41.3809 62.9659 39.9712 64.3754H39.9712ZM33.362 40.9743L29.2123 49.273C29.083 49.5557 29.0108 49.8612 28.9998 50.1719C28.9999 50.7064 29.2123 51.219 29.5903 51.597C29.9682 51.975 30.4808 52.1874 31.0154 52.1875H38.8646C40.8334 48.2056 43.9887 41.8261 45.4062 38.9744C45.4499 38.8976 45.4902 38.8259 45.5342 38.75H36.9632C35.5906 38.7513 33.9791 39.7473 33.362 40.9743ZM61.026 54.5871C58.1738 56.0155 51.7825 59.1794 47.8123 61.1441V69.0019C47.8196 69.532 48.0344 70.0382 48.4106 70.4117C48.7868 70.7853 49.2944 70.9965 49.8246 71C50.1331 70.9883 50.4363 70.9161 50.7169 70.7874L59.0084 66.6394C60.2367 66.0252 61.234 64.4138 61.234 63.0399V54.5141C61.2396 54.5107 61.2445 54.5067 61.2498 54.5033V54.459C61.1736 54.5026 61.1031 54.5432 61.026 54.5871Z" fill="#35104C"/>
							<path d="M71.4253 29.639C71.3664 29.382 71.2365 29.1468 71.0504 28.9601C70.8642 28.7734 70.6293 28.6429 70.3725 28.5833C67.6516 28 65.4804 28 63.39 28C55.903 28 50.2317 31.411 45.5427 38.7347C45.4958 38.8169 45.4528 38.8924 45.4062 38.9744C43.9887 41.8261 40.8333 48.2056 38.8646 52.1875H39.7498C40.8085 52.1875 41.857 52.396 42.8351 52.8012C43.8133 53.2064 44.7021 53.8003 45.4508 54.5489C46.1995 55.2976 46.7934 56.1864 47.1985 57.1646C47.6037 58.1428 47.8123 59.1912 47.8122 60.25V61.1441C51.7825 59.1794 58.1738 56.0155 61.026 54.5871C61.1067 54.541 61.1799 54.499 61.2602 54.4529C68.5866 49.7447 71.9984 44.0799 71.9984 36.625C72.005 34.5178 72.0106 32.3746 71.4253 29.639ZM59.906 44.125C59.1087 44.125 58.3293 43.8886 57.6664 43.4456C57.0034 43.0027 56.4867 42.3731 56.1816 41.6365C55.8765 40.8999 55.7967 40.0893 55.9522 39.3074C56.1077 38.5254 56.4916 37.8071 57.0554 37.2433C57.6192 36.6795 58.3375 36.2955 59.1194 36.14C59.9014 35.9844 60.712 36.0642 61.4486 36.3693C62.1852 36.6744 62.8148 37.1911 63.2578 37.854C63.7007 38.5169 63.9372 39.2963 63.9372 40.0936C63.9368 41.1626 63.5119 42.1877 62.756 42.9437C62.0001 43.6996 60.975 44.1245 59.906 44.125ZM35.6234 60.0276C34.7186 60.9324 34.2714 63.1957 34.3944 65.6038C36.8129 65.7285 39.07 65.2768 39.9712 64.3754C41.3809 62.9659 41.4711 61.0864 40.192 59.8068C38.9125 58.5273 37.0327 58.6179 35.6234 60.0276Z" fill="#35104C"/>
						</g>
						<defs>
						<clipPath id="clip0_598_5931">
							<rect width="43" height="43" fill="white" transform="translate(29 28)"/>
						</clipPath>
						</defs>
					</svg>
				</div>
				<div class="welcome-content">
					<div class="title-block">
						<span>Snapshot Restore</span>
						<h2>Get Started</h2>
					</div>

					<div class="content-block">
						<p>Welcome to Snapshot backup restore page. This wizard will guide you through the process of restoring your site from a snapshot backup archive. Before we proceed, let’s check that your site meets the necessary requirements. Click on Get Started to begin.</p>
					</div>
				</div>
			</div>
		</div>	<!-- /#screen-welcome -->
		<?php
	}
}




// Source: src/loader.php
 // phpcs:ignore

/**
 * Loads everything and bootstraps the restore process
 *
 *  @package snapshot-installer
 */

/**
 * Class loader function
 *
 * @param string $class_name Class to look for.
 *
 * @return bool
 */
function si_load_class( $class_name ) {
	if ( ! preg_match( '/^Si_/', $class_name ) ) {
		return false;
	}
	$rqsimple = preg_replace( '/^Si_/', '', $class_name );

	$pathparts = explode( '_', $rqsimple );
	$path      = array();
	foreach ( $pathparts as $part ) {
		$path[] = $part;
	}
	array_pop( $path );
	$rqsimple = strtolower( $rqsimple );
	$rqfile   = rtrim( join( '/', $path ), '/' ) . '/class_si_' . $rqsimple;

	$rqpath = __DIR__ . '/lib/' . $rqfile . '.php';
	if ( ! file_exists( $rqpath ) ) {
		dump_args_and_die( array( "{$rqpath} doesnot exist, for {$class_name}", debug_backtrace() ) ); //phpcs:ignore
		return false;
	}
	require_once $rqpath;

	if ( ! class_exists( $class_name ) ) {
		dump_args_and_die( array( "{$class_name} doesnot exist in {$rqfile}", debug_backtrace() ) ); //phpcs:ignore
		return false;
	}

	return true;
}
spl_autoload_register( 'si_load_class' );

ini_set( 'display_errors', 1 ); //phpcs:ignore
ini_set( 'display_startup_errors', 1 ); //phpcs:ignore
error_reporting( E_ALL ); //phpcs:ignore

if ( ! function_exists( 'dump_args' ) ) {
	/**
	 * Output args
	 *
	 * @return void
	 */
	function dump_args() {
		echo '<pre>';
		var_export( func_get_args() ); //phpcs:ignore
		echo '</pre>';
	}
}

if ( ! function_exists( 'dump_args_and_die' ) ) {
	/**
	 * Output args and die.
	 *
	 * @return void
	 */
	function dump_args_and_die() {
		dump_args( func_get_args() );
		die;
	}
}
/**
 * Installer app instance
 *
 * @return \SI_App
 */
function app() {
	return Si_App::instance();
}

/**
 * Init Session
 *
 * @return false|\Si_Helper_Session
 */
function session() {
	if ( PHP_SESSION_DISABLED === session_status() ) {
		return false;
	}

	return Si_Helper_Session::instance();
}

/**
 * Boots the standalone installer
 *
 * @return void
 */
function si_boot() {
	define( 'SI_PATH_ROOT', __DIR__ );

	$dirname = 'si_test';

	$env = new Si_Model_Env();
	if ( $env->can_override() ) {
		$value = $env->get( 'temp_dir' );
		if ( ! empty( $value ) ) {
			$dirname = $value;
		} else {
			$dirname = uniqid( $dirname );
			$env->set( 'temp_dir', $dirname );
		}
	}

	define( 'SI_TEMP_DIR', $dirname );

	$request = new Si_Request();
	if (
		session()->has( 'partial_restore_type' ) &&
		in_array( session()->get( 'partial_restore_type' ), ['files', 'database'] ) &&
		$env->get( 'temp_dir' !== SI_TEMP_DIR )
	){
		Si_Helper_Log::log( 'Unsetting the session for partial restore type' );
		session()->unset( 'partial_restore_type' );
	}

	// Handle AJAX requests.
	if (
		$request->has( 'request' ) &&
		$request->has( 'action' ) &&
		! empty( $request->get( 'request' ) ) &&
		! empty( $request->get( 'action' ) )
	) {
		if ( 'ajax' === $request->get( 'request' ) ) {
			$action = $request->get( 'action' );

			$ajax = new Si_Requests_Ajax();

			if ( in_array( $action, $ajax->actions(), true ) ) {
				$ajax->set_action( $action );
				$ajax->request( $request );
			}
		}
	}

	app()->boot();
}
si_boot();