<?php

namespace PWH_DCFH\App\Frontend\DiviContactForm\Features;

use DOMException;
use ET_Builder_Element;
use PWH_DCFH\App\Controllers\PWH_DCFH_DOM;

if (!defined('ABSPATH')) {
    exit;
}
if (!class_exists('PWH_DCFH_Field_HTML')) {
    class PWH_DCFH_Field_HTML
    {
        public $render_slug;

        public $output;

        public $props = [];

        /**
         * Class Constructor
         */
        public function __construct($render_slug, $output, $props)
        {
            $this->render_slug = $render_slug;
            $this->output = $output;
            $this->props = $props;
        }

        /**
         * Render Output
         * @throws DOMException
         */
        public function output()
        {
            $dom = PWH_DCFH_DOM::dom($this->output);
            $input = $dom->getElementsByTagName('input');
            $p_tag = $dom->getElementsByTagName('p');
            $field_htmlcontent = isset($this->props['field_htmlcontent']) ? $this->props['field_htmlcontent'] : '';
            if ((isset($input->length) && 0 !== $input->length) && (isset($p_tag->length) && 0 !== $p_tag->length)) {
                //$et_pb_contact_field_half = 'off' === (isset($this->props['fullwidth_field']) ? $this->props['fullwidth_field'] : 'on') ? 'et_pb_contact_field_half' : '';
                $conditional_logic = isset($this->props['conditional_logic']) ? $this->props['conditional_logic'] : 'off';
                $field_order_class = ET_Builder_Element::get_module_order_class($this->render_slug);
                //$field_id = pwh_dcfh_helpers()::get_field_index($field_order_class);
                $label = $dom->getElementsByTagName('label');
                $label_item = $label->item(0);
                $input_item = $input->item(0);
                $p_item = $p_tag->item(0);
                $p_class = $p_item->getAttribute('class');
                $p_item->removeChild($label_item);
                $p_item->setAttribute('class', "$p_class et_pb_v_hidden");
                $input_item->setAttribute('value', 'et_pb_html_field');
                $html_element = $dom->createElement('div');
                $html_element->setAttribute('id', $field_order_class);
                $html_element->setAttribute('class', "et_pb_html_field $p_class");
                $html_inner_element = $dom->createElement('div');
                $html_inner_element->setAttribute('class', "et_pb_html_field_inner");
                if ('on' === $conditional_logic) {
                    $logic = $p_item->getAttribute('data-conditional-logic');
                    $relation = $p_item->getAttribute('data-conditional-relation');
                    $html_element->setAttribute('data-conditional-logic', $logic);
                    $html_element->setAttribute('data-conditional-relation', $relation);
                }
                $html_inner_element->appendChild($html_element->ownerDocument->createCDATASection($field_htmlcontent));
                $html_element->appendChild($html_inner_element);
                $p_item->insertBefore($html_element);
                $this->output = $dom->saveHTML();
                $this->output = preg_replace('%<p>(<img .*?/>)</p>%i', '<div class="et_pb_html_field_img">$1</div>', $this->output);
            }

            return $this->output;
        }

        /**
         * Render Css
         * @return void
         */
        public function css()
        {
            $css_selector = '%%order_class%%.et_pb_html_field .et_pb_html_field_inner';
            /**
             * Wrapper
             */
            $d_wrapper_background = pwh_dcfh_module_helpers()::get_global_color(et_pb_responsive_options()->get_property_values($this->props, 'html_wrapper_background'));
            et_pb_responsive_options()->generate_responsive_css($d_wrapper_background, "$css_selector", 'background', $this->render_slug, '', 'color');
            $d_wrapper_margin = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_wrapper_margin'));
            et_pb_responsive_options()->generate_responsive_css($d_wrapper_margin, "$css_selector", 'margin', $this->render_slug, '', 'custom_padding');
            $d_wrapper_padding = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_wrapper_padding'));
            et_pb_responsive_options()->generate_responsive_css($d_wrapper_padding, "$css_selector", 'padding', $this->render_slug, '', 'custom_padding');
            $d_wrapper_border = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_wrapper_border'));
            et_pb_responsive_options()->generate_responsive_css($d_wrapper_border, "$css_selector", 'border-radius', $this->render_slug, '', 'border-radius');
            $d_wrapper_border_color = et_pb_responsive_options()->get_property_values($this->props, 'html_wrapper_border_color');
            et_pb_responsive_options()->generate_responsive_css($d_wrapper_border_color, "$css_selector", 'border-color', $this->render_slug, '', 'color');
            $d_wrapper_border_width = et_pb_responsive_options()->get_property_values($this->props, 'html_wrapper_border_width');
            et_pb_responsive_options()->generate_responsive_css($d_wrapper_border_width, "$css_selector", 'border-width', $this->render_slug);
            $d_wrapper_border_style = et_pb_responsive_options()->get_property_values($this->props, 'html_wrapper_border_style');
            et_pb_responsive_options()->generate_responsive_css($d_wrapper_border_style, "$css_selector", 'border-style', $this->render_slug, '', 'select');
            $html_wrapper_shadow = isset($this->props['html_wrapper_shadow']) ? $this->props['html_wrapper_shadow'] : null;
            if (!empty($html_wrapper_shadow) && 'none' !== $html_wrapper_shadow) {
                $shadow = pwh_dcfh_module_helpers()::get_shadow_presets_values($html_wrapper_shadow);
                $horizontal = isset($this->props['html_wrapper_shadow_horizontal']) ? $this->props['html_wrapper_shadow_horizontal'] : $shadow['horizontal'];
                $vertical = isset($this->props['html_wrapper_shadow_vertical']) ? $this->props['html_wrapper_shadow_vertical'] : $shadow['vertical'];
                $blur = isset($this->props['html_wrapper_shadow_blur']) ? $this->props['html_wrapper_shadow_blur'] : $shadow['blur'];
                $spread = isset($this->props['html_wrapper_shadow_spread']) ? $this->props['html_wrapper_shadow_spread'] : $shadow['spread'];
                $color = isset($this->props['html_wrapper_shadow_color']) ? $this->props['html_wrapper_shadow_color'] : 'rgba(0,0,0,0.3)';
                $position = isset($this->props['html_wrapper_shadow_position']) ? $this->props['html_wrapper_shadow_position'] : $shadow['position'];
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => $css_selector,
                    'declaration' => "-webkit-box-shadow: $position $horizontal $vertical $blur $spread $color;-moz-box-shadow: $position $horizontal $vertical $blur $spread $color; box-shadow: $position $horizontal $vertical $blur $spread $color;",
                ]);
            }
            /**
             * Heading
             */
            $desktop_font = isset($this->props['html_heading_font']) ? $this->props['html_heading_font'] : null;
            $tablet_font = isset($this->props['html_heading_font_tablet']) ? $this->props['html_heading_font_tablet'] : null;
            $phone_font = isset($this->props['html_heading_font_phone']) ? $this->props['html_heading_font_phone'] : null;
            if (!empty($desktop_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($desktop_font)),
                ]);
            }
            if (!empty($tablet_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($tablet_font)),
                    'media_query' => ET_Builder_Element::get_media_query('max_width_980'),
                ]);
            }
            if (!empty($phone_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($phone_font)),
                    'media_query' => ET_Builder_Element::get_media_query('max_width_767'),
                ]);
            }
            $d_heading_color = et_pb_responsive_options()->get_property_values($this->props, 'html_heading_color');
            et_pb_responsive_options()->generate_responsive_css($d_heading_color, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'color', $this->render_slug, '', 'color');
            $d_heading_background = pwh_dcfh_module_helpers()::get_global_color(et_pb_responsive_options()->get_property_values($this->props, 'html_heading_background'));
            et_pb_responsive_options()->generate_responsive_css($d_heading_background, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'background', $this->render_slug, '', 'color');
            $d_heading_size = et_pb_responsive_options()->get_property_values($this->props, 'html_heading_size');
            et_pb_responsive_options()->generate_responsive_css($d_heading_size, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'font-size', $this->render_slug);
            $d_heading_letterspace = et_pb_responsive_options()->get_property_values($this->props, 'html_heading_letterspace');
            et_pb_responsive_options()->generate_responsive_css($d_heading_letterspace, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'letter-spacing', $this->render_slug);
            $d_heading_lineheight = et_pb_responsive_options()->get_property_values($this->props, 'html_heading_lineheight');
            et_pb_responsive_options()->generate_responsive_css($d_heading_lineheight, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'line-height', $this->render_slug);
            $d_heading_alignment = pwh_dcfh_module_helpers()::justified_to_justify(et_pb_responsive_options()->get_property_values($this->props, 'html_heading_alignment'));
            et_pb_responsive_options()->generate_responsive_css($d_heading_alignment, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'text-align', $this->render_slug, '', 'text_alignment');
            $d_heading_margin = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_heading_margin'));
            et_pb_responsive_options()->generate_responsive_css($d_heading_margin, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'margin', $this->render_slug, '', 'custom_padding');
            $d_heading_padding = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_heading_padding'));
            et_pb_responsive_options()->generate_responsive_css($d_heading_padding, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'padding', $this->render_slug, '', 'custom_padding');
            $d_heading_border = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_heading_border'));
            et_pb_responsive_options()->generate_responsive_css($d_heading_border, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'border-radius', $this->render_slug, '', 'border-radius');
            $d_heading_border_color = et_pb_responsive_options()->get_property_values($this->props, 'html_heading_border_color');
            et_pb_responsive_options()->generate_responsive_css($d_heading_border_color, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'border-color', $this->render_slug, '', 'color');
            $d_heading_border_width = et_pb_responsive_options()->get_property_values($this->props, 'html_heading_border_width');
            et_pb_responsive_options()->generate_responsive_css($d_heading_border_width, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'border-width', $this->render_slug);
            $d_heading_border_style = et_pb_responsive_options()->get_property_values($this->props, 'html_heading_border_style');
            et_pb_responsive_options()->generate_responsive_css($d_heading_border_style, "$css_selector h1,$css_selector h2,$css_selector h3,$css_selector h4,$css_selector h5,$css_selector h6", 'border-style', $this->render_slug, '', 'select');
            /**
             * Paragraphs
             */
            $desktop_font = isset($this->props['html_paragraph_font']) ? $this->props['html_paragraph_font'] : null;
            $tablet_font = isset($this->props['html_paragraph_font_tablet']) ? $this->props['html_paragraph_font_tablet'] : null;
            $phone_font = isset($this->props['html_paragraph_font_phone']) ? $this->props['html_paragraph_font_phone'] : null;
            if (!empty($desktop_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector p",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($desktop_font)),
                ]);
            }
            if (!empty($tablet_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector p",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($tablet_font)),
                    'media_query' => ET_Builder_Element::get_media_query('max_width_980'),
                ]);
            }
            if (!empty($phone_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector p",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($phone_font)),
                    'media_query' => ET_Builder_Element::get_media_query('max_width_767'),
                ]);
            }
            $d_paragraph_color = et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_color');
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_color, "$css_selector p", 'color', $this->render_slug, '', 'color');
            $d_paragraph_background = pwh_dcfh_module_helpers()::get_global_color(et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_background'));
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_background, "$css_selector p", 'background', $this->render_slug, '', 'color');
            $d_paragraph_size = et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_size');
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_size, "$css_selector p", 'font-size', $this->render_slug);
            $d_paragraph_letterspace = et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_letterspace');
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_letterspace, "$css_selector p", 'letter-spacing', $this->render_slug);
            $d_paragraph_lineheight = et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_lineheight');
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_lineheight, "$css_selector p", 'line-height', $this->render_slug);
            $d_paragraph_alignment = pwh_dcfh_module_helpers()::justified_to_justify(et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_alignment'));
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_alignment, "$css_selector p", 'text-align', $this->render_slug, '', 'text_alignment');
            $d_paragraph_margin = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_margin'));
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_margin, "$css_selector p", 'margin', $this->render_slug, '', 'custom_padding');
            $d_paragraph_padding = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_padding'));
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_padding, "$css_selector p", 'padding', $this->render_slug, '', 'custom_padding');
            $d_paragraph_border = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_border'));
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_border, "$css_selector p", 'border-radius', $this->render_slug, '', 'border-radius');
            $d_paragraph_border_color = et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_border_color');
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_border_color, "$css_selector p", 'border-color', $this->render_slug, '', 'color');
            $d_paragraph_border_width = et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_border_width');
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_border_width, "$css_selector p", 'border-width', $this->render_slug);
            $d_paragraph_border_style = et_pb_responsive_options()->get_property_values($this->props, 'html_paragraph_border_style');
            et_pb_responsive_options()->generate_responsive_css($d_paragraph_border_style, "$css_selector p", 'border-style', $this->render_slug, '', 'select');
            /**
             * Links
             */
            $desktop_font = isset($this->props['html_link_font']) ? $this->props['html_link_font'] : null;
            $tablet_font = isset($this->props['html_link_font_tablet']) ? $this->props['html_link_font_tablet'] : null;
            $phone_font = isset($this->props['html_link_font_phone']) ? $this->props['html_link_font_phone'] : null;
            if (!empty($desktop_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector a",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($desktop_font)),
                ]);
            }
            if (!empty($tablet_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector a",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($tablet_font)),
                    'media_query' => ET_Builder_Element::get_media_query('max_width_980'),
                ]);
            }
            if (!empty($phone_font)) {
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector a",
                    'declaration' => sprintf('%s;', et_builder_set_element_font($phone_font)),
                    'media_query' => ET_Builder_Element::get_media_query('max_width_767'),
                ]);
            }
            $d_link_color = et_pb_responsive_options()->get_property_values($this->props, 'html_link_color');
            et_pb_responsive_options()->generate_responsive_css($d_link_color, "$css_selector a", 'color', $this->render_slug, '', 'color');
            if (et_pb_hover_options()->is_enabled('html_link_color', $this->props)) {
                $html_link_color_hover = et_pb_hover_options()->get_value('html_link_color', $this->props);
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector a:hover",
                    'declaration' => "color:$html_link_color_hover !important;"
                ]);
            }
            $d_link_background = pwh_dcfh_module_helpers()::get_global_color(et_pb_responsive_options()->get_property_values($this->props, 'html_link_background'));
            et_pb_responsive_options()->generate_responsive_css($d_link_background, "$css_selector a", 'background', $this->render_slug, '', 'color');
            if (et_pb_hover_options()->is_enabled('html_link_background', $this->props)) {
                $html_link_background_hover = et_pb_hover_options()->get_value('html_link_background', $this->props);
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector a:hover",
                    'declaration' => "background:$html_link_background_hover !important;"
                ]);
            }
            $d_link_size = et_pb_responsive_options()->get_property_values($this->props, 'html_link_size');
            et_pb_responsive_options()->generate_responsive_css($d_link_size, "$css_selector a", 'font-size', $this->render_slug);
            $d_link_letterspace = et_pb_responsive_options()->get_property_values($this->props, 'html_link_letterspace');
            et_pb_responsive_options()->generate_responsive_css($d_link_letterspace, "$css_selector a", 'letter-spacing', $this->render_slug);
            $d_link_lineheight = et_pb_responsive_options()->get_property_values($this->props, 'html_link_lineheight');
            et_pb_responsive_options()->generate_responsive_css($d_link_lineheight, "$css_selector a", 'line-height', $this->render_slug);
            $d_link_margin = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_link_margin'));
            et_pb_responsive_options()->generate_responsive_css($d_link_margin, "$css_selector a", 'margin', $this->render_slug, '', 'custom_padding');
            $d_link_padding = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_link_padding'));
            et_pb_responsive_options()->generate_responsive_css($d_link_padding, "$css_selector a", 'padding', $this->render_slug, '', 'custom_padding');
            $d_link_border = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_link_border'));
            et_pb_responsive_options()->generate_responsive_css($d_link_border, "$css_selector a", 'border-radius', $this->render_slug, '', 'border-radius');
            $d_link_border_color = et_pb_responsive_options()->get_property_values($this->props, 'html_link_border_color');
            et_pb_responsive_options()->generate_responsive_css($d_link_border_color, "$css_selector a", 'border-color', $this->render_slug, '', 'color');
            $d_link_border_width = et_pb_responsive_options()->get_property_values($this->props, 'html_link_border_width');
            et_pb_responsive_options()->generate_responsive_css($d_link_border_width, "$css_selector a", 'border-width', $this->render_slug);
            $d_link_border_style = et_pb_responsive_options()->get_property_values($this->props, 'html_link_border_style');
            et_pb_responsive_options()->generate_responsive_css($d_link_border_style, "$css_selector a", 'border-style', $this->render_slug, '', 'select');
            /**
             * Image
             */
            $d_image_width = et_pb_responsive_options()->get_property_values($this->props, 'html_image_width');
            et_pb_responsive_options()->generate_responsive_css($d_image_width, "$css_selector .et_pb_html_field_img img", 'width', $this->render_slug);
            $d_image_height = et_pb_responsive_options()->get_property_values($this->props, 'html_image_height');
            et_pb_responsive_options()->generate_responsive_css($d_image_height, "$css_selector .et_pb_html_field_img img", 'height', $this->render_slug);
            $d_image_fit = et_pb_responsive_options()->get_property_values($this->props, 'html_image_fit');
            et_pb_responsive_options()->generate_responsive_css($d_image_fit, "$css_selector .et_pb_html_field_img img", 'object-fit', $this->render_slug, '', 'select');
            $d_image_margin = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_image_margin'));
            et_pb_responsive_options()->generate_responsive_css($d_image_margin, "$css_selector .et_pb_html_field_img img", 'margin', $this->render_slug, '', 'custom_padding');
            $d_image_padding = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_image_padding'));
            et_pb_responsive_options()->generate_responsive_css($d_image_padding, "$css_selector .et_pb_html_field_img img", 'padding', $this->render_slug, '', 'custom_padding');
            $d_image_alignment = pwh_dcfh_module_helpers()::justified_to_justify(et_pb_responsive_options()->get_property_values($this->props, 'html_image_alignment'));
            et_pb_responsive_options()->generate_responsive_css($d_image_alignment, "$css_selector .et_pb_html_field_img", 'text-align', $this->render_slug, '', 'text_alignment');
            $d_image_border = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_image_border'));
            et_pb_responsive_options()->generate_responsive_css($d_image_border, "$css_selector .et_pb_html_field_img img", 'border-radius', $this->render_slug, '', 'border-radius');
            $d_border_color = et_pb_responsive_options()->get_property_values($this->props, 'html_image_border_color');
            et_pb_responsive_options()->generate_responsive_css($d_border_color, "$css_selector .et_pb_html_field_img img", 'border-color', $this->render_slug, '', 'color');
            $d_border_width = et_pb_responsive_options()->get_property_values($this->props, 'html_image_border_width');
            et_pb_responsive_options()->generate_responsive_css($d_border_width, "$css_selector .et_pb_html_field_img img", 'border-width', $this->render_slug);
            $d_border_style = et_pb_responsive_options()->get_property_values($this->props, 'html_image_border_style');
            et_pb_responsive_options()->generate_responsive_css($d_border_style, "$css_selector .et_pb_html_field_img img", 'border-style', $this->render_slug, '', 'select');
            $html_image_shadow = isset($this->props['html_image_shadow']) ? $this->props['html_image_shadow'] : null;
            if (!empty($html_image_shadow) && 'none' !== $html_image_shadow) {
                $shadow = pwh_dcfh_module_helpers()::get_shadow_presets_values($html_image_shadow);
                $horizontal = isset($this->props['html_image_shadow_horizontal']) ? $this->props['html_image_shadow_horizontal'] : $shadow['horizontal'];
                $vertical = isset($this->props['html_image_shadow_vertical']) ? $this->props['html_image_shadow_vertical'] : $shadow['vertical'];
                $blur = isset($this->props['html_image_shadow_blur']) ? $this->props['html_image_shadow_blur'] : $shadow['blur'];
                $spread = isset($this->props['html_image_shadow_spread']) ? $this->props['html_image_shadow_spread'] : $shadow['spread'];
                $color = isset($this->props['html_image_shadow_color']) ? $this->props['html_image_shadow_color'] : 'rgba(0,0,0,0.3)';
                $position = isset($this->props['html_image_shadow_position']) ? $this->props['html_image_shadow_position'] : $shadow['position'];
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector .et_pb_html_field_img img",
                    'declaration' => "-webkit-box-shadow: $position $horizontal $vertical $blur $spread $color;-moz-box-shadow: $position $horizontal $vertical $blur $spread $color; box-shadow: $position $horizontal $vertical $blur $spread $color;",
                ]);
            }
            /**
             * Divider
             */
            $d_divider_width = et_pb_responsive_options()->get_property_values($this->props, 'html_divider_width');
            et_pb_responsive_options()->generate_responsive_css($d_divider_width, "$css_selector hr", 'width', $this->render_slug);
            $d_divider_height = et_pb_responsive_options()->get_property_values($this->props, 'html_divider_height');
            et_pb_responsive_options()->generate_responsive_css($d_divider_height, "$css_selector hr", 'height', $this->render_slug);
            $html_divider_color = et_pb_responsive_options()->get_property_values($this->props, 'html_divider_color');
            et_pb_responsive_options()->generate_responsive_css($html_divider_color, "$css_selector hr", 'background', $this->render_slug, '', 'color');
            $d_divider_margin = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_divider_margin'));
            et_pb_responsive_options()->generate_responsive_css($d_divider_margin, "$css_selector hr", 'margin', $this->render_slug, '', 'custom_padding');
            $d_divider_padding = pwh_dcfh_module_helpers()::get_responsive_margin_padding_border_props(et_pb_responsive_options()->get_property_values($this->props, 'html_divider_padding'));
            et_pb_responsive_options()->generate_responsive_css($d_divider_padding, "$css_selector hr", 'padding', $this->render_slug, '', 'custom_padding');
            $html_divider_shadow = isset($this->props['html_divider_shadow']) ? $this->props['html_divider_shadow'] : null;
            if (!empty($html_divider_shadow) && 'none' !== $html_divider_shadow) {
                $shadow = pwh_dcfh_module_helpers()::get_shadow_presets_values($html_divider_shadow);
                $horizontal = isset($this->props['html_divider_shadow_horizontal']) ? $this->props['html_divider_shadow_horizontal'] : $shadow['horizontal'];
                $vertical = isset($this->props['html_divider_shadow_vertical']) ? $this->props['html_divider_shadow_vertical'] : $shadow['vertical'];
                $blur = isset($this->props['html_divider_shadow_blur']) ? $this->props['html_divider_shadow_blur'] : $shadow['blur'];
                $spread = isset($this->props['html_divider_shadow_spread']) ? $this->props['html_divider_shadow_spread'] : $shadow['spread'];
                $color = isset($this->props['html_divider_shadow_color']) ? $this->props['html_divider_shadow_color'] : 'rgba(0,0,0,0.3)';
                $position = isset($this->props['html_divider_shadow_position']) ? $this->props['html_divider_shadow_position'] : $shadow['position'];
                ET_Builder_Element::set_style($this->render_slug, [
                    'selector' => "$css_selector hr",
                    'declaration' => "-webkit-box-shadow: $position $horizontal $vertical $blur $spread $color;-moz-box-shadow: $position $horizontal $vertical $blur $spread $color; box-shadow: $position $horizontal $vertical $blur $spread $color;",
                ]);
            }
        }

    }
}