<?php

namespace Unlockafe_addons\Widgets;

use Unlockafe_addons\Traits\Utils as UnlockafeUtils;
use Unlockafe_addons\Traits\Widget_helper;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use \Elementor\Group_Control_Typography;

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

/**
 * Breadcrumb Widget
 *
 * @since 1.0.0
 */
class Breadcrumb extends Widget_Base
{

    use Widget_helper, UnlockafeUtils;

    /**
     * Retrieve the widget name.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return string Widget name.
     */
    public function get_name()
    {
        return 'unlockafe-breadcrumb';
    }

    /**
     * Retrieve the widget title.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return string Widget title.
     */
    public function get_title()
    {
        return __('WPRealizer - Breadcrumb', 'unlock-addons-for-elementor');
    }

    /**
     * Retrieve the widget icon.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return string Widget icon.
     */
    public function get_icon()
    {
        return 'eicon-breadcrumbs ulicon';
    }

    /**
     * Retrieve the list of categories the widget belongs to.
     *
     * Used to determine where to display the widget in the editor.
     *
     * Note that currently Elementor supports only one category.
     * When multiple categories passed, Elementor uses the first one.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return array Widget categories.
     */
    public function get_categories()
    {
        return ['unlockafe-addons'];
    }

    /**
     * Retrieve the list of scripts the widget depended on.
     *
     * Used to set scripts dependencies required to run the widget.
     *
     * @since 1.0.0
     *
     * @access public
     *
     * @return array Widget scripts dependencies.
     */
    public function get_script_depends()
    {
        return [];
    }

    public function get_style_depends()
    {
        return ['unlockafe-global'];
    }

    /**
     * Register the widget controls.
     *
     * Adds different input fields to allow the user to change and customize the widget settings.
     *
     * @since 1.0.0
     *
     * @access protected
     */

    protected function register_controls()
    {
        $this->register_controls_section();
        $this->style_tab_content();
    }

