﻿!!!!!!!!!!!
ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+...383-7(-.+
<?php
/**
 * The Sidebar containing the main widget areas.
 *
 * @package PRORANGE
 * @since PRORANGE 1.0
 */

if ( prorange_sidebar_present() ) {
	
	$prorange_sidebar_type = prorange_get_theme_option( 'sidebar_type' );
	if ( 'custom' == $prorange_sidebar_type && ! prorange_is_layouts_available() ) {
		$prorange_sidebar_type = 'default';
	}
	
	// Catch output to the buffer
	ob_start();
	if ( 'default' == $prorange_sidebar_type ) {
		// Default sidebar with widgets
		$prorange_sidebar_name = prorange_get_theme_option( 'sidebar_widgets' );
		prorange_storage_set( 'current_sidebar', 'sidebar' );
		if ( is_active_sidebar( $prorange_sidebar_name ) ) {
			dynamic_sidebar( $prorange_sidebar_name );
		}
	} else {
		// Custom sidebar from Layouts Builder
		$prorange_sidebar_id = prorange_get_custom_sidebar_id();
		do_action( 'prorange_action_show_layout', $prorange_sidebar_id );
	}
	$prorange_out = trim( ob_get_contents() );
	ob_end_clean();
	
	// If any html is present - display it
	if ( ! empty( $prorange_out ) ) {
		$prorange_sidebar_position    = prorange_get_theme_option( 'sidebar_position' );
		$prorange_sidebar_position_ss = prorange_get_theme_option( 'sidebar_position_ss', 'below' );
		?>
		<div class="sidebar widget_area
			<?php
			echo ' ' . esc_attr( $prorange_sidebar_position );
			echo ' sidebar_' . esc_attr( $prorange_sidebar_position_ss );
			echo ' sidebar_' . esc_attr( $prorange_sidebar_type );

			$prorange_sidebar_scheme = apply_filters( 'prorange_filter_sidebar_scheme', prorange_get_theme_option( 'sidebar_scheme', 'inherit' ) );
			if ( ! empty( $prorange_sidebar_scheme ) && ! prorange_is_inherit( $prorange_sidebar_scheme ) && 'custom' != $prorange_sidebar_type ) {
				echo ' scheme_' . esc_attr( $prorange_sidebar_scheme );
			}
			?>
		" role="complementary">
			<?php

			// Skip link anchor to fast access to the sidebar from keyboard
			?>
			<span id="sidebar_skip_link_anchor" class="prorange_skip_link_anchor"></span>
			<?php

			do_action( 'prorange_action_before_sidebar_wrap', 'sidebar' );

			// Button to show/hide sidebar on mobile
			if ( in_array( $prorange_sidebar_position_ss, array( 'above', 'float' ) ) ) {
				$prorange_title = apply_filters( 'prorange_filter_sidebar_control_title', 'float' == $prorange_sidebar_position_ss ? esc_html__( 'Show Sidebar', 'prorange' ) : '' );
				$prorange_text  = apply_filters( 'prorange_filter_sidebar_control_text', 'above' == $prorange_sidebar_position_ss ? esc_html__( 'Show Sidebar', 'prorange' ) : '' );
				?>
				<a href="#" role="button" class="sidebar_control" title="<?php echo esc_attr( $prorange_title ); ?>"><?php echo esc_html( $prorange_text ); ?></a>
				<?php
			}
			?>
			<div class="sidebar_inner">
				<?php
				do_action( 'prorange_action_before_sidebar', 'sidebar' );
				prorange_show_layout( preg_replace( "/<\/aside>[\r\n\s]*<aside/", '</aside><aside', $prorange_out ) );
				do_action( 'prorange_action_after_sidebar', 'sidebar' );
				?>
			</div>
			<?php

			do_act