    protected function register_controls_section()
    {
        // layout Panel
        $this->start_controls_section(
            'wpr_layout',
            [
                'label' => esc_html__('Design Layout', 'unlock-addons-for-elementor'),
            ]
        );

        $this->add_control(
            'wpr_design_style',
            [
                'label' => esc_html__('Select Layout', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::SELECT,
                'options' => [
                    'layout-1' => esc_html__('Layout 1', 'unlock-addons-for-elementor'),
                    'layout-2' => esc_html__('Layout 2', 'unlock-addons-for-elementor'),
                    'layout-3' => esc_html__('Layout 3', 'unlock-addons-for-elementor'),
                    // 'layout-4' => esc_html__('Layout 4', 'unlock-addons-for-elementor'),
                    // 'layout-5' => esc_html__('Layout 5', 'unlock-addons-for-elementor'),
                ],
                'default' => 'layout-1',
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'section_breadcrumb_settings',
            [
                'label' => esc_html__('Settings', 'unlock-addons-for-elementor'),
            ]
        );

        $this->add_control(
            'show_title',
            [
                'label' => esc_html__('Show Title', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'unlock-addons-for-elementor'),
                'label_off' => esc_html__('Hide', 'unlock-addons-for-elementor'),
                'return_value' => 'yes',
                'default' => 'yes',
            ]
        );

        $this->add_control(
            'show_nav',
            [
                'label' => esc_html__('Show Nav', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'unlock-addons-for-elementor'),
                'label_off' => esc_html__('Hide', 'unlock-addons-for-elementor'),
                'return_value' => 'yes',
                'default' => 'yes',
            ]
        );

        $this->add_control(
            'title_tag',
            [
                'label' => __('Title HTML Tag', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::CHOOSE,
                'options' => [
                    'h1' => [
                        'title' => __('H1', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-editor-h1'
                    ],
                    'h2' => [
                        'title' => __('H2', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-editor-h2'
                    ],
                    'h3' => [
                        'title' => __('H3', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-editor-h3'
                    ],
                    'h4' => [
                        'title' => __('H4', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-editor-h4'
                    ],
                    'h5' => [
                        'title' => __('H5', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-editor-h5'
                    ],
                    'h6' => [
                        'title' => __('H6', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-editor-h6'
                    ]
                ],
                'default' => 'h1',
                'toggle' => false,
            ]
        );

        $this->add_control(
            'nav_pos',
            [
                'label' => __('Nav Postion', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::SELECT,
                'default' => '',
                'options' => [
                    '' => __('Default', 'unlock-addons-for-elementor'),
                    'd-flex flex-column' => __('Top', 'unlock-addons-for-elementor'),
                    'd-flex flex-column-reverse' => __('Bottom', 'unlock-addons-for-elementor'),
                ],
                'condition'   => ['wpr_design_style'   => ['layout-20']],
            ]
        );

        $this->add_responsive_control(
            'tp_wprealizer_breadcrumb_align',
            [
                'label' => esc_html__('Alignment', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::CHOOSE,
                'options' => [
                    'start' => [
                        'title' => esc_html__('Left', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-text-align-center',
                    ],
                    'end' => [
                        'title' => esc_html__('Right', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-text-align-right',
                    ],
                ],
                'default' => 'start',
                'selectors' => [
                    '{{WRAPPER}} .wprcore-page-header' => 'text-align: {{VALUE}};',
                ],
                'frontend_available' => true,
                'toggle' => true,
                'condition'   => ['wpr_design_style'   => ['layout-2', 'layout-30']],
            ]
        );

        $this->end_controls_section();


        $this->start_controls_section(
            'tp_theme_btn_button_group',
            [
                'label' => esc_html__('Theme Button', 'unlock-addons-for-elementor'),
                'tab' => Controls_Manager::TAB_CONTENT,
                'condition'   => ['wpr_design_style'   => ['layout-20']],
            ]

        );

        $this->add_control(
            'tp_button_type',
            [
                'label' => esc_html__('Button Style Type', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::SELECT,
                'default' => 'inline',
                'options' => [
                    'inline' => esc_html__('Inline', 'unlock-addons-for-elementor'),
                    'w-100 d-block' => esc_html__('Full Width', 'unlock-addons-for-elementor'),
                ],

            ]
        );

        $this->add_control(
            'tp_theme_btn_button_show',
            [
                'label' => esc_html__('Show Button', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'unlock-addons-for-elementor'),
                'label_off' => esc_html__('Hide', 'unlock-addons-for-elementor'),
                'return_value' => 'yes',
                'default' => 'yes',
            ]
        );

        $this->add_control(
            'tp_theme_btn_text',
            [
                'label' => esc_html__('Button Text', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::TEXT,
                'default' => esc_html__('Read More', 'unlock-addons-for-elementor'),
                'title' => esc_html__('Enter button text', 'unlock-addons-for-elementor'),
                'label_block' => true,
                'condition' => [
                    'tp_theme_btn_button_show' => 'yes'
                ],
            ]
        );

        $this->add_control(
            'wpr_button_img_thumb',
            [
                'label' => esc_html__('Choose Thumbnail', 'unlock-addons-for-elementor'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'default' => [
                    'url' => \Elementor\Utils::get_placeholder_image_src(),
                ],
                'condition'   => ['wpr_design_style'   => ['layout-12']],
            ]
        );

        $this->add_control(
            'tp_theme_btn_icon_show',
            [
                'label' => esc_html__('Add Icon ?', 'unlock-addons-for-elementor'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => esc_html__('Show', 'unlock-addons-for-elementor'),
                'label_off' => esc_html__('Hide', 'unlock-addons-for-elementor'),
                'return_value' => 'yes',
                'default' => 'no',
            ]
        );

        $this->tp_single_icon_control('theme_btn', 'tp_theme_btn_icon_show', 'yes');

        $this->add_control(
            'tp_theme_btn_icon_position',
            [
                'label' => esc_html__('Choose Icon Position', 'unlock-addons-for-elementor'),
                'type' => \Elementor\Controls_Manager::CHOOSE,
                'options' => [
                    'left' => [
                        'title' => esc_html__('Left', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-h-align-left',
                    ],
                    'right' => [
                        'title' => esc_html__('Right', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-h-align-right',
                    ],
                ],
                'default' => 'right',
                'toggle' => true,
            ]
        );

        $this->add_control(
            'tp_theme_btn_link_type',
            [
                'label' => esc_html__('Button Link Type', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::SELECT,
                'options' => [
                    '1' => 'Custom Link',
                    '2' => 'Internal Page',
                ],
                'default' => '1',
                'label_block' => true,
                'condition' => [
                    'tp_theme_btn_button_show' => 'yes'
                ],
            ]
        );
        $this->add_control(
            'tp_theme_btn_link',
            [
                'label' => esc_html__('Button link', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::URL,
                'dynamic' => [
                    'active' => true,
                ],
                'placeholder' => esc_html__('https://your-link.com', 'unlock-addons-for-elementor'),
                'show_external' => false,
                'default' => [
                    'url' => '#',
                    'is_external' => false,
                    'nofollow' => false,
                ],
                'condition' => [
                    'tp_theme_btn_link_type' => '1',
                    'tp_theme_btn_button_show' => 'yes'
                ],
                'label_block' => true,
            ]
        );
        $this->add_control(
            'tp_theme_btn_page_link',
            [
                'label' => esc_html__('Select Button Link Page', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::SELECT2,
                'label_block' => true,
                'options' => $this->tp_get_all_types_post('page'),
                'condition' => [
                    'tp_theme_btn_link_type' => '2',
                    'tp_theme_btn_button_show' => 'yes'
                ]
            ]
        );

        $this->add_responsive_control(
            'tp_button_align',
            [
                'label' => esc_html__('Alignment', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::CHOOSE,
                'options' => [
                    'start' => [
                        'title' => esc_html__('Left', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-text-align-left',
                    ],
                    'center' => [
                        'title' => esc_html__('Center', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-text-align-center',
                    ],
                    'end' => [
                        'title' => esc_html__('Right', 'unlock-addons-for-elementor'),
                        'icon' => 'eicon-text-align-right',
                    ],
                ],
                'default' => 'center',
                'selectors' => [
                    '{{WRAPPER}} .wpr-el-theme-btn' => 'justify-content: {{VALUE}};',
                ],
                'frontend_available' => true,
                'toggle' => true,
            ]
        );
        $this->end_controls_section();
    }

    // style_tab_content
    protected function style_tab_content()
    {
        $this->start_controls_section(
            '_section_style_content',
            [
                'label' => esc_html__('Breadcrumb', 'unlock-addons-for-elementor'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );

        // Title
        $this->add_control(
            '_breadcrumb_title',
            [
                'type' => Controls_Manager::HEADING,
                'label' => esc_html__('Title', 'unlock-addons-for-elementor'),
                'condition'   => ['wpr_design_style'   => ['layout-1', 'layout-2']],
                'separator' => 'before'
            ]
        );

        $this->add_control(
            'breadcrumb_title_spacing',
            [
                'label' => __('Margin', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', '%'],
                'selectors' => [
                    '{{WRAPPER}} .wprcore-el-page-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
                'condition'   => ['wpr_design_style'   => ['layout-1', 'layout-2']],
            ]
        );

        $this->add_control(
            'title_color',
            [
                'label' => esc_html__('Text Color', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .wprcore-el-page-title' => 'color: {{VALUE}}',
                ],
                'condition'   => ['wpr_design_style'   => ['layout-1', 'layout-2']],
            ]
        );

        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'breadcrumb-title',
                'selector' => '{{WRAPPER}} .wprcore-el-page-title',
                'condition'   => ['wpr_design_style'   => ['layout-1', 'layout-2']],
            ]
        );

        $this->add_control(
            'tp_icon_color',
            [
                'label' => esc_html__('Icon Color', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .wprcore-el-icon-color path' => 'fill: {{VALUE}}',
                ],
                'condition'   => ['wpr_design_style'   => ['layout-10', 'layout-20']],
                'separator' => 'before',
            ]
        );

        $this->add_control(
            'tp_breadcrumb_nav_color',
            [
                'label' => esc_html__('Nav Color', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::COLOR,
                'separator' => 'before',
                'selectors' => [
                    '{{WRAPPER}} .wprcore-el-breadcrumb-nav' => 'color: {{VALUE}}',
                ],
                'condition'   => ['wpr_design_style'   => ['layout-10', 'layout-3']],
            ]
        );

        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'tp_breadcrumb_nav',
                'selector' => '{{WRAPPER}} .wprcore-el-breadcrumb-nav',
                'condition'   => ['wpr_design_style'   => ['layout-10', 'layout-3']],
            ]
        );

        $this->add_control(
            'breadcrumb_nav_spacing',
            [
                'label' => __('Nav Spacing', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => ['px', '%'],
                'selectors' => [
                    '{{WRAPPER}} .wprcore-el-breadcrumb-nav' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
                'condition'   => ['wpr_design_style'   => ['layout-10', 'layout-3']],
            ]
        );

        $this->add_control(
            'tp_icon_bar_color',
            [
                'label' => esc_html__('Icon Bar Color', 'unlock-addons-for-elementor'),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .wprcore-el-breadcrumb-nav.active::before' => 'background: {{VALUE}}',
                ],
                'condition'   => ['wpr_design_style'   => ['layout-10', 'layout-30']],
                'separator' => 'before',
            ]
        );

        $this->end_controls_section();
    }

    /**
     * Render the widget output on the frontend.
     *
     * Written in PHP and used to generate the final HTML.
     *
     * @since 1.0.0
     *
     * @access protected
     */
    protected function render()
    {
        $settings = $this->get_settings_for_display();
        $title_tag = $settings['title_tag'];
        $nav_pos = $settings['nav_pos'];
        $btn_id = 'theme_btn';

        global $post, $wp;
        $breadcrumb_show = 1;

        $current_slug = add_query_arg(array(), $wp->request);

        if (is_front_page() && is_home()) {
            $title = get_theme_mod('breadcrumb_blog_title', __('Blog', 'unlock-addons-for-elementor'));
            $breadcrumb_class = 'home_front_page';
        } elseif (is_front_page()) {
            $title = get_theme_mod('breadcrumb_blog_title', __('Blog', 'unlock-addons-for-elementor'));
            $breadcrumb_show = 0;
        } elseif (is_home()) {
            if (get_option('page_for_posts')) {
                $title = get_the_title(get_option('page_for_posts'));
            }
        } elseif (is_single() && 'post' == get_post_type()) {
            $title = get_the_title();
        } elseif ('courses' == get_post_type()) {
            $title = esc_html__('All Courses', 'unlock-addons-for-elementor');
        } elseif (is_single() && 'product' == get_post_type()) {
            $title = get_theme_mod('breadcrumb_product_details', __('Shop', 'unlock-addons-for-elementor'));
        } elseif (is_single() && 'courses' == get_post_type()) {
            $title = esc_html__('Course Details', 'unlock-addons-for-elementor');
        } elseif (is_search()) {
            $title = esc_html__('Search Results for : ', 'unlock-addons-for-elementor') . get_search_query();
        } elseif (is_404()) {
            $title = esc_html__('Page not Found', 'unlock-addons-for-elementor');
        } elseif (is_archive()) {
            $title = get_the_archive_title();
        } else {
            // Fallback for get_dashboard_title if it doesn't exist
            $title = function_exists('get_dashboard_title') ? get_dashboard_title($current_slug) : get_the_title();
        }


        $_id = get_the_ID() ?? NULL;

        if (is_single() && 'product' == get_post_type()) {
            $_id = $post->ID;
        } elseif (function_exists("is_shop") and is_shop()) {
            $_id = wc_get_page_id('shop');
        } elseif (is_home() && get_option('page_for_posts')) {
            $_id = get_option('page_for_posts');
        }
?>


        <?php if ($settings['wpr_design_style'] == 'layout-2'):
            $this->add_inline_editing_attributes('title', 'basic');
            $this->add_render_attribute('title', 'class', 'breadcrumb-title wprcore-page-header wprcore-el-page-title');
        ?>

            <div class="breadcrumb__wrapper">
                <div class="title-box">
                    <?php if (!empty($settings['show_title'])): ?>
                        <?php printf(
                            '<%1$s %2$s>%3$s</%1$s>',
                            tag_escape($settings['title_tag']),
                            $this->get_render_attribute_string('title'),
                            $title
                        ); ?>
                    <?php endif; ?>
                </div>
            </div>

        <?php elseif ($settings['wpr_design_style'] == 'layout-3'): ?>
            <div class="breadcrumb__nav_wrapper wprcore-page-header">
                <div class="breadcrumb__nav">
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item wprcore-el-breadcrumb-nav">
                                <a href="<?php echo get_home_url(); ?>">Home</a>
                            </li>
                            <li class="breadcrumb-item wprcore-el-breadcrumb-nav active" aria-current="page"><?php echo $this->tp_kses($title); ?></li>
                        </ol>
                    </nav>
                </div>
            </div>

        <?php else:
            $this->add_inline_editing_attributes('title', 'basic');
            $this->add_render_attribute('title', 'class', 'breadcrumb-title char-anim wprcore-el-page-title');

            $tp_button_type = $settings['tp_button_type'] ?? 'inline';
            $this->tp_link_attributes_render('theme_btn', 'wpr-el-theme-btn btn_breadcrumb ' . $tp_button_type, $this->get_settings());
        ?>

            <div class="breadcrumb section">
                <div class="container large-container">
                    <div class="row">
                        <div class="col-12">
                            <div class="breadcrumb__wrapper">
                                <div class="breadcrumb__left"></div>
                                <?php if (!empty($settings['show_nav'])): ?>
                                    <div class="breadcrumb__nav">
                                        <nav aria-label="breadcrumb">
                                            <ol class="breadcrumb">
                                                <li class="breadcrumb-item wprcore-el-breadcrumb-nav">
                                                    <a href="<?php echo get_home_url(); ?>">Home</a>
                                                </li>
                                                <li class="breadcrumb-item wprcore-el-breadcrumb-nav active" aria-current="page"><?php echo $this->tp_kses($title); ?></li>
                                            </ol>
                                        </nav>
                                        <div class="circle-shape">
                                            <svg xmlns="http://www.w3.org/2000/svg" width="130" height="130" viewBox="0 0 130 130" fill="none">
                                                <path d="M65.5 0L65.502 55.4043L71.2969 0.303711L72.292 0.408203L66.5029 55.5088L78.0254 1.31641L78.5146 1.41992L79.0029 1.52441L67.4873 55.7148L84.6104 3.02637L85.5615 3.33594L68.4434 56.0283L90.9814 5.41602L91.4375 5.61914L91.8945 5.82324L69.3613 56.4395L97.0674 8.45801L97.9326 8.95801L70.2344 56.9395L102.802 12.1201L103.61 12.708L71.0459 57.5332L108.122 16.3613L108.493 16.6953L108.865 17.0303L71.8018 58.1973L112.97 21.1348L113.305 21.5068L113.639 21.8779L72.4658 58.9531L117.292 26.3896L117.88 27.1982L73.0596 59.7646L121.042 32.0674L121.542 32.9326L73.5596 60.6377L124.177 38.1055L124.381 38.5625L124.584 39.0186L73.9707 61.5557L126.664 44.4385L126.974 45.3896L74.2842 62.5117L128.476 50.9971L128.58 51.4854L128.684 51.9746L74.4902 63.4961L129.592 57.708L129.696 58.7031L74.5947 64.4971L130 64.5V65.5L74.5947 65.502L129.696 71.2969L129.592 72.292L74.4902 66.5029L128.684 78.0254L128.58 78.5146L128.476 79.0029L74.2842 67.4873L126.974 84.6104L126.664 85.5615L73.9707 68.4434L124.584 90.9814L124.381 91.4375L124.177 91.8945L73.5596 69.3613L121.542 97.0674L121.042 97.9326L73.0596 70.2344L117.88 102.802L117.292 103.61L72.4658 71.0459L113.639 108.122L113.305 108.493L112.97 108.865L71.8018 71.8018L108.865 112.97L108.493 113.305L108.122 113.639L71.0459 72.4658L103.61 117.292L102.802 117.88L70.2344 73.0596L97.9326 121.042L97.0674 121.542L69.3613 73.5596L91.8945 124.177L91.4375 124.381L90.9814 124.584L68.4434 73.9707L85.5615 126.664L84.6104 126.974L67.4873 74.2842L79.0029 128.476L78.5146 128.58L78.0254 128.684L66.5029 74.4902L72.292 129.592L71.2969 129.696L65.502 74.5947L65.5 130H64.5L64.4971 74.5947L58.7031 129.696L57.708 129.592L57.9834 126.974L63.4961 74.4902L51.9746 128.684L51.4854 128.58L50.9971 128.476L51.8672 124.381L62.5117 74.2842L45.3896 126.974L44.4385 126.664L45.1807 124.381L61.5557 73.9707L39.0186 124.584L38.5625 124.381L38.1055 124.177L39.501 121.042L60.6377 73.5596L32.9326 121.542L32.0674 121.042L59.7646 73.0596L27.1982 117.88L26.3896 117.292L29.0439 113.639L58.9531 72.4658L21.8779 113.639L21.5068 113.305L21.1348 112.97L58.1973 71.8018L17.0303 108.865L16.6953 108.493L16.3613 108.122L57.5332 71.0459L12.708 103.61L12.1201 102.802L56.9395 70.2344L8.95801 97.9326L8.45801 97.0674L56.4395 69.3613L5.82324 91.8945L5.61914 91.4375L5.41602 90.9814L56.0283 68.4434L3.33594 85.5615L3.18164 85.0859L3.02637 84.6104L55.7148 67.4873L1.52441 79.0029L1.41992 78.5146L1.31641 78.0254L55.5088 66.5029L0.408203 72.292L0.303711 71.2969L55.4043 64.4971L0 64.5L0 64.5L55.4043 64.4971L0.303711 58.7031L0.408203 57.708L55.5088 63.4961L1.31641 51.9746L1.41992 51.4854L1.52441 50.9971L55.7148 62.5117L3.02637 45.3896L3.33594 44.4385L56.0283 61.5557L5.41602 39.0186L5.61914 38.5625L5.82324 38.1055L56.4395 60.6377L8.45801 32.9326L8.95801 32.0674L56.9395 59.7646L12.1201 27.1982L12.708 26.3896L57.5332 58.9531L16.3613 21.8779L16.6953 21.5068L17.0303 21.1348L58.1973 58.1973L21.1348 17.0303L21.5068 16.6953L21.8779 16.3613L58.9531 57.5332L26.3896 12.708L27.1982 12.1201L59.7646 56.9395L32.0674 8.95801L32.9326 8.45801L60.6377 56.4395L38.1055 5.82324L38.5625 5.61914L39.0186 5.41602L61.5557 56.0283L44.4385 3.33594L45.3896 3.02637L62.5117 55.7148L50.9971 1.52441L51.4854 1.41992L51.9746 1.31641L63.4961 55.5088L57.708 0.408203L58.7031 0.303711L64.4971 55.4043L64.5 0L65.5 0Z" fill="currentColor" stroke="currentColor" />
                                            </svg>
                                        </div>
                                    </div>
                                <?php endif; ?>
                                <div class="breadcrumb__right">
                                    <div class="content-box">
                                        <?php if (!empty($settings['show_title'])): ?>
                                            <?php printf(
                                                '<%1$s %2$s>%3$s</%1$s>',
                                                tag_escape($settings['title_tag']),
                                                $this->get_render_attribute_string('title'),
                                                $title
                                            ); ?>
                                        <?php endif; ?>
                                    </div>
                                    <div class="lines" data-gaps="8"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        <?php endif; ?>

<?php
    }
}